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 #include <memory>
18 class AudacityProject;
19 class Meter;
20 
23 class AUDACITY_DLL_API ProjectAudioIO final
24  : public ClientData::Base
25 {
26 public:
27  static ProjectAudioIO &Get( AudacityProject &project );
28  static const ProjectAudioIO &Get( const AudacityProject &project );
29 
30  explicit ProjectAudioIO( AudacityProject &project );
31  ProjectAudioIO( const ProjectAudioIO & ) PROHIBITED;
32  ProjectAudioIO &operator=( const ProjectAudioIO & ) PROHIBITED;
33  ~ProjectAudioIO();
34 
35  int GetAudioIOToken() const;
36  bool IsAudioActive() const;
37  void SetAudioIOToken(int token);
38 
39  const std::shared_ptr<Meter> &GetPlaybackMeter() const;
40  void SetPlaybackMeter(
41  const std::shared_ptr<Meter> &playback);
42  const std::shared_ptr<Meter> &GetCaptureMeter() const;
43  void SetCaptureMeter(
44  const std::shared_ptr<Meter> &capture);
45 
46 private:
48 
49  // Project owned meters
50  std::shared_ptr<Meter> mPlaybackMeter;
51  std::shared_ptr<Meter> mCaptureMeter;
52 
53  int mAudioIOToken{ -1 };
54 };
55 
56 #endif
ProjectAudioIO::ProjectAudioIO
ProjectAudioIO(const ProjectAudioIO &) PROHIBITED
ProjectAudioIO::mProject
AudacityProject & mProject
Definition: ProjectAudioIO.h:47
Meter
AudioIO uses this to send sample buffers for real-time display updates.
Definition: Meter.h:16
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
ProjectAudioIO::mPlaybackMeter
std::shared_ptr< Meter > mPlaybackMeter
Definition: ProjectAudioIO.h:50
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:92
ProjectAudioIO
Definition: ProjectAudioIO.h:25
ProjectAudioIO::mCaptureMeter
std::shared_ptr< Meter > mCaptureMeter
Definition: ProjectAudioIO.h:51