diff options
author | Tim E. Real <termtech@rogers.com> | 2011-08-30 01:14:15 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2011-08-30 01:14:15 +0000 |
commit | 0f08cac5b167b989ccf3607a231ee5e992cdee05 (patch) | |
tree | 8f81066a386da313feda5f134a34ede9d829b36e /muse2 | |
parent | fe843e9d861971a7053e26570d7854f048e3eb7e (diff) |
Small fix - could not add new points to discrete automation graphs.
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/muse/arranger/pcanvas.cpp | 8 | ||||
-rw-r--r-- | muse2/muse/song.cpp | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 57bf71ba..ef45c9df 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -3587,6 +3587,7 @@ void PartCanvas::checkAutomation(Track * t, const QPoint &pointer, bool addNewCt double min, max; cl->range(&min,&max); //bool discrete = cl->valueType() == VAL_BOOL || cl->mode() == CtrlList::DISCRETE; // Tim + bool discrete = cl->mode() == CtrlList::DISCRETE; // First check that there IS automation, ic == cl->end means no automation if (ic == cl->end()) @@ -3611,7 +3612,7 @@ void PartCanvas::checkAutomation(Track * t, const QPoint &pointer, bool addNewCt } else y = (y-min)/(max-min); // we need to set curVal between 0 and 1 - + ypixel = mapy(trackY + trackH - 2 - y * trackH); xpixel = mapx(tempomap.frame2tick(ic->second.frame)); @@ -3625,7 +3626,7 @@ void PartCanvas::checkAutomation(Track * t, const QPoint &pointer, bool addNewCt double firstX=oldX; double lastX=xpixel; double firstY=oldY; - double lastY=ypixel; + double lastY = discrete ? oldY : ypixel; double proportion = (currX-firstX)/(lastX-firstX); @@ -3807,7 +3808,8 @@ void PartCanvas::processAutomationMovements(QPoint pos, bool addPoint) // we need to set val between 0 and 1 (unless integer) cvval = yfraction * (max-min) + min; // 'Snap' to integer or boolean - if (automation.currentCtrlList->valueType() == VAL_INT || automation.currentCtrlList->valueType() == VAL_BOOL) + //if (automation.currentCtrlList->valueType() == VAL_INT || automation.currentCtrlList->valueType() == VAL_BOOL) + if (automation.currentCtrlList->mode() == CtrlList::DISCRETE) cvval = rint(cvval + 0.1); // LADSPA docs say add a slight bias to avoid rounding errors. Try this. if (cvval< min) cvval=min; if (cvval>max) cvval=max; diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index 9d1c3afb..e4749d19 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -2517,13 +2517,13 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a if(icl != track->controller()->end()) { CtrlList *cl = icl->second; - canAdd = true; - ctlval = cl->curVal(); + canAdd = true; + int frame = pos[0].frame(); + ctlval = cl->curVal(); + //ctlval = cl->value(frame); // p4.0.32 count = cl->size(); if(count) { - int frame = pos[0].frame(); - iCtrl s = cl->lower_bound(frame); iCtrl e = cl->upper_bound(frame); |