forked from Sneeds-Feed-and-Seed/sneedacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProjectAudioIO.h
56 lines (40 loc) · 1.52 KB
/
ProjectAudioIO.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**********************************************************************
Sneedacity: A Digital Audio Editor
ProjectAudioIO.h
Paul Licameli split from SneedacityProject.h
**********************************************************************/
#ifndef __PROJECT_AUDIO_IO__
#define __PROJECT_AUDIO_IO__
#include "ClientData.h" // to inherit
#include <wx/weakref.h>
class SneedacityProject;
// Windows build needs complete type for parameter of wxWeakRef
// class MeterPanelBase;
#include "widgets/MeterPanelBase.h"
///\ brief Holds per-project state needed for interaction with AudioIO,
/// including the audio stream token and pointers to meters
class SNEEDACITY_DLL_API ProjectAudioIO final
: public ClientData::Base
{
public:
static ProjectAudioIO &Get( SneedacityProject &project );
static const ProjectAudioIO &Get( const SneedacityProject &project );
explicit ProjectAudioIO( SneedacityProject &project );
ProjectAudioIO( const ProjectAudioIO & ) PROHIBITED;
ProjectAudioIO &operator=( const ProjectAudioIO & ) PROHIBITED;
~ProjectAudioIO();
int GetAudioIOToken() const;
bool IsAudioActive() const;
void SetAudioIOToken(int token);
MeterPanelBase *GetPlaybackMeter();
void SetPlaybackMeter(MeterPanelBase *playback);
MeterPanelBase *GetCaptureMeter();
void SetCaptureMeter(MeterPanelBase *capture);
private:
SneedacityProject &mProject;
// Project owned meters
wxWeakRef<MeterPanelBase> mPlaybackMeter{};
wxWeakRef<MeterPanelBase> mCaptureMeter{};
int mAudioIOToken{ -1 };
};
#endif