24#ifndef __LS_AUDIOOUTPUTDEVICE_H__
25#define __LS_AUDIOOUTPUTDEVICE_H__
32#include "../../common/global.h"
33#include "../../common/Exception.h"
35#include "../DeviceParameter.h"
36#include "../../engines/Engine.h"
38#include "../../common/SynchronizedConfig.h"
39#include "../../effects/EffectChain.h"
45 class AudioOutputDeviceFactory;
Audio Channel (always mono)
Device Parameter 'ACTIVE'.
ParameterActive(String s)
virtual std::map< String, DeviceCreationParameter * > DependsAsParameters() OVERRIDE
Might return a unique key-value pair list (map) reflecting the dependencies of this parameter to othe...
virtual optional< bool > DefaultAsBool(std::map< String, String > Parameters) OVERRIDE
virtual String Description() OVERRIDE
A human readable description, explaining the exact purpose of the driver parameter.
virtual bool Fix() OVERRIDE
Whether the parameter is read only.
virtual bool Mandatory() OVERRIDE
Whether the parameter must be supplied by the user at device creation time.
virtual void OnSetValue(bool b) OVERRIDE
Device Parameters 'CHANNELS'.
ParameterChannels(String s)
virtual String Description() OVERRIDE
A human readable description, explaining the exact purpose of the driver parameter.
Device Parameter 'SAMPLERATE'.
virtual String Description() OVERRIDE
A human readable description, explaining the exact purpose of the driver parameter.
ParameterSampleRate(String s)
Abstract base class for audio output drivers in LinuxSampler.
void ReconnectAll()
This method can or should be called by the deriving driver in case some fundamental parameter changed...
virtual uint MaxSamplesPerCycle()=0
Maximum amount of sample points the implementing audio device will ever demand the sampler engines to...
EffectChain * SendEffectChain(uint iChain) const
Returns send effect chain given by iChain or NULL if there's no such effect chain.
uint SendEffectChainCount() const
Returns amount of send effect chains this AudioOutputDevice currently provides.
virtual AudioChannel * CreateChannel(uint ChannelNr)=0
Create new audio channel.
void AcquireChannels(uint Channels)
This method will usually be called by the sampler engines that are connected to this audio device to ...
virtual void Stop()=0
Stop playback of audio signal on the audio device.
virtual uint SampleRate()=0
Playback samplerate the audio device uses.
SynchronizedConfig< std::set< Engine * > >::Reader EnginesReader
Audio thread access to Engines.
EffectChain * SendEffectChainByID(uint iChainID) const
Returns send effect chain with ID iChainID or NULL if there's no such effect chain.
void Disconnect(Engine *pEngine)
Disconnect given sampler engine from this audio output device.
void RemoveMasterEffectChain(uint iChain) DEPRECATED_API
int RenderAudio(uint Samples)
This method should be called by the AudioOutputDevice descendant to let all connected engines proceed...
virtual bool IsPlaying()=0
Returns true if the audio device is currently playing back.
void Connect(Engine *pEngine)
Connect given sampler engine to this audio output device.
SynchronizedConfig< std::set< Engine * > > Engines
All sampler engines that are connected to the audio output device.
virtual float latency()
Might be optionally implemented by the deriving driver.
EffectChain * MasterEffectChain(uint iChain) const DEPRECATED_API
virtual String Driver()=0
Return the audio output device driver name.
EffectChain * AddMasterEffectChain() DEPRECATED_API
std::vector< EffectChain * > vEffectChains
IDGenerator * EffectChainIDs
std::vector< AudioChannel * > Channels
All audio channels of the audio output device. This is just a container; the descendant has to create...
int RenderSilence(uint Samples)
This can be called as an alternative to RenderAudio() for just writing silence to the audio output bu...
virtual void Play()=0
Start playback of audio signal on the audio device.
void RemoveSendEffectChain(uint iChain)
Remove the send effect chain given by iChain .
uint MasterEffectChainCount() const DEPRECATED_API
uint ChannelCount()
Returns the amount of audio channels (including the so called "mix channels") the device is currently...
AudioChannel * Channel(uint ChannelIndex)
Returns audio channel with index ChannelIndex or NULL if index out of bounds.
std::map< String, DeviceCreationParameter * > Parameters
All device parameters.
friend class AudioOutputDeviceFactory
EffectChain * AddSendEffectChain()
Add a chain of send effects to this AudioOutputDevice.
std::map< String, DeviceCreationParameter * > DeviceParameters()
Returns all device parameter settings.
Audio output exception that should be thrown by the AudioOutputDevice descendants in case initializat...
AudioOutputException(const std::string &msg)
Abstract base class for driver parameters of type Bool.
Abstract base class for driver parameters of type int.
Abstract base class for parameters at driver instanciation time.
Abstract base class for all kind of drivers in LinuxSampler.
LinuxSampler Sampler Engine Interface.
Exception that will be thrown in NON REAL TIME PARTS of the LinuxSampler application.
Wraps as a kind of pointer class some data object shared with other threads, to protect / synchronize...
Thread-safe management of configuration data, where the data is updated by a single non real time thr...