Sonic Flow libsf Reference Guide
SF_Input_Terminal ();
Construct a "null" input terminal. The intention is that every input terminal is initialized after construction with the init_terminal () function. This is because in C++ an array of objects cannot be initialized sufficiently flexibly.
virtual ~SF_Input_Terminal ();
Destruct an input terminal.
void init_terminal (const char* name,
const SF_Block* host,
bool multiple_inputs,
SF_Frequency sample_rate = SF_DEFAULT_SAMPLE_RATE,
double relative_sample_rate = SF_DEFAULT_RELATIVE_SAMPLE_RATE);
Initialize the input terminal after construction. This function call is to be considered an "extension" to the default constructor of input terminals, since it MUST be called after constructing an input terminal. This version of init_terminal () doesn't include a default value, i.e. the input terminal initialized with this function will not have a default value.
void init_terminal (const char* name,
const SF_Block* host,
SF_Sample default_value,
bool multiple_inputs,
SF_Frequency sample_rate = SF_DEFAULT_SAMPLE_RATE,
double relative_sample_rate = SF_DEFAULT_RELATIVE_SAMPLE_RATE);
Initialize the input terminal after construction. This function call is to be considered an "extension" to the default constructor of input terminals, since it MUST be called after constructing an input terminal. This version of init_terminal () contains a default value argument, i.e. the input terminal initialized with this function WILL have a default value.
virtual void set_sample_rate (SF_Frequency sample_rate);
Set the sample rate (in hertz) of the incoming data to the input terminal. This will both initialize the sample rate and also set the sample rates of all output terminals on the block. The sample rates of the output terminals are calculated based on the relative sample rates of the terminals. After this function is finished, the block may have nonmatching sample rates in its input terminals.
virtual void set_relative_sample_rate (double relative_sample_rate);
Set the relative sample rate of this input terminal with respect to all the other input and output terminals. This will both initialize the relative sample rate and also set the sample rates of all output terminals on the block. The sample rates of the output terminals are calculated based on the actual sample rate of this terminal and the relative sample rates of the terminals. After this function is finished, the block may have nonmatching sample rates in its input terminals.
SF_Frame* get_first_source_frame ();
Fetch the first frame pointer from the source frame list and prepare to traverse the list. If there are no frames in the list, returns 0. There is hidden logic related to default values in here.
SF_Frame* get_next_source_frame ();
Fetch the next frame pointer from the source frame list. If there are no more frames in the list, returns 0. There is hidden logic related to default values in here.
void add_input (const SF_Frame* in);
This function is for the creation of wires. This function is called by SF_Output_Terminal::connect(), i.e. it is NOT part of the "public API".
void remove_input (const SF_Frame* in);
This function is for the destruction of wires. This function is called by SF_Output_Terminal::disconnect(), i.e. it is NOT part of the "public API".
inline int get_degree () const;
Return the number of connections to this input terminal.
inline bool has_default() const;
Return true if there is a default value for this input terminal. Note that the default value need not be in use necessarily.
SF_Sample get_default() const;
Returns the default value of the input terminal, if there is any. Throws an exception if there isn't.
Last modified: Thu Dec 10 14:07:50 1998
jarno.seppanen@cs.tut.fi
Audio Research Group