Main Page | Namespace List | Class Hierarchy | Class List | Directories | Namespace Members | Class Members

RAWFILE Class Reference

Class for handling raw/headerless audio files. More...

Inheritance diagram for RAWFILE:

AUDIO_IO_BUFFERED AUDIO_IO DYNAMIC_OBJECT< string > ECA_AUDIO_FORMAT ECA_AUDIO_POSITION DYNAMIC_PARAMETERS< string > ECA_OBJECT ECA_SAMPLERATE_AWARE ECA_SAMPLERATE_AWARE List of all members.

Public Member Functions

 RAWFILE (const std::string &name="")
virtual RAWFILEclone (void) const
 Virtual method that clones the current object and returns a pointer to it.
virtual RAWFILEnew_expr (void) const
 Virtual method that creates a new object of current type.
virtual std::string name (void) const
 Object name used to identify the object type.
virtual std::string parameter_names (void) const
 A comma-separated list of parameters names.
virtual void open (void) throw (AUDIO_IO::SETUP_ERROR &)
 Opens the raw audio i/o device.
virtual void close (void)
 Closes audio object.
virtual long int read_samples (void *target_buffer, long int samples)
 Low-level routine for reading samples.
virtual void write_samples (void *target_buffer, long int samples)
 Low-level routine for writing samples.
virtual bool finished (void) const
 Whether all data has been processed? If opened in mode 'io_read', this means that end of stream has been reached.
virtual void seek_position (void)
virtual void set_parameter (int param, std::string value)
virtual std::string get_parameter (int param) const
 Get parameter value.

Detailed Description

Class for handling raw/headerless audio files.

Author:
Kai Vehmanen


Member Function Documentation

RAWFILE * RAWFILE::clone void   )  const [virtual]
 

Virtual method that clones the current object and returns a pointer to it.

This must be implemented by all subclasses!

Implements AUDIO_IO.

void RAWFILE::close void   )  [virtual]
 

Closes audio object.

After calling this routine, all resources (for instance files and devices) must be freed so that they can be used by other processes.

Precondition:
is_open() == true
Postcondition:
readable() != true

writable() != true

Reimplemented from AUDIO_IO.

bool RAWFILE::finished void   )  const [virtual]
 

Whether all data has been processed? If opened in mode 'io_read', this means that end of stream has been reached.

If opened in 'io_write' or 'io_readwrite' modes, finished status usually means that an error has occured (no space left, etc). After finished() has returned 'true', further calls to read_buffer() and/or write_buffer() won't process any data.

For output for which 'finite_length_stream()' is true, when 'finished()' returns true, that means an error has occured. Otherwise 'finished()' just tells that further attempts to do i/o will fail.

Implements AUDIO_IO.

string RAWFILE::get_parameter int  param  )  const [virtual]
 

Get parameter value.

Parameters:
param parameter id, require: param > 0

Reimplemented from AUDIO_IO.

virtual std::string RAWFILE::name void   )  const [inline, virtual]
 

Object name used to identify the object type.

In most cases, object name is same for all class instances. Must be implemented in all subclasses.

Implements ECA_OBJECT.

virtual RAWFILE* RAWFILE::new_expr void   )  const [inline, virtual]
 

Virtual method that creates a new object of current type.

This must be implemented by all subclasses!

Implements AUDIO_IO.

void RAWFILE::open void   )  throw (AUDIO_IO::SETUP_ERROR &) [virtual]
 

Opens the raw audio i/o device.

Note! Cases where label() matches either "stdin", "stdout" or "stderr" are handled as special cases.

Reimplemented from AUDIO_IO.

virtual std::string RAWFILE::parameter_names void   )  const [inline, virtual]
 

A comma-separated list of parameters names.

Derived classes must implement this.

Reimplemented from AUDIO_IO.

long int RAWFILE::read_samples void *  target_buffer,
long int  samples
[virtual]
 

Low-level routine for reading samples.

Number of read sample frames is returned. This must be implemented by all subclasses.

Implements AUDIO_IO_BUFFERED.

void RAWFILE::write_samples void *  target_buffer,
long int  samples
[virtual]
 

Low-level routine for writing samples.

This must be implemented by all subclasses.

Implements AUDIO_IO_BUFFERED.


The documentation for this class was generated from the following files:
Generated on Fri Apr 8 01:38:04 2005 for libecasound by  doxygen 1.4.1