|
@@ -26,7 +26,6 @@
|
|
|
#ifndef AUTOMATION_EDITOR_H
|
|
|
#define AUTOMATION_EDITOR_H
|
|
|
|
|
|
-#include <QtCore/QMutex>
|
|
|
#include <QVector>
|
|
|
#include <QWidget>
|
|
|
|
|
@@ -52,14 +51,15 @@ class TimeLineWidget;
|
|
|
class AutomationEditor : public QWidget, public JournallingObject
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
- Q_PROPERTY(QColor barLineColor READ barLineColor WRITE setBarLineColor)
|
|
|
- Q_PROPERTY(QColor beatLineColor READ beatLineColor WRITE setBeatLineColor)
|
|
|
- Q_PROPERTY(QColor lineColor READ lineColor WRITE setLineColor)
|
|
|
- Q_PROPERTY(QColor vertexColor READ vertexColor WRITE setVertexColor)
|
|
|
- Q_PROPERTY(QBrush scaleColor READ scaleColor WRITE setScaleColor)
|
|
|
- Q_PROPERTY(QBrush graphColor READ graphColor WRITE setGraphColor)
|
|
|
- Q_PROPERTY(QColor crossColor READ crossColor WRITE setCrossColor)
|
|
|
- Q_PROPERTY(QColor backgroundShade READ backgroundShade WRITE setBackgroundShade)
|
|
|
+ Q_PROPERTY(QColor barLineColor MEMBER m_barLineColor)
|
|
|
+ Q_PROPERTY(QColor beatLineColor MEMBER m_beatLineColor)
|
|
|
+ Q_PROPERTY(QColor lineColor MEMBER m_lineColor)
|
|
|
+ Q_PROPERTY(QColor nodeInValueColor MEMBER m_nodeInValueColor)
|
|
|
+ Q_PROPERTY(QColor nodeOutValueColor MEMBER m_nodeOutValueColor)
|
|
|
+ Q_PROPERTY(QBrush scaleColor MEMBER m_scaleColor)
|
|
|
+ Q_PROPERTY(QBrush graphColor MEMBER m_graphColor)
|
|
|
+ Q_PROPERTY(QColor crossColor MEMBER m_crossColor)
|
|
|
+ Q_PROPERTY(QColor backgroundShade MEMBER m_backgroundShade)
|
|
|
public:
|
|
|
void setCurrentPattern(AutomationPattern * new_pattern);
|
|
|
|
|
@@ -80,30 +80,11 @@ public:
|
|
|
return "automationeditor";
|
|
|
}
|
|
|
|
|
|
- // qproperty access methods
|
|
|
- QColor barLineColor() const;
|
|
|
- void setBarLineColor(const QColor & c);
|
|
|
- QColor beatLineColor() const;
|
|
|
- void setBeatLineColor(const QColor & c);
|
|
|
- QColor lineColor() const;
|
|
|
- void setLineColor(const QColor & c);
|
|
|
- QBrush graphColor() const;
|
|
|
- void setGraphColor(const QBrush & c);
|
|
|
- QColor vertexColor() const;
|
|
|
- void setVertexColor(const QColor & c);
|
|
|
- QBrush scaleColor() const;
|
|
|
- void setScaleColor(const QBrush & c);
|
|
|
- QColor crossColor() const;
|
|
|
- void setCrossColor(const QColor & c);
|
|
|
- QColor backgroundShade() const;
|
|
|
- void setBackgroundShade(const QColor & c);
|
|
|
-
|
|
|
enum EditModes
|
|
|
{
|
|
|
DRAW,
|
|
|
ERASE,
|
|
|
- SELECT,
|
|
|
- MOVE
|
|
|
+ DRAW_OUTVALUES
|
|
|
};
|
|
|
|
|
|
public slots:
|
|
@@ -126,13 +107,11 @@ protected:
|
|
|
float getLevel( int y );
|
|
|
int xCoordOfTick( int tick );
|
|
|
float yCoordOfLevel( float level );
|
|
|
- inline void drawLevelTick( QPainter & p, int tick, float value);// bool is_selected ); //NEEDS Change in CSS
|
|
|
- void removeSelection();
|
|
|
- void selectAll();
|
|
|
- void getSelectedValues(timeMap & selected_values );
|
|
|
+ inline void drawLevelTick(QPainter & p, int tick, float value);
|
|
|
+
|
|
|
+ timeMap::iterator getNodeAt(int x, int y, bool outValue = false, int r = 5);
|
|
|
|
|
|
void drawLine( int x0, float y0, int x1, float y1 );
|
|
|
- void removePoints( int x0, int x1 );
|
|
|
|
|
|
protected slots:
|
|
|
void play();
|
|
@@ -148,11 +127,6 @@ protected slots:
|
|
|
void setProgressionType(int type);
|
|
|
void setTension();
|
|
|
|
|
|
- void copySelectedValues();
|
|
|
- void cutSelectedValues();
|
|
|
- void pasteValues();
|
|
|
- void deleteSelectedValues();
|
|
|
-
|
|
|
void updatePosition( const TimePos & t );
|
|
|
|
|
|
void zoomingXChanged();
|
|
@@ -167,8 +141,10 @@ private:
|
|
|
{
|
|
|
NONE,
|
|
|
MOVE_VALUE,
|
|
|
- SELECT_VALUES,
|
|
|
- MOVE_SELECTION
|
|
|
+ ERASE_VALUES,
|
|
|
+ MOVE_OUTVALUE,
|
|
|
+ RESET_OUTVALUES,
|
|
|
+ DRAW_LINE
|
|
|
} ;
|
|
|
|
|
|
// some constants...
|
|
@@ -187,7 +163,7 @@ private:
|
|
|
|
|
|
static QPixmap * s_toolDraw;
|
|
|
static QPixmap * s_toolErase;
|
|
|
- static QPixmap * s_toolSelect;
|
|
|
+ static QPixmap * s_toolDrawOut;
|
|
|
static QPixmap * s_toolMove;
|
|
|
static QPixmap * s_toolYFlip;
|
|
|
static QPixmap * s_toolXFlip;
|
|
@@ -200,7 +176,6 @@ private:
|
|
|
|
|
|
FloatModel * m_tensionModel;
|
|
|
|
|
|
- QMutex m_patternMutex;
|
|
|
AutomationPattern * m_pattern;
|
|
|
float m_minLevel;
|
|
|
float m_maxLevel;
|
|
@@ -219,13 +194,6 @@ private:
|
|
|
|
|
|
Actions m_action;
|
|
|
|
|
|
- tick_t m_selectStartTick;
|
|
|
- tick_t m_selectedTick;
|
|
|
- float m_selectStartLevel;
|
|
|
- float m_selectedLevels;
|
|
|
-
|
|
|
- float m_moveStartLevel;
|
|
|
- tick_t m_moveStartTick;
|
|
|
int m_moveXOffset;
|
|
|
|
|
|
float m_drawLastLevel;
|
|
@@ -235,9 +203,8 @@ private:
|
|
|
int m_y_delta;
|
|
|
bool m_y_auto;
|
|
|
|
|
|
- timeMap m_valuesToCopy;
|
|
|
- timeMap m_selValuesForMove;
|
|
|
-
|
|
|
+ // Time position (key) of automation node whose outValue is being dragged
|
|
|
+ int m_draggedOutValueKey;
|
|
|
|
|
|
EditModes m_editMode;
|
|
|
|
|
@@ -255,7 +222,8 @@ private:
|
|
|
QColor m_beatLineColor;
|
|
|
QColor m_lineColor;
|
|
|
QBrush m_graphColor;
|
|
|
- QColor m_vertexColor;
|
|
|
+ QColor m_nodeInValueColor;
|
|
|
+ QColor m_nodeOutValueColor;
|
|
|
QBrush m_scaleColor;
|
|
|
QColor m_crossColor;
|
|
|
QColor m_backgroundShade;
|