mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 17:09:26 +02:00
Start and stop record or playback scrolling in idle time
This commit is contained in:
parent
2a87ea77cf
commit
34e9cb6171
@ -384,11 +384,6 @@ void DoTogglePinnedHead( AudacityProject &project )
|
|||||||
TracksPrefs::SetPinnedHeadPreference(value, true);
|
TracksPrefs::SetPinnedHeadPreference(value, true);
|
||||||
MenuManager::ModifyAllProjectToolbarMenus();
|
MenuManager::ModifyAllProjectToolbarMenus();
|
||||||
|
|
||||||
// Change what happens in case transport is in progress right now
|
|
||||||
auto ctb = ControlToolBar::Find( *GetActiveProject() );
|
|
||||||
if (ctb)
|
|
||||||
ctb->StartScrollingIfPreferred();
|
|
||||||
|
|
||||||
auto &ruler = AdornedRulerPanel::Get( project );
|
auto &ruler = AdornedRulerPanel::Get( project );
|
||||||
// Update button image
|
// Update button image
|
||||||
ruler.UpdateButtonStates();
|
ruler.UpdateButtonStates();
|
||||||
|
@ -691,8 +691,6 @@ int ControlToolBar::PlayPlayRegion(const SelectedRegion &selectedRegion,
|
|||||||
if (!success)
|
if (!success)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
StartScrollingIfPreferred();
|
|
||||||
|
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -794,8 +792,6 @@ void ControlToolBar::PlayDefault()
|
|||||||
|
|
||||||
void ControlToolBar::StopPlaying(bool stopStream /* = true*/)
|
void ControlToolBar::StopPlaying(bool stopStream /* = true*/)
|
||||||
{
|
{
|
||||||
StopScrolling();
|
|
||||||
|
|
||||||
AudacityProject *project = &mProject;
|
AudacityProject *project = &mProject;
|
||||||
auto &projectAudioManager = ProjectAudioManager::Get( mProject );
|
auto &projectAudioManager = ProjectAudioManager::Get( mProject );
|
||||||
|
|
||||||
@ -1210,8 +1206,6 @@ bool ControlToolBar::DoRecord(AudacityProject &project,
|
|||||||
if (success) {
|
if (success) {
|
||||||
ProjectAudioIO::Get( *p ).SetAudioIOToken(token);
|
ProjectAudioIO::Get( *p ).SetAudioIOToken(token);
|
||||||
mBusyProject = p;
|
mBusyProject = p;
|
||||||
|
|
||||||
StartScrollingIfPreferred();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CancelRecording();
|
CancelRecording();
|
||||||
@ -1275,7 +1269,8 @@ void ControlToolBar::OnIdle(wxIdleEvent & event)
|
|||||||
else
|
else
|
||||||
mPause->PopUp();
|
mPause->PopUp();
|
||||||
|
|
||||||
if (!projectAudioManager.Recording()) {
|
bool recording = projectAudioManager.Recording();
|
||||||
|
if (!recording) {
|
||||||
mRecord->PopUp();
|
mRecord->PopUp();
|
||||||
mRecord->SetAlternateIdx( wxGetKeyState(WXK_SHIFT) ? 1 : 0 );
|
mRecord->SetAlternateIdx( wxGetKeyState(WXK_SHIFT) ? 1 : 0 );
|
||||||
}
|
}
|
||||||
@ -1284,8 +1279,8 @@ void ControlToolBar::OnIdle(wxIdleEvent & event)
|
|||||||
mRecord->SetAlternateIdx( projectAudioManager.Appending() ? 0 : 1 );
|
mRecord->SetAlternateIdx( projectAudioManager.Appending() ? 0 : 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !(projectAudioManager.Playing() || Scrubber::Get(mProject).HasMark())
|
bool playing = projectAudioManager.Playing();
|
||||||
) {
|
if ( !(playing || Scrubber::Get(mProject).HasMark()) ) {
|
||||||
mPlay->PopUp();
|
mPlay->PopUp();
|
||||||
mPlay->SetAlternateIdx(
|
mPlay->SetAlternateIdx(
|
||||||
wxGetKeyState(WXK_CONTROL)
|
wxGetKeyState(WXK_CONTROL)
|
||||||
@ -1306,6 +1301,11 @@ void ControlToolBar::OnIdle(wxIdleEvent & event)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( recording || playing )
|
||||||
|
StartScrollingIfPreferred();
|
||||||
|
else
|
||||||
|
StopScrolling();
|
||||||
|
|
||||||
if ( projectAudioManager.Stopping() )
|
if ( projectAudioManager.Stopping() )
|
||||||
mStop->PushDown();
|
mStop->PushDown();
|
||||||
else
|
else
|
||||||
@ -1468,12 +1468,12 @@ void ControlToolBar::StartScrolling()
|
|||||||
using Mode = ProjectWindow::PlaybackScroller::Mode;
|
using Mode = ProjectWindow::PlaybackScroller::Mode;
|
||||||
const auto project = &mProject;
|
const auto project = &mProject;
|
||||||
if (project) {
|
if (project) {
|
||||||
auto gAudioIO = AudioIO::Get();
|
|
||||||
auto mode = Mode::Pinned;
|
auto mode = Mode::Pinned;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Enable these lines to pin the playhead right instead of center,
|
// Enable these lines to pin the playhead right instead of center,
|
||||||
// when recording but not overdubbing.
|
// when recording but not overdubbing.
|
||||||
|
auto gAudioIO = AudioIO::Get();
|
||||||
if (gAudioIO->GetNumCaptureChannels() > 0) {
|
if (gAudioIO->GetNumCaptureChannels() > 0) {
|
||||||
// recording
|
// recording
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user