#include <audiodevice.h>
Inherits Thread.

Definition at line 56 of file audiodevice.h.
| AudioDevice::AudioDevice | ( | MWindow * | mwindow = 0 |
) |
Definition at line 34 of file audiodevice.C.
References arm_lock, buffer_lock, duplex_lock, in_config, initialize(), out_config, play_lock, playback_timer, polling_lock, record_timer, startup_lock, timer_lock, TOTAL_BUFFERS, and vconfig.

| AudioDevice::~AudioDevice | ( | ) |
Definition at line 56 of file audiodevice.C.
References arm_lock, buffer_lock, duplex_lock, in_config, out_config, play_lock, playback_timer, polling_lock, record_timer, startup_lock, timer_lock, TOTAL_BUFFERS, and vconfig.
| int AudioDevice::open_input | ( | AudioInConfig * | config, | |
| VideoInConfig * | vconfig, | |||
| int | rate, | |||
| int | samples, | |||
| int | channels, | |||
| int | realtime | |||
| ) |
Definition at line 164 of file audiodevice.C.
References VideoInConfig::copy_from(), AudioInConfig::copy_from(), create_lowlevel(), AudioInConfig::driver, duplex_init, in_channels, in_config, in_realtime, in_samplerate, in_samples, lowlevel_in, AudioLowLevel::open_input(), r, record_timer, and Timer::update().
Referenced by Record::open_input_devices(), and LiveAudio::process_buffer().

| int AudioDevice::open_output | ( | AudioOutConfig * | config, | |
| int | rate, | |||
| int | samples, | |||
| int | channels, | |||
| int | realtime | |||
| ) |
Definition at line 185 of file audiodevice.C.
References create_lowlevel(), AudioOutConfig::driver, duplex_init, lowlevel_out, AudioLowLevel::open_output(), out_channels, out_config, out_realtime, out_samplerate, out_samples, and w.
Referenced by Record::open_input_devices(), and RenderEngine::open_output().

| int AudioDevice::close_all | ( | ) |
Definition at line 210 of file audiodevice.C.
References AudioLowLevel::close_all(), d, duplex_init, input_buffer, is_recording, Thread::join(), last_buffer_size, lowlevel_duplex, lowlevel_in, lowlevel_out, play_dither, position_correction, r, read_waiting, rec_dither, reset_output(), sharing, software_position_info, TOTAL_BUFFERS, vdevice, and w.
Referenced by RecordEngine::close_input_devices(), Record::close_input_devices(), RenderEngine::close_output(), RecordEngine::close_output_devices(), LiveAudio::render_stop(), and LiveAudio::~LiveAudio().

| int AudioDevice::reset_output | ( | ) |
Definition at line 192 of file audioodevice.C.
References arm_buffer_num, arm_lock, buffer_size, interrupt, is_playing_back, last_buffer, last_buffer_size, last_position, output_buffer, play_dither, play_lock, position_correction, Sema::reset(), software_position_info, TOTAL_BUFFERS, and total_samples.
Referenced by close_all().

| int AudioDevice::restart | ( | ) |
| int AudioDevice::set_vdevice | ( | VideoDevice * | vdevice | ) |
Definition at line 260 of file audiodevice.C.
Referenced by RecordEngine::open_input_devices(), Record::open_input_devices(), and RenderEngine::open_output().
| int AudioDevice::read_buffer | ( | double ** | input, | |
| int | samples, | |||
| int * | over, | |||
| double * | max, | |||
| int | input_offset = 0 | |||
| ) |
Definition at line 77 of file audioidevice.C.
References bits, buffer_lock, buffer_size, GET_16BIT_SAMPLE_MACRO1, GET_16BIT_SAMPLE_MACRO2, GET_24BIT_SAMPLE_MACRO1, GET_24BIT_SAMPLE_MACRO2, GET_32BIT_SAMPLE_MACRO1, GET_32BIT_SAMPLE_MACRO2, GET_8BIT_SAMPLE_MACRO1, GET_8BIT_SAMPLE_MACRO2, get_ibits(), get_ichannels(), GET_PEAK_MACRO, input_buffer, is_recording, Mutex::lock(), Condition::lock(), MAXCHANNELS, memcpy, polling_lock, read_waiting, record_timer, thread_buffer_num, TOTAL_BUFFERS, total_samples_read, Mutex::unlock(), and Timer::update().
Referenced by LiveAudio::process_buffer(), and RecordAudio::run().

| int AudioDevice::set_record_dither | ( | int | value | ) |
| void AudioDevice::start_recording | ( | ) |
Definition at line 311 of file audioidevice.C.
References get_irealtime(), input_buffer, interrupt, is_recording, record_timer, Thread::set_realtime(), Thread::start(), thread_buffer_num, TOTAL_BUFFERS, and Timer::update().
Referenced by Record::open_input_devices(), and LiveAudio::process_buffer().

