## BtMachine

BtMachine — base class for signal processing machines

## Synopsis

    #include <libbtcore/core.h>

                        BtMachine;
    enum                BtMachineState;
    gboolean            bt_machine_enable_input_pre_level   (BtMachine * const self);
    gboolean            bt_machine_enable_input_post_level  (BtMachine * const self);
    gboolean            bt_machine_enable_output_pre_level  (BtMachine * const self);
    gboolean            bt_machine_enable_output_post_level (BtMachine * const self);
    gboolean            bt_machine_enable_input_gain        (BtMachine * const self);
    gboolean            bt_machine_enable_output_gain       (BtMachine * const self);
    gboolean            bt_machine_activate_adder           (BtMachine * const self);
    gboolean            bt_machine_has_active_adder         (const BtMachine * const self);
    gboolean            bt_machine_activate_spreader        (BtMachine * const self);
    gboolean            bt_machine_has_active_spreader      (const BtMachine * const self);
    void                bt_machine_renegotiate_adder_format (const BtMachine * const self);
    void                bt_machine_add_pattern              (const BtMachine *self,
                                                             const BtPattern *pattern);
    void                bt_machine_remove_pattern           (const BtMachine *self,
                                                             const BtPattern *pattern);
    BtPattern *         bt_machine_get_pattern_by_id        (const BtMachine * const self,
                                                             const gchar * const id);
    BtPattern *         bt_machine_get_pattern_by_index     (const BtMachine * const self,
                                                             const gulong index);
    gchar *             bt_machine_get_unique_pattern_name  (const BtMachine * const self);
    gboolean            bt_machine_has_patterns             (const BtMachine * const self);
    gboolean            bt_machine_is_polyphonic            (const BtMachine * const self);
    gboolean            bt_machine_is_global_param_trigger  (const BtMachine * const self,
                                                             const gulong index);
    gboolean            bt_machine_is_voice_param_trigger   (const BtMachine * const self,
                                                             const gulong index);
    gboolean            bt_machine_is_global_param_no_value (const BtMachine * const self,
                                                             const gulong index,
                                                             GValue * const value);
    gboolean            bt_machine_is_voice_param_no_value  (const BtMachine *const self,
                                                             const gulong index,
                                                             GValue * const value);
    glong               bt_machine_get_global_wave_param_index
                                                            (const BtMachine * const self);
    glong               bt_machine_get_voice_wave_param_index
                                                            (const BtMachine * const self);
    void                bt_machine_set_global_param_default (const BtMachine * const self,
                                                             const gulong index);
    void                bt_machine_set_voice_param_default  (const BtMachine * const self,
                                                             const gulong voice,
                                                             const gulong index);
    void                bt_machine_set_param_defaults       (const BtMachine *const self);
    glong               bt_machine_get_global_param_index   (const BtMachine * const self,
                                                             const gchar * const name,
                                                             GError **error);
    glong               bt_machine_get_voice_param_index    (const BtMachine * const self,
                                                             const gchar * const name,
                                                             GError **error);
    GParamSpec *        bt_machine_get_global_param_spec    (const BtMachine * const self,
                                                             const gulong index);
    GParamSpec *        bt_machine_get_voice_param_spec     (const BtMachine * const self,
                                                             const gulong index);
    GType               bt_machine_get_global_param_type    (const BtMachine * const self,
                                                             const gulong index);
    GType               bt_machine_get_voice_param_type     (const BtMachine * const self,
                                                             const gulong index);
    void                bt_machine_set_global_param_value   (const BtMachine * const self,
                                                             const gulong index,
                                                             GValue * const event);
    void                bt_machine_set_voice_param_value    (const BtMachine * const self,
                                                             const gulong voice,
                                                             const gulong index,
                                                             GValue * const event);
    const gchar *       bt_machine_get_global_param_name    (const BtMachine * const self,
                                                             const gulong index);
    const gchar *       bt_machine_get_voice_param_name     (const BtMachine * const self,
                                                             const gulong index);
    void                bt_machine_get_global_param_details (const BtMachine * const self,
                                                             const gulong index,
                                                             GParamSpec **pspec,
                                                             GValue **min_val,
                                                             GValue **max_val);
    void                bt_machine_get_voice_param_details  (const BtMachine * const self,
                                                             const gulong index,
                                                             GParamSpec **pspec,
                                                             GValue **min_val,
                                                             GValue **max_val);
    gchar *             bt_machine_describe_global_param_value
                                                            (const BtMachine * const self,
                                                             const gulong index,
                                                             GValue * const event);
    gchar *             bt_machine_describe_voice_param_value
                                                            (const BtMachine * const self,
                                                             const gulong index,
                                                             GValue * const event);
    void                bt_machine_global_controller_change_value
                                                            (const BtMachine * const self,
                                                             const gulong param,
                                                             const GstClockTime timestamp,
                                                             GValue *value);
    void                bt_machine_voice_controller_change_value
                                                            (const BtMachine * const self,
                                                             const gulong voice,
                                                             const gulong param,
                                                             const GstClockTime timestamp,
                                                             GValue *value);
    void                bt_machine_bind_parameter_control   (const BtMachine * const self,
                                                             GstObject *object,
                                                             const gchar *property_name,
                                                             BtIcControl *control);
    void                bt_machine_unbind_parameter_control (const BtMachine * const self,
                                                             GstObject *object,
                                                             const char *property_name);
    void                bt_machine_unbind_parameter_controls
                                                            (const BtMachine * const self);
    void                bt_machine_randomize_parameters     (const BtMachine * const self);
    void                bt_machine_reset_parameters         (const BtMachine * const self);

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstBin
                         +----BtMachine
                               +----BtProcessorMachine
                               +----BtSinkMachine
                               +----BtSourceMachine

