Audacity  3.0.3
ProjectAudioIO.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 ProjectAudioIO.h
6 
7 Paul Licameli split from AudacityProject.h
8 
9 **********************************************************************/
10 
11 #ifndef __PROJECT_AUDIO_IO__
12 #define __PROJECT_AUDIO_IO__
13 
14 #include "ClientData.h" // to inherit
15 #include <wx/weakref.h>
16 
17 class AudacityProject;
18 
19 // Windows build needs complete type for parameter of wxWeakRef
20 // class MeterPanelBase;
21 #include "widgets/MeterPanelBase.h"
22 
25 class AUDACITY_DLL_API ProjectAudioIO final
26  : public ClientData::Base
27 {
28 public:
29  static ProjectAudioIO &Get( AudacityProject &project );
30  static const ProjectAudioIO &Get( const AudacityProject &project );
31 
32  explicit ProjectAudioIO( AudacityProject &project );
33  ProjectAudioIO( const ProjectAudioIO & ) PROHIBITED;
34  ProjectAudioIO &operator=( const ProjectAudioIO & ) PROHIBITED;
35  ~ProjectAudioIO();
36 
37  int GetAudioIOToken() const;
38  bool IsAudioActive() const;
39  void SetAudioIOToken(int token);
40 
41  MeterPanelBase *GetPlaybackMeter();
42  void SetPlaybackMeter(MeterPanelBase *playback);
43  MeterPanelBase *GetCaptureMeter();
44  void SetCaptureMeter(MeterPanelBase *capture);
45 
46 private:
48 
49  // Project owned meters
50  wxWeakRef<MeterPanelBase> mPlaybackMeter{};
51  wxWeakRef<MeterPanelBase> mCaptureMeter{};
52 
53  int mAudioIOToken{ -1 };
54 };
55 
56 #endif
ProjectAudioIO::ProjectAudioIO
ProjectAudioIO(const ProjectAudioIO &) PROHIBITED
ProjectAudioIO::mProject
AudacityProject & mProject
Definition: ProjectAudioIO.h:47
MeterPanelBase
Definition: MeterPanelBase.h:18
ClientData::Base
A convenient default parameter for class template Site.
Definition: ClientData.h:28
ClientData.h
Utility ClientData::Site to register hooks into a host class that attach client data.
ProjectAudioIO::operator=
ProjectAudioIO & operator=(const ProjectAudioIO &) PROHIBITED
BasicUI::Get
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:113
MeterPanelBase.h
ProjectAudioIO
Definition: ProjectAudioIO.h:27