Mercurial > hg > tony
changeset 42:140f1fdc7edd
vertical scale adapts to note range
author | matthiasm |
---|---|
date | Wed, 19 Jun 2013 22:05:45 +0100 |
parents | be5676304132 |
children | dce769cf4495 |
files | .hgsubstate src/Analyser.cpp src/MainWindow.cpp |
diffstat | 3 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate Wed Jun 19 08:27:27 2013 +0100 +++ b/.hgsubstate Wed Jun 19 22:05:45 2013 +0100 @@ -1,3 +1,3 @@ cba1e2a3d14bdaa7ca167d8c1ff9727359a560d3 svapp e2b535b35b5f19eee55dd95242101147cc105eb0 svcore -c572a070522359e2c001973d0258ebad782cb190 svgui +902c7c9d77eaef3363711b7871b140aaec632097 svgui
--- a/src/Analyser.cpp Wed Jun 19 08:27:27 2013 +0100 +++ b/src/Analyser.cpp Wed Jun 19 22:05:45 2013 +0100 @@ -74,7 +74,7 @@ tvl->setBaseColour(ColourDatabase::getInstance()-> getColourIndex(QString("Black"))); tvl->setVerticalScale(TimeValueLayer::LogScale); - tvl->setDisplayExtents(80.f,600.f); // temporary values: better get the real extents of the data form the model + tvl->setDisplayExtents(27.5f,880.f); // temporary values: better get the real extents of the data form the model } } @@ -85,11 +85,12 @@ if (nl) { nl->setBaseColour(ColourDatabase::getInstance()-> getColourIndex(QString("Bright Blue"))); - // nl->setVerticalScale(FlexiNoteLayer::LogScale); - // nl->setDisplayExtents(100.f,550.f); // temporary values: better get the real extents of the data form the model + nl->setVerticalScale(FlexiNoteLayer::AutoAlignScale); + // nl->setDisplayExtents(80.f,600.f); // temporary values: better get the real extents of the data form the model } } + paneStack->setCurrentLayer(m_pane, layer); }
--- a/src/MainWindow.cpp Wed Jun 19 08:27:27 2013 +0100 +++ b/src/MainWindow.cpp Wed Jun 19 22:05:45 2013 +0100 @@ -25,6 +25,7 @@ #include "data/model/WaveFileModel.h" #include "data/model/NoteModel.h" #include "data/model/FlexiNoteModel.h" +#include "layer/FlexiNoteLayer.h" #include "data/model/NoteModel.h" #include "view/ViewManager.h" #include "base/Preferences.h" @@ -1289,7 +1290,13 @@ m_myStatusMessage = tr("Visible: %1 to %2 (duration %3)") .arg(startStr).arg(endStr).arg(durationStr); } - + + // scale Y axis + FlexiNoteLayer *fnl = dynamic_cast<FlexiNoteLayer *>(p->getLayer(2)); + if (fnl) { + fnl->setVerticalRangeToNoteRange(p); + } + statusBar()->showMessage(m_myStatusMessage); }