Dante Application Library API
Audio.hpp
1 #pragma once
2 
3 #include "audinate/dal/Common.hpp"
4 #include "audinate/dal/DAL.hpp"
5 
6 namespace Audinate { namespace DAL {
7 
8 //------------------------------------------------------
9 // Audio API
10 //------------------------------------------------------
11 
14 {
15 public:
17  unsigned int mBytesPerSample;
18 
20  unsigned int mBytesPerPeriod;
21 
23  unsigned int mBytesPerBuffer;
24 
26  unsigned int mSamplesPerPeriod;
27 
29  unsigned int mSamplesPerBuffer;
30 
32  unsigned int mPeriodsPerBuffer;
33 
35  std::vector<Uint8 *> mTxChannelBuffers;
36 
38  std::vector<const Uint8 *> mRxChannelBuffers;
39 
42 
45 };
46 
52 {
53 public:
54  // nothing for now
55 };
56 
59 {
60 public:
62  unsigned int mNumPeriodsSkipped;
63 
65  unsigned int mNumBytesSkipped;
66 
68  unsigned int mNumPeriodsAvailable;
69 
71  unsigned int mNumBytesAvailable;
72 
75 
78 };
79 
85 typedef std::function<void(const BufferResetParameters & params)> BufferResetFn;
86 
97 typedef std::function<void(const AudioTransferParameters & params)> TransferFn;
98 
100 class Audio
101 {
102 protected:
103  Audio() {}
104  virtual ~Audio() {}
105 
106 public:
107 
113  virtual void setBufferResetFn(BufferResetFn fn) = 0;
114 
120  virtual void setTransferFn(TransferFn fn) = 0;
121 
126  virtual AudioProperties getProperties() const = 0;
127 };
128 
129 }; };
Audinate::DAL::AudioProperties::mRxActivatedChannelCount
unsigned int mRxActivatedChannelCount
How many rx channels are available?
Definition: Audio.hpp:41
Audinate::DAL::AudioTransferParameters
Parameters of an audio transfer event.
Definition: Audio.hpp:58
Audinate::DAL::AudioProperties::mSamplesPerPeriod
unsigned int mSamplesPerPeriod
How many audio samples in each period?
Definition: Audio.hpp:26
Audinate::DAL::AudioTransferParameters::mNumBytesSkipped
unsigned int mNumBytesSkipped
How many bytes of audio were skipped for the given transfer?
Definition: Audio.hpp:65
Audinate::DAL::AudioTransferParameters::mAvailableDataOffsetInPeriods
unsigned int mAvailableDataOffsetInPeriods
What is the offset (in periods) from the start of the buffer to the 'available' data for this transfe...
Definition: Audio.hpp:74
Audinate::DAL::AudioTransferParameters::mNumPeriodsSkipped
unsigned int mNumPeriodsSkipped
How many periods of audio were skipped for the given transfer?
Definition: Audio.hpp:62
Audinate::DAL::AudioProperties::mTxChannelBuffers
std::vector< Uint8 * > mTxChannelBuffers
Get the pointers to each TX channel buffer.
Definition: Audio.hpp:35
Audinate::DAL::AudioProperties::mBytesPerPeriod
unsigned int mBytesPerPeriod
How many bytes in each period.
Definition: Audio.hpp:20
Audinate::DAL::AudioProperties
AudioProperties for the life of a DAL instance.
Definition: Audio.hpp:13
Audinate::DAL::AudioProperties::mBytesPerSample
unsigned int mBytesPerSample
How many bytes does each audio sample use in the buffer?
Definition: Audio.hpp:17
Audinate::DAL::AudioProperties::mBytesPerBuffer
unsigned int mBytesPerBuffer
How many total bytes in each buffer?
Definition: Audio.hpp:23
Audinate::DAL::AudioProperties::mSamplesPerBuffer
unsigned int mSamplesPerBuffer
How many audio samples in each buffer?
Definition: Audio.hpp:29
Audinate::DAL::AudioProperties::mPeriodsPerBuffer
unsigned int mPeriodsPerBuffer
How many periods in each buffer?
Definition: Audio.hpp:32
Audinate::DAL::AudioTransferParameters::mNumPeriodsAvailable
unsigned int mNumPeriodsAvailable
How many periods worth of audio is available for the given transfer?
Definition: Audio.hpp:68
Audinate::DAL::AudioTransferParameters::mAvailableDataOffsetInBytes
unsigned int mAvailableDataOffsetInBytes
What is the offset (in bytes) from the start of the buffer to the 'available' data for this transfer.
Definition: Audio.hpp:77
Audinate::DAL::AudioProperties::mTxActivatedChannelCount
unsigned int mTxActivatedChannelCount
How many tx channels are available?
Definition: Audio.hpp:44
Audinate::DAL::AudioTransferParameters::mNumBytesAvailable
unsigned int mNumBytesAvailable
How many samples of data is available for the given transfer?
Definition: Audio.hpp:71
Audinate::DAL::Audio::setBufferResetFn
virtual void setBufferResetFn(BufferResetFn fn)=0
Set the buffer reset callback function for this audio object This value cannot be changed while the D...
Audinate::DAL::Audio::getProperties
virtual AudioProperties getProperties() const =0
Get the audio properties for this audio object.
Audinate::DAL::Audio::setTransferFn
virtual void setTransferFn(TransferFn fn)=0
Set the transfer callback function for this audio object This value cannot be changed while the DAL i...
Audinate::DAL::AudioProperties::mRxChannelBuffers
std::vector< const Uint8 * > mRxChannelBuffers
Get the pointers to each RX channel buffer.
Definition: Audio.hpp:38
Audinate::DAL::BufferResetParameters
Parameters of a buffer reset event.
Definition: Audio.hpp:51
Audinate::DAL::Audio
A pure-virtual class representing a DAL Instance's Audio API.
Definition: Audio.hpp:100