AmAudioFile Class Reference

AmAudio implementation for file access. More...

#include <AmAudio.h>

Inheritance diagram for AmAudioFile:

AmAudio

Public Types

 Read = 1
 Write = 2
enum  OpenMode { Read = 1, Write = 2 }

Public Member Functions

int open (const string &filename, OpenMode mode, bool is_tmp=false)
int fpopen (const string &filename, OpenMode mode, FILE *n_fp)
void rewind ()
void close ()
void on_close ()
FILE * getfp ()
OpenMode getMode ()
int getDataSize ()
string getMimeType ()
void setCloseOnDestroy (bool cod)

Data Fields

AmSharedVar< bool > loop

Protected Member Functions

int read (unsigned int user_ts, unsigned int size)
int write (unsigned int user_ts, unsigned int size)
AmAudioFileFormatfileName2Fmt (const string &name)

Protected Attributes

FILE * fp
long begin
amci_inoutfmt_t * iofmt
int open_mode
int data_size
bool on_close_done
bool close_on_exit

Detailed Description

AmAudio implementation for file access.


Member Enumeration Documentation

Open mode.


Member Function Documentation

void AmAudioFile::close (  )  [virtual]

Closes the file.

Reimplemented from AmAudio.

AmAudioFileFormat * AmAudioFile::fileName2Fmt ( const string &  name  )  [protected]

Returns:
a file format from file name. (ex: '1234.wav')

int AmAudioFile::getDataSize (  )  [inline]

Gets data size in the current file

FILE* AmAudioFile::getfp (  )  [inline]

be carefull with this one ;-)

string AmAudioFile::getMimeType (  ) 

Returns:
MIME type corresponding to the audio file.

void AmAudioFile::on_close (  ) 

Executes the handler's on_close.

int AmAudioFile::open ( const string &  filename,
OpenMode  mode,
bool  is_tmp = false 
)

Opens a file.

  • In read mode: sets input format.
  • In write mode:
    1. needs output format set.
    2. If file name already exists, the file will be overwritten.
Parameters:
filename Name of the file.
mode Open mode.
Returns:
0 if everything's OK
See also:
OpenMode

int AmAudioFile::read ( unsigned int  user_ts,
unsigned int  size 
) [protected, virtual]

See also:
AmAudio::read

Implements AmAudio.

void AmAudioFile::rewind (  ) 

Rewind the file.

int AmAudioFile::write ( unsigned int  user_ts,
unsigned int  size 
) [protected, virtual]

See also:
AmAudio::write

Implements AmAudio.


Field Documentation

int AmAudioFile::data_size [protected]

Size of datas having been read/written until now.

FILE* AmAudioFile::fp [protected]

Pointer to the file opened as last.

amci_inoutfmt_t* AmAudioFile::iofmt [protected]

Format of that file.

See also:
fp, open().

int AmAudioFile::open_mode [protected]

Open mode.


The documentation for this class was generated from the following files:
Generated on Thu Mar 8 00:12:45 2007 for Sems by  doxygen 1.4.7
Home |  Recent changes |  Search |  Glossary |  Sitemap |  Login