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

Backend without functionality. More...

#include <vae_device_dummy.hpp>

Inheritance diagram for vae::core::DeviceDummy:
Collaboration diagram for vae::core::DeviceDummy:

Public Member Functions

 DeviceDummy (Backend &backend, const EngineConfig &config)
 
bool openDevice (bool input=false) override
 Tries to open the default audio device whith desired in out channels. More...
 
bool openDevice (DeviceInfo &device) override
 Opens a specific audio device. More...
 
bool closeDevice () override
 Closes the currently open device. More...
 
template<typename T >
void swapBufferInterleaved (const T *from, T *to, Size frames)
 Simulate the callback from the audio device. More...
 
- Public Member Functions inherited from vae::core::Device
 Device (Backend &backend, const EngineConfig &config)
 Only a Backend can construct a Device. More...
 
virtual ~Device ()
 
void setCallback (Callback callback)
 
Size push (const ScratchBuffer &buffer)
 Push samples to the audio device. More...
 
Size canPush () const
 Return amount of audio frames which can be pushed in buffer ! this is an estimate when resampling ! More...
 
void pop (ScratchBuffer &buffer)
 Get samples form audio device. More...
 
Size canPop () const
 
Size getChannelsOut () const
 
Size getChannelsIn () const
 
Size getSampleRate () const
 Get the sample rate. More...
 
Size getRealSampleRate () const
 Get the Real Sample Rate before resampling. More...
 
size_t getStreamTime () const
 
Size getOverruns () const
 
Size getUnderruns () const
 

Additional Inherited Members

- Public Types inherited from vae::core::Device
using Resampler = tklb::ResamplerTpl< Sample, ScratchBuffer >
 
- Protected Types inherited from vae::core::Device
using Callback = tklb::Delegate< void(Device *)>
 
- Protected Member Functions inherited from vae::core::Device
void init (Size sampleRate, Uchar channelsIn, Uchar channelsOut, Size bufferSize)
 initializes buffers, queues and resamplers if needed Has to be called in openDevice once the samplerate and channel config is known More...
 
void postInit ()
 
- Protected Attributes inherited from vae::core::Device
BackendmBackend
 
const EngineConfigmConfig
 
Size mSampleRate = 0
 
Size mRealSampleRate = 0
 
Size mOverruns = 0
 
Size mUnderruns = 0
 
Resampler mResamplerToDevice
 
ScratchBuffer mResamplerBufferToDevice
 
AudioThreadWorker mWorker
 
- Static Protected Attributes inherited from vae::core::Device
static constexpr int _VAE_WORKER_SIZE = sizeof(AudioThreadWorker)
 

Detailed Description

Backend without functionality.

Definition at line 10 of file vae_device_dummy.hpp.

Constructor & Destructor Documentation

◆ DeviceDummy()

vae::core::DeviceDummy::DeviceDummy ( Backend backend,
const EngineConfig config 
)
inline

Definition at line 12 of file vae_device_dummy.hpp.

14 : Device(backend, config) { }
Device(Backend &backend, const EngineConfig &config)
Only a Backend can construct a Device.
Definition: vae_device.hpp:184

Member Function Documentation

◆ closeDevice()

bool vae::core::DeviceDummy::closeDevice ( )
inlineoverridevirtual

Closes the currently open device.

Otherwise does nothing.

Implements vae::core::Device.

Definition at line 28 of file vae_device_dummy.hpp.

28{ return true; }

◆ openDevice() [1/2]

bool vae::core::DeviceDummy::openDevice ( bool  input = false)
inlineoverridevirtual

Tries to open the default audio device whith desired in out channels.

Reimplemented from vae::core::Device.

Definition at line 16 of file vae_device_dummy.hpp.

16 {
18 postInit();
19 return true;
20 }
const EngineConfig & mConfig
Definition: vae_device.hpp:24
void init(Size sampleRate, Uchar channelsIn, Uchar channelsOut, Size bufferSize)
initializes buffers, queues and resamplers if needed Has to be called in openDevice once the samplera...
Definition: vae_device.hpp:114
constexpr Size MaxBlock
Maximum block size.
Definition: vae.hpp:276
Size internalSampleRate
Samplerate requested from device.
Definition: vae.hpp:168
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openDevice() [2/2]

bool vae::core::DeviceDummy::openDevice ( DeviceInfo device)
inlineoverridevirtual

Opens a specific audio device.

The device struct may be altered to match the actual hardware. (sampleRate, bufferSize and channel count)

Implements vae::core::Device.

Definition at line 22 of file vae_device_dummy.hpp.

22 {
23 // there's only one device
24 TKLB_ASSERT(device.id == 0)
25 return openDevice(false);
26 }
#define TKLB_ASSERT(condition)
Wrap assertions.
Definition: TAssert.h:18
bool openDevice(bool input=false) override
Tries to open the default audio device whith desired in out channels.
Here is the call graph for this function:

◆ swapBufferInterleaved()

template<typename T >
void vae::core::DeviceDummy::swapBufferInterleaved ( const T *  from,
T *  to,
Size  frames 
)
inline

Simulate the callback from the audio device.

Template Parameters
T
Parameters
from
to
frames

Definition at line 39 of file vae_device_dummy.hpp.

39 {
40 mWorker.swapBufferInterleaved<T>(from, to, frames);
41 }
AudioThreadWorker mWorker
Definition: vae_device.hpp:102
void swapBufferInterleaved(const T *from, T *to, Size frames)
Called from audio backend to push in interleaved audio data.
Definition: vae_device.hpp:64
Here is the call graph for this function:

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