VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
vae::core::BackendRtAudio Class Referencefinal

#include <vae_rtaudio.hpp>

Inheritance diagram for vae::core::BackendRtAudio:
Collaboration diagram for vae::core::BackendRtAudio:

Public Member Functions

unsigned int getDeviceCount () override
 Gets number of devices, needed to iterate them. More...
 
DeviceInfo getDevice (unsigned int index) override
 Returns a spefic device info for index. More...
 
const char * getName () const override
 Returns name of the api. More...
 
DeviceInfo getDefaultInputDevice () override
 
DeviceInfo getDefaultOutputDevice () override
 
DevicecreateDevice (const EngineConfig &config) override
 Creates a device instance for this backend. More...
 

Static Public Member Functions

static BackendRtAudioinstance ()
 

Private Member Functions

 BackendRtAudio ()
 
 ~BackendRtAudio ()
 

Private Attributes

RtAudio mAudio
 

Detailed Description

Definition at line 117 of file vae_rtaudio.hpp.

Constructor & Destructor Documentation

◆ BackendRtAudio()

vae::core::BackendRtAudio::BackendRtAudio ( )
inlineprivate

Definition at line 119 of file vae_rtaudio.hpp.

119{ }

◆ ~BackendRtAudio()

vae::core::BackendRtAudio::~BackendRtAudio ( )
inlineprivate

Definition at line 121 of file vae_rtaudio.hpp.

121{ }

Member Function Documentation

◆ createDevice()

Device * vae::core::BackendRtAudio::createDevice ( const EngineConfig )
inlineoverridevirtual

Creates a device instance for this backend.

Implements vae::core::Backend.

Definition at line 157 of file vae_rtaudio.hpp.

157 {
158 return new DeviceRtaudio(*this, config);
159 }

◆ getDefaultInputDevice()

DeviceInfo vae::core::BackendRtAudio::getDefaultInputDevice ( )
inlineoverridevirtual

Implements vae::core::Backend.

Definition at line 149 of file vae_rtaudio.hpp.

149 {
150 return getDevice(mAudio.getDefaultInputDevice());
151 };
DeviceInfo getDevice(unsigned int index) override
Returns a spefic device info for index.
Here is the call graph for this function:

◆ getDefaultOutputDevice()

DeviceInfo vae::core::BackendRtAudio::getDefaultOutputDevice ( )
inlineoverridevirtual

Implements vae::core::Backend.

Definition at line 153 of file vae_rtaudio.hpp.

153 {
154 return getDevice(mAudio.getDefaultOutputDevice());
155 };
Here is the call graph for this function:

◆ getDevice()

DeviceInfo vae::core::BackendRtAudio::getDevice ( unsigned int  index)
inlineoverridevirtual

Returns a spefic device info for index.

Implements vae::core::Backend.

Definition at line 133 of file vae_rtaudio.hpp.

133 {
134 const auto rtInfo = mAudio.getDeviceInfo(index);
135 TKLB_ASSERT(rtInfo.probed) // device needs to be probed
136
137 DeviceInfo info;
138 info.id = index;
139 info.channelsIn = rtInfo.inputChannels;
140 info.channelsOut = rtInfo.outputChannels;
141 info.sampleRate = Uint(rtInfo.preferredSampleRate);
142 tklb::memory::stringCopy(info.name, rtInfo.name.c_str(), sizeof(DeviceInfo::name));
143 tklb::memory::stringCopy(info.api, getName(), sizeof(DeviceInfo::api), false);
144 return info;
145 };
#define TKLB_ASSERT(condition)
Wrap assertions.
Definition: TAssert.h:18
const char * getName() const override
Returns name of the api.
static void stringCopy(char *dst, const char *src, size_t size, bool terminate=true)
Definition: TMemoryUtil.hpp:26
Using template interfaces isn't an option so this simply defines a default Convolver type.
Definition: TAllocator.hpp:15
unsigned int Uint
Definition: vae_types.hpp:46
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDeviceCount()

unsigned int vae::core::BackendRtAudio::getDeviceCount ( )
inlineoverridevirtual

Gets number of devices, needed to iterate them.

Device index != does not have to be the device index!

Implements vae::core::Backend.

Definition at line 129 of file vae_rtaudio.hpp.

129 {
130 return mAudio.getDeviceCount();
131 }

◆ getName()

const char * vae::core::BackendRtAudio::getName ( ) const
inlineoverridevirtual

Returns name of the api.

Implements vae::core::Backend.

Definition at line 147 of file vae_rtaudio.hpp.

147{ return "rtaudio"; };
Here is the caller graph for this function:

◆ instance()

static BackendRtAudio & vae::core::BackendRtAudio::instance ( )
inlinestatic

Definition at line 124 of file vae_rtaudio.hpp.

124 {
125 static BackendRtAudio backend;
126 return backend;
127 }

Member Data Documentation

◆ mAudio

RtAudio vae::core::BackendRtAudio::mAudio
private

Definition at line 118 of file vae_rtaudio.hpp.


The documentation for this class was generated from the following file: