## BtWire BtWire — class for a connection of two BtMachines |

## Functions

BtParameterGroup * | bt_wire_get_param_group ()
BtWire * | bt_wire_new ()
gboolean | bt_wire_reconnect ()
gboolean | bt_wire_can_link ()

## Properties

gpointer | analyzers | Read / Write
gpointer | construction-error | Read / Write / Construct Only
BtMachine * | dst | Read / Write / Construct Only
GstElement * | gain | Read
gulong | num-params | Read / Write
GstElement * | pan | Read
gchar * | pretty-name | Read
gpointer | properties | Read
BtSong * | song | Read / Write / Construct Only
BtMachine * | src | Read / Write / Construct Only

## Types and Values

#define | BT_WIRE_MAX_NUM_PARAMS
struct | BtWire

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBin
                        ╰── BtWire

## Implemented Interfaces

BtWire implements GstChildProxy and BtPersistence.

## Includes

    #include <libbtcore/core.h>

## Description

Abstracts connection between two BtMachines. After creation, the elements are connected. In contrast to directly wiring GstElements this insert needed conversion elements automatically.

Furthermore each wire has a volume and if possible panorama/balance element. Volume and panorama/balance can be sequenced like machine parameters in wire groups of the BtPattern objects on the target machine (that means that source-machines don't have the controls).

## Functions

### bt_wire_get_param_group ()

    BtParameterGroup *
    bt_wire_get_param_group (const BtWire * const self);

Get the parameter group.

#### Parameters

self | the machine |

#### Returns

the BtParameterGroup or `NULL`.

[transfer none]

### bt_wire_new ()

    BtWire *
    bt_wire_new (const BtSong *song,
                 const BtMachine *src_machine,
                 const BtMachine *dst_machine,
                 GError **err);

Create a new instance. The new wire is automatically added to a songs setup. You don't need to call

`bt_setup_add_wire(setup,wire);`.

#### Parameters

song | the song the new instance belongs to |
src_machine | the data source (BtSourceMachine or BtProcessorMachine) |
dst_machine | the data sink (BtSinkMachine or BtProcessorMachine) |
err | inform about failed instance creation |

#### Returns

the new instance or `NULL` in case of an error

### bt_wire_reconnect ()

    gboolean
    bt_wire_reconnect (BtWire *self);

Call this method after internal elements in a BtMachine have changed, but failed to link.

#### Parameters

self | the wire to re-link |

#### Returns

`TRUE` for success and `FALSE` otherwise

### bt_wire_can_link ()

    gboolean
    bt_wire_can_link (const BtMachine * const src,
                      const BtMachine * const dst);

Check if we don't have such a wire yet and if we can connect the machines. We can connect if the data flow direction is correct (sources to effects to sinks) and if the new connect is not creating cycles in the graph.

#### Parameters

src | the src machine |
dst | the dst machine |

#### Returns

`TRUE` if we can link the machines

## Types and Values

### BT_WIRE_MAX_NUM_PARAMS

    #define BT_WIRE_MAX_NUM_PARAMS 2

Maximum number of parameters per wire.

### struct BtWire

    struct BtWire;

A link between two BtMachine instances.

## Property Details

### The `“analyzers”` property

      “analyzers”                gpointer

list of wire analyzers.

Flags: Read / Write

### The `“construction-error”` property

      “construction-error”       gpointer

signal failed instance creation.

Flags: Read / Write / Construct Only

### The `“dst”` property

      “dst”                      BtMachine *

dst machine object, the wire links to.

Flags: Read / Write / Construct Only

### The `“gain”` property

      “gain”                     GstElement *

the gain element for the connection.

Flags: Read

### The `“num-params”` property

      “num-params”               gulong

number of params for the wire.

Flags: Read / Write

Allowed values: <= 2

### The `“pan”` property

      “pan”                      GstElement *

the panorama element for the connection.

Flags: Read

### The `“pretty-name”` property

      “pretty-name”              gchar *

pretty-printed name for display purposes.

Flags: Read

Default value: NULL

### The `“properties”` property

      “properties”               gpointer

list of wire properties.

Flags: Read

### The `“song”` property

      “song”                     BtSong *

the song object, the wire belongs to.

Flags: Read / Write / Construct Only

### The `“src”` property

      “src”                      BtMachine *

src machine object, the wire links to.

Flags: Read / Write / Construct Only