## Implemented Interfaces

BtMachine implements GstChildProxy.

## Properties

      "construction-error"       gpointer              : Read / Write / Construct Only
      "global-params"            gulong                : Read / Write
      "id"                       gchar*                : Read / Write / Construct
      "input-gain"               GstElement*           : Read
      "input-post-level"         GstElement*           : Read
      "input-pre-level"          GstElement*           : Read
      "machine"                  GstElement*           : Read
      "output-gain"              GstElement*           : Read
      "output-post-level"        GstElement*           : Read
      "output-pre-level"         GstElement*           : Read
      "patterns"                 gpointer              : Read
      "plugin-name"              gchar*                : Read / Write / Construct
      "properties"               gpointer              : Read
      "song"                     BtSong*               : Read / Write / Construct Only
      "state"                    BtMachineState        : Read / Write
      "voice-params"             gulong                : Read / Write
      "voices"                   gulong                : Read / Write / Construct

## Signals

      "pattern-added"                                  : Run Last / No Recursion / No Hooks
      "pattern-removed"                                : Run Last / No Recursion / No Hooks

## Description

The machine class cares about inserting additional low-level elemnts to do signal conversion etc.. Further it provides general facillities like input/output level monitoring.

A machine can have several GstElements:

adder: | mixes all incomming signals
input volume: | gain for incomming signals
input pre/post-gain level: | level meter for incomming 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.

## Details

### BtMachine

    typedef struct _BtMachine BtMachine;

Base object for a virtual piece of hardware (generator, effect, ...).

### enum BtMachineState

    typedef enum {
      BT_MACHINE_STATE_NORMAL=0,
      BT_MACHINE_STATE_MUTE,
      BT_MACHINE_STATE_SOLO,
      BT_MACHINE_STATE_BYPASS,
      BT_MACHINE_STATE_COUNT
    } BtMachineState;

A machine is always in one of the 4 states. Use the "state" property of the BtMachine to change or query the current state.

`BT_MACHINE_STATE_NORMAL` | just working
`BT_MACHINE_STATE_MUTE` | be quiet
`BT_MACHINE_STATE_SOLO` | be the only one playing
`BT_MACHINE_STATE_BYPASS` | be uneffective (pass through)
`BT_MACHINE_STATE_COUNT` |

### bt_machine_enable_input_pre_level ()

    gboolean            bt_machine_enable_input_pre_level   (BtMachine * const self);

Creates the pre-gain input-level analyser of the machine and activates it.

`self` : | the machine to enable the pre-gain input-level analyser in
Returns : | `TRUE` for success, `FALSE` otherwise

