Nsound
0.9.4
|
#include <Nsound/AudioBackendLibportaudio.h>
Public Types | |
enum | State { BACKEND_NOT_INITIALIZED, BACKEND_READY, BACKEND_ERROR } |
Public Member Functions | |
AudioBackendLibportaudio (uint32 sample_rate=44100, uint32 channels=1, uint32 bits_per_sample=16) | |
~AudioBackendLibportaudio () | |
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 Libportaudio 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 | |
AudioBackendLibportaudio (const AudioBackendLibportaudio ©) | |
AudioBackendLibportaudio & | operator= (const AudioBackendLibportaudio &rhs) |
Private Attributes | |
std::vector< std::string > | options_ |
std::stringstream | error_buffer_ |
PaStreamParameters * | out_params_ |
PaStream * | stream_ |
uint32 | n_frames_per_buffer_ |
uint32 | driver_id_ |
Definition at line 51 of file AudioBackendLibportaudio.h.
|
inherited |
Enumerator | |
---|---|
BACKEND_NOT_INITIALIZED | |
BACKEND_READY | |
BACKEND_ERROR |
Definition at line 52 of file AudioBackend.h.
AudioBackendLibportaudio::AudioBackendLibportaudio | ( | uint32 | sample_rate = 44100 , |
uint32 | channels = 1 , |
||
uint32 | bits_per_sample = 16 |
||
) |
Definition at line 79 of file AudioBackendLibportaudio.cc.
References initialize().
AudioBackendLibportaudio::~AudioBackendLibportaudio | ( | ) |
Definition at line 98 of file AudioBackendLibportaudio.cc.
References Nsound::AudioBackend::BACKEND_READY, shutdown(), and Nsound::AudioBackend::state_.
|
inlineprivate |
Definition at line 113 of file AudioBackendLibportaudio.h.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 108 of file AudioBackendLibportaudio.cc.
References Nsound::BACKEND_TYPE_LIBPORTAUDIO.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 116 of file AudioBackendLibportaudio.cc.
References error_buffer_.
Referenced by getInfo().
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 124 of file AudioBackendLibportaudio.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_NOT_INITIALIZED, getError(), M_THROW, out_params_, and Nsound::AudioBackend::state_.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 194 of file AudioBackendLibportaudio.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_NOT_INITIALIZED, Nsound::AudioBackend::BACKEND_READY, Nsound::AudioBackend::bits_per_sample_, Nsound::AudioBackend::channels_, error_buffer_, M_THROW, n_frames_per_buffer_, out_params_, Nsound::AudioBackend::sample_rate_, Nsound::AudioBackend::state_, and stream_.
Referenced by AudioBackendLibportaudio(), and scanDevices().
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 389 of file AudioBackendLibportaudio.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_READY, error_buffer_, M_THROW, n_frames_per_buffer_, out_params_, Nsound::AudioBackend::state_, stream_, and write_stream().
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 606 of file AudioBackendLibportaudio.cc.
References driver_id_, initialize(), lower(), Nsound::AudioPlayback::play(), and shutdown().
|
virtual |
Set Libportaudio options.
Available options:
Key | Value |
---|---|
"driver" | "alsa", "oss", "asihpi", "jack", "coreaudio", "asio", "wasapi", "wdm/ks", "directsound", "wmme" |
"frames_per_buffer" | integer, default = 64 |
Implements Nsound::AudioBackend.
Definition at line 674 of file AudioBackendLibportaudio.cc.
References Nsound::AudioBackend::BACKEND_ERROR, driver_id_, integer(), lower(), M_THROW, n_frames_per_buffer_, and Nsound::AudioBackend::state_.
|
virtual |
Implements Nsound::AudioBackend.
Definition at line 744 of file AudioBackendLibportaudio.cc.
References Nsound::AudioBackend::BACKEND_ERROR, Nsound::AudioBackend::BACKEND_NOT_INITIALIZED, M_THROW, out_params_, Nsound::AudioBackend::state_, and stream_.
Referenced by scanDevices(), and ~AudioBackendLibportaudio().
|
inlineprivate |
Definition at line 124 of file AudioBackendLibportaudio.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 125 of file AudioBackendLibportaudio.h.
|
private |
Definition at line 129 of file AudioBackendLibportaudio.h.
Referenced by getError(), initialize(), and play().
|
private |
Definition at line 131 of file AudioBackendLibportaudio.h.
Referenced by getInfo(), initialize(), play(), and shutdown().
|
private |
Definition at line 132 of file AudioBackendLibportaudio.h.
Referenced by initialize(), play(), and shutdown().
|
private |
Definition at line 136 of file AudioBackendLibportaudio.h.
Referenced by initialize(), play(), and setOption().
|
private |
Definition at line 138 of file AudioBackendLibportaudio.h.
Referenced by scanDevices(), and setOption().
|
protectedinherited |
Definition at line 127 of file AudioBackend.h.
Referenced by Nsound::AudioBackend::getSampleRate(), Nsound::AudioBackendLibao::initialize(), and initialize().
|
protectedinherited |
Definition at line 128 of file AudioBackend.h.
Referenced by Nsound::AudioBackend::getChannels(), Nsound::AudioBackendLibao::initialize(), and initialize().
|
protectedinherited |
Definition at line 129 of file AudioBackend.h.
Referenced by Nsound::AudioBackend::getBitsPerSample(), Nsound::AudioBackendLibao::initialize(), and initialize().
|
protectedinherited |
Definition at line 130 of file AudioBackend.h.
Referenced by Nsound::AudioBackendLibao::getInfo(), getInfo(), Nsound::AudioBackend::getState(), Nsound::AudioBackend::getStateString(), Nsound::AudioBackendLibao::initialize(), initialize(), Nsound::AudioBackendLibao::play(), play(), Nsound::AudioBackendLibao::setOption(), setOption(), Nsound::AudioBackendLibao::shutdown(), shutdown(), and ~AudioBackendLibportaudio().