DiskIO Class Reference

handles all the read's and write's of AudioSources in it's private thread. More...

List of all members.

Public Slots

void seek ()
void start_io ()
void stop_io ()

Signals

void seekFinished ()
void readSourceBufferUnderRun ()
void writeSourceBufferOverRun ()

Public Member Functions

 DiskIO (Sheet *sheet)
void prepare_for_seek ()
void output_rate_changed (int rate)
void register_read_source (ReadSource *source)
void register_write_source (WriteSource *source)
void set_resample_quality (int quality)
void unregister_read_source (ReadSource *source)
void unregister_write_source (WriteSource *source)
trav_time_t get_cpu_time ()
int get_write_buffers_fill_status ()
int get_read_buffers_fill_status ()
int get_output_rate ()
int get_resample_quality ()
DecodeBuffer * get_resample_decode_buffer ()

Static Public Attributes

static const int writebuffertime = 5
static const int bufferdividefactor = 5

Friends

class DiskIOThread


Detailed Description

handles all the read's and write's of AudioSources in it's private thread.

Each Sheet class has it's own DiskIO instance. The DiskIO manages all the AudioSources related to a Sheet, and makes sure the RingBuffers from the AudioSources are processed in time. (It at least tries very hard)


Member Function Documentation

void DiskIO::prepare_for_seek (  ) 

Interupts any pending AudioSource's buffer processing, and returns from do_work(). Use this before calling seek() to shorten the seek process.

void DiskIO::register_read_source ( ReadSource source  ) 

Registers the ReadSource source. The source's RingBuffer will be initialized at this point.

Note: This function is thread save.

Parameters:
source The ReadSource to register

References AudioSource::get_channel_count(), and ReadSource::set_diskio().

void DiskIO::register_write_source ( WriteSource source  ) 

Registers the WriteSource source. The source's RingBuffer will be initialized at this point.

Note: This function is thread save.

Parameters:
source The WriteSource to register

References WriteSource::set_diskio().

void DiskIO::unregister_read_source ( ReadSource source  ) 

Unregisters the ReadSource from this DiskIO instance

Note: This function is Thread save.

Parameters:
source The ReadSource to be removed from the DiskIO instance.

trav_time_t DiskIO::get_cpu_time (  ) 

Returns:
Returns the CPU time consumed by the DiskIO work thread

References RingBuffer::read(), and RingBuffer::read_space().

int DiskIO::get_write_buffers_fill_status (  ) 

Get the status of the writebuffers.

Returns:
The status in procentual amount of the smallest remaining space in the writebuffers that could be used to write 'recording' data too.

References AudioDevice::get_sample_rate().

int DiskIO::get_read_buffers_fill_status (  ) 

Get the status of the readbuffers.

Returns:
The status is the procentual amount of the buffer which was most empty since the last call to this function

void DiskIO::seek (  )  [slot]

Seek's all the ReadSources readbuffers to the new position. Call prepare_seek() first, to interupt do_work() if it was running.

Parameters:
position The position to seek too

References Sheet::get_new_transport_location(), ReadSource::rb_seek_to_file_position(), and ReadSource::set_diskio().


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

Generated on Sun Mar 8 12:44:05 2009 for traverso by  doxygen 1.5.5