mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 08:09:32 +02:00
New files for ProjectAudioIO
This commit is contained in:
parent
1f4202c878
commit
e5cf2165d1
@ -158,6 +158,8 @@ src/Profiler.cpp
|
||||
src/Profiler.h
|
||||
src/Project.cpp
|
||||
src/Project.h
|
||||
src/ProjectAudioIO.cpp
|
||||
src/ProjectAudioIO.h
|
||||
src/ProjectFileIORegistry.cpp
|
||||
src/ProjectFileIORegistry.h
|
||||
src/ProjectFSCK.cpp
|
||||
|
@ -1212,6 +1212,7 @@
|
||||
5E0A1CDD20E95FF7001AAF8D /* CellularPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E0A1CDB20E95FF7001AAF8D /* CellularPanel.cpp */; };
|
||||
5E10D9061EC8F81300B3AC57 /* PlayableTrackButtonHandles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E10D9041EC8F81300B3AC57 /* PlayableTrackButtonHandles.cpp */; };
|
||||
5E135A36229EDBE80076E983 /* ProjectSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E135A34229EDBE80076E983 /* ProjectSettings.cpp */; };
|
||||
5E135A39229EDEBA0076E983 /* ProjectAudioIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E135A37229EDEBA0076E983 /* ProjectAudioIO.cpp */; };
|
||||
5E15123D1DB000C000702E29 /* UIHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E15123B1DB000C000702E29 /* UIHandle.cpp */; };
|
||||
5E15125A1DB000DC00702E29 /* LabelTrackControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E1512401DB000DC00702E29 /* LabelTrackControls.cpp */; };
|
||||
5E15125B1DB000DC00702E29 /* LabelTrackUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E1512421DB000DC00702E29 /* LabelTrackUI.cpp */; };
|
||||
@ -3178,6 +3179,8 @@
|
||||
5E10D9051EC8F81300B3AC57 /* PlayableTrackButtonHandles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayableTrackButtonHandles.h; sourceTree = "<group>"; };
|
||||
5E135A34229EDBE80076E983 /* ProjectSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProjectSettings.cpp; sourceTree = "<group>"; };
|
||||
5E135A35229EDBE80076E983 /* ProjectSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectSettings.h; sourceTree = "<group>"; };
|
||||
5E135A37229EDEBA0076E983 /* ProjectAudioIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProjectAudioIO.cpp; sourceTree = "<group>"; };
|
||||
5E135A38229EDEBA0076E983 /* ProjectAudioIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectAudioIO.h; sourceTree = "<group>"; };
|
||||
5E1512381DB000C000702E29 /* HitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitTestResult.h; sourceTree = "<group>"; };
|
||||
5E1512391DB000C000702E29 /* RefreshCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefreshCode.h; sourceTree = "<group>"; };
|
||||
5E15123A1DB000C000702E29 /* TrackPanelMouseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPanelMouseEvent.h; sourceTree = "<group>"; };
|
||||
@ -4361,6 +4364,7 @@
|
||||
1790B0CE09883BFD008A330A /* Printing.cpp */,
|
||||
186CCEA30E523C8E00659159 /* Profiler.cpp */,
|
||||
1790B0D009883BFD008A330A /* Project.cpp */,
|
||||
5E135A37229EDEBA0076E983 /* ProjectAudioIO.cpp */,
|
||||
5E18CFEE2291C31000E75250 /* ProjectFileIORegistry.cpp */,
|
||||
5ECF728C228B307E007F2A35 /* ProjectFSCK.cpp */,
|
||||
5E135A34229EDBE80076E983 /* ProjectSettings.cpp */,
|
||||
@ -4477,6 +4481,7 @@
|
||||
1790B0CF09883BFD008A330A /* Printing.h */,
|
||||
186CCEA20E523C8D00659159 /* Profiler.h */,
|
||||
1790B0D109883BFD008A330A /* Project.h */,
|
||||
5E135A38229EDEBA0076E983 /* ProjectAudioIO.h */,
|
||||
5E18CFEF2291C31000E75250 /* ProjectFileIORegistry.h */,
|
||||
5ECF728B228B307E007F2A35 /* ProjectFSCK.h */,
|
||||
5E135A35229EDBE80076E983 /* ProjectSettings.h */,
|
||||
@ -8358,6 +8363,7 @@
|
||||
1790B17D09883BFD008A330A /* PitchName.cpp in Sources */,
|
||||
1790B17E09883BFD008A330A /* PlatformCompatibility.cpp in Sources */,
|
||||
1790B18009883BFD008A330A /* BatchPrefs.cpp in Sources */,
|
||||
5E135A39229EDEBA0076E983 /* ProjectAudioIO.cpp in Sources */,
|
||||
1790B18109883BFD008A330A /* DirectoriesPrefs.cpp in Sources */,
|
||||
1790B18309883BFD008A330A /* GUIPrefs.cpp in Sources */,
|
||||
1790B18409883BFD008A330A /* KeyConfigPrefs.cpp in Sources */,
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "Menus.h"
|
||||
#include "Prefs.h"
|
||||
#include "Project.h"
|
||||
#include "ProjectAudioIO.h"
|
||||
#include "RefreshCode.h"
|
||||
#include "Snap.h"
|
||||
#include "TrackPanel.h"
|
||||
|
@ -83,6 +83,7 @@ It handles initialization and termination by subclassing wxApp.
|
||||
#include "MissingAliasFileDialog.h"
|
||||
#include "PluginManager.h"
|
||||
#include "Project.h"
|
||||
#include "ProjectAudioIO.h"
|
||||
#include "ProjectSettings.h"
|
||||
#include "Screenshot.h"
|
||||
#include "Sequence.h"
|
||||
|
@ -455,6 +455,7 @@ TimeTrack and AudioIOListener and whether the playback is looped.
|
||||
#include "prefs/GUISettings.h"
|
||||
#include "Prefs.h"
|
||||
#include "Project.h"
|
||||
#include "ProjectAudioIO.h"
|
||||
#include "TimeTrack.h"
|
||||
#include "WaveTrack.h"
|
||||
#include "AutoRecovery.h"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "AudioIO.h"
|
||||
#include "Prefs.h" // for RTL_WORKAROUND
|
||||
#include "Project.h"
|
||||
#include "ProjectAudioIO.h"
|
||||
#include "TrackPanel.h" // for EVT_TRACK_PANEL_TIMER
|
||||
#include "ViewInfo.h"
|
||||
|
||||
|
@ -209,6 +209,8 @@ audacity_SOURCES = \
|
||||
Profiler.h \
|
||||
Project.cpp \
|
||||
Project.h \
|
||||
ProjectAudioIO.cpp \
|
||||
ProjectAudioIO.h \
|
||||
ProjectFileIORegistry.cpp \
|
||||
ProjectFileIORegistry.h \
|
||||
ProjectFSCK.cpp \
|
||||
|
@ -320,15 +320,16 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
|
||||
PlatformCompatibility.cpp PlatformCompatibility.h \
|
||||
PluginManager.cpp PluginManager.h Printing.cpp Printing.h \
|
||||
Profiler.cpp Profiler.h Project.cpp Project.h \
|
||||
ProjectFileIORegistry.cpp ProjectFileIORegistry.h \
|
||||
ProjectFSCK.cpp ProjectFSCK.h ProjectSettings.cpp \
|
||||
ProjectSettings.h RealFFTf.cpp RealFFTf.h RealFFTf48x.cpp \
|
||||
RealFFTf48x.h RefreshCode.h Resample.cpp Resample.h \
|
||||
RevisionIdent.h RingBuffer.cpp RingBuffer.h Screenshot.cpp \
|
||||
Screenshot.h SelectedRegion.cpp SelectedRegion.h \
|
||||
SelectionState.cpp SelectionState.h Shuttle.cpp Shuttle.h \
|
||||
ShuttleGetDefinition.cpp ShuttleGetDefinition.h ShuttleGui.cpp \
|
||||
ShuttleGui.h ShuttlePrefs.cpp ShuttlePrefs.h Snap.cpp Snap.h \
|
||||
ProjectAudioIO.cpp ProjectAudioIO.h ProjectFileIORegistry.cpp \
|
||||
ProjectFileIORegistry.h ProjectFSCK.cpp ProjectFSCK.h \
|
||||
ProjectSettings.cpp ProjectSettings.h RealFFTf.cpp RealFFTf.h \
|
||||
RealFFTf48x.cpp RealFFTf48x.h RefreshCode.h Resample.cpp \
|
||||
Resample.h RevisionIdent.h RingBuffer.cpp RingBuffer.h \
|
||||
Screenshot.cpp Screenshot.h SelectedRegion.cpp \
|
||||
SelectedRegion.h SelectionState.cpp SelectionState.h \
|
||||
Shuttle.cpp Shuttle.h ShuttleGetDefinition.cpp \
|
||||
ShuttleGetDefinition.h ShuttleGui.cpp ShuttleGui.h \
|
||||
ShuttlePrefs.cpp ShuttlePrefs.h Snap.cpp Snap.h \
|
||||
SoundActivatedRecord.cpp SoundActivatedRecord.h Spectrum.cpp \
|
||||
Spectrum.h SplashDialog.cpp SplashDialog.h SseMathFuncs.cpp \
|
||||
SseMathFuncs.h Tags.cpp Tags.h Theme.cpp Theme.h \
|
||||
@ -664,6 +665,7 @@ am_audacity_OBJECTS = $(am__objects_1) audacity-AboutDialog.$(OBJEXT) \
|
||||
audacity-PlatformCompatibility.$(OBJEXT) \
|
||||
audacity-PluginManager.$(OBJEXT) audacity-Printing.$(OBJEXT) \
|
||||
audacity-Profiler.$(OBJEXT) audacity-Project.$(OBJEXT) \
|
||||
audacity-ProjectAudioIO.$(OBJEXT) \
|
||||
audacity-ProjectFileIORegistry.$(OBJEXT) \
|
||||
audacity-ProjectFSCK.$(OBJEXT) \
|
||||
audacity-ProjectSettings.$(OBJEXT) audacity-RealFFTf.$(OBJEXT) \
|
||||
@ -1383,15 +1385,16 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
|
||||
PlatformCompatibility.cpp PlatformCompatibility.h \
|
||||
PluginManager.cpp PluginManager.h Printing.cpp Printing.h \
|
||||
Profiler.cpp Profiler.h Project.cpp Project.h \
|
||||
ProjectFileIORegistry.cpp ProjectFileIORegistry.h \
|
||||
ProjectFSCK.cpp ProjectFSCK.h ProjectSettings.cpp \
|
||||
ProjectSettings.h RealFFTf.cpp RealFFTf.h RealFFTf48x.cpp \
|
||||
RealFFTf48x.h RefreshCode.h Resample.cpp Resample.h \
|
||||
RevisionIdent.h RingBuffer.cpp RingBuffer.h Screenshot.cpp \
|
||||
Screenshot.h SelectedRegion.cpp SelectedRegion.h \
|
||||
SelectionState.cpp SelectionState.h Shuttle.cpp Shuttle.h \
|
||||
ShuttleGetDefinition.cpp ShuttleGetDefinition.h ShuttleGui.cpp \
|
||||
ShuttleGui.h ShuttlePrefs.cpp ShuttlePrefs.h Snap.cpp Snap.h \
|
||||
ProjectAudioIO.cpp ProjectAudioIO.h ProjectFileIORegistry.cpp \
|
||||
ProjectFileIORegistry.h ProjectFSCK.cpp ProjectFSCK.h \
|
||||
ProjectSettings.cpp ProjectSettings.h RealFFTf.cpp RealFFTf.h \
|
||||
RealFFTf48x.cpp RealFFTf48x.h RefreshCode.h Resample.cpp \
|
||||
Resample.h RevisionIdent.h RingBuffer.cpp RingBuffer.h \
|
||||
Screenshot.cpp Screenshot.h SelectedRegion.cpp \
|
||||
SelectedRegion.h SelectionState.cpp SelectionState.h \
|
||||
Shuttle.cpp Shuttle.h ShuttleGetDefinition.cpp \
|
||||
ShuttleGetDefinition.h ShuttleGui.cpp ShuttleGui.h \
|
||||
ShuttlePrefs.cpp ShuttlePrefs.h Snap.cpp Snap.h \
|
||||
SoundActivatedRecord.cpp SoundActivatedRecord.h Spectrum.cpp \
|
||||
Spectrum.h SplashDialog.cpp SplashDialog.h SseMathFuncs.cpp \
|
||||
SseMathFuncs.h Tags.cpp Tags.h Theme.cpp Theme.h \
|
||||
@ -2558,6 +2561,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Printing.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Profiler.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Project.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-ProjectAudioIO.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-ProjectFSCK.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-ProjectFileIORegistry.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-ProjectSettings.Po@am__quote@
|
||||
@ -3962,6 +3966,20 @@ audacity-Project.obj: Project.cpp
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-Project.obj `if test -f 'Project.cpp'; then $(CYGPATH_W) 'Project.cpp'; else $(CYGPATH_W) '$(srcdir)/Project.cpp'; fi`
|
||||
|
||||
audacity-ProjectAudioIO.o: ProjectAudioIO.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-ProjectAudioIO.o -MD -MP -MF $(DEPDIR)/audacity-ProjectAudioIO.Tpo -c -o audacity-ProjectAudioIO.o `test -f 'ProjectAudioIO.cpp' || echo '$(srcdir)/'`ProjectAudioIO.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-ProjectAudioIO.Tpo $(DEPDIR)/audacity-ProjectAudioIO.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ProjectAudioIO.cpp' object='audacity-ProjectAudioIO.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-ProjectAudioIO.o `test -f 'ProjectAudioIO.cpp' || echo '$(srcdir)/'`ProjectAudioIO.cpp
|
||||
|
||||
audacity-ProjectAudioIO.obj: ProjectAudioIO.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-ProjectAudioIO.obj -MD -MP -MF $(DEPDIR)/audacity-ProjectAudioIO.Tpo -c -o audacity-ProjectAudioIO.obj `if test -f 'ProjectAudioIO.cpp'; then $(CYGPATH_W) 'ProjectAudioIO.cpp'; else $(CYGPATH_W) '$(srcdir)/ProjectAudioIO.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-ProjectAudioIO.Tpo $(DEPDIR)/audacity-ProjectAudioIO.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ProjectAudioIO.cpp' object='audacity-ProjectAudioIO.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-ProjectAudioIO.obj `if test -f 'ProjectAudioIO.cpp'; then $(CYGPATH_W) 'ProjectAudioIO.cpp'; else $(CYGPATH_W) '$(srcdir)/ProjectAudioIO.cpp'; fi`
|
||||
|
||||
audacity-ProjectFileIORegistry.o: ProjectFileIORegistry.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-ProjectFileIORegistry.o -MD -MP -MF $(DEPDIR)/audacity-ProjectFileIORegistry.Tpo -c -o audacity-ProjectFileIORegistry.o `test -f 'ProjectFileIORegistry.cpp' || echo '$(srcdir)/'`ProjectFileIORegistry.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-ProjectFileIORegistry.Tpo $(DEPDIR)/audacity-ProjectFileIORegistry.Po
|
||||
|
@ -40,6 +40,7 @@
|
||||
#endif // USE_MIDI
|
||||
#include "Prefs.h"
|
||||
#include "Project.h"
|
||||
#include "ProjectAudioIO.h"
|
||||
#include "ProjectSettings.h"
|
||||
#include "TrackPanel.h"
|
||||
#include "UndoManager.h"
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "KeyboardCapture.h"
|
||||
#include "Prefs.h" // for RTL_WORKAROUND
|
||||
#include "Project.h"
|
||||
#include "ProjectAudioIO.h"
|
||||
#include "ProjectSettings.h"
|
||||
#include "TrackPanel.h" // for EVT_TRACK_PANEL_TIMER
|
||||
#include "UndoManager.h"
|
||||
|
@ -51,6 +51,7 @@ scroll information. It also has some status flags.
|
||||
#include "Audacity.h" // for USE_* macros
|
||||
#include "Project.h"
|
||||
|
||||
#include "ProjectAudioIO.h"
|
||||
#include "ProjectFileIORegistry.h"
|
||||
#include "ProjectSettings.h"
|
||||
|
||||
@ -1418,22 +1419,6 @@ void AudacityProject::OnThemeChange(wxCommandEvent& evt)
|
||||
AdornedRulerPanel::Get( project ).ReCreateButtons();
|
||||
}
|
||||
|
||||
int ProjectAudioIO::GetAudioIOToken() const
|
||||
{
|
||||
return mAudioIOToken;
|
||||
}
|
||||
|
||||
void ProjectAudioIO::SetAudioIOToken(int token)
|
||||
{
|
||||
mAudioIOToken = token;
|
||||
}
|
||||
|
||||
bool ProjectAudioIO::IsAudioActive() const
|
||||
{
|
||||
return GetAudioIOToken() > 0 &&
|
||||
gAudioIO->IsStreamActive(GetAudioIOToken());
|
||||
}
|
||||
|
||||
wxString AudacityProject::GetProjectName() const
|
||||
{
|
||||
wxString name = wxFileNameFromPath(mFileName);
|
||||
@ -4769,37 +4754,6 @@ void AudacityProject::SkipEnd(bool shift)
|
||||
}
|
||||
|
||||
|
||||
MeterPanel *ProjectAudioIO::GetPlaybackMeter()
|
||||
{
|
||||
return mPlaybackMeter;
|
||||
}
|
||||
|
||||
void ProjectAudioIO::SetPlaybackMeter(MeterPanel *playback)
|
||||
{
|
||||
auto &project = mProject;
|
||||
mPlaybackMeter = playback;
|
||||
if (gAudioIO)
|
||||
{
|
||||
gAudioIO->SetPlaybackMeter( &project , mPlaybackMeter );
|
||||
}
|
||||
}
|
||||
|
||||
MeterPanel *ProjectAudioIO::GetCaptureMeter()
|
||||
{
|
||||
return mCaptureMeter;
|
||||
}
|
||||
|
||||
void ProjectAudioIO::SetCaptureMeter(MeterPanel *capture)
|
||||
{
|
||||
auto &project = mProject;
|
||||
mCaptureMeter = capture;
|
||||
|
||||
if (gAudioIO)
|
||||
{
|
||||
gAudioIO->SetCaptureMeter( &project, mCaptureMeter );
|
||||
}
|
||||
}
|
||||
|
||||
void AudacityProject::RestartTimer()
|
||||
{
|
||||
if (mTimer) {
|
||||
@ -5456,28 +5410,3 @@ void AudacityProject::CloseLock()
|
||||
mLastSavedTracks.reset();
|
||||
}
|
||||
}
|
||||
|
||||
static const AudacityProject::AttachedObjects::RegisteredFactory sAudioIOKey{
|
||||
[]( AudacityProject &parent ){
|
||||
return std::make_shared< ProjectAudioIO >( parent );
|
||||
}
|
||||
};
|
||||
|
||||
ProjectAudioIO &ProjectAudioIO::Get( AudacityProject &project )
|
||||
{
|
||||
return project.AttachedObjects::Get< ProjectAudioIO >( sAudioIOKey );
|
||||
}
|
||||
|
||||
const ProjectAudioIO &ProjectAudioIO::Get( const AudacityProject &project )
|
||||
{
|
||||
return Get( const_cast<AudacityProject &>(project) );
|
||||
}
|
||||
|
||||
ProjectAudioIO::ProjectAudioIO( AudacityProject &project )
|
||||
: mProject{ project }
|
||||
{
|
||||
}
|
||||
|
||||
ProjectAudioIO::~ProjectAudioIO()
|
||||
{
|
||||
}
|
||||
|
@ -55,8 +55,6 @@ class RecordingRecoveryHandler;
|
||||
namespace ProjectFileIORegistry{ struct Entry; }
|
||||
class TrackList;
|
||||
|
||||
class MeterPanel;
|
||||
|
||||
struct AudioIOStartStreamOptions;
|
||||
struct UndoState;
|
||||
|
||||
@ -585,35 +583,6 @@ inline const wxFrame *FindProjectFrame( const AudacityProject *project ) {
|
||||
return project ? &GetProjectFrame( *project ) : nullptr;
|
||||
}
|
||||
|
||||
class ProjectAudioIO final
|
||||
: public ClientData::Base
|
||||
{
|
||||
public:
|
||||
static ProjectAudioIO &Get( AudacityProject &project );
|
||||
static const ProjectAudioIO &Get( const AudacityProject &project );
|
||||
|
||||
explicit ProjectAudioIO( AudacityProject &project );
|
||||
~ProjectAudioIO();
|
||||
|
||||
int GetAudioIOToken() const;
|
||||
bool IsAudioActive() const;
|
||||
void SetAudioIOToken(int token);
|
||||
|
||||
MeterPanel *GetPlaybackMeter();
|
||||
void SetPlaybackMeter(MeterPanel *playback);
|
||||
MeterPanel *GetCaptureMeter();
|
||||
void SetCaptureMeter(MeterPanel *capture);
|
||||
|
||||
private:
|
||||
AudacityProject &mProject;
|
||||
|
||||
// Project owned meters
|
||||
MeterPanel *mPlaybackMeter{};
|
||||
MeterPanel *mCaptureMeter{};
|
||||
|
||||
int mAudioIOToken{ -1 };
|
||||
};
|
||||
|
||||
AudioIOStartStreamOptions DefaultPlayOptions( AudacityProject &project );
|
||||
AudioIOStartStreamOptions DefaultSpeedPlayOptions( AudacityProject &project );
|
||||
|
||||
|
86
src/ProjectAudioIO.cpp
Normal file
86
src/ProjectAudioIO.cpp
Normal file
@ -0,0 +1,86 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ProjectAudioIO.cpp
|
||||
|
||||
Paul Licameli split from AudacityProject.cpp
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "ProjectAudioIO.h"
|
||||
|
||||
#include "AudioIO.h"
|
||||
#include "Project.h"
|
||||
|
||||
static const AudacityProject::AttachedObjects::RegisteredFactory sAudioIOKey{
|
||||
[]( AudacityProject &parent ){
|
||||
return std::make_shared< ProjectAudioIO >( parent );
|
||||
}
|
||||
};
|
||||
|
||||
ProjectAudioIO &ProjectAudioIO::Get( AudacityProject &project )
|
||||
{
|
||||
return project.AttachedObjects::Get< ProjectAudioIO >( sAudioIOKey );
|
||||
}
|
||||
|
||||
const ProjectAudioIO &ProjectAudioIO::Get( const AudacityProject &project )
|
||||
{
|
||||
return Get( const_cast<AudacityProject &>(project) );
|
||||
}
|
||||
|
||||
ProjectAudioIO::ProjectAudioIO( AudacityProject &project )
|
||||
: mProject{ project }
|
||||
{
|
||||
}
|
||||
|
||||
ProjectAudioIO::~ProjectAudioIO()
|
||||
{
|
||||
}
|
||||
|
||||
int ProjectAudioIO::GetAudioIOToken() const
|
||||
{
|
||||
return mAudioIOToken;
|
||||
}
|
||||
|
||||
void ProjectAudioIO::SetAudioIOToken(int token)
|
||||
{
|
||||
mAudioIOToken = token;
|
||||
}
|
||||
|
||||
bool ProjectAudioIO::IsAudioActive() const
|
||||
{
|
||||
return GetAudioIOToken() > 0 &&
|
||||
gAudioIO->IsStreamActive(GetAudioIOToken());
|
||||
}
|
||||
|
||||
MeterPanel *ProjectAudioIO::GetPlaybackMeter()
|
||||
{
|
||||
return mPlaybackMeter;
|
||||
}
|
||||
|
||||
void ProjectAudioIO::SetPlaybackMeter(MeterPanel *playback)
|
||||
{
|
||||
auto &project = mProject;
|
||||
mPlaybackMeter = playback;
|
||||
if (gAudioIO)
|
||||
{
|
||||
gAudioIO->SetPlaybackMeter( &project , mPlaybackMeter );
|
||||
}
|
||||
}
|
||||
|
||||
MeterPanel *ProjectAudioIO::GetCaptureMeter()
|
||||
{
|
||||
return mCaptureMeter;
|
||||
}
|
||||
|
||||
void ProjectAudioIO::SetCaptureMeter(MeterPanel *capture)
|
||||
{
|
||||
auto &project = mProject;
|
||||
mCaptureMeter = capture;
|
||||
|
||||
if (gAudioIO)
|
||||
{
|
||||
gAudioIO->SetCaptureMeter( &project, mCaptureMeter );
|
||||
}
|
||||
}
|
50
src/ProjectAudioIO.h
Normal file
50
src/ProjectAudioIO.h
Normal file
@ -0,0 +1,50 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ProjectAudioIO.h
|
||||
|
||||
Paul Licameli split from AudacityProject.h
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __PROJECT_AUDIO_IO__
|
||||
#define __PROJECT_AUDIO_IO__
|
||||
|
||||
#include "ClientData.h" // to inherit
|
||||
|
||||
class AudacityProject;
|
||||
class MeterPanel;
|
||||
|
||||
///\ brief Holds per-project state needed for interaction with AudioIO,
|
||||
/// including the audio stream token and pointers to meters
|
||||
class ProjectAudioIO final
|
||||
: public ClientData::Base
|
||||
{
|
||||
public:
|
||||
static ProjectAudioIO &Get( AudacityProject &project );
|
||||
static const ProjectAudioIO &Get( const AudacityProject &project );
|
||||
|
||||
explicit ProjectAudioIO( AudacityProject &project );
|
||||
~ProjectAudioIO();
|
||||
|
||||
int GetAudioIOToken() const;
|
||||
bool IsAudioActive() const;
|
||||
void SetAudioIOToken(int token);
|
||||
|
||||
MeterPanel *GetPlaybackMeter();
|
||||
void SetPlaybackMeter(MeterPanel *playback);
|
||||
MeterPanel *GetCaptureMeter();
|
||||
void SetCaptureMeter(MeterPanel *capture);
|
||||
|
||||
private:
|
||||
AudacityProject &mProject;
|
||||
|
||||
// Project owned meters
|
||||
MeterPanel *mPlaybackMeter{};
|
||||
MeterPanel *mCaptureMeter{};
|
||||
|
||||
int mAudioIOToken{ -1 };
|
||||
};
|
||||
|
||||
#endif
|
@ -70,6 +70,7 @@ is time to refresh some aspect of the screen.
|
||||
#include "AdornedRulerPanel.h"
|
||||
#include "KeyboardCapture.h"
|
||||
#include "Project.h"
|
||||
#include "ProjectAudioIO.h"
|
||||
#include "ProjectSettings.h"
|
||||
#include "TrackPanelMouseEvent.h"
|
||||
#include "TrackPanelResizeHandle.h"
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "../Menus.h"
|
||||
#include "../Prefs.h"
|
||||
#include "../Project.h"
|
||||
#include "../ProjectAudioIO.h"
|
||||
#include "../TrackPanel.h"
|
||||
#include "../ViewInfo.h"
|
||||
#include "../WaveTrack.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "../Menus.h" // for PrefsListener
|
||||
#include "../Prefs.h"
|
||||
#include "../Project.h"
|
||||
#include "../ProjectAudioIO.h"
|
||||
#include "../ProjectSettings.h"
|
||||
#include "../SelectionState.h"
|
||||
#include "../TimeDialog.h"
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "../Prefs.h"
|
||||
#include "../Project.h"
|
||||
#include "../ProjectAudioIO.h"
|
||||
#include "../ProjectSettings.h"
|
||||
#include "../PluginManager.h"
|
||||
#include "../ShuttleGui.h"
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "../Menus.h"
|
||||
#include "../Prefs.h"
|
||||
#include "../Project.h"
|
||||
#include "../ProjectAudioIO.h"
|
||||
#include "../ProjectSettings.h"
|
||||
#include "../SoundActivatedRecord.h"
|
||||
#include "../TimerRecordDialog.h"
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include "../Menus.h"
|
||||
#include "../Prefs.h"
|
||||
#include "../Project.h"
|
||||
#include "../ProjectAudioIO.h"
|
||||
#include "../ProjectSettings.h"
|
||||
#include "../ViewInfo.h"
|
||||
#include "../widgets/AButton.h"
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include "../AllThemeResources.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../Project.h"
|
||||
#include "../ProjectAudioIO.h"
|
||||
#include "../widgets/Meter.h"
|
||||
|
||||
IMPLEMENT_CLASS(MeterToolBar, ToolBar);
|
||||
|
@ -16,6 +16,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../../HitTestResult.h"
|
||||
#include "../../../LabelTrack.h"
|
||||
#include "../../../Project.h"
|
||||
#include "../../../ProjectAudioIO.h"
|
||||
#include "../../../RefreshCode.h"
|
||||
#include "../../../SelectionState.h"
|
||||
#include "../../../TrackPanelMouseEvent.h"
|
||||
|
@ -16,6 +16,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../../../HitTestResult.h"
|
||||
#include "../../../../NoteTrack.h"
|
||||
#include "../../../../Project.h"
|
||||
#include "../../../../ProjectAudioIO.h"
|
||||
#include "../../../../ProjectSettings.h"
|
||||
#include "../../../../RefreshCode.h"
|
||||
#include "../../../../TrackPanelMouseEvent.h"
|
||||
|
@ -15,6 +15,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
|
||||
#include "../../../../HitTestResult.h"
|
||||
#include "../../../../Project.h"
|
||||
#include "../../../../ProjectAudioIO.h"
|
||||
#include "../../../../RefreshCode.h"
|
||||
#include "../../../../Snap.h" // for kPixelTolerance
|
||||
#include "../../../../TrackPanelMouseEvent.h"
|
||||
|
@ -20,6 +20,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../../../HitTestResult.h"
|
||||
#include "../../../../prefs/WaveformSettings.h"
|
||||
#include "../../../../Project.h"
|
||||
#include "../../../../ProjectAudioIO.h"
|
||||
#include "../../../../RefreshCode.h"
|
||||
#include "../../../../TrackArtist.h"
|
||||
#include "../../../../TrackPanelMouseEvent.h"
|
||||
|
@ -19,6 +19,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../../../AudioIO.h"
|
||||
#include "../../../../Menus.h"
|
||||
#include "../../../../Project.h"
|
||||
#include "../../../../ProjectAudioIO.h"
|
||||
#include "../../../../RefreshCode.h"
|
||||
#include "../../../../ShuttleGui.h"
|
||||
#include "../../../../TrackPanel.h"
|
||||
|
@ -17,6 +17,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../HitTestResult.h"
|
||||
#include "../../prefs/WaveformSettings.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../ProjectAudioIO.h"
|
||||
#include "../../RefreshCode.h"
|
||||
#include "../../TimeTrack.h"
|
||||
#include "../../TrackArtist.h"
|
||||
|
@ -15,6 +15,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../AdornedRulerPanel.h"
|
||||
#include "../../AudioIO.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../ProjectAudioIO.h"
|
||||
#include "../../Track.h"
|
||||
#include "../../TrackPanel.h"
|
||||
#include "../../ViewInfo.h"
|
||||
|
@ -19,6 +19,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../AudioIO.h"
|
||||
#include "../../Menus.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../ProjectAudioIO.h"
|
||||
#include "../../TrackPanel.h"
|
||||
#include "../../ViewInfo.h"
|
||||
#include "../../prefs/PlaybackPrefs.h"
|
||||
|
@ -21,6 +21,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../Menus.h"
|
||||
#include "../../NumberScale.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../ProjectAudioIO.h"
|
||||
#include "../../ProjectSettings.h"
|
||||
#include "../../RefreshCode.h"
|
||||
#include "../../SelectionState.h"
|
||||
|
@ -18,6 +18,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../HitTestResult.h"
|
||||
#include "../../NoteTrack.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../ProjectAudioIO.h"
|
||||
#include "../../ProjectSettings.h"
|
||||
#include "../../RefreshCode.h"
|
||||
#include "../../TrackPanelMouseEvent.h"
|
||||
|
@ -13,6 +13,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
|
||||
#include "../../Menus.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../ProjectAudioIO.h"
|
||||
#include "../../RefreshCode.h"
|
||||
#include "../../Track.h"
|
||||
#include "../../TrackPanel.h"
|
||||
|
@ -14,6 +14,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "TrackControls.h"
|
||||
#include "../../Menus.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../ProjectAudioIO.h"
|
||||
#include "../../RefreshCode.h"
|
||||
#include "../../TrackPanel.h"
|
||||
#include "../../TrackPanelMouseEvent.h"
|
||||
|
@ -221,6 +221,7 @@
|
||||
<ClCompile Include="..\..\..\src\Printing.cpp" />
|
||||
<ClCompile Include="..\..\..\src\Profiler.cpp" />
|
||||
<ClCompile Include="..\..\..\src\Project.cpp" />
|
||||
<ClCompile Include="..\..\..\src\ProjectAudioIO.cpp" />
|
||||
<ClCompile Include="..\..\..\src\ProjectFileIORegistry.cpp" />
|
||||
<ClCompile Include="..\..\..\src\ProjectFSCK.cpp" />
|
||||
<ClCompile Include="..\..\..\src\ProjectSettings.cpp" />
|
||||
@ -649,6 +650,7 @@
|
||||
<ClInclude Include="..\..\..\src\Printing.h" />
|
||||
<ClInclude Include="..\..\..\src\Profiler.h" />
|
||||
<ClInclude Include="..\..\..\src\Project.h" />
|
||||
<ClInclude Include="..\..\..\src\ProjectAudioIO.h" />
|
||||
<ClInclude Include="..\..\..\src\ProjectFileIORegistry.h" />
|
||||
<ClInclude Include="..\..\..\src\ProjectFSCK.h" />
|
||||
<ClInclude Include="..\..\..\src\ProjectSettings.h" />
|
||||
|
@ -260,6 +260,9 @@
|
||||
<ClCompile Include="..\..\..\src\Project.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\ProjectAudioIO.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\ProjectFileIORegistry.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
@ -1321,6 +1324,9 @@
|
||||
<ClInclude Include="..\..\..\src\Project.h">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\ProjectAudioIO.h">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\ProjectFileIORegistry.h">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
|
Loading…
x
Reference in New Issue
Block a user