### bt_machine_enable_input_post_level ()

    gboolean            bt_machine_enable_input_post_level  (BtMachine * const self);

Creates the post-gain input-level analyser of the machine and activates it.

`self` : | the machine to enable the post-gain input-level analyser in
Returns : | `TRUE` for success, `FALSE` otherwise

### bt_machine_enable_output_pre_level ()

    gboolean            bt_machine_enable_output_pre_level  (BtMachine * const self);

Creates the pre-gain output-level analyser of the machine and activates it.

`self` : | the machine to enable the pre-gain output-level analyser in
Returns : | `TRUE` for success, `FALSE` otherwise

### bt_machine_enable_output_post_level ()

    gboolean            bt_machine_enable_output_post_level (BtMachine * const self);

Creates the post-gain output-level analyser of the machine and activates it.

`self` : | the machine to enable the post-gain output-level analyser in
Returns : | `TRUE` for success, `FALSE` otherwise

### bt_machine_enable_input_gain ()

    gboolean            bt_machine_enable_input_gain        (BtMachine * const self);

Creates the input-gain element of the machine and activates it.

`self` : | the machine to enable the input-gain element in
Returns : | `TRUE` for success, `FALSE` otherwise

### bt_machine_enable_output_gain ()

    gboolean            bt_machine_enable_output_gain       (BtMachine * const self);

Creates the output-gain element of the machine and activates it.

`self` : | the machine to enable the output-gain element in
Returns : | `TRUE` for success, `FALSE` otherwise

### bt_machine_activate_adder ()

    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.

`self` : | the machine to activate the adder in
Returns : | `TRUE` for success

### bt_machine_has_active_adder ()

    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.

`self` : | the machine to check
Returns : | `TRUE` for success

### bt_machine_activate_spreader ()

    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.

`self` : | the machine to activate the spreader in
Returns : | `TRUE` for success

### bt_machine_has_active_spreader ()

    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.

`self` : | the machine to check
Returns : | `TRUE` for success

### bt_machine_renegotiate_adder_format ()

    void                bt_machine_renegotiate_adder_format (const BtMachine * const self);

Analyze the format on all machines linking to this one and determine a common format for mixing.

`self` : | the machine

