MPD
0.20.15
|
A plugin which controls an audio output device. More...
#include <OutputPlugin.hxx>
Data Fields | |
const char * | name |
the plugin's name More... | |
bool(* | test_default_device )() |
Test if this plugin can provide a default output, in case none has been configured. More... | |
AudioOutput *(* | init )(const ConfigBlock &block) |
Configure and initialize the device, but do not open it yet. More... | |
void(* | finish )(AudioOutput *data) |
Free resources allocated by this device. More... | |
void(* | enable )(AudioOutput *data) |
Enable the device. More... | |
void(* | disable )(AudioOutput *data) |
Disables the device. More... | |
void(* | open )(AudioOutput *data, AudioFormat &audio_format) |
Really open the device. More... | |
void(* | close )(AudioOutput *data) |
Close the device. More... | |
std::chrono::steady_clock::duration(* | delay )(AudioOutput *data) noexcept |
Returns a positive number if the output thread shall further delay the next call to play() or pause(), which will happen until this function returns 0. More... | |
void(* | send_tag )(AudioOutput *data, const Tag &tag) |
Display metadata for the next chunk. More... | |
size_t(* | play )(AudioOutput *data, const void *chunk, size_t size) |
Play a chunk of audio data. More... | |
void(* | drain )(AudioOutput *data) |
Wait until the device has finished playing. More... | |
void(* | cancel )(AudioOutput *data) |
Try to cancel data which may still be in the device's buffers. More... | |
bool(* | pause )(AudioOutput *data) |
Pause the device. More... | |
const MixerPlugin * | mixer_plugin |
The mixer plugin associated with this output plugin. More... | |
A plugin which controls an audio output device.
Definition at line 38 of file OutputPlugin.hxx.
void(* AudioOutputPlugin::cancel) (AudioOutput *data) |
Try to cancel data which may still be in the device's buffers.
Definition at line 131 of file OutputPlugin.hxx.
void(* AudioOutputPlugin::close) (AudioOutput *data) |
Close the device.
Definition at line 93 of file OutputPlugin.hxx.
|
noexcept |
Returns a positive number if the output thread shall further delay the next call to play() or pause(), which will happen until this function returns 0.
This should be implemented instead of doing a sleep inside the plugin, because this allows MPD to listen to commands meanwhile.
Definition at line 104 of file OutputPlugin.hxx.
void(* AudioOutputPlugin::disable) (AudioOutput *data) |
Disables the device.
It is closed before this method is called.
Definition at line 78 of file OutputPlugin.hxx.
void(* AudioOutputPlugin::drain) (AudioOutput *data) |
Wait until the device has finished playing.
Definition at line 125 of file OutputPlugin.hxx.
void(* AudioOutputPlugin::enable) (AudioOutput *data) |
Enable the device.
This may allocate resources, preparing for the device to be opened.
Throws #std::runtime_error on error.
Definition at line 72 of file OutputPlugin.hxx.
void(* AudioOutputPlugin::finish) (AudioOutput *data) |
Free resources allocated by this device.
Definition at line 64 of file OutputPlugin.hxx.
AudioOutput*(* AudioOutputPlugin::init) (const ConfigBlock &block) |
Configure and initialize the device, but do not open it yet.
Throws #std::runtime_error on error.
param | the configuration section, or nullptr if there is no configuration |
Definition at line 59 of file OutputPlugin.hxx.
const MixerPlugin* AudioOutputPlugin::mixer_plugin |
The mixer plugin associated with this output plugin.
This may be nullptr if no mixer plugin is implemented. When created, this mixer plugin gets the same ConfigParam as this audio output device.
Definition at line 152 of file OutputPlugin.hxx.
const char* AudioOutputPlugin::name |
the plugin's name
Definition at line 42 of file OutputPlugin.hxx.
void(* AudioOutputPlugin::open) (AudioOutput *data, AudioFormat &audio_format) |
Really open the device.
Throws #std::runtime_error on error.
audio_format | the audio format in which data is going to be delivered; may be modified by the plugin |
Definition at line 88 of file OutputPlugin.hxx.
bool(* AudioOutputPlugin::pause) (AudioOutput *data) |
Pause the device.
If supported, it may perform a special action, which keeps the device open, but does not play anything. Output plugins like "shout" might want to play silence during pause, so their clients won't be disconnected. Plugins which do not support pausing will simply be closed, and have to be reopened when unpaused.
Definition at line 144 of file OutputPlugin.hxx.
size_t(* AudioOutputPlugin::play) (AudioOutput *data, const void *chunk, size_t size) |
Play a chunk of audio data.
Throws #std::runtime_error on error.
Definition at line 119 of file OutputPlugin.hxx.
void(* AudioOutputPlugin::send_tag) (AudioOutput *data, const Tag &tag) |
Display metadata for the next chunk.
Optional method, because not all devices can display metadata.
Definition at line 110 of file OutputPlugin.hxx.
bool(* AudioOutputPlugin::test_default_device) () |
Test if this plugin can provide a default output, in case none has been configured.
This method is optional.
Definition at line 48 of file OutputPlugin.hxx.