diff options
author | Florian Jung <flo@windfisch.org> | 2012-03-16 14:34:56 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2012-03-16 14:34:56 +0000 |
commit | 8f7ed6ab503f7f1befae937bdc33e6907f3a1868 (patch) | |
tree | 3c193b15ec70c1cb0230ab6a0683dc99b5a3185d /muse2/muse/arranger | |
parent | e232be5476afe17a3abc717f757e667832d9daa6 (diff) |
custom columns now send their changes to the device if appropriate
Diffstat (limited to 'muse2/muse/arranger')
-rw-r--r-- | muse2/muse/arranger/tlist.cpp | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 77686ff2..0c14bf7b 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -425,7 +425,7 @@ void TList::paint(const QRect& r) MusECore::MidiTrack* mt=dynamic_cast<MusECore::MidiTrack*>(track); MusECore::MidiPort* mp = &MusEGlobal::midiPorts[mt->outPort()]; MusECore::MidiController* mctl = mp->midiController(col_ctrl_no); - int val=mt->getControllerValueAtTick(0,col_ctrl_no,MusECore::CTRL_VAL_UNKNOWN); + int val=mt->getControllerChangeAtTick(0,col_ctrl_no,MusECore::CTRL_VAL_UNKNOWN); if (val!=MusECore::CTRL_VAL_UNKNOWN) val-=mctl->bias(); @@ -627,11 +627,7 @@ void TList::ctrlValueFinished() if (val!=MusECore::CTRL_VAL_UNKNOWN) { - MusECore::Event a(MusECore::Controller); - a.setTick(0); - a.setA(ctrl_num); - a.setB(val); - MusEGlobal::song->recordEvent(mt, a); + record_controller_change_and_maybe_send(0, ctrl_num, val, mt); } else { @@ -810,7 +806,7 @@ void TList::mouseDoubleClickEvent(QMouseEvent* ev) ctrl_edit->setMinimum(mctl->minVal()-1); // -1 because of the specialValueText ctrl_edit->setMaximum(mctl->maxVal()); - ctrl_edit->setValue(((MusECore::MidiTrack*)editTrack)->getControllerValueAtTick(0,ctrl_num)-mctl->bias()); + ctrl_edit->setValue(((MusECore::MidiTrack*)editTrack)->getControllerChangeAtTick(0,ctrl_num)-mctl->bias()); int w=colw; if (w < ctrl_edit->sizeHint().width()) w=ctrl_edit->sizeHint().width(); ctrl_edit->setGeometry(colx, coly, w, colh); @@ -1858,7 +1854,7 @@ void TList::mousePressEvent(QMouseEvent* ev) int minval=mctl->minVal()+mctl->bias(); int maxval=mctl->maxVal()+mctl->bias(); - int val = mt->getControllerValueAtTick(0,ctrl_num); + int val = mt->getControllerChangeAtTick(0,ctrl_num); int oldval=val; if (ctrl_num!=MusECore::CTRL_PROGRAM) @@ -1880,11 +1876,7 @@ void TList::mousePressEvent(QMouseEvent* ev) { if (val!=minval-1) { - MusECore::Event a(MusECore::Controller); - a.setTick(0); - a.setA(ctrl_num); - a.setB(val); - MusEGlobal::song->recordEvent(mt, a); + record_controller_change_and_maybe_send(0, ctrl_num, val, mt); } else { @@ -1937,13 +1929,7 @@ void TList::mousePressEvent(QMouseEvent* ev) { int val = act->data().toInt(); if(val != -1) - { - MusECore::Event a(MusECore::Controller); - a.setTick(0); - a.setA(MusECore::CTRL_PROGRAM); - a.setB(val); - MusEGlobal::song->recordEvent(mt, a); - } + record_controller_change_and_maybe_send(0, MusECore::CTRL_PROGRAM, val, mt); } delete pup; @@ -2334,7 +2320,7 @@ void TList::wheelEvent(QWheelEvent* ev) int minval=mctl->minVal()+mctl->bias(); int maxval=mctl->maxVal()+mctl->bias(); - int val = mt->getControllerValueAtTick(0,ctrl_num); + int val = mt->getControllerChangeAtTick(0,ctrl_num); int oldval=val; if (ctrl_num!=MusECore::CTRL_PROGRAM) @@ -2356,11 +2342,7 @@ void TList::wheelEvent(QWheelEvent* ev) { if (val!=minval-1) { - MusECore::Event a(MusECore::Controller); - a.setTick(0); - a.setA(ctrl_num); - a.setB(val); - MusEGlobal::song->recordEvent(mt, a); + record_controller_change_and_maybe_send(0, ctrl_num, val, mt); } else { @@ -2532,13 +2514,7 @@ void TList::instrPopupActivated(QAction* act) { int val = act->data().toInt(); if(val != -1) - { - MusECore::Event a(MusECore::Controller); - a.setTick(0); - a.setA(MusECore::CTRL_PROGRAM); - a.setB(val); - MusEGlobal::song->recordEvent(mt, a); - } + record_controller_change_and_maybe_send(0, MusECore::CTRL_PROGRAM, val, mt); } } |