### bt_machine_add_pattern ()

    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()`.

`self` : | the machine to add the pattern to
`pattern` : | the new pattern instance

### bt_machine_remove_pattern ()

    void                bt_machine_remove_pattern           (const BtMachine *self,
                                                             const BtPattern *pattern);

Remove the given pattern from the machine.

`self` : | the machine to remove the pattern from
`pattern` : | the existing pattern instance

### bt_machine_get_pattern_by_id ()

    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.

`self` : | the machine to search for the pattern
`id` : | the identifier of the pattern
Returns : | BtPattern instance or `NULL` if not found

### bt_machine_get_pattern_by_index ()

    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.

`self` : | the machine to search for the pattern
`index` : | the index of the pattern in the machines pattern list
Returns : | BtPattern instance or `NULL` if not found

### bt_machine_get_unique_pattern_name ()

    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.

`self` : | the machine for which the name should be unique
Returns : | the newly allocated unique name

### bt_machine_has_patterns ()

    gboolean            bt_machine_has_patterns             (const BtMachine * const self);

Check if the machine has BtPattern entries appart from the standart private ones.

`self` : | the machine for which to check the patterns
Returns : | `TRUE` if it has patterns

### bt_machine_is_polyphonic ()

    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.

`self` : | the machine to check
Returns : | `TRUE` for polyphic machines, `FALSE` for monophonic ones

### bt_machine_is_global_param_trigger ()

    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).

`self` : | the machine to check params from
`index` : | the offset in the list of global params
Returns : | `TRUE` if it is a trigger

### bt_machine_is_voice_param_trigger ()

    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).

`self` : | the machine to check params from
`index` : | the offset in the list of voice params
Returns : | `TRUE` if it is a trigger

### bt_machine_is_global_param_no_value ()

    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

`self` : | the machine to check params from
`index` : | the offset in the list of global params
`value` : | the value to compare against the no-value
Returns : | `TRUE` if it is the no-value

### bt_machine_is_voice_param_no_value ()

    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

`self` : | the machine to check params from
`index` : | the offset in the list of voice params
`value` : | the value to compare against the no-value
Returns : | `TRUE` if it is the no-value

### bt_machine_get_global_wave_param_index ()

    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.

`self` : | the machine to lookup the param from
Returns : | the index of the wave-table parameter or -1 if none.

### bt_machine_get_voice_wave_param_index ()

    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.

`self` : | the machine to lookup the param from
Returns : | the index of the wave-table parameter or -1 if none.

### bt_machine_set_global_param_default ()

    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.

`self` : | the machine
`index` : | the offset in the list of global params

### bt_machine_set_voice_param_default ()

    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.

`self` : | the machine
`voice` : | the voice number
`index` : | the offset in the list of global params

### bt_machine_set_param_defaults ()

    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).

`self` : | the machine

### bt_machine_get_global_param_index ()

    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.

`self` : | the machine to search for the global param
`name` : | the name of the global param
`error` : | the location of an error instance to fill with a message, if an error occures
Returns : | the index or sets error if it is not found and returns -1.

### bt_machine_get_voice_param_index ()

    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.

`self` : | the machine to search for the voice param
`name` : | the name of the voice param
`error` : | the location of an error instance to fill with a message, if an error occures
Returns : | the index or sets error if it is not found and returns -1.

### bt_machine_get_global_param_spec ()

    GParamSpec *        bt_machine_get_global_param_spec    (const BtMachine * const self,
                                                             const gulong index);

Retrieves the parameter specification for the global param

`self` : | the machine to search for the global param
`index` : | the offset in the list of global params
Returns : | the GParamSpec for the requested global param

### bt_machine_get_voice_param_spec ()

    GParamSpec *        bt_machine_get_voice_param_spec     (const BtMachine * const self,
                                                             const gulong index);

Retrieves the parameter specification for the voice param

`self` : | the machine to search for the voice param
`index` : | the offset in the list of voice params
Returns : | the GParamSpec for the requested voice param

### bt_machine_get_global_param_type ()

    GType               bt_machine_get_global_param_type    (const BtMachine * const self,
                                                             const gulong index);

Retrieves the GType of a global param

`self` : | the machine to search for the global param type
`index` : | the offset in the list of global params
Returns : | the requested GType

### bt_machine_get_voice_param_type ()

    GType               bt_machine_get_voice_param_type     (const BtMachine * const self,
                                                             const gulong index);

Retrieves the GType of a voice param

`self` : | the machine to search for the voice param type
`index` : | the offset in the list of voice params
Returns : | the requested GType

### bt_machine_set_global_param_value ()

    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.

`self` : | the machine to set the global param value
`index` : | the offset in the list of global params
`event` : | the new value

### bt_machine_set_voice_param_value ()

    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.

`self` : | the machine to set the voice param value
`voice` : | the voice to change
`index` : | the offset in the list of voice params
`event` : | the new value

### bt_machine_get_global_param_name ()

    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.

`self` : | the machine to get the param name from
`index` : | the offset in the list of global params
Returns : | the requested name

### bt_machine_get_voice_param_name ()

    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.

`self` : | the machine to get the param name from
`index` : | the offset in the list of voice params
Returns : | the requested name

### bt_machine_get_global_param_details ()

    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.

`self` : | the machine to search for the global param details
`index` : | the offset in the list of global params
`pspec` : | place for the param spec
`min_val` : | place to hold new GValue with minimum
`max_val` : | place to hold new GValue with maximum

### bt_machine_get_voice_param_details ()

    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.

`self` : | the machine to search for the voice param details
`index` : | the offset in the list of voice params
`pspec` : | place for the param spec
`min_val` : | place to hold new GValue with minimum
`max_val` : | place to hold new GValue with maximum

### bt_machine_describe_global_param_value ()

    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`.

`self` : | the machine to get a param description from
`index` : | the offset in the list of global params
`event` : | the value to describe
Returns : | the description as newly allocated string

