mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-20 17:41:13 +02:00
New files for ProjectAudioManager...
... This eliminates some inclusions of ProjectManager, helping to free it from cycles into a higher level
This commit is contained in:
53
src/ProjectAudioManager.h
Normal file
53
src/ProjectAudioManager.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ProjectAudioManager.h
|
||||
|
||||
Paul Licameli split from ProjectManager.h
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_PROJECT_AUDIO_MANAGER__
|
||||
#define __AUDACITY_PROJECT_AUDIO_MANAGER__
|
||||
|
||||
#include "AudioIOListener.h" // to inherit
|
||||
#include "ClientData.h" // to inherit
|
||||
|
||||
class AudacityProject;
|
||||
struct AudioIOStartStreamOptions;
|
||||
|
||||
class ProjectAudioManager final
|
||||
: public ClientData::Base
|
||||
, public AudioIOListener
|
||||
{
|
||||
public:
|
||||
static ProjectAudioManager &Get( AudacityProject &project );
|
||||
static const ProjectAudioManager &Get( const AudacityProject &project );
|
||||
|
||||
explicit ProjectAudioManager( AudacityProject &project )
|
||||
: mProject{ project }
|
||||
{}
|
||||
~ProjectAudioManager() override;
|
||||
|
||||
bool IsTimerRecordCancelled() { return mTimerRecordCanceled; }
|
||||
void SetTimerRecordCancelled() { mTimerRecordCanceled = true; }
|
||||
void ResetTimerRecordCancelled() { mTimerRecordCanceled = false; }
|
||||
|
||||
private:
|
||||
// Audio IO callback methods
|
||||
void OnAudioIORate(int rate) override;
|
||||
void OnAudioIOStartRecording() override;
|
||||
void OnAudioIOStopRecording() override;
|
||||
void OnAudioIONewBlockFiles(const AutoSaveFile & blockFileLog) override;
|
||||
|
||||
AudacityProject &mProject;
|
||||
|
||||
//flag for cancellation of timer record.
|
||||
bool mTimerRecordCanceled{ false };
|
||||
};
|
||||
|
||||
AudioIOStartStreamOptions DefaultPlayOptions( AudacityProject &project );
|
||||
AudioIOStartStreamOptions DefaultSpeedPlayOptions( AudacityProject &project );
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user