AudioDevice Class Reference

#include <audiodevice.h>

Inherits Thread.

Collaboration diagram for AudioDevice:

Collaboration graph
[legend]

Public Member Functions

 AudioDevice (MWindow *mwindow=0)
 ~AudioDevice ()
int open_input (AudioInConfig *config, VideoInConfig *vconfig, int rate, int samples, int channels, int realtime)
int open_output (AudioOutConfig *config, int rate, int samples, int channels, int realtime)
int close_all ()
int reset_output ()
int restart ()
int set_vdevice (VideoDevice *vdevice)
int read_buffer (double **input, int samples, int *over, double *max, int input_offset=0)
int set_record_dither (int value)
void start_recording ()
int stop_recording ()
int interrupt_crash ()
int write_buffer (double **output, int samples)
void run ()
void run_output ()
void run_input ()
int set_last_buffer ()
int wait_for_startup ()
int wait_for_completion ()
int start_playback ()
int interrupt_playback ()
int set_play_dither (int status)
int set_software_positioning (int status=1)
int64_t current_position ()
int get_interrupted ()
int get_device_buffer ()
AudioLowLevelget_lowlevel_out ()
AudioLowLevelget_lowlevel_in ()

Private Member Functions

int initialize ()
int create_lowlevel (AudioLowLevel *&lowlevel, int driver)
int arm_buffer (int buffer, double **output, int samples)
int get_obits ()
int get_ochannels ()
int get_ibits ()
int get_ichannels ()
int get_orate ()
int get_irate ()
int get_orealtime ()
int get_irealtime ()

Private Attributes

int in_samplerate
int in_bits
int in_channels
int in_samples
int in_realtime
int out_samplerate
int out_bits
int out_channels
int out_samples
int duplex_samplerate
int duplex_bits
int duplex_channels
int duplex_samples
int out_realtime
int duplex_realtime
int r
int w
int d
int osamples
int isamples
int dsamples
VideoDevicevdevice
int record_before_play
Conditionduplex_lock
Conditionstartup_lock
int duplex_init
int rec_dither
int play_dither
int sharing
int buffer_size [TOTAL_BUFFERS]
int last_buffer [TOTAL_BUFFERS]
char * output_buffer [TOTAL_BUFFERS]
char * input_buffer [TOTAL_BUFFERS]
Semaplay_lock [TOTAL_BUFFERS]
Semaarm_lock [TOTAL_BUFFERS]
Mutextimer_lock
int read_waiting
Mutexbuffer_lock
Conditionpolling_lock
int arm_buffer_num
int total_samples
int last_buffer_size
int position_correction
int device_buffer
int last_position
Timerplayback_timer
Timerrecord_timer
int is_playing_back
int is_recording
int global_timer_started
int software_position_info
int interrupt
int driver
AudioLowLevellowlevel_in
AudioLowLevellowlevel_out
AudioLowLevellowlevel_duplex
AudioOutConfigout_config
AudioInConfigin_config
VideoInConfigvconfig
int thread_buffer_num
int thread_result
int64_t total_samples_read
MWindowmwindow

Friends

class AudioALSA
class AudioDVB
class AudioOSS
class AudioESound
class Audio1394
class VDevice1394
class Device1394Output

Detailed Description

Definition at line 56 of file audiodevice.h.


Constructor & Destructor Documentation

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.

Here is the call graph for this function:

AudioDevice::~AudioDevice (  ) 


Member Function Documentation

int AudioDevice::open_input ( AudioInConfig config,
VideoInConfig vconfig,
int  rate,
int  samples,
int  channels,
int  realtime 
)

int AudioDevice::open_output ( AudioOutConfig config,
int  rate,
int  samples,
int  channels,
int  realtime 
)

int AudioDevice::close_all (  ) 

int AudioDevice::reset_output (  ) 

int AudioDevice::restart (  ) 

int AudioDevice::set_vdevice ( VideoDevice vdevice  ) 

int AudioDevice::read_buffer ( double **  input,
int  samples,
int *  over,
double *  max,
int  input_offset = 0 
)

int AudioDevice::set_record_dither ( int  value  ) 

