Audacity 3.2.0
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
23struct PaStreamCallbackTimeInfo;
24struct PaStreamInfo;
25struct PlaybackSchedule;
26struct TransportTracks;
27
28class AUDIO_IO_API AudioIOExt : public AudioIOExtBase
29{
30public:
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_IO_API RegisteredFactory{
40 };
41
42 virtual ~AudioIOExt();
43
44 // Formerly in AudioIoCallback
45 virtual void ComputeOtherTimings(double rate, bool paused,
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
Abstract interface to alternative, concurrent playback with the main audio (such as MIDI events)
Definition: AudioIOBase.h:87
virtual void AbortOtherStream()=0
virtual unsigned CountOtherSoloTracks() const =0
std::vector< AudioIOExt::Factory > Factories
Definition: AudioIOExt.h:33
virtual ~AudioIOExt()
virtual void StopOtherStream()=0
std::function< std::unique_ptr< AudioIOExt >(const PlaybackSchedule &) > Factory
Definition: AudioIOExt.h:32
virtual void ComputeOtherTimings(double rate, bool paused, const PaStreamCallbackTimeInfo *timeInfo, unsigned long framesPerBuffer)=0
virtual bool StartOtherStream(const TransportTracks &tracks, const PaStreamInfo *info, double startTime, double rate)=0
virtual void FillOtherBuffers(double rate, unsigned long pauseFrames, bool paused, bool hasSolo)=0
virtual void SignalOtherCompletion()=0
static RegisteredToolbarFactory factory
Typically statically constructed.
Definition: AudioIOExt.h:37