### bt_machine_describe_voice_param_value ()

    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`.

`self` : | the machine to get a param description from
`index` : | the offset in the list of voice params
`event` : | the value to describe
Returns : | the description as newly allocated string

### bt_machine_global_controller_change_value ()

    void                bt_machine_global_controller_change_value
                                                            (const BtMachine * const self,
                                                             const gulong param,
                                                             const GstClockTime timestamp,
                                                             GValue *value);

Depending on wheter 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.

`self` : | the machine to change the param for
`param` : | the global parameter index
`timestamp` : | the time stamp of the change
`value` : | the new value or `NULL` to unset a previous one

### bt_machine_voice_controller_change_value ()

    void                bt_machine_voice_controller_change_value
                                                            (const BtMachine * const self,
                                                             const gulong voice,
                                                             const gulong param,
                                                             const GstClockTime timestamp,
                                                             GValue *value);

Depending on wheter 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.

`self` : | the machine to change the param for
`voice` : | the voice number
`param` : | the voice parameter index
`timestamp` : | the time stamp of the change
`value` : | the new value or `NULL` to unset a previous one

### bt_machine_bind_parameter_control ()

    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.

`self` : | machine
`object` : | child object (global or voice child)
`property_name` : | name of the parameter
`control` : | interaction control object

### bt_machine_unbind_parameter_control ()

    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.

`self` : | machine
`object` : | child object (global or voice child)
`property_name` : | name of the parameter

### bt_machine_unbind_parameter_controls ()

    void                bt_machine_unbind_parameter_controls
                                                            (const BtMachine * const self);

Disconnect all interaction controls.

`self` : | machine

### bt_machine_randomize_parameters ()

    void                bt_machine_randomize_parameters     (const BtMachine * const self);

Randomizes machine parameters.

`self` : | machine

### bt_machine_reset_parameters ()

    void                bt_machine_reset_parameters         (const BtMachine * const self);

Resets machine parameters back to defaults.

`self` : | machine

## Property Details

### The `"construction-error"` property

      "construction-error"       gpointer              : Read / Write / Construct Only

signal failed instance creation.

### The `"global-params"` property

      "global-params"            gulong                : Read / Write

number of params for the machine.

### The `"id"` property

      "id"                       gchar*                : Read / Write / Construct

machine identifier.

Default value: "unamed machine"

### The `"input-gain"` property

      "input-gain"               GstElement*           : Read

the input-gain element, if any.

### The `"input-post-level"` property

      "input-post-level"         GstElement*           : Read

the post-gain input-level element, if any.

### The `"input-pre-level"` property

      "input-pre-level"          GstElement*           : Read

the pre-gain input-level element, if any.

### The `"machine"` property

      "machine"                  GstElement*           : Read

the machine element, if any.

### The `"output-gain"` property

      "output-gain"              GstElement*           : Read

the output-gain element, if any.

### The `"output-post-level"` property

      "output-post-level"        GstElement*           : Read

the post-gain output-level element, if any.

### The `"output-pre-level"` property

      "output-pre-level"         GstElement*           : Read

the pre-gain output-level element, if any.

### The `"patterns"` property

      "patterns"                 gpointer              : Read

a copy of the list of patterns.

### The `"plugin-name"` property

      "plugin-name"              gchar*                : Read / Write / Construct

the name of the gst plugin for the machine.

Default value: "unamed machine"

### The `"properties"` property

      "properties"               gpointer              : Read

list of machine properties.

### The `"song"` property

      "song"                     BtSong*               : Read / Write / Construct Only

song object, the machine belongs to.

### The `"state"` property

      "state"                    BtMachineState        : Read / Write

the current state of this machine.

Default value: BT_MACHINE_STATE_NORMAL

### The `"voice-params"` property

      "voice-params"             gulong                : Read / Write

number of params for each machine voice.

### The `"voices"` property

      "voices"                   gulong                : Read / Write / Construct

number of voices in the machine.

## Signal Details

### The `"pattern-added"` signal

    void                user_function                      (BtMachine *self,
                                                            BtPattern *pattern,
                                                            gpointer   user_data)      : Run Last / No Recursion / No Hooks

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.

### The `"pattern-removed"` signal

    void                user_function                      (BtMachine *self,
                                                            BtPattern *pattern,
                                                            gpointer   user_data)      : Run Last / No Recursion / No Hooks

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.