diff options
Diffstat (limited to 'muse2/muse/waveedit/waveedit.cpp')
-rw-r--r-- | muse2/muse/waveedit/waveedit.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 2350a2c5..ccfb2730 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -222,6 +222,9 @@ WaveEdit::WaveEdit(PartList* pl) ymag->setFixedWidth(16); connect(view, SIGNAL(mouseWheelMoved(int)), this, SLOT(moveVerticalSlider(int))); connect(ymag, SIGNAL(valueChanged(int)), view, SLOT(setYScale(int))); + connect(view, SIGNAL(horizontalZoomIn()), SLOT(horizontalZoomIn())); + connect(view, SIGNAL(horizontalZoomOut()), SLOT(horizontalZoomOut())); + time->setOrigin(0, 0); mainGrid->setRowStretch(0, 100); @@ -246,6 +249,8 @@ WaveEdit::WaveEdit(PartList* pl) // connect(time, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); connect(view, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); + connect(view, SIGNAL(horizontalScroll(unsigned)),hscroll, SLOT(setPos(unsigned))); + connect(hscroll, SIGNAL(scaleChanged(int)), SLOT(updateHScrollRange())); connect(song, SIGNAL(songChanged(int)), SLOT(songChanged1(int))); @@ -498,3 +503,29 @@ void WaveEdit::moveVerticalSlider(int val) ymag->setValue(ymag->value() + val); } + +void WaveEdit::horizontalZoomIn() +{ + int mag = hscroll->mag(); + int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + if (zoomlvl < 23) + zoomlvl++; + + int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + + hscroll->setMag(newmag); + +} + +void WaveEdit::horizontalZoomOut() +{ + int mag = hscroll->mag(); + int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + if (zoomlvl > 1) + zoomlvl--; + + int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + + hscroll->setMag(newmag); + +} |