| int AudioDevice::stop_recording | ( | ) |
| int AudioDevice::interrupt_crash | ( | ) |
Definition at line 203 of file audiodevice.C.
References AudioLowLevel::interrupt_crash(), and lowlevel_in.
Referenced by LiveAudio::render_stop(), RecordAudio::stop_recording(), and LiveAudio::~LiveAudio().

| int AudioDevice::write_buffer | ( | double ** | output, | |
| int | samples | |||
| ) |
Definition at line 11 of file audioodevice.C.
References arm_buffer(), arm_buffer_num, interrupt, and TOTAL_BUFFERS.
Referenced by VirtualAConsole::process_buffer().

| void AudioDevice::run | ( | ) | [virtual] |
Implements Thread.
Definition at line 361 of file audiodevice.C.
References r, run_input(), run_output(), and w.

| void AudioDevice::run_output | ( | ) |
Definition at line 330 of file audioodevice.C.
References arm_lock, buffer_size, duplex_init, duplex_lock, AudioLowLevel::flush_device(), get_lowlevel_out(), get_obits(), get_ochannels(), interrupt, is_playing_back, last_buffer, last_buffer_size, Mutex::lock(), Condition::lock(), Sema::lock(), output_buffer, play_lock, playback_timer, record_before_play, startup_lock, thread_buffer_num, thread_result, timer_lock, TOTAL_BUFFERS, total_samples, Sema::unlock(), Mutex::unlock(), Condition::unlock(), Timer::update(), and AudioLowLevel::write_buffer().
Referenced by run().

| void AudioDevice::run_input | ( | ) |
Definition at line 271 of file audioidevice.C.
References buffer_lock, buffer_size, get_ibits(), get_ichannels(), get_lowlevel_in(), in_samples, input_buffer, is_recording, Mutex::lock(), polling_lock, AudioLowLevel::read_buffer(), read_waiting, thread_buffer_num, Condition::unlock(), and Mutex::unlock().
Referenced by run().

| int AudioDevice::set_last_buffer | ( | ) |
Definition at line 21 of file audioodevice.C.
References arm_buffer_num, arm_lock, last_buffer, Sema::lock(), play_lock, TOTAL_BUFFERS, and Sema::unlock().
Referenced by ARender::send_last_buffer(), and VirtualAConsole::send_last_output_buffer().

| int AudioDevice::wait_for_startup | ( | ) |
Definition at line 267 of file audioodevice.C.
References Condition::lock(), and startup_lock.

| int AudioDevice::wait_for_completion | ( | ) |
Definition at line 273 of file audioodevice.C.
References Thread::join().
Referenced by ARender::wait_device_completion().

| int AudioDevice::start_playback | ( | ) |
Definition at line 229 of file audioodevice.C.
References get_orealtime(), interrupt, is_playing_back, last_position, playback_timer, Thread::set_realtime(), Thread::start(), and Timer::update().
Referenced by RenderEngine::open_output().

| int AudioDevice::interrupt_playback | ( | ) |
Definition at line 242 of file audioodevice.C.
References arm_lock, get_lowlevel_out(), interrupt, AudioLowLevel::interrupt_playback(), is_playing_back, play_lock, TOTAL_BUFFERS, and Sema::unlock().
Referenced by RenderEngine::interrupt_playback().

| int AudioDevice::set_play_dither | ( | int | status | ) |
| int AudioDevice::set_software_positioning | ( | int | status = 1 |
) |
Definition at line 223 of file audioodevice.C.
References software_position_info.
Referenced by RecordEngine::open_input_devices(), Record::open_input_devices(), RenderEngine::open_output(), and RecordEngine::open_output_devices().
| int64_t AudioDevice::current_position | ( | ) |
Definition at line 281 of file audioodevice.C.
References AudioOutConfig::audio_offset, device_buffer, AudioLowLevel::device_position(), get_irate(), get_lowlevel_out(), get_obits(), get_ochannels(), get_orate(), Timer::get_scaled_difference(), last_buffer_size, last_position, Mutex::lock(), out_config, playback_timer, r, record_timer, software_position_info, timer_lock, total_samples, total_samples_read, Mutex::unlock(), and w.
Referenced by ARender::run(), RenderEngine::session_position(), RenderEngine::sync_position(), and RecordAudio::sync_position().

