From: werner s. <wsc...@us...> - 2005-12-12 22:03:52
|
Update of /cvsroot/lmuse/muse/awl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7250/awl Modified Files: tcanvas.cpp tcanvas.h Log Message: updates Index: tcanvas.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/awl/tcanvas.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** tcanvas.cpp 9 Dec 2005 17:54:16 -0000 1.37 --- tcanvas.cpp 12 Dec 2005 22:03:43 -0000 1.38 *************** *** 34,37 **** --- 34,38 ---- : QFrame() { + _yFit = false; _tool = PointerTool; type = t; *************** *** 91,95 **** _ymagMin = 0.5; _ymagMax = 3.0; - _ymag = 1.0; vmag->setValue(lrint((_ymag-_ymagMin)*100.0/(_ymagMax-_ymagMin))); initPianoroll(); --- 92,95 ---- *************** *** 887,902 **** //--------------------------------------------------------- - // setVSize - //--------------------------------------------------------- - - void TimeCanvas::setVSize(int val) - { - if (yRange == val) - return; - yRange = val; - updateScrollBars(); - } - - //--------------------------------------------------------- // updateScrollBars //--------------------------------------------------------- --- 887,890 ---- *************** *** 1462,1470 **** rButton.setRect(0, 0, rCanvasA.x(), rPanelA.y()); ! if (yRange > 0) { _ymagMin = double(rCanvasA.height()) / double(yRange); if (_ymag < _ymagMin) _ymag = _ymagMin; ! vmag->setValue(lrint((_ymag-_ymagMin)*100.0/(_ymagMax-_ymagMin))); } } --- 1450,1459 ---- rButton.setRect(0, 0, rCanvasA.x(), rPanelA.y()); ! if (yRange > 0 && _yFit) { _ymagMin = double(rCanvasA.height()) / double(yRange); if (_ymag < _ymagMin) _ymag = _ymagMin; ! if (vmag) ! vmag->setValue(lrint((_ymag-_ymagMin)*100.0/(_ymagMax-_ymagMin))); } } *************** *** 1528,1532 **** { _canvasBg.setTexture(pm); - // _canvasBg.setStyle(Qt::TexturePattern); } --- 1517,1520 ---- *************** *** 1539,1556 **** _ymagMin = min; _ymagMax = max; ! vmag->setValue(lrint((_ymag-_ymagMin)*100.0/(_ymagMax-_ymagMin))); } //--------------------------------------------------------- ! // setYRange //--------------------------------------------------------- ! void TimeCanvas::setYRange(int min, int max) { ! yRange = max - min; ! _ymagMin = double(rCanvasA.height()) / double(yRange); ! if (_ymag < _ymagMin) ! _ymag = _ymagMin; ! vmag->setValue(lrint((_ymag-_ymagMin)*100.0/(_ymagMax-_ymagMin))); } --- 1527,1552 ---- _ymagMin = min; _ymagMax = max; ! if (vmag) ! vmag->setValue(lrint((_ymag-_ymagMin)*100.0/(_ymagMax-_ymagMin))); } //--------------------------------------------------------- ! // setVSize //--------------------------------------------------------- ! void TimeCanvas::setVSize(int val) { ! if (yRange == val) ! return; ! yRange = val; ! if (_yFit) { ! _ymagMin = double(rCanvasA.height()) / double(yRange); ! if (_ymag < _ymagMin) ! _ymag = _ymagMin; ! if (vmag) ! vmag->setValue(lrint((_ymag-_ymagMin)*100.0/(_ymagMax-_ymagMin))); ! } ! updateScrollBars(); } + Index: tcanvas.h =================================================================== RCS file: /cvsroot/lmuse/muse/awl/tcanvas.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcanvas.h 9 Dec 2005 17:54:16 -0000 1.27 --- tcanvas.h 12 Dec 2005 22:03:43 -0000 1.28 *************** *** 54,57 **** --- 54,58 ---- int yRange; + bool _yFit; AL::Pos pos1; // time range AL::Pos pos2; *************** *** 193,201 **** TimeCanvas(TimeCanvasType = TIME_CANVAS); void setTimeRange(const AL::Pos&, const AL::Pos&); - void setYRange(int, int); void setMag(double, double); double xmag() const { return _xmag; } double ymag() const { return _ymag; } void setYMagRange(double, double); QPoint getWPos() const { return wpos; } QWidget* widget() const { return _widget; } --- 194,204 ---- TimeCanvas(TimeCanvasType = TIME_CANVAS); void setTimeRange(const AL::Pos&, const AL::Pos&); void setMag(double, double); double xmag() const { return _xmag; } double ymag() const { return _ymag; } + void setYMagRange(double, double); + void setYFit(bool val) { _yFit = val; } + QPoint getWPos() const { return wpos; } QWidget* widget() const { return _widget; } |