Mercurial > hg > svapp
changeset 357:337cdb5e5b06 tonioni
Rework menu entries & shortcuts: left/right now move the playhead a fixed amount, ctrl+left/right still move it note-by-note, and now alt+left/right scroll without moving playhead
author | Chris Cannam |
---|---|
date | Thu, 12 Jun 2014 14:24:48 +0100 |
parents | 42a5801da931 |
children | 2da91cceed64 |
files | framework/MainWindowBase.cpp framework/MainWindowBase.h |
diffstat | 2 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp Tue Jun 03 11:14:56 2014 +0100 +++ b/framework/MainWindowBase.cpp Thu Jun 12 14:24:48 2014 +0100 @@ -152,7 +152,9 @@ m_openingAudioFile(false), m_abandoning(false), m_labeller(0), - m_lastPlayStatusSec(0) + m_lastPlayStatusSec(0), + m_initialDarkBackground(false), + m_defaultFfwdRwdStep(2, 0) { Profiler profiler("MainWindowBase::MainWindowBase"); @@ -2549,7 +2551,7 @@ if (!layer) { frame = RealTime::realTime2Frame - (RealTime::frame2RealTime(frame, sr) + RealTime(2, 0), sr); + (RealTime::frame2RealTime(frame, sr) + m_defaultFfwdRwdStep, sr); if (frame > int(getMainModel()->getEndFrame())) { frame = getMainModel()->getEndFrame(); } @@ -2657,7 +2659,7 @@ // the prior point instead of the immediately neighbouring one if (m_playSource && m_playSource->isPlaying()) { RealTime ct = RealTime::frame2RealTime(frame, sr); - ct = ct - RealTime::fromSeconds(0.25); + ct = ct - RealTime::fromSeconds(0.15); if (ct < RealTime::zeroTime) ct = RealTime::zeroTime; frame = RealTime::realTime2Frame(ct, sr); } @@ -2665,7 +2667,7 @@ if (!layer) { frame = RealTime::realTime2Frame - (RealTime::frame2RealTime(frame, sr) - RealTime(2, 0), sr); + (RealTime::frame2RealTime(frame, sr) - m_defaultFfwdRwdStep, sr); if (frame < int(getMainModel()->getStartFrame())) { frame = getMainModel()->getStartFrame(); }
--- a/framework/MainWindowBase.h Tue Jun 03 11:14:56 2014 +0100 +++ b/framework/MainWindowBase.h Thu Jun 12 14:24:48 2014 +0100 @@ -112,6 +112,10 @@ /// Implementation of FrameTimer interface method virtual unsigned long getFrame() const; + void setDefaultFfwdRwdStep(RealTime step) { + m_defaultFfwdRwdStep = step; + } + signals: // Used to toggle the availability of menu actions void canAddPane(bool); @@ -331,6 +335,8 @@ bool m_initialDarkBackground; + RealTime m_defaultFfwdRwdStep; + WaveFileModel *getMainModel(); const WaveFileModel *getMainModel() const; void createDocument();