From: Mathias L. <lun...@us...> - 2005-03-25 11:54:32
|
Update of /cvsroot/lmuse/muse/muse/arranger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14015/muse/arranger Modified Files: cswidget.cpp cswidget.h Log Message: Added a special signal for velocity Index: cswidget.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/arranger/cswidget.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** cswidget.cpp 19 Jan 2005 17:50:10 -0000 1.17 --- cswidget.cpp 25 Mar 2005 11:54:24 -0000 1.18 *************** *** 199,203 **** void CanvasSWidget::mousePressEvent(QMouseEvent* event) { ! song->selectPart(0, false); // deselect all parts emit kbdMovementUpdate(0, 0); // tell arranger nothing is selected (kbdmovement) button = event->button(); --- 199,203 ---- void CanvasSWidget::mousePressEvent(QMouseEvent* event) { ! song->selectPart(0, false); // deselect all parts (this is a bit strange when it's invoked from the controller pane) emit kbdMovementUpdate(0, 0); // tell arranger nothing is selected (kbdmovement) button = event->button(); *************** *** 230,234 **** x = 0; unsigned time = MAPXDEV(x); ! song->addControllerVal(_track, controller->id(), time, cval); } } --- 230,238 ---- x = 0; unsigned time = MAPXDEV(x); ! ! if (controller == &veloList) // Velocity - special case: ! emit velocityChange(time, cval.f); ! else ! song->addControllerVal(_track, controller->id(), time, cval); } } *************** *** 245,251 **** dragy = controller->val2pixelR(val, height()); emit cursorPos(mapxDev(x < _mapOffset ? _mapOffset : x)); ! if (controller && controller->type() == Ctrl::DISCRETE) { CVal val = controller->pixel2val(event->pos().y(), height()); emit yposChanged(val); } if (starty != -1) --- 249,258 ---- dragy = controller->val2pixelR(val, height()); emit cursorPos(mapxDev(x < _mapOffset ? _mapOffset : x)); ! /* if (controller && controller->type() == Ctrl::DISCRETE) { CVal val = controller->pixel2val(event->pos().y(), height()); emit yposChanged(val); + }*/ + if (controller == &veloList && button == QMouseEvent::LeftButton) { // Velocity - special case + emit velocityChange(MAPXDEV(x), val.f); } if (starty != -1) *************** *** 259,262 **** --- 266,271 ---- void CanvasSWidget::mouseReleaseEvent(QMouseEvent* event) { + button = QMouseEvent::NoButton; + if (starty == -1) return; Index: cswidget.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/arranger/cswidget.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** cswidget.h 13 Jan 2005 21:16:00 -0000 1.10 --- cswidget.h 25 Mar 2005 11:54:24 -0000 1.11 *************** *** 72,75 **** --- 72,76 ---- void kbdMovementUpdate(Track* t, Part* p); void yposChanged(CVal); + void velocityChange(unsigned time, float val); // sent to CtrlEdit public: |