Skip to content

Commit

Permalink
Piano roll vertical zoom (LMMS#5442)
Browse files Browse the repository at this point in the history
  • Loading branch information
akimaze authored Apr 30, 2020
1 parent 84b9b90 commit bea0ecd
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 84 deletions.
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

0 comments on commit bea0ecd

Please sign in to comment.