Merge pull request #203 from wongcc966422/issue1

Automation points are now draggable
This commit is contained in:
Tobias Doerffel
2014-01-30 11:27:38 -08:00
5 changed files with 134 additions and 76 deletions

View File

@@ -34,6 +34,7 @@
#include "MidiTime.h"
#include "AutomationPattern.h"
#include "ComboBoxModel.h"
#include "knob.h"
class QPainter;
@@ -103,7 +104,7 @@ protected:
void getSelectedValues( timeMap & _selected_values );
void drawLine( int x0, float y0, int x1, float y1 );
void disableTensionComboBox();
void disableTensionKnob();
protected slots:
void play();
@@ -188,9 +189,8 @@ private:
toolButton * m_discreteButton;
toolButton * m_linearButton;
toolButton * m_cubicHermiteButton;
comboBox * m_tensionComboBox;
ComboBoxModel m_tensionModel;
ComboBoxModel m_tensionDisabledModel;
knob * m_tensionKnob;
FloatModel * m_tensionModel;
toolButton * m_cutButton;
toolButton * m_copyButton;

View File

@@ -66,7 +66,7 @@ public:
}
void setProgressionType( ProgressionTypes _new_progression_type );
inline QString getTension() const
inline float getTension() const
{
return m_tension;
}
@@ -77,7 +77,19 @@ public:
MidiTime putValue( const MidiTime & _time, const float _value,
const bool _quant_pos = true );
void removeValue( const MidiTime & _time );
void removeValue( const MidiTime & _time,
const bool _quant_pos = true );
MidiTime setDragValue( const MidiTime & _time, const float _value,
const bool _quant_pos = true );
void applyDragValue();
bool isDragging() const
{
return m_dragging;
}
inline const timeMap & getTimeMap() const
{
@@ -149,11 +161,14 @@ private:
QVector<jo_id_t> m_idsToResolve;
objectVector m_objects;
timeMap m_timeMap; // actual values
timeMap m_oldTimeMap; // old values for storing the values before setDragValue() is called.
timeMap m_tangents; // slope at each point for calculating spline
QString m_tension;
float m_tension;
bool m_hasAutomation;
ProgressionTypes m_progressionType;
bool m_dragging;
friend class AutomationPatternView;