| int AudioDevice::get_interrupted | ( | ) |
Definition at line 341 of file audiodevice.C.
References interrupt.
Referenced by VirtualAConsole::process_buffer().
| int AudioDevice::get_device_buffer | ( | ) |
| AudioLowLevel * AudioDevice::get_lowlevel_out | ( | ) |
Definition at line 296 of file audiodevice.C.
References d, lowlevel_duplex, lowlevel_out, and w.
Referenced by current_position(), interrupt_playback(), VDevice1394::open_output(), and run_output().
| AudioLowLevel * AudioDevice::get_lowlevel_in | ( | ) |
Definition at line 303 of file audiodevice.C.
References d, lowlevel_duplex, lowlevel_in, and r.
Referenced by VDevice1394::open_input(), and run_input().
| int AudioDevice::initialize | ( | ) | [private] |
Definition at line 75 of file audiodevice.C.
References arm_buffer_num, buffer_size, d, duplex_init, duplex_realtime, in_realtime, input_buffer, interrupt, is_playing_back, is_recording, last_buffer, last_buffer_size, last_position, lowlevel_duplex, lowlevel_in, lowlevel_out, out_realtime, output_buffer, play_dither, position_correction, r, read_waiting, rec_dither, record_before_play, sharing, software_position_info, TOTAL_BUFFERS, total_samples, total_samples_read, vdevice, and w.
Referenced by AudioDevice().
| int AudioDevice::create_lowlevel | ( | AudioLowLevel *& | lowlevel, | |
| int | driver | |||
| ) | [private] |
Definition at line 110 of file audiodevice.C.
References Audio1394, AudioALSA, AudioDVB, AudioESound, and AudioOSS.
Referenced by open_input(), and open_output().
| int AudioDevice::arm_buffer | ( | int | buffer, | |
| double ** | output, | |||
| int | samples | |||
| ) | [private] |
Definition at line 36 of file audioodevice.C.
References arm_lock, bits, buffer_size, CLAMP, get_obits(), get_ochannels(), interrupt, Sema::lock(), output_buffer, play_dither, play_lock, and Sema::unlock().
Referenced by write_buffer().

| int AudioDevice::get_obits | ( | ) | [private] |
Definition at line 282 of file audiodevice.C.
References d, duplex_bits, out_bits, and w.
Referenced by arm_buffer(), current_position(), and run_output().
| int AudioDevice::get_ochannels | ( | ) | [private] |
Definition at line 289 of file audiodevice.C.
References d, duplex_channels, out_channels, and w.
Referenced by arm_buffer(), current_position(), and run_output().
| int AudioDevice::get_ibits | ( | ) | [private] |
Definition at line 274 of file audiodevice.C.
References d, duplex_bits, in_bits, and r.
Referenced by read_buffer(), and run_input().
| int AudioDevice::get_ichannels | ( | ) | [private] |
Definition at line 267 of file audiodevice.C.
References d, duplex_channels, in_channels, and r.
Referenced by read_buffer(), and run_input().
| int AudioDevice::get_orate | ( | ) | [private] |
Definition at line 334 of file audiodevice.C.
References d, duplex_samplerate, out_samplerate, and w.
Referenced by current_position().
| int AudioDevice::get_irate | ( | ) | [private] |
Definition at line 310 of file audiodevice.C.
References d, duplex_samplerate, in_samplerate, and r.
Referenced by current_position().
| int AudioDevice::get_orealtime | ( | ) | [private] |
Definition at line 317 of file audiodevice.C.
References d, duplex_realtime, out_realtime, and w.
Referenced by start_playback().
| int AudioDevice::get_irealtime | ( | ) | [private] |
Definition at line 325 of file audiodevice.C.
References d, duplex_realtime, in_realtime, and r.
Referenced by start_recording().
friend class AudioALSA [friend] |
friend class AudioDVB [friend] |
friend class AudioOSS [friend] |
friend class AudioESound [friend] |
friend class Audio1394 [friend] |
friend class VDevice1394 [friend] |
Definition at line 68 of file audiodevice.h.
friend class Device1394Output [friend] |
Definition at line 69 of file audiodevice.h.
int AudioDevice::in_samplerate [private] |
Definition at line 161 of file audiodevice.h.
Referenced by get_irate(), open_input(), and Audio1394::open_input().
int AudioDevice::in_bits [private] |
Definition at line 161 of file audiodevice.h.
Referenced by get_ibits(), and Audio1394::open_input().
int AudioDevice::in_channels [private] |
Definition at line 161 of file audiodevice.h.
Referenced by get_ichannels(), open_input(), and Audio1394::open_input().
int AudioDevice::in_samples [private] |
int AudioDevice::in_realtime [private] |
Definition at line 162 of file audiodevice.h.
Referenced by get_irealtime(), initialize(), and open_input().
int AudioDevice::out_samplerate [private] |
Definition at line 163 of file audiodevice.h.
Referenced by get_orate(), open_output(), and Audio1394::open_output().
int AudioDevice::out_bits [private] |
Definition at line 163 of file audiodevice.h.
Referenced by get_obits(), and Audio1394::open_output().
int AudioDevice::out_channels [private] |
Definition at line 163 of file audiodevice.h.