Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 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 | 4969e7921931 |
children | 2da91cceed64 |
comparison
equal
deleted
inserted
replaced
356:42a5801da931 | 357:337cdb5e5b06 |
---|---|
150 m_recentTransforms("RecentTransforms", 20), | 150 m_recentTransforms("RecentTransforms", 20), |
151 m_documentModified(false), | 151 m_documentModified(false), |
152 m_openingAudioFile(false), | 152 m_openingAudioFile(false), |
153 m_abandoning(false), | 153 m_abandoning(false), |
154 m_labeller(0), | 154 m_labeller(0), |
155 m_lastPlayStatusSec(0) | 155 m_lastPlayStatusSec(0), |
156 m_initialDarkBackground(false), | |
157 m_defaultFfwdRwdStep(2, 0) | |
156 { | 158 { |
157 Profiler profiler("MainWindowBase::MainWindowBase"); | 159 Profiler profiler("MainWindowBase::MainWindowBase"); |
158 | 160 |
159 #ifdef Q_WS_X11 | 161 #ifdef Q_WS_X11 |
160 XSetErrorHandler(handle_x11_error); | 162 XSetErrorHandler(handle_x11_error); |
2547 size_t sr = getMainModel()->getSampleRate(); | 2549 size_t sr = getMainModel()->getSampleRate(); |
2548 | 2550 |
2549 if (!layer) { | 2551 if (!layer) { |
2550 | 2552 |
2551 frame = RealTime::realTime2Frame | 2553 frame = RealTime::realTime2Frame |
2552 (RealTime::frame2RealTime(frame, sr) + RealTime(2, 0), sr); | 2554 (RealTime::frame2RealTime(frame, sr) + m_defaultFfwdRwdStep, sr); |
2553 if (frame > int(getMainModel()->getEndFrame())) { | 2555 if (frame > int(getMainModel()->getEndFrame())) { |
2554 frame = getMainModel()->getEndFrame(); | 2556 frame = getMainModel()->getEndFrame(); |
2555 } | 2557 } |
2556 | 2558 |
2557 } else { | 2559 } else { |
2655 // when rewinding during playback, we want to allow a period | 2657 // when rewinding during playback, we want to allow a period |
2656 // following a rewind target point at which the rewind will go to | 2658 // following a rewind target point at which the rewind will go to |
2657 // the prior point instead of the immediately neighbouring one | 2659 // the prior point instead of the immediately neighbouring one |
2658 if (m_playSource && m_playSource->isPlaying()) { | 2660 if (m_playSource && m_playSource->isPlaying()) { |
2659 RealTime ct = RealTime::frame2RealTime(frame, sr); | 2661 RealTime ct = RealTime::frame2RealTime(frame, sr); |
2660 ct = ct - RealTime::fromSeconds(0.25); | 2662 ct = ct - RealTime::fromSeconds(0.15); |
2661 if (ct < RealTime::zeroTime) ct = RealTime::zeroTime; | 2663 if (ct < RealTime::zeroTime) ct = RealTime::zeroTime; |
2662 frame = RealTime::realTime2Frame(ct, sr); | 2664 frame = RealTime::realTime2Frame(ct, sr); |
2663 } | 2665 } |
2664 | 2666 |
2665 if (!layer) { | 2667 if (!layer) { |
2666 | 2668 |
2667 frame = RealTime::realTime2Frame | 2669 frame = RealTime::realTime2Frame |
2668 (RealTime::frame2RealTime(frame, sr) - RealTime(2, 0), sr); | 2670 (RealTime::frame2RealTime(frame, sr) - m_defaultFfwdRwdStep, sr); |
2669 if (frame < int(getMainModel()->getStartFrame())) { | 2671 if (frame < int(getMainModel()->getStartFrame())) { |
2670 frame = getMainModel()->getStartFrame(); | 2672 frame = getMainModel()->getStartFrame(); |
2671 } | 2673 } |
2672 | 2674 |
2673 } else { | 2675 } else { |