void AudioDevice::start_recording (  ) 

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void AudioDevice::run (  )  [virtual]

Implements Thread.

Definition at line 361 of file audiodevice.C.

References r, run_input(), run_output(), and w.

Here is the call graph for this function:

void AudioDevice::run_output (  ) 

void AudioDevice::run_input (  ) 

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().

Here is the call graph for this function:

int AudioDevice::wait_for_startup (  ) 

Definition at line 267 of file audioodevice.C.

References Condition::lock(), and startup_lock.

Here is the call graph for this function:

int AudioDevice::wait_for_completion (  ) 

Definition at line 273 of file audioodevice.C.

References Thread::join().

Referenced by ARender::wait_device_completion().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

int AudioDevice::set_play_dither ( int  status  ) 

Definition at line 217 of file audioodevice.C.

References play_dither.

int AudioDevice::set_software_positioning ( int  status = 1  ) 

int64_t AudioDevice::current_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 (  ) 

Definition at line 346 of file audiodevice.C.

References device_buffer.

AudioLowLevel * AudioDevice::get_lowlevel_out (  ) 

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]

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().

Here is the call graph for this function:

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().


Friends And Related Function Documentation

friend class AudioALSA [friend]

Definition at line 63 of file audiodevice.h.

Referenced by create_lowlevel().

friend class AudioDVB [friend]

Definition at line 64 of file audiodevice.h.

Referenced by create_lowlevel().

friend class AudioOSS [friend]

Definition at line 65 of file audiodevice.h.

Referenced by create_lowlevel().

friend class AudioESound [friend]

Definition at line 66 of file audiodevice.h.

Referenced by create_lowlevel().

friend class Audio1394 [friend]

Definition at line 67 of file audiodevice.h.

Referenced by create_lowlevel().

friend class VDevice1394 [friend]

Definition at line 68 of file audiodevice.h.

friend class Device1394Output [friend]

Definition at line 69 of file audiodevice.h.


Field Documentation

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]

Definition at line 161 of file audiodevice.h.

Referenced by open_input(), and run_input().

int AudioDevice::in_realtime [private]

Definition at line 162 of file audiodevice.h.

Referenced by get_irealtime(), initialize(), and open_input().

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().

Definition at line 163 of file audiodevice.h.

Referenced by get_ochannels(), open_output(), and Audio1394::open_output().

int AudioDevice::out_samples [private]

Definition at line 163 of file audiodevice.h.

Referenced by open_output().

Definition at line 164 of file audiodevice.h.

Referenced by get_irate(), and get_orate().

int AudioDevice::duplex_bits [private]

Definition at line 164 of file audiodevice.h.

Referenced by get_ibits(), and get_obits().

Definition at line 164 of file audiodevice.h.

Referenced by get_ichannels(), and get_ochannels().

Definition at line 164 of file audiodevice.h.

Definition at line 165 of file audiodevice.h.

Referenced by get_orealtime(), initialize(), and open_output().

Definition at line 165 of file audiodevice.h.

Referenced by get_irealtime(), get_orealtime(), and initialize().

int AudioDevice::r [private]

int AudioDevice::w [private]

int AudioDevice::d [private]

int AudioDevice::osamples [private]

Definition at line 170 of file audiodevice.h.

int AudioDevice::isamples [private]

Definition at line 170 of file audiodevice.h.

int AudioDevice::dsamples [private]

Definition at line 170 of file audiodevice.h.

Definition at line 172 of file audiodevice.h.

Referenced by close_all(), and initialize().

Definition at line 176 of file audiodevice.h.

Referenced by initialize(), and run_output().

Definition at line 177 of file audiodevice.h.

Referenced by AudioDevice(), run_output(), and ~AudioDevice().

Definition at line 178 of file audiodevice.h.

Referenced by AudioDevice(), run_output(), wait_for_startup(), and ~AudioDevice().

int AudioDevice::duplex_init [private]

Definition at line 180 of file audiodevice.h.

Referenced by close_all(), initialize(), open_input(), open_output(), and run_output().

int AudioDevice::rec_dither [private]

Definition at line 182 of file audiodevice.h.

