Nsound
0.9.4
|
#include <Nsound/AudioBackendLibao.h>
Public Types | |
enum | State { BACKEND_NOT_INITIALIZED, BACKEND_READY, BACKEND_ERROR } |
Public Member Functions | |
AudioBackendLibao (uint32 sample_rate=44100, uint32 channels=1, uint32 bits_per_sample=16) | |
~AudioBackendLibao () | |
AudioBackendType | getBackendType () |
std::string | getError () |
std::string | getInfo () |
void | initialize () |
void | play (void *data, uint32 n_bytes) |
void | scanDevices (AudioPlayback &pb, const AudioStream &test_clip) |
void | setOption (const std::string &key, const std::string &value) |
Set libao options. More... | |
void | shutdown () |
uint32 | getBitsPerSample () |
uint32 | getChannels () |
uint32 | getSampleRate () |
State | getState () |
std::string | getStateString () |
Returns the backend state. More... | |
Static Public Member Functions | |
static std::string | getStateString (const AudioBackend::State &state) |
Returns the backend state string. More... | |
Protected Attributes | |
uint32 | sample_rate_ |
uint32 | channels_ |
uint32 | bits_per_sample_ |
State | state_ |
Private Member Functions | |
AudioBackendLibao (const AudioBackendLibao ©) | |
AudioBackendLibao & | operator= (const AudioBackendLibao &rhs) |
Private Attributes | |
std::vector< std::string > | options_ |
std::stringstream | error_buffer_ |
int32 | driver_id_ |
ao_device * | device_ptr_ |
Definition at line 50 of file AudioBackendLibao.h.
|
inherited |
Enumerator | |
---|---|
BACKEND_NOT_INITIALIZED | |
BACKEND_READY | |
BACKEND_ERROR |
Definition at line 52 of file AudioBackend.h.
AudioBackendLibao::AudioBackendLibao | ( | uint32 | sample_rate = 44100 , |
uint32 | channels = 1 , |
||
uint32 | bits_per_sample = 16 |
||
) |
Definition at line 75 of file AudioBackendLibao.cc.
References initialize().
AudioBackendLibao::~AudioBackendLibao | ( | ) |
|
inlineprivate |
Definition at line 111 of file AudioBackendLibao.h.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 97 of file AudioBackendLibao.cc.
References Nsound::BACKEND_TYPE_LIBAO.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 104 of file AudioBackendLibao.cc.
References error_buffer_.
Referenced by getInfo().
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 161 of file AudioBackendLibao.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_NOT_INITIALIZED, driver_id_, getError(), M_THROW, print_info(), and Nsound::AudioBackend::state_.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 193 of file AudioBackendLibao.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_NOT_INITIALIZED, Nsound::AudioBackend::BACKEND_READY, Nsound::AudioBackend::bits_per_sample_, Nsound::AudioBackend::channels_, device_ptr_, driver_id_, error_buffer_, M_THROW, options_, Nsound::AudioBackend::sample_rate_, and Nsound::AudioBackend::state_.
Referenced by AudioBackendLibao(), and scanDevices().
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 376 of file AudioBackendLibao.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_READY, device_ptr_, error_buffer_, M_THROW, and Nsound::AudioBackend::state_.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 467 of file AudioBackendLibao.cc.
References driver_id_, driver_types, initialize(), N_DRIVER_TYPES, Nsound::AudioPlayback::play(), and shutdown().
|
virtual |
Set libao options.
Available options:
Key | Value |
---|---|
"driver" | "alsa", "arts", "axis", "esd", "irix", "macosx", "nas", "oss", "pulse", "roar", "sndio", "sun", "wmm" |
Each libao driver has specific options. Please read the labao documentation for the options here.
Implements Nsound::AudioBackend.
Definition at line 498 of file AudioBackendLibao.cc.
References Nsound::AudioBackend::BACKEND_ERROR, driver_id_, integer(), lower(), M_THROW, options_, and Nsound::AudioBackend::state_.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 551 of file AudioBackendLibao.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_NOT_INITIALIZED, device_ptr_, driver_id_, M_THROW, and Nsound::AudioBackend::state_.
Referenced by scanDevices(), and ~AudioBackendLibao().
|
inlineprivate |
Definition at line 119 of file AudioBackendLibao.h.
|
inlineinherited |
Definition at line 77 of file AudioBackend.h.
References Nsound::AudioBackend::bits_per_sample_.
Referenced by Nsound::AudioPlayback::getBitsPerSample().
|
inlineinherited |
Definition at line 80 of file AudioBackend.h.
References Nsound::AudioBackend::channels_.
Referenced by Nsound::AudioPlayback::getChannels(), and play_int().
|
inlineinherited |
Definition at line 91 of file AudioBackend.h.
References Nsound::AudioBackend::sample_rate_.
Referenced by Nsound::AudioPlayback::getSampleRate().
|
inlineinherited |
Definition at line 94 of file AudioBackend.h.
References Nsound::AudioBackend::state_.
Referenced by Nsound::AudioPlayback::getState(), Nsound::AudioPlayback::initialize(), Nsound::AudioPlayback::scanDevices(), and Nsound::AudioPlayback::setOption().
|
inherited |
Returns the backend state.
Definition at line 43 of file AudioBackend.cc.
References Nsound::AudioBackend::state_, and state_strings.
Referenced by Nsound::AudioPlayback::getStateString().
|
staticinherited |
Returns the backend state string.
Definition at line 51 of file AudioBackend.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_NOT_INITIALIZED, and state_strings.
|
private |
Definition at line 119 of file AudioBackendLibao.h.
Referenced by initialize(), and setOption().
|
private |
Definition at line 122 of file AudioBackendLibao.h.
Referenced by getError(), initialize(), and play().
|
private |
Definition at line 124 of file AudioBackendLibao.h.
Referenced by getInfo(), initialize(), scanDevices(), setOption(), and shutdown().
|
private |
Definition at line 125 of file AudioBackendLibao.h.
Referenced by initialize(), play(), and shutdown().
|
protectedinherited |
Definition at line 127 of file AudioBackend.h.
Referenced by Nsound::AudioBackend::getSampleRate(), initialize(), and Nsound::AudioBackendLibportaudio::initialize().
|
protectedinherited |
Definition at line 128 of file AudioBackend.h.
Referenced by Nsound::AudioBackend::getChannels(), initialize(), and Nsound::AudioBackendLibportaudio::initialize().
|
protectedinherited |
Definition at line 129 of file AudioBackend.h.
Referenced by Nsound::AudioBackend::getBitsPerSample(), initialize(), and Nsound::AudioBackendLibportaudio::initialize().
|
protectedinherited |
Definition at line 130 of file AudioBackend.h.
Referenced by getInfo(), Nsound::AudioBackendLibportaudio::getInfo(), Nsound::AudioBackend::getState(), Nsound::AudioBackend::getStateString(), initialize(), Nsound::AudioBackendLibportaudio::initialize(), play(), Nsound::AudioBackendLibportaudio::play(), setOption(), Nsound::AudioBackendLibportaudio::setOption(), shutdown(), Nsound::AudioBackendLibportaudio::shutdown(), and Nsound::AudioBackendLibportaudio::~AudioBackendLibportaudio().