summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse2/muse/midiedit/drumedit.cpp29
-rw-r--r--muse2/muse/midiedit/ecanvas.cpp2
-rw-r--r--muse2/muse/midiedit/ecanvas.h6
-rw-r--r--muse2/muse/midiedit/pianoroll.cpp21
-rw-r--r--muse2/muse/midiedit/prcanvas.cpp3
-rw-r--r--muse2/muse/midiedit/prcanvas.h5
6 files changed, 11 insertions, 55 deletions
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp
index 97ab092e..e64379a2 100644
--- a/muse2/muse/midiedit/drumedit.cpp
+++ b/muse2/muse/midiedit/drumedit.cpp
@@ -289,19 +289,6 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
tools->addSeparator();
tools->addActions(undoRedo->actions());
- tools->addSeparator();
-
- srec = new QToolButton();
- srec->setToolTip(tr("Step Record"));
- srec->setIcon(*steprecIcon);
- srec->setCheckable(true);
- tools->addWidget(srec);
-
- midiin = new QToolButton();
- midiin->setToolTip(tr("Midi Input"));
- midiin->setIcon(*midiinIcon);
- midiin->setCheckable(true);
- tools->addWidget(midiin);
tools2 = new EditToolBar(this, drumeditTools);
@@ -453,8 +440,6 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
connect(vscroll, SIGNAL(scaleChanged(int)), dlist, SLOT(setYMag(int)));
connect(hscroll, SIGNAL(scrollChanged(int)), canvas, SLOT(setXPos(int)));
connect(hscroll, SIGNAL(scaleChanged(int)), canvas, SLOT(setXMag(int)));
- connect(srec, SIGNAL(toggled(bool)), canvas, SLOT(setSteprec(bool)));
- connect(midiin, SIGNAL(toggled(bool)), canvas, SLOT(setMidiin(bool)));
connect(vscroll, SIGNAL(scrollChanged(int)), dlist, SLOT(setYPos(int)));
connect(hscroll, SIGNAL(scrollChanged(int)), time, SLOT(setXPos(int)));
@@ -675,8 +660,6 @@ void DrumEdit::writeStatus(int level, Xml& xml) const
split2->writeStatus(level, xml);
header->writeStatus(level, xml);
- xml.intTag(level, "steprec", canvas->steprec());
- xml.intTag(level, "midiin", canvas->midiin());
xml.intTag(level, "xpos", hscroll->pos());
xml.intTag(level, "xmag", hscroll->mag());
xml.intTag(level, "ypos", vscroll->pos());
@@ -698,17 +681,7 @@ void DrumEdit::readStatus(Xml& xml)
case Xml::End:
return;
case Xml::TagStart:
- if (tag == "steprec") {
- int val = xml.parseInt();
- canvas->setSteprec(val);
- srec->setChecked(val);
- }
- else if (tag == "midiin") {
- int val = xml.parseInt();
- canvas->setMidiin(val);
- midiin->setChecked(val);
- }
- else if (tag == "ctrledit") {
+ if (tag == "ctrledit") {
CtrlEdit* ctrl = addCtrl();
ctrl->readStatus(xml);
}
diff --git a/muse2/muse/midiedit/ecanvas.cpp b/muse2/muse/midiedit/ecanvas.cpp
index 7a421411..8f04bdfc 100644
--- a/muse2/muse/midiedit/ecanvas.cpp
+++ b/muse2/muse/midiedit/ecanvas.cpp
@@ -35,8 +35,6 @@ EventCanvas::EventCanvas(MidiEditor* pr, QWidget* parent, int sx,
: Canvas(parent, sx, sy, name)
{
editor = pr;
- _steprec = false;
- _midiin = false;
_playEvents = false;
curVelo = 70;
diff --git a/muse2/muse/midiedit/ecanvas.h b/muse2/muse/midiedit/ecanvas.h
index 86e1c200..a278fb19 100644
--- a/muse2/muse/midiedit/ecanvas.h
+++ b/muse2/muse/midiedit/ecanvas.h
@@ -51,8 +51,6 @@ class EventCanvas : public Canvas {
MidiEditor* editor;
unsigned start_tick, end_tick;
int curVelo;
- bool _steprec;
- bool _midiin;
void updateSelection();
virtual void addItem(Part*, Event&) = 0;
@@ -61,8 +59,6 @@ class EventCanvas : public Canvas {
public slots:
void redrawGrid() { redraw(); }
- void setSteprec(bool f) { _steprec = f; }
- void setMidiin(bool f) { _midiin = f; }
signals:
void pitchChanged(int); // current cursor position
@@ -75,8 +71,6 @@ class EventCanvas : public Canvas {
MidiTrack* track() const;
unsigned start() const { return start_tick; }
unsigned end() const { return end_tick; }
- bool midiin() const { return _midiin; }
- bool steprec() const { return _steprec; }
QString getCaption() const;
void songChanged(int);
void range(int* s, int* e) const { *s = start_tick; *e = end_tick; }
diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp
index ab83e85f..89f5ad6a 100644
--- a/muse2/muse/midiedit/pianoroll.cpp
+++ b/muse2/muse/midiedit/pianoroll.cpp
@@ -236,12 +236,6 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
srec->setCheckable(true);
tools->addWidget(srec);
- midiin = new QToolButton();
- midiin->setToolTip(tr("Midi Input"));
- midiin->setIcon(*midiinIcon);
- midiin->setCheckable(true);
- tools->addWidget(midiin);
-
speaker = new QToolButton();
speaker->setToolTip(tr("Play Events"));
speaker->setIcon(*speakerIcon);
@@ -441,7 +435,6 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
connect(piano, SIGNAL(keyPressed(int, int, bool)), canvas, SLOT(pianoPressed(int, int, bool)));
connect(piano, SIGNAL(keyReleased(int, bool)), canvas, SLOT(pianoReleased(int, bool)));
connect(srec, SIGNAL(toggled(bool)), SLOT(setSteprec(bool)));
- connect(midiin, SIGNAL(toggled(bool)), canvas, SLOT(setMidiin(bool)));
connect(speaker, SIGNAL(toggled(bool)), SLOT(setSpeaker(bool)));
connect(canvas, SIGNAL(followEvent(int)), SLOT(follow(int)));
@@ -873,8 +866,7 @@ void PianoRoll::writeStatus(int level, Xml& xml) const
(*i)->writeStatus(level, xml);
}
- xml.intTag(level, "steprec", canvas->steprec());
- xml.intTag(level, "midiin", canvas->midiin());
+ xml.intTag(level, "steprec", ((PianoCanvas*)canvas)->steprec());
xml.intTag(level, "tool", int(canvas->tool()));
xml.intTag(level, "playEvents", _playEvents);
xml.intTag(level, "xpos", hscroll->pos());
@@ -899,14 +891,9 @@ void PianoRoll::readStatus(Xml& xml)
case Xml::TagStart:
if (tag == "steprec") {
int val = xml.parseInt();
- canvas->setSteprec(val);
+ ((PianoCanvas*)canvas)->setSteprec(val);
srec->setChecked(val);
}
- else if (tag == "midiin") {
- int val = xml.parseInt();
- canvas->setMidiin(val);
- midiin->setChecked(val);
- }
else if (tag == "tool") {
int tool = xml.parseInt();
canvas->setTool(tool);
@@ -1130,9 +1117,7 @@ void PianoRoll::keyPressEvent(QKeyEvent* event)
void PianoRoll::setSteprec(bool flag)
{
- canvas->setSteprec(flag);
- if (flag == false)
- midiin->setChecked(flag);
+ ((PianoCanvas*)canvas)->setSteprec(flag);
}
//---------------------------------------------------------
diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp
index 84cac135..1706681e 100644
--- a/muse2/muse/midiedit/prcanvas.cpp
+++ b/muse2/muse/midiedit/prcanvas.cpp
@@ -83,6 +83,7 @@ PianoCanvas::PianoCanvas(MidiEditor* pr, QWidget* parent, int sx, int sy)
{
colorMode = 0;
playedPitch = -1;
+ _steprec = false;
chordTimer = new QTimer(this);
chordTimer->setSingleShot(true);
@@ -1055,7 +1056,7 @@ void PianoCanvas::cmd(int cmd)
void PianoCanvas::midiNote(int pitch, int velo)
{
- if (_midiin && _steprec && curPart
+ if (_steprec && curPart
&& !audio->isPlaying() && velo && pos[0] >= start_tick
&& pos[0] < end_tick
&& !(globalKeyState & Qt::AltModifier)) {
diff --git a/muse2/muse/midiedit/prcanvas.h b/muse2/muse/midiedit/prcanvas.h
index 3ca9ab52..a5fea173 100644
--- a/muse2/muse/midiedit/prcanvas.h
+++ b/muse2/muse/midiedit/prcanvas.h
@@ -44,6 +44,8 @@ class PianoCanvas : public EventCanvas {
QTimer* chordTimer;
unsigned chordTimer_setToTick;
+ bool _steprec;
+
Q_OBJECT
virtual void viewMouseDoubleClickEvent(QMouseEvent*);
virtual void drawItem(QPainter&, const CItem*, const QRect&);
@@ -87,6 +89,7 @@ class PianoCanvas : public EventCanvas {
void pianoCmd(int);
void pianoPressed(int pitch, int velocity, bool shift);
void pianoReleased(int pitch, bool);
+ void setSteprec(bool f) { _steprec = f; }
public:
enum {
@@ -108,6 +111,8 @@ class PianoCanvas : public EventCanvas {
redraw();
}
virtual void modifySelected(NoteInfo::ValType type, int delta);
+
+ bool steprec() const { return _steprec; }
};
#endif