#include <iso_synth_input_file.h>
Inherits iso::synth::InputUnit.
Inheritance diagram for iso::synth::InputFile:
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; | |
SoundFile * | mSoundFile |
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 | |
Buffer * | mRawBuffer |
raw sound data buffer | |
sample | mRawStartFrame |
start frame position within raw sound file data | |
ControlPort * | mAmplitude |
amplitude control port | |
ControlPort * | mTranspose |
transpose control port | |
Static Protected Attributes | |
static unsigned int | sUnitCount |
total number of units created so far |
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.
InputFile::InputFile | ( | String | pFileName | ) | throw (SynthException) |
parameter based contructor
pFileName | sound file name |
InputFile::InputFile | ( | String | pName, | |
String | pFileName | |||
) | throw (SynthException) |
parameter based contructor
pName | unit name | |
pFileName | sound file name |
InputFile::InputFile | ( | unsigned int | pFrameCount, | |
String | pFileName | |||
) | throw (SynthException) |
parameter based contructor
pFrameCount | number of frames | |
pFileName | sound file name |
InputFile::InputFile | ( | String | pName, | |
unsigned int | pFrameCount, | |||
String | pFileName | |||
) | throw (SynthException) |
parameter based contructor
pName | unit name | |
pFrameCount | number of frames | |
pFileName | sound file name |
InputFile::InputFile | ( | const data::Values & | pValues | ) | throw (SynthException) |
values based constructor
pValues | unit values |
SynthException | failed to create unit |
InputFile::~InputFile | ( | ) | throw (SynthException) |
destructor
InputFile::InputFile | ( | ) | [protected] |
default constructor
void InputFile::play | ( | bool | pActive | ) |
trigger sound file playback or stop
pActive | ( true: start playback, false: stop playback ) |
void InputFile::setLooping | ( | bool | pLooping | ) |
set soundfile looping property
pLooping | ( true: sound file is looping, false: soundfile plays once ) |
void InputFile::setPlayStartPosition | ( | sample | pPlayStartPosition | ) |
set play start position
pPlayStartPosition | ( play start position (in milisecs) ) |
void InputFile::setPlayStopPosition | ( | sample | pPlayStopPosition | ) |
set play stop position
pPlayStopPosition | ( play stop position (in milisecs) ) |
void InputFile::process | ( | Buffer * | pBuffer | ) | throw (SynthException) [virtual] |
String InputFile::info | ( | bool | pPropagate = false , |
|
bool | pShowPorts = true | |||
) | const [virtual] |
obtain textual unit information
pPropagate | if true, the unit calls the info methods of its input ports | |
pShowPorts | print port information |
Reimplemented from iso::synth::InputUnit.
void InputFile::init | ( | ) | [protected] |
called by constructor
const String InputFile::sClassName [static] |
unsigned int InputFile::sUnitCount [static, protected] |
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