mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
StopIfPaused is now a member function of ProjectAudioManager
This commit is contained in:
parent
2c840a75c5
commit
ca8740b510
@ -1009,19 +1009,19 @@ TransportTracks ProjectAudioManager::GetAllPlaybackTracks(
|
||||
return result;
|
||||
}
|
||||
|
||||
// Stop playing or recording, if paused.
|
||||
void ProjectAudioManager::StopIfPaused()
|
||||
{
|
||||
if( AudioIOBase::Get()->IsPaused() )
|
||||
Stop();
|
||||
}
|
||||
|
||||
#include "widgets/AudacityMessageBox.h"
|
||||
|
||||
namespace TransportActions {
|
||||
|
||||
// exported helper functions
|
||||
|
||||
// Stop playing or recording, if paused.
|
||||
void StopIfPaused( AudacityProject &project )
|
||||
{
|
||||
if( AudioIOBase::Get()->IsPaused() )
|
||||
ProjectAudioManager::Get( project ).Stop();
|
||||
}
|
||||
|
||||
bool DoPlayStopSelect
|
||||
(AudacityProject &project, bool click, bool shift)
|
||||
{
|
||||
@ -1106,6 +1106,6 @@ static RegisteredMenuItemEnabler stopIfPaused{{
|
||||
return MenuManager::Get( project ).mStopIfWasPaused; },
|
||||
[]( AudacityProject &project, CommandFlag ){
|
||||
if ( MenuManager::Get( project ).mStopIfWasPaused )
|
||||
TransportActions::StopIfPaused( project );
|
||||
ProjectAudioManager::Get( project ).StopIfPaused();
|
||||
}
|
||||
}};
|
||||
|
@ -108,6 +108,8 @@ public:
|
||||
// Stop playing or recording
|
||||
void Stop(bool stopStream = true);
|
||||
|
||||
void StopIfPaused();
|
||||
|
||||
PlayMode GetLastPlayMode() const { return mLastPlayMode; }
|
||||
|
||||
private:
|
||||
@ -163,7 +165,6 @@ extern const ReservedCommandFlag
|
||||
|
||||
/// Namespace for functions for Transport menu
|
||||
namespace TransportActions {
|
||||
void StopIfPaused( AudacityProject &project );
|
||||
bool DoPlayStopSelect( AudacityProject &project, bool click, bool shift );
|
||||
void DoPlayStopSelect( AudacityProject &project );
|
||||
}
|
||||
|
@ -667,7 +667,7 @@ void ControlToolBar::OnRewind(wxCommandEvent & WXUNUSED(evt))
|
||||
|
||||
AudacityProject *p = &mProject;
|
||||
{
|
||||
TransportActions::StopIfPaused( *p );
|
||||
ProjectAudioManager::Get( *p ).StopIfPaused();
|
||||
ProjectWindow::Get( *p ).Rewind(mRewind->WasShiftDown());
|
||||
}
|
||||
}
|
||||
@ -680,7 +680,7 @@ void ControlToolBar::OnFF(wxCommandEvent & WXUNUSED(evt))
|
||||
AudacityProject *p = &mProject;
|
||||
|
||||
{
|
||||
TransportActions::StopIfPaused( *p );
|
||||
ProjectAudioManager::Get( *p ).StopIfPaused();
|
||||
ProjectWindow::Get( *p ).SkipEnd(mFF->WasShiftDown());
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ UIHandle::Result CloseButtonHandle::CommitChanges
|
||||
if (pTrack)
|
||||
{
|
||||
auto toRemove = pTrack->SubstitutePendingChangedTrack();
|
||||
TransportActions::StopIfPaused( *pProject );
|
||||
ProjectAudioManager::Get( *pProject ).StopIfPaused();
|
||||
if (!ProjectAudioIO::Get( *pProject ).IsAudioActive()) {
|
||||
// This pushes an undo item:
|
||||
TrackUtilities::DoRemoveTrack(*pProject, toRemove.get());
|
||||
|
Loading…
x
Reference in New Issue
Block a user