Audacity  3.0.3
AudioIOExt.h
Go to the documentation of this file.
1 /*!********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  @file AudioIOExt.h
6  @brief Abstract base class for hooks into audio playback procedures
7 
8  Paul Licameli
9 
10  **********************************************************************/
11 
12 #ifndef __AUDACITY_AUDIO_IO_EXT__
13 #define __AUDACITY_AUDIO_IO_EXT__
14 
15 #include <functional>
16 #include <memory>
17 #include <vector>
18 
19 #include <wx/string.h>
20 
21 #include "AudioIOBase.h"
22 
23 struct PaStreamCallbackTimeInfo;
24 struct PaStreamInfo;
25 struct PlaybackSchedule;
26 struct TransportTracks;
27 
28 class AUDACITY_DLL_API AudioIOExt : public AudioIOExtBase
29 {
30 public:
31  using Factory = std::function<
32  std::unique_ptr<AudioIOExt>( const PlaybackSchedule& ) >;
33  using Factories = std::vector<AudioIOExt::Factory>;
34  static Factories &GetFactories();
35 
37  struct AUDIO_DEVICES_API RegisteredFactory{
40  };
41 
42  virtual ~AudioIOExt();
43 
44  // Formerly in AudioIoCallback
45  virtual void ComputeOtherTimings(double rate,
46  const PaStreamCallbackTimeInfo *timeInfo,
47  unsigned long framesPerBuffer) = 0;
48  virtual void SignalOtherCompletion() = 0;
49  virtual unsigned CountOtherSoloTracks() const = 0;
50 
51  // Formerly in AudioIO
52  virtual bool StartOtherStream(const TransportTracks &tracks,
53  const PaStreamInfo* info, double startTime, double rate) = 0;
54  virtual void AbortOtherStream() = 0;
55  virtual void FillOtherBuffers(
56  double rate, unsigned long pauseFrames, bool paused, bool hasSolo) = 0;
57  virtual void StopOtherStream() = 0;
58 };
59 
60 #endif
AudioIOBase.h
AudioIOExt::StartOtherStream
virtual bool StartOtherStream(const TransportTracks &tracks, const PaStreamInfo *info, double startTime, double rate)=0
AudioIOExt::SignalOtherCompletion
virtual void SignalOtherCompletion()=0
AudioIOExt::Factories
std::vector< AudioIOExt::Factory > Factories
Definition: AudioIOExt.h:33
AudioIOExt::StopOtherStream
virtual void StopOtherStream()=0
AudioIOExt::~AudioIOExt
virtual ~AudioIOExt()
AudioIOExt
Definition: AudioIOExt.h:29
AudioIOExt::Factory
std::function< std::unique_ptr< AudioIOExt >(const PlaybackSchedule &) > Factory
Definition: AudioIOExt.h:32
AudioIOExtBase
Abstract interface to alternative, concurrent playback with the main audio (such as MIDI events)
Definition: AudioIOBase.h:85
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:817
AudioIOExt::ComputeOtherTimings
virtual void ComputeOtherTimings(double rate, const PaStreamCallbackTimeInfo *timeInfo, unsigned long framesPerBuffer)=0
AudioIOExt::AbortOtherStream
virtual void AbortOtherStream()=0
PlaybackSchedule
Definition: PlaybackSchedule.h:268
AudioIOExt::FillOtherBuffers
virtual void FillOtherBuffers(double rate, unsigned long pauseFrames, bool paused, bool hasSolo)=0
AudioIOExt::RegisteredFactory
Typically statically constructed.
Definition: AudioIOExt.h:37
TransportTracks
Definition: AudioIO.h:64
AudioIOExt::CountOtherSoloTracks
virtual unsigned CountOtherSoloTracks() const =0