## BtSourceMachine

BtSourceMachine — class for signal processing machines with outputs only

## Synopsis

    #include <libbtcore/core.h>

                        BtSourceMachine;
    enum                BtSourceMachinePatternIndex;
    BtSourceMachine *   bt_source_machine_new               (const BtSong * const song,
                                                             const gchar * const id,
                                                             const gchar * const plugin_name,
                                                             const glong voices,
                                                             GError **err);

## Object Hierarchy

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

## Implemented Interfaces

BtSourceMachine implements GstChildProxy.

## Description

Sources are machines that generate audio.

## Details

### BtSourceMachine

    typedef struct _BtSourceMachine BtSourceMachine;

Sub-class of a BtMachine that implements a signal generator (a machine with outputs only).

### enum BtSourceMachinePatternIndex

    typedef enum {
      BT_SOURCE_MACHINE_PATTERN_INDEX_BREAK=0,
      BT_SOURCE_MACHINE_PATTERN_INDEX_MUTE,
      BT_SOURCE_MACHINE_PATTERN_INDEX_SOLO,
      BT_SOURCE_MACHINE_PATTERN_INDEX_OFFSET
    } BtSourceMachinePatternIndex;

Use this with `bt_machine_get_pattern_by_index()` to get the command patterns.

`BT_SOURCE_MACHINE_PATTERN_INDEX_BREAK` | stop the pattern
`BT_SOURCE_MACHINE_PATTERN_INDEX_MUTE` | mute the machine
`BT_SOURCE_MACHINE_PATTERN_INDEX_SOLO` | play only this machine
`BT_SOURCE_MACHINE_PATTERN_INDEX_OFFSET` | offset for real pattern ids

### bt_source_machine_new ()

    BtSourceMachine *   bt_source_machine_new               (const BtSong * const song,
                                                             const gchar * const id,
                                                             const gchar * const plugin_name,
                                                             const glong voices,
                                                             GError **err);

Create a new instance The machine is automaticly added to the setup from the given song object. You don't need to add the machine with `bt_setup_add_machine(setup,BT_MACHINE(machine));`.

`song` : | the song the new instance belongs to
`id` : | the id, we can use to lookup the machine
`plugin_name` : | the name of the gst-plugin the machine is using
`voices` : | the number of voices the machine should initially have
`err` : | inform about failed instance creation
Returns : | the new instance or `NULL` in case of an error