Referenced by close_all(), and initialize().

int AudioDevice::play_dither [private]

Definition at line 184 of file audiodevice.h.

Referenced by arm_buffer(), close_all(), initialize(), reset_output(), and set_play_dither().

int AudioDevice::sharing [private]

Definition at line 185 of file audiodevice.h.

Referenced by close_all(), and initialize().

int AudioDevice::buffer_size[TOTAL_BUFFERS] [private]

Definition at line 188 of file audiodevice.h.

Referenced by arm_buffer(), initialize(), read_buffer(), reset_output(), run_input(), and run_output().

int AudioDevice::last_buffer[TOTAL_BUFFERS] [private]

Definition at line 189 of file audiodevice.h.

Referenced by initialize(), reset_output(), run_output(), and set_last_buffer().

char* AudioDevice::output_buffer[TOTAL_BUFFERS] [private]

Definition at line 191 of file audiodevice.h.

Referenced by arm_buffer(), initialize(), reset_output(), and run_output().

char* AudioDevice::input_buffer[TOTAL_BUFFERS] [private]

Definition at line 192 of file audiodevice.h.

Referenced by close_all(), initialize(), read_buffer(), run_input(), and start_recording().

Sema* AudioDevice::play_lock[TOTAL_BUFFERS] [private]

Sema* AudioDevice::arm_lock[TOTAL_BUFFERS] [private]

Definition at line 195 of file audiodevice.h.

Referenced by AudioDevice(), current_position(), run_output(), and ~AudioDevice().

Definition at line 197 of file audiodevice.h.

Referenced by close_all(), initialize(), read_buffer(), and run_input().

Definition at line 198 of file audiodevice.h.

Referenced by AudioDevice(), read_buffer(), run_input(), and ~AudioDevice().

Definition at line 199 of file audiodevice.h.

Referenced by AudioDevice(), read_buffer(), run_input(), and ~AudioDevice().

Definition at line 200 of file audiodevice.h.

Referenced by initialize(), reset_output(), set_last_buffer(), and write_buffer().

Definition at line 203 of file audiodevice.h.

Referenced by current_position(), initialize(), reset_output(), and run_output().

Definition at line 205 of file audiodevice.h.

Referenced by close_all(), current_position(), initialize(), reset_output(), and run_output().

Definition at line 206 of file audiodevice.h.

Referenced by close_all(), initialize(), and reset_output().

Definition at line 207 of file audiodevice.h.

Referenced by current_position(), and get_device_buffer().

Definition at line 209 of file audiodevice.h.

Referenced by current_position(), initialize(), reset_output(), and start_playback().

Definition at line 214 of file audiodevice.h.

Referenced by close_all(), initialize(), read_buffer(), run_input(), and start_recording().

Definition at line 215 of file audiodevice.h.

int AudioDevice::interrupt [private]

int AudioDevice::driver [private]

Definition at line 218 of file audiodevice.h.

Referenced by Audio1394::open_input(), and Audio1394::open_output().

Definition at line 221 of file audiodevice.h.

Referenced by close_all(), get_lowlevel_in(), initialize(), interrupt_crash(), and open_input().

Definition at line 221 of file audiodevice.h.

Referenced by close_all(), get_lowlevel_out(), initialize(), and open_output().

Definition at line 221 of file audiodevice.h.

Referenced by close_all(), get_lowlevel_in(), get_lowlevel_out(), and initialize().

Definition at line 226 of file audiodevice.h.

Referenced by AudioDevice(), Audio1394::open_input(), and ~AudioDevice().

Definition at line 229 of file audiodevice.h.

Referenced by read_buffer(), run_input(), run_output(), and start_recording().

Definition at line 230 of file audiodevice.h.

Referenced by run_output().

Definition at line 231 of file audiodevice.h.

Referenced by current_position(), initialize(), and read_buffer().

Definition at line 232 of file audiodevice.h.

Referenced by AudioDVB::close_all(), and AudioDVB::open_input().


The documentation for this class was generated from the following files:

Generated on Mon Apr 28 14:11:12 2008 for Cinelerra by  doxygen 1.5.5