Top | ![]() |
![]() |
![]() |
![]() |
GstElement * | adder-convert | Read |
gpointer | construction-error | Read / Write / Construct Only |
gulong | global-params | Read / Write |
gchar * | id | Read / Write / Construct |
GstElement * | input-gain | Read |
GstElement * | input-post-level | Read |
GstElement * | input-pre-level | Read |
GstElement * | machine | Read |
GstElement * | output-gain | Read |
GstElement * | output-post-level | Read |
GstElement * | output-pre-level | Read |
gpointer | patterns | Read |
gchar * | plugin-name | Read / Write / Construct |
gpointer | properties | Read |
BtSong * | song | Read / Write / Construct Only |
BtMachineState | state | Read / Write |
gulong | voice-params | Read / Write |
gulong | voices | Read / Write / Construct |
GObject ╰── GstObject ╰── GstElement ╰── GstBin ╰── BtMachine ├── BtProcessorMachine ├── BtSinkMachine ╰── BtSourceMachine
Machines are pieces in a BtSong that generate, process or play media.
The machine class takes care of inserting additional low-level elemnts to do signal conversion etc.. Further it provides general facillities like input/output level monitoring. The resulting machine instance is a box containing several processing elements.
A machine can have several GstElements:
adder: |
mixes all incoming signals |
input volume: |
gain for incoming signals |
input pre/post-gain level: |
level meter for incoming signal |
machine: |
the real machine |
output volume: |
gain for outgoing signal |
output pre/post-gain level: |
level meter for outgoing signal |
spreader: |
distibutes signal to outgoing connections |
The adder and spreader elements are activated depending on element type. The volume controls and level meters are activated as requested via the API. It is recommended to only activate them, when needed. The instances are cached after deactivation (so that they can be easily reactivated) and destroyed with the BtMachine object.
Furthermore the machine handles a list of BtPattern instances. These contain event patterns that form a BtSequence.
gboolean
bt_machine_activate_adder (BtMachine * const self
);
Machines use an adder to allow multiple incoming wires. This method is used by the BtWire class to activate the adder when needed.
gboolean
bt_machine_activate_spreader (BtMachine * const self
);
Machines use a spreader to allow multiple outgoing wires. This method is used by the BtWire class to activate the spreader when needed.
void bt_machine_add_pattern (const BtMachine *self
,const BtPattern *pattern
);
Add the supplied pattern to the machine. This is automatically done by
bt_pattern_new()
.
void bt_machine_bind_parameter_control (const BtMachine * const self
,GstObject *object
,const gchar *property_name
,BtIcControl *control
);
Connect the interaction control object to the give parameter. Changes of the control-value are mapped into a change of the parameter.
gchar * bt_machine_describe_global_param_value (const BtMachine * const self
,const gulong index
,GValue * const event
);
Described a param value in human readable form. The type of the given value
must match the type of the paramspec of the param referenced by index
.
gchar * bt_machine_describe_voice_param_value (const BtMachine * const self
,const gulong index
,GValue * const event
);
Described a param value in human readable form. The type of the given value
must match the type of the paramspec of the param referenced by index
.
gboolean
bt_machine_enable_input_gain (BtMachine * const self
);
Creates the input-gain element of the machine and activates it.
gboolean
bt_machine_enable_input_post_level (BtMachine * const self
);
Creates the post-gain input-level analyser of the machine and activates it.
gboolean
bt_machine_enable_input_pre_level (BtMachine * const self
);
Creates the pre-gain input-level analyser of the machine and activates it.
gboolean
bt_machine_enable_output_gain (BtMachine * const self
);
Creates the output-gain element of the machine and activates it.
gboolean
bt_machine_enable_output_post_level (BtMachine * const self
);
Creates the post-gain output-level analyser of the machine and activates it.
gboolean
bt_machine_enable_output_pre_level (BtMachine * const self
);
Creates the pre-gain output-level analyser of the machine and activates it.
void bt_machine_get_global_param_details (const BtMachine * const self
,const gulong index
,GParamSpec **pspec
,GValue **min_val
,GValue **max_val
);
Retrieves the details of a global param. Any detail can be NULL
if its not
wanted.
glong bt_machine_get_global_param_index (const BtMachine * const self
,const gchar * const name
,GError **error
);
Searches the list of registered param of a machine for a global param of the given name and returns the index if found.
const gchar * bt_machine_get_global_param_name (const BtMachine * const self
,const gulong index
);
Gets the global param name. Do not modify returned content.
GValue * bt_machine_get_global_param_no_value (const BtMachine * const self
,const gulong index
);
Get the neutral value for the machines parameter.
Since 0.6
GParamSpec * bt_machine_get_global_param_spec (const BtMachine * const self
,const gulong index
);
Retrieves the parameter specification for the global param
GType bt_machine_get_global_param_type (const BtMachine * const self
,const gulong index
);
Retrieves the GType of a global param
glong
bt_machine_get_global_wave_param_index
(const BtMachine * const self
);
Searches for the wave-table index parameter (if any). This parameter should refer to a wavetable index that should be used to play a note.
BtPattern * bt_machine_get_pattern_by_id (const BtMachine * const self
,const gchar * const id
);
Search the machine for a pattern by the supplied id.
The pattern must have been added previously to this setup with bt_machine_add_pattern()
.
Unref the pattern, when done with it.
BtPattern * bt_machine_get_pattern_by_index (const BtMachine * const self
,const gulong index
);
Fetches the pattern from the given position of the machines pattern list.
The pattern must have been added previously to this setup with bt_machine_add_pattern()
.
Unref the pattern, when done with it.
BtPattern * bt_machine_get_pattern_by_name (const BtMachine * const self
,const gchar * const name
);
Search the machine for a pattern by the supplied name.
The pattern must have been added previously to this setup with bt_machine_add_pattern()
.
Unref the pattern, when done with it.
gchar *
bt_machine_get_unique_pattern_name (const BtMachine * const self
);
The function generates a unique pattern name for this machine by eventually adding a number postfix. This method should be used when adding new patterns.
void bt_machine_get_voice_param_details (const BtMachine * const self
,const gulong index
,GParamSpec **pspec
,GValue **min_val
,GValue **max_val
);
Retrieves the details of a voice param. Any detail can be NULL
if its not
wanted.
glong bt_machine_get_voice_param_index (const BtMachine * const self
,const gchar * const name
,GError **error
);
Searches the list of registered param of a machine for a voice param of the given name and returns the index if found.
const gchar * bt_machine_get_voice_param_name (const BtMachine * const self
,const gulong index
);
Gets the voice param name. Do not modify returned content.
GValue * bt_machine_get_voice_param_no_value (const BtMachine * const self
,const gulong index
);
Get the neutral value for the machines parameter.
Since 0.6
GParamSpec * bt_machine_get_voice_param_spec (const BtMachine * const self
,const gulong index
);
Retrieves the parameter specification for the voice param
GType bt_machine_get_voice_param_type (const BtMachine * const self
,const gulong index
);
Retrieves the GType of a voice param
glong
bt_machine_get_voice_wave_param_index (const BtMachine * const self
);
Searches for the wave-table index parameter (if any). This parameter should refer to a wavetable index that should be used to play a note.
BtWire * bt_machine_get_wire_by_dst_machine (const BtMachine * const self
,const BtMachine * const dst
);
Searches for a wire in the wires originating from this machine that uses the given BtMachine instances as a target. Unref the wire, when done with it.
self |
the machine that is at src of a wire |
|
dst |
the machine that is at the dst end of the wire |
Since 0.6
void bt_machine_global_controller_change_value (const BtMachine * const self
,const gulong param
,const GstClockTime timestamp
,GValue *value
);
Depending on whether the given value is NULL, sets or unsets the controller
value for the specified param and at the given time.
If timestamp
is 0 and value
is NULL
it set a default value for the start
of the controller sequence, taken from the current value of the parameter.
gboolean
bt_machine_has_active_adder (const BtMachine * const self
);
Checks if the machine currently uses an adder. This method is used by the BtWire class to activate the adder when needed.
gboolean
bt_machine_has_active_spreader (const BtMachine * const self
);
Checks if the machine currently uses an spreader. This method is used by the BtWire class to activate the spreader when needed.
gboolean
bt_machine_has_patterns (const BtMachine * const self
);
Check if the machine has BtPattern entries appart from the standart private ones.
gboolean bt_machine_is_global_param_no_value (const BtMachine * const self
,const gulong index
,GValue * const value
);
Tests if the given value is the no-value of the global param
gboolean bt_machine_is_global_param_trigger (const BtMachine * const self
,const gulong index
);
Tests if the global param is a trigger param (like a key-note or a drum trigger).
gboolean
bt_machine_is_polyphonic (const BtMachine * const self
);
Tells if the machine can produce (multiple) voices. Monophonic machines have their (one) voice params as part of the global params.
gboolean bt_machine_is_voice_param_no_value (const BtMachine *const self
,const gulong index
,GValue * const value
);
Tests if the given value is the no-value of the voice param
gboolean bt_machine_is_voice_param_trigger (const BtMachine * const self
,const gulong index
);
Tests if the voice param is a trigger param (like a key-note or a drum trigger).
void
bt_machine_randomize_parameters (const BtMachine * const self
);
Randomizes machine parameters.
void bt_machine_remove_pattern (const BtMachine *self
,const BtPattern *pattern
);
Remove the given pattern from the machine.
void
bt_machine_reset_parameters (const BtMachine * const self
);
Resets machine parameters back to defaults.
void bt_machine_set_global_param_default (const BtMachine * const self
,const gulong index
);
Set a default value that should be used before the first control-point.
void bt_machine_set_global_param_value (const BtMachine * const self
,const gulong index
,GValue * const event
);
Sets a the specified global param to the give data value.
void
bt_machine_set_param_defaults (const BtMachine *const self
);
Sets default values that should be used before the first control-point. Should be called, if all parameters are changed (like after switching presets).
void bt_machine_set_voice_param_default (const BtMachine * const self
,const gulong voice
,const gulong index
);
Set a default value that should be used before the first control-point.
void bt_machine_set_voice_param_value (const BtMachine * const self
,const gulong voice
,const gulong index
,GValue * const event
);
Sets a the specified voice param to the give data value.
void bt_machine_unbind_parameter_control (const BtMachine * const self
,GstObject *object
,const char *property_name
);
Disconnect the interaction control object from the give parameter.
void
bt_machine_unbind_parameter_controls (const BtMachine * const self
);
Disconnect all interaction controls.
void bt_machine_voice_controller_change_value (const BtMachine * const self
,const gulong voice
,const gulong param
,const GstClockTime timestamp
,GValue *value
);
Depending on whether the given value is NULL, sets or unsets the controller
value for the specified param and at the given time.
If timestamp
is 0 and value
is NULL
it set a default value for the start
of the controller sequence, taken from the current value of the parameter.
struct BtMachine { /*< read-only >*/ GList *src_wires; GList *dst_wires; };
Base object for a virtual piece of hardware (generator, effect, ...).
struct BtMachineClass { /* virtual methods for subclasses */ gboolean (*check_type)(const BtMachine * const machine, const gulong pad_src_ct, const gulong pad_sink_ct); };
Base class for machines.
A machine is always in one of the 4 states. Use the "state" property of the BtMachine to change or query the current state.
“adder-convert”
property “adder-convert” GstElement *
the after mixing format converter element, if any.
Flags: Read
“construction-error”
property “construction-error” gpointer
signal failed instance creation.
Flags: Read / Write / Construct Only
“global-params”
property “global-params” gulong
number of params for the machine.
Flags: Read / Write
“id”
property “id” gchar *
machine identifier.
Flags: Read / Write / Construct
Default value: "unamed machine"
“input-post-level”
property “input-post-level” GstElement *
the post-gain input-level element, if any.
Flags: Read
“input-pre-level”
property “input-pre-level” GstElement *
the pre-gain input-level element, if any.
Flags: Read
“output-post-level”
property “output-post-level” GstElement *
the post-gain output-level element, if any.
Flags: Read
“output-pre-level”
property “output-pre-level” GstElement *
the pre-gain output-level element, if any.
Flags: Read
“plugin-name”
property “plugin-name” gchar *
the name of the gst plugin for the machine.
Flags: Read / Write / Construct
Default value: "unamed machine"
“song”
property“song” BtSong *
song object, the machine belongs to.
Flags: Read / Write / Construct Only
“state”
property“state” BtMachineState
the current state of this machine.
Flags: Read / Write
Default value: BT_MACHINE_STATE_NORMAL
“voice-params”
property “voice-params” gulong
number of params for each machine voice.
Flags: Read / Write
“pattern-added”
signalvoid user_function (BtMachine *self, BtPattern *pattern, gpointer user_data)
A new pattern item has been added to the machine
self |
the machine object that emitted the signal |
|
pattern |
the new pattern |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Hooks
“pattern-removed”
signalvoid user_function (BtMachine *self, BtPattern *pattern, gpointer user_data)
A pattern item has been removed from the machine
self |
the machine object that emitted the signal |
|
pattern |
the old pattern |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Hooks