Piano Roll and Automation editor grid redesign (w/ @BaraMGB) (#3062)

* Make dem grid ndasd

* grid BG

* fix bug in scroll behavior

* debugging scrolling

* Add CSS property, port to automation editor

* Fix a fail

* Spaces to tabs

* Use fillRect rather than drawRect

* Implement @vlad1777d's idea

* Seperate loops and stuff

* Finish up Piano Roll Grid

* Cleanup

* Redesign the grid for the Automation Editor

* Update colors

* Formatting changes

* formatting changes II
This commit is contained in:
Umcaruje
2017-02-22 19:56:32 +01:00
committed by GitHub
parent 5863752988
commit de2e164aae
5 changed files with 321 additions and 185 deletions

View File

@@ -52,11 +52,14 @@ class TimeLineWidget;
class AutomationEditor : public QWidget, public JournallingObject
{
Q_OBJECT
Q_PROPERTY(QColor gridColor READ gridColor WRITE setGridColor)
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)
public:
void setCurrentPattern(AutomationPattern * new_pattern);
@@ -78,16 +81,22 @@ public:
}
// qproperty access methods
QColor gridColor() const;
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 setGridColor(const QColor& c);
void setGraphColor(const QBrush& c);
void setVertexColor(const QColor& c);
void setScaleColor(const QBrush& c);
void setCrossColor(const QColor& c);
void setCrossColor(const QColor & c);
QColor backgroundShade() const;
void setBackgroundShade(const QColor & c);
enum EditModes
{
@@ -239,11 +248,14 @@ private:
void drawAutomationPoint( QPainter & p, timeMap::iterator it );
bool inBBEditor();
QColor m_gridColor;
QColor m_barLineColor;
QColor m_beatLineColor;
QColor m_lineColor;
QBrush m_graphColor;
QColor m_vertexColor;
QBrush m_scaleColor;
QColor m_crossColor;
QColor m_backgroundShade;
friend class AutomationEditorWindow;

View File

@@ -54,7 +54,9 @@ class TimeLineWidget;
class PianoRoll : public QWidget
{
Q_OBJECT
Q_PROPERTY( QColor gridColor READ gridColor WRITE setGridColor )
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 noteModeColor READ noteModeColor WRITE setNoteModeColor )
Q_PROPERTY( QColor noteColor READ noteColor WRITE setNoteColor )
Q_PROPERTY( QColor barColor READ barColor WRITE setBarColor )
@@ -65,6 +67,7 @@ class PianoRoll : public QWidget
Q_PROPERTY( QColor markedSemitoneColor READ markedSemitoneColor WRITE setMarkedSemitoneColor )
Q_PROPERTY( int noteOpacity READ noteOpacity WRITE setNoteOpacity )
Q_PROPERTY( bool noteBorders READ noteBorders WRITE setNoteBorders )
Q_PROPERTY( QColor backgroundShade READ backgroundShade WRITE setBackgroundShade )
public:
enum EditModes
{
@@ -107,10 +110,14 @@ public:
Song::PlayModes desiredPlayModeForAccompany() const;
int quantization() const;
// qproperty acces functions
QColor gridColor() const;
void setGridColor( const QColor & c );
// qproperty access functions
QColor barLineColor() const;
void setBarLineColor( const QColor & c );
QColor beatLineColor() const;
void setBeatLineColor( const QColor & c );
QColor lineColor() const;
void setLineColor( const QColor & c );
QColor noteModeColor() const;
void setNoteModeColor( const QColor & c );
QColor noteColor() const;
@@ -131,6 +138,8 @@ public:
void setNoteOpacity( const int i );
bool noteBorders() const;
void setNoteBorders( const bool b );
QColor backgroundShade() const;
void setBackgroundShade( const QColor & c );
protected:
@@ -154,6 +163,7 @@ protected:
void selectAll();
NoteVector getSelectedNotes();
void selectNotesOnKey();
int xCoordOfTick( int tick );
// for entering values with dblclick in the vol/pan bars
void enterValue( NoteVector* nv );
@@ -370,7 +380,9 @@ private:
friend class PianoRollWindow;
// qproperty fields
QColor m_gridColor;
QColor m_barLineColor;
QColor m_beatLineColor;
QColor m_lineColor;
QColor m_noteModeColor;
QColor m_noteColor;
QColor m_barColor;
@@ -381,6 +393,7 @@ private:
QColor m_markedSemitoneColor;
int m_noteOpacity;
bool m_noteBorders;
QColor m_backgroundShade;
signals:
void positionChanged( const MidiTime & );