Dante Application Library API
Loading...
Searching...
No Matches
Audio.hpp
1#pragma once
2
3#include "audinate/dal/Common.hpp"
4#include "audinate/dal/DAL.hpp"
5
6namespace Audinate { namespace DAL {
7
8//------------------------------------------------------
9// Audio API
10//------------------------------------------------------
11
14{
15public:
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{
53public:
54 // nothing for now
55};
56
59{
60public:
62 unsigned int mNumPeriodsSkipped;
63
65 unsigned int mNumBytesSkipped;
66
69
71 unsigned int mNumBytesAvailable;
72
75
78};
79
85typedef std::function<void(const BufferResetParameters & params)> BufferResetFn;
86
97typedef std::function<void(const AudioTransferParameters & params)> TransferFn;
98
100class Audio
101{
102protected:
103 Audio() {}
104 virtual ~Audio() {}
105
106public:
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}; };
virtual AudioProperties getProperties() const =0
Get the audio properties for this audio object.
virtual void setTransferFn(TransferFn fn)=0
Set the transfer callback function for this audio object This value cannot be changed while the DAL i...
virtual void setBufferResetFn(BufferResetFn fn)=0
Set the buffer reset callback function for this audio object This value cannot be changed while the D...
AudioProperties for the life of a DAL instance.
Definition Audio.hpp:14
unsigned int mBytesPerBuffer
How many total bytes in each buffer?
Definition Audio.hpp:23
unsigned int mBytesPerSample
How many bytes does each audio sample use in the buffer?
Definition Audio.hpp:17
unsigned int mSamplesPerBuffer
How many audio samples in each buffer?
Definition Audio.hpp:29
unsigned int mPeriodsPerBuffer
How many periods in each buffer?
Definition Audio.hpp:32
unsigned int mSamplesPerPeriod
How many audio samples in each period?
Definition Audio.hpp:26
unsigned int mTxActivatedChannelCount
How many tx channels are available?
Definition Audio.hpp:44
unsigned int mBytesPerPeriod
How many bytes in each period.
Definition Audio.hpp:20
std::vector< const Uint8 * > mRxChannelBuffers
Get the pointers to each RX channel buffer.
Definition Audio.hpp:38
unsigned int mRxActivatedChannelCount
How many rx channels are available?
Definition Audio.hpp:41
std::vector< Uint8 * > mTxChannelBuffers
Get the pointers to each TX channel buffer.
Definition Audio.hpp:35
Parameters of an audio transfer event.
Definition Audio.hpp:59
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
unsigned int mNumPeriodsAvailable
How many periods worth of audio is available for the given transfer?
Definition Audio.hpp:68
unsigned int mNumBytesAvailable
How many samples of data is available for the given transfer?
Definition Audio.hpp:71
unsigned int mNumBytesSkipped
How many bytes of audio were skipped for the given transfer?
Definition Audio.hpp:65
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
unsigned int mNumPeriodsSkipped
How many periods of audio were skipped for the given transfer?
Definition Audio.hpp:62
Parameters of a buffer reset event.
Definition Audio.hpp:52