![]() |
![]() |
![]() |
Buzztard Bt-Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <libbtcore/core.h> struct BtSetup; 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
); 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
); gchar * bt_setup_get_unique_machine_id (const BtSetup * const self
,const gchar * const base_name
); 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
); BtWire * bt_setup_get_wire_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
); GList * bt_setup_get_wires_by_src_machine (const BtSetup * const self
,const BtMachine * const src
); BtSetup * bt_setup_new (const BtSong * const song
); void bt_setup_remember_missing_machine (const BtSetup * const self
,const gchar * const str
); 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
);
"machines" gpointer : Read "missing-machines" gpointer : Read "properties" gpointer : Read "song" BtSong* : Read / Write / Construct Only "wires" gpointer : Read
"machine-added" :No Hooks
"machine-removed" :No Hooks
"wire-added" :No Hooks
"wire-removed" :No Hooks
The setup manages virtual gear in a BtSong. This is a list of BtMachines that are used and the BtWires that connect them.
The setup manages the actual GStreamer GstPipeline content. Freshly created machines are not yet added to the pipeline. Only once a subgraph from a source is fully connected to the sink, that subgraph is added o the pipeline.
Applications can watch the GstObject:parent property to see wheter a machine is physically inserted into the processing pipeline.
gboolean bt_setup_add_machine (const BtSetup * const self
,const BtMachine * const machine
);
Let the setup know that the supplied 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 supplied 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). |
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 |
gchar * bt_setup_get_unique_machine_id (const BtSetup * const self
,const 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 |
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 |
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
|
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
|
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
|
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 |
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 |
void bt_setup_remove_machine (const BtSetup * const self
,const BtMachine * const machine
);
Let the setup know that the supplied machine is removed from the song.
|
the setup to remove the machine from |
|
the machine instance to remove |
"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) : 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) : 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) : 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. |