Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piano roll vertical zoom #5442

Merged
merged 10 commits into from
Apr 30, 2020
14 changes: 13 additions & 1 deletion include/PianoRoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class PianoRoll : public QWidget
void focusOutEvent( QFocusEvent * ) override;

int getKey( int y ) const;
static void drawNoteRect( QPainter & p, int x, int y,
void drawNoteRect( QPainter & p, int x, int y,
int width, const Note * n, const QColor & noteCol, const QColor & noteTextColor,
const QColor & selCol, const int noteOpc, const bool borderless, bool drawNoteName );
void removeSelection();
Expand All @@ -192,6 +192,8 @@ class PianoRoll : public QWidget
// for entering values with dblclick in the vol/pan bars
void enterValue( NoteVector* nv );

void updateYScroll();

protected slots:
void play();
void record();
Expand All @@ -217,6 +219,7 @@ protected slots:
void updatePositionStepRecording(const MidiTime & t );

void zoomingChanged();
void zoomingYChanged();
void quantizeChanged();
void noteLengthChanged();
void quantizeNotes();
Expand Down Expand Up @@ -330,12 +333,14 @@ protected slots:
static TextFloat * s_textFloat;

ComboBoxModel m_zoomingModel;
ComboBoxModel m_zoomingYModel;
ComboBoxModel m_quantizeModel;
ComboBoxModel m_noteLenModel;
ComboBoxModel m_scaleModel;
ComboBoxModel m_chordModel;

static const QVector<double> m_zoomLevels;
static const QVector<double> m_zoomYLevels;

Pattern* m_pattern;
NoteVector m_ghostNotes;
Expand Down Expand Up @@ -385,6 +390,12 @@ protected slots:
int m_ppb; // pixels per bar
int m_totalKeysToScroll;

int m_keyLineHeight;
int m_octaveHeight;
int m_whiteKeySmallHeight;
int m_whiteKeyBigHeight;
int m_blackKeyHeight;

// remember these values to use them
// for the next note that is set
MidiTime m_lenOfNewNotes;
Expand Down Expand Up @@ -501,6 +512,7 @@ private slots:
PianoRoll* m_editor;

ComboBox * m_zoomingComboBox;
ComboBox * m_zoomingYComboBox;
ComboBox * m_quantizeComboBox;
ComboBox * m_noteLenComboBox;
ComboBox * m_scaleComboBox;
Expand Down
Loading