![]() |
![]() |
![]() |
Buzztard Bt-Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <libbtcore/core.h> BtSetup; BtSetup * bt_setup_new (const BtSong * const song
); gboolean bt_setup_add_machine (const BtSetup * const self
,const BtMachine * const machine
); gboolean bt_setup_add_wire (const BtSetup * const self
,const BtWire * const wire
); void bt_setup_remove_machine (const BtSetup * const self
,const BtMachine * const machine
); void bt_setup_remove_wire (const BtSetup * const self
,const BtWire * const wire
); BtMachine * bt_setup_get_machine_by_id (const BtSetup * const self
,const gchar * const id
); BtMachine * bt_setup_get_machine_by_type (const BtSetup * const self
,const GType type
); GList * bt_setup_get_machines_by_type (const BtSetup * const self
,const GType type
); BtWire * bt_setup_get_wire_by_src_machine (const BtSetup * const self
,const BtMachine * const src
); BtWire * bt_setup_get_wire_by_dst_machine (const BtSetup * const self
,const BtMachine * const dst
); BtWire * bt_setup_get_wire_by_machines (const BtSetup * const self
,const BtMachine * const src
,const BtMachine * const dst
); GList * bt_setup_get_wires_by_src_machine (const BtSetup * const self
,const BtMachine * const src
); GList * bt_setup_get_wires_by_dst_machine (const BtSetup * const self
,const BtMachine * const dst
); gchar * bt_setup_get_unique_machine_id (const BtSetup * const self
,gchar * const base_name
); void bt_setup_remember_missing_machine (const BtSetup * const self
,const gchar * const str
);
"machines" gpointer : Read "missing-machines" gpointer : Read "properties" gpointer : Read "song" BtSong* : Read / Write / Construct Only "wires" gpointer : Read
"machine-added" : Run Last / No Recursion / No Hooks "machine-removed" : Run Last / No Recursion / No Hooks "wire-added" : Run Last / No Recursion / No Hooks "wire-removed" : Run Last / No Recursion / No Hooks
The setup manages virtual gear. That is used BtMachines and the BtWires that connect them.
It also manages the GStreamer GstPipeline content.
typedef struct _BtSetup BtSetup;
virtual hardware setup (contains BtMachine and BtWire objects)
BtSetup * bt_setup_new (const BtSong * const song
);
Create a new instance
|
the song the new instance belongs to |
Returns : |
the new instance or NULL in case of an error
|
gboolean bt_setup_add_machine (const BtSetup * const self
,const BtMachine * const machine
);
Let the setup know that the suplied machine is now part of the song.
|
the setup to add the machine to |
|
the new machine instance |
Returns : |
return true, if the machine can be added. Returns false if the machine is currently added to the setup. |
gboolean bt_setup_add_wire (const BtSetup * const self
,const BtWire * const wire
);
Let the setup know that the suplied wire is now part of the song.
|
the setup to add the wire to |
|
the new wire instance |
Returns : |
returns true, if the wire is added. Returns false, if the setup contains a wire witch is link between the same src and dst machines (cycle check). |
void bt_setup_remove_machine (const BtSetup * const self
,const BtMachine * const machine
);
Let the setup know that the suplied machine is removed from the song.
|
the setup to remove the machine from |
|
the machine instance to remove |
void bt_setup_remove_wire (const BtSetup * const self
,const BtWire * const wire
);
Let the setup know that the suplied wire is removed from the song.
|
the setup to remove the wire from |
|
the wire instance to remove |
BtMachine * bt_setup_get_machine_by_id (const BtSetup * const self
,const gchar * const id
);
Search the setup for a machine by the supplied id.
The machine must have been added previously to this setup with bt_setup_add_machine()
.
Unref the machine, when done with it.
|
the setup to search for the machine |
|
the identifier of the machine |
Returns : |
BtMachine instance or NULL if not found
|
BtMachine * bt_setup_get_machine_by_type (const BtSetup * const self
,const GType type
);
Search the setup for the first machine with the given type.
The machine must have been added previously to this setup with bt_setup_add_machine()
.
Unref the machine, when done with it.
|
the setup to search for the machine |
|
the gobject type (sink,processor,source) |
Returns : |
BtMachine instance or NULL if not found
|
GList * bt_setup_get_machines_by_type (const BtSetup * const self
,const GType type
);
Gathers all machines of the given type from the setup. Free the list (and unref the machines), when done with it.
|
the setup to search for the machine |
|
the gobject type (sink,processor,source) |
Returns : |
the list instance or NULL if not found
|
BtWire * bt_setup_get_wire_by_src_machine (const BtSetup * const self
,const BtMachine * const src
);
Searches for the first wire in setup that uses the given BtMachine as a source. In other words - it returns the first wire that starts at the given BtMachine. Unref the wire, when done with it.
|
the setup to search for the wire |
|
the machine that is at the src end of the wire |
Returns : |
the BtWire or NULL
|
BtWire * bt_setup_get_wire_by_dst_machine (const BtSetup * const self
,const BtMachine * const dst
);
Searches for the first wire in setup that uses the given BtMachine as a target. In other words - it returns the first wire that ends at the given BtMachine. Unref the wire, when done with it.
|
the setup to search for the wire |
|
the machine that is at the dst end of the wire |
Returns : |
the BtWire or NULL
|
BtWire * bt_setup_get_wire_by_machines (const BtSetup * const self
,const BtMachine * const src
,const BtMachine * const dst
);
Searches for a wire in setup that uses the given BtMachine instances as a source and dest. Unref the wire, when done with it.
|
the setup to search for the wire |
|
the machine that is at the src end of the wire |
|
the machine that is at the dst end of the wire |
Returns : |
the BtWire or NULL |
GList * bt_setup_get_wires_by_src_machine (const BtSetup * const self
,const BtMachine * const src
);
Searches for all wires in setup that use the given BtMachine as a source. Free the list (and unref the wires), when done with it.
|
the setup to search for the wire |
|
the machine that is at the src end of the wire |
Returns : |
a GList with the BtWires or NULL
|
GList * bt_setup_get_wires_by_dst_machine (const BtSetup * const self
,const BtMachine * const dst
);
Searches for all wires in setup that use the given BtMachine as a target. Free the list (and unref the wires), when done with it.
|
the setup to search for the wire |
|
the machine that is at the dst end of the wire |
Returns : |
a GList with the BtWires or NULL
|
gchar * bt_setup_get_unique_machine_id (const BtSetup * const self
,gchar * const base_name
);
The function makes the supplied base_name unique in this setup by eventually adding a number postfix. This method should be used when adding new machines.
|
the setup for which the name should be unique |
|
the leading name part |
Returns : |
the newly allocated unique name |
void bt_setup_remember_missing_machine (const BtSetup * const self
,const gchar * const str
);
Loaders can use this function to collect information about machines that failed to load. The front-end can access this later by reading BtSetup::missing-machines property.
|
the setup |
|
human readable description of the missing machine |
"missing-machines"
property "missing-machines" gpointer : Read
The list of missing machines, don't change.
"song"
property"song" BtSong* : Read / Write / Construct Only
Set song object, the setup belongs to.
"machine-added"
signalvoid user_function (BtSetup *self, BtMachine *machine, gpointer user_data) : Run Last / No Recursion / No Hooks
A new machine item has been added to the setup
|
the setup object that emitted the signal |
|
the new machine |
|
user data set when the signal handler was connected. |
"machine-removed"
signalvoid user_function (BtSetup *self, BtMachine *machine, gpointer user_data) : Run Last / No Recursion / No Hooks
A machine item has been removed from the setup
|
the setup object that emitted the signal |
|
the old machine |
|
user data set when the signal handler was connected. |
"wire-added"
signalvoid user_function (BtSetup *self, BtWire *wire, gpointer user_data) : Run Last / No Recursion / No Hooks
A new wire item has been added to the setup
|
the setup object that emitted the signal |
|
the new wire |
|
user data set when the signal handler was connected. |
"wire-removed"
signalvoid user_function (BtSetup *self, BtWire *wire, gpointer user_data) : Run Last / No Recursion / No Hooks
A wire item has been removed from the setup
|
the setup object that emitted the signal |
|
the old wire |
|
user data set when the signal handler was connected. |