mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Prepare to split AudioIOBase from AudioIO...
... New files, but (almost) empty; don't use the global variable gAudioIO, but use one of two accessor function names (which are the same function for now). AudioIOBase will have fewer dependencies than AudioIO -- in particular, no dependency on tracks. It won't include StartStream. It will contain functions to query the present state of streams, and device capabilities.
This commit is contained in:
@@ -10,7 +10,7 @@ Paul Licameli split from AudacityProject.cpp
|
||||
|
||||
#include "ProjectAudioIO.h"
|
||||
|
||||
#include "AudioIO.h"
|
||||
#include "AudioIOBase.h"
|
||||
#include "Project.h"
|
||||
|
||||
static const AudacityProject::AttachedObjects::RegisteredFactory sAudioIOKey{
|
||||
@@ -50,6 +50,7 @@ void ProjectAudioIO::SetAudioIOToken(int token)
|
||||
|
||||
bool ProjectAudioIO::IsAudioActive() const
|
||||
{
|
||||
auto gAudioIO = AudioIOBase::Get();
|
||||
return GetAudioIOToken() > 0 &&
|
||||
gAudioIO->IsStreamActive(GetAudioIOToken());
|
||||
}
|
||||
@@ -63,6 +64,7 @@ void ProjectAudioIO::SetPlaybackMeter(MeterPanel *playback)
|
||||
{
|
||||
auto &project = mProject;
|
||||
mPlaybackMeter = playback;
|
||||
auto gAudioIO = AudioIOBase::Get();
|
||||
if (gAudioIO)
|
||||
{
|
||||
gAudioIO->SetPlaybackMeter( &project , mPlaybackMeter );
|
||||
@@ -79,6 +81,7 @@ void ProjectAudioIO::SetCaptureMeter(MeterPanel *capture)
|
||||
auto &project = mProject;
|
||||
mCaptureMeter = capture;
|
||||
|
||||
auto gAudioIO = AudioIOBase::Get();
|
||||
if (gAudioIO)
|
||||
{
|
||||
gAudioIO->SetCaptureMeter( &project, mCaptureMeter );
|
||||
|
||||
Reference in New Issue
Block a user