iso::synth::InputFile Class Reference

unit that reads audio from a sound file More...

#include <iso_synth_input_file.h>

Inherits iso::synth::InputUnit.

Inheritance diagram for iso::synth::InputFile:

Inheritance graph
[legend]
Collaboration diagram for iso::synth::InputFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InputFile (String pFileName) throw (SynthException)
 parameter based contructor
 InputFile (String pName, String pFileName) throw (SynthException)
 parameter based contructor
 InputFile (unsigned int pFrameCount, String pFileName) throw (SynthException)
 parameter based contructor
 InputFile (String pName, unsigned int pFrameCount, String pFileName) throw (SynthException)
 parameter based contructor
 InputFile (const data::Values &pValues) throw (SynthException)
 values based constructor
 ~InputFile () throw (SynthException)
 destructor
void play (bool pActive)
 trigger sound file playback or stop
void setLooping (bool pLooping)
 set soundfile looping property
void setPlayStartPosition (sample pPlayStartPosition)
 set play start position
void setPlayStopPosition (sample pPlayStopPosition)
 set play stop position
virtual void process (Buffer *pBuffer) throw (SynthException)
 processes buffer
virtual String info (bool pPropagate=false, bool pShowPorts=true) const
 obtain textual unit information

Static Public Attributes

static const String sClassName
 default name

Protected Member Functions

 InputFile ()
 default constructor
void init ()
 called by constructor

Protected Attributes

String mFileName
 sound file name;
SoundFilemSoundFile
 sound file
SoundFileInfo mSoundFileInfo
 information on sound file
bool mLooping
 true: sound file loops, false: sound file plays once
int mPlayStartPosition
 play start position in sound file
int mPlayStopPosition
 play stop position in sound file
int mCurrentPlayPosition
 current play position in sound file
bool mResetSoundFile
 whether the play position will be reset to the start position at the beginning of the next process call
BuffermRawBuffer
 raw sound data buffer
sample mRawStartFrame
 start frame position within raw sound file data
ControlPortmAmplitude
 amplitude control port
ControlPortmTranspose
 transpose control port

Static Protected Attributes

static unsigned int sUnitCount
 total number of units created so far

Detailed Description

unit that reads audio from a sound file

reads audio from a sound file

This class expands the input unit base class.
It reads audio data from an audio file and sends it through it's audio output port.
For the moment, the following audio file formats are supported:
.wav .aiff/.aif .raw
It distinguishes between different output file formats based on the filename suffix.
The number of audio channels output through the audio output port is equal to the number of audio channels in the audio file.
This number of channels must be larger than zero but can be arbitrarly high.

ControlPorts:
name: amplitude defaultValue: 1.0
name: transpose defaultValue: 1.0

SwitchPorts:
name: active channelCount: 1 defaultValue: 1.0 resizable: false function: setActive
name: play channelCount: 1 defaultValue: 1.0 resizable: false function: play
name: looping channelCount: 1 defaultValue: 0.0 resizable: false function: setLooping
name: playStart channelCount: 1 defaultValue: 0.0 resizable: false function: setPlayStartPosition
name: playEnd channelCount: 1 defaultValue: file duration (milisecs) resizable: false function: setPlayStopPosition


Created by Daniel Bisig on 6/27/06.


Constructor & Destructor Documentation

InputFile::InputFile ( String  pFileName  )  throw (SynthException)

parameter based contructor

Parameters:
pFileName sound file name

InputFile::InputFile ( String  pName,
String  pFileName 
) throw (SynthException)

parameter based contructor

Parameters:
pName unit name
pFileName sound file name

InputFile::InputFile ( unsigned int  pFrameCount,
String  pFileName 
) throw (SynthException)

parameter based contructor

Parameters:
pFrameCount number of frames
pFileName sound file name

InputFile::InputFile ( String  pName,
unsigned int  pFrameCount,
String  pFileName 
) throw (SynthException)

parameter based contructor

Parameters:
pName unit name
pFrameCount number of frames
pFileName sound file name

InputFile::InputFile ( const data::Values &  pValues  )  throw (SynthException)

values based constructor

Parameters:
pValues unit values
Exceptions:
SynthException failed to create unit
pValues structure & data types: 0: const String& : unit name 1: unsigned int : number of frames 2: const String& : file name

InputFile::~InputFile (  )  throw (SynthException)

destructor

InputFile::InputFile (  )  [protected]

default constructor


Member Function Documentation

void InputFile::play ( bool  pActive  ) 

trigger sound file playback or stop

Parameters:
pActive ( true: start playback, false: stop playback )

void InputFile::setLooping ( bool  pLooping  ) 

set soundfile looping property

Parameters:
pLooping ( true: sound file is looping, false: soundfile plays once )

void InputFile::setPlayStartPosition ( sample  pPlayStartPosition  ) 

set play start position

Parameters:
pPlayStartPosition ( play start position (in milisecs) )

void InputFile::setPlayStopPosition ( sample  pPlayStopPosition  ) 

set play stop position

Parameters:
pPlayStopPosition ( play stop position (in milisecs) )

void InputFile::process ( Buffer pBuffer  )  throw (SynthException) [virtual]

processes buffer

Parameters:
pBuffer buffer to process

Reimplemented from iso::synth::InputUnit.

String InputFile::info ( bool  pPropagate = false,
bool  pShowPorts = true 
) const [virtual]

obtain textual unit information

Parameters:
pPropagate if true, the unit calls the info methods of its input ports
pShowPorts print port information
Returns:
String containing unit information

Reimplemented from iso::synth::InputUnit.

void InputFile::init (  )  [protected]

called by constructor


Member Data Documentation

const String InputFile::sClassName [static]

default name

Reimplemented from iso::synth::InputUnit.

unsigned int InputFile::sUnitCount [static, protected]

total number of units created so far

Reimplemented from iso::synth::InputUnit.

String iso::synth::InputFile::mFileName [protected]

sound file name;

SoundFile* iso::synth::InputFile::mSoundFile [protected]

sound file

SoundFileInfo iso::synth::InputFile::mSoundFileInfo [protected]

information on sound file

bool iso::synth::InputFile::mLooping [protected]

true: sound file loops, false: sound file plays once

int iso::synth::InputFile::mPlayStartPosition [protected]

play start position in sound file

int iso::synth::InputFile::mPlayStopPosition [protected]

play stop position in sound file

int iso::synth::InputFile::mCurrentPlayPosition [protected]

current play position in sound file

bool iso::synth::InputFile::mResetSoundFile [protected]

whether the play position will be reset to the start position at the beginning of the next process call

Buffer* iso::synth::InputFile::mRawBuffer [protected]

raw sound data buffer

sample iso::synth::InputFile::mRawStartFrame [protected]

start frame position within raw sound file data

ControlPort* iso::synth::InputFile::mAmplitude [protected]

amplitude control port

ControlPort* iso::synth::InputFile::mTranspose [protected]

transpose control port


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:18:46 2011 for synth by  doxygen 1.5.1