MuseScore  3.4
Music composition and notation
pianoroll.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2009-2011 Werner Schweer
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2
9 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __PIANOROLL_H__
14 #define __PIANOROLL_H__
15 
16 namespace Awl {
17  class PitchEdit;
18  class PosLabel;
19  };
20 
21 #include "libmscore/mscoreview.h"
22 #include "libmscore/pos.h"
23 #include "libmscore/score.h"
24 #include "libmscore/select.h"
25 
26 namespace Ms {
27 
28 class Score;
29 class Staff;
30 class PianoView;
31 class PianoKeyboard;
32 class PianoLevels;
33 class PianoLevelsChooser;
34 class Note;
35 class PianoRuler;
36 class Seq;
37 class WaveView;
38 
39 //---------------------------------------------------------
40 // PianorollEditor
41 //---------------------------------------------------------
42 
43 class PianorollEditor : public QMainWindow, public MuseScoreView {
44  Q_OBJECT
45 
50  QScrollBar* hsb; // horizontal scroll bar for pianoView
53  QLabel* partLabel;
55  QSpinBox* velocity;
56  QSpinBox* onTime;
57  QSpinBox* tickLen;
59  QComboBox* barPattern;
60  QComboBox* veloType;
61  QSpinBox* subdiv;
62  QSpinBox* tuplet;
65  QAction* showWave;
67  QSplitter* split;
68  QList<QAction*> actions;
69 
70  bool updateScheduled = false;
71 
72  void updateVelocity(Note* note);
73  void updateSelection();
74  void readSettings();
75  void doUpdate();
76 
77  private slots:
78  void selectionChanged();
79  void veloTypeChanged(int);
80  void velocityChanged(int);
81  void keyPressed(int);
82  void keyReleased(int);
83  void moveLocator(int, const Pos&);
84  void cmd(QAction*);
85  void rangeChanged(int min, int max);
86  void setXpos(int x);
87  void showWaveView(bool);
88  void posChanged(POS pos, unsigned tick);
89  void tickLenChanged(int);
90  void onTimeChanged(int val);
91  void playlistChanged();
92 
93  public slots:
95 
96  public:
97  PianorollEditor(QWidget* parent = 0);
98  virtual ~PianorollEditor();
99 
100  void setStaff(Staff* staff);
101  void focusOnPosition(Position* p);
102  void heartBeat(Seq*);
103 
104  virtual void dataChanged(const QRectF&) override;
105  virtual void updateAll() override;
106  virtual void removeScore() override;
107  virtual void changeEditElement(Element*) override;
108  virtual QCursor cursor() const override;
109  virtual void setCursor(const QCursor&) override;
110  const QTransform& matrix() const;
111  virtual Element* elementNear(QPointF) override;
112  virtual void drawBackground(QPainter* /*p*/, const QRectF& /*r*/) const override {}
113 
114  void setLocator(POS posi, int tick) { locator[int(posi)].setTick(tick); }
115 
116  void writeSettings();
117  virtual const QRect geometry() const override { return QMainWindow::geometry(); }
118  };
119 
120 
121 } // namespace Ms
122 #endif
123 
124 
void keyPressed(int)
Definition: pianoroll.cpp:580
const QTransform & matrix() const
Definition: pianoroll.cpp:680
Score * _score
Definition: pianoroll.h:51
Global staff data not directly related to drawing.
Definition: staff.h:62
Definition: pianoview.h:76
SelState
Definition: select.h:71
PianoLevels * pianoLevels
Definition: pianoroll.h:48
PianoRuler * ruler
Definition: pianoroll.h:64
Definition: pianoroll.h:43
virtual Element * elementNear(QPointF) override
Definition: pianoroll.cpp:690
QComboBox * barPattern
Definition: pianoroll.h:59
Definition of Score class.
void selectionChanged()
Definition: pianoroll.cpp:455
void posChanged(POS pos, unsigned tick)
Definition: pianoroll.cpp:757
void writeSettings()
Definition: pianoroll.cpp:381
virtual void removeScore() override
Definition: pianoroll.cpp:645
Base class of score layout elements.
Definition: element.h:158
Definition: pitchedit.h:29
void cmd(QAction *)
Definition: pianoroll.cpp:624
void velocityChanged(int)
Definition: pianoroll.cpp:557
Pos locator[3]
Definition: pianoroll.h:58
virtual void updateAll() override
Definition: pianoroll.cpp:699
Definition: pianolevelschooser.h:33
Definition: score.h:391
Definition: seq.h:104
void focusOnPosition(Position *p)
Definition: pianoroll.cpp:318
QSpinBox * tickLen
Definition: pianoroll.h:57
QList< QAction * > actions
Definition: pianoroll.h:68
Definition: score.h:196
virtual ~PianorollEditor()
Definition: pianoroll.cpp:306
void setLocator(POS posi, int tick)
Definition: pianoroll.h:114
void readSettings()
Definition: pianoroll.cpp:390
virtual const QRect geometry() const override
Definition: pianoroll.h:117
void tickLenChanged(int)
Definition: pianoroll.cpp:798
void showWaveView(bool)
Definition: pianoroll.cpp:732
void veloTypeChanged(int)
Definition: pianoroll.cpp:493
PianoKeyboard * pianoKbd
Definition: pianoroll.h:47
Definition: aeolus.cpp:26
QSpinBox * onTime
Definition: pianoroll.h:56
void updateSelection()
Definition: pianoroll.cpp:422
Definition: poslabel.h:32
void updateVelocity(Note *note)
Definition: pianoroll.cpp:526
void doUpdate()
Definition: pianoroll.cpp:712
virtual void setCursor(const QCursor &) override
Definition: pianoroll.cpp:672
QSpinBox * subdiv
Definition: pianoroll.h:61
PianoView * pianoView
Definition: pianoroll.h:46
void playlistChanged()
Definition: pianoroll.cpp:724
WaveView * waveView
Definition: pianoroll.h:66
QSpinBox * velocity
Definition: pianoroll.h:55
Awl::PitchEdit * pitch
Definition: pianoroll.h:54
void setTick(unsigned)
Definition: pos.cpp:285
Definition: pianolevels.h:42
virtual void drawBackground(QPainter *, const QRectF &) const override
Definition: pianoroll.h:112
void rangeChanged(int min, int max)
Definition: pianoroll.cpp:413
bool updateScheduled
Definition: pianoroll.h:70
QSpinBox * tuplet
Definition: pianoroll.h:62
Graphic representation of a note.
Definition: note.h:212
Definition: aslider.cpp:23
QSplitter * split
Definition: pianoroll.h:67
void onTimeChanged(int val)
Definition: pianoroll.cpp:773
Awl::PosLabel * pos
Definition: pianoroll.h:63
void setXpos(int x)
Definition: pianoroll.cpp:400
Definition: pianoruler.h:36
void moveLocator(int, const Pos &)
Definition: pianoroll.cpp:614
void setStaff(Staff *staff)
Definition: pianoroll.cpp:331
virtual QCursor cursor() const override
Definition: pianoroll.cpp:663
POS
Definition: score.h:100
void changeSelection(SelState)
Definition: pianoroll.cpp:484
QLabel * partLabel
Definition: pianoroll.h:53
QComboBox * veloType
Definition: pianoroll.h:60
PianorollEditor(QWidget *parent=0)
Definition: pianoroll.cpp:42
Definition: pianokeyboard.h:40
QAction * showWave
Definition: pianoroll.h:65
void keyReleased(int)
Definition: pianoroll.cpp:589
Staff * staff
Definition: pianoroll.h:52
Definition: pos.h:42
Definition: mscoreview.h:32
void heartBeat(Seq *)
Definition: pianoroll.cpp:598
virtual void dataChanged(const QRectF &) override
Definition: pianoroll.cpp:637
QScrollBar * hsb
Definition: pianoroll.h:50
Definition: waveview.h:27
virtual void changeEditElement(Element *) override
Definition: pianoroll.cpp:655
PianoLevelsChooser * pianoLevelsChooser
Definition: pianoroll.h:49