![]() |
![]() |
![]() |
Buzztard Bt-Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
BtSongBtSong — class of a song project object (contains BtSongInfo, BtSetup, BtSequence and BtWavetable) |
#include <libbtcore/core.h> BtSong; BtSongClass; BtSong * bt_song_new (const BtApplication * const app
); void bt_song_set_unsaved (const BtSong * const self
,const gboolean unsaved
); gboolean bt_song_play (const BtSong * const self
); gboolean bt_song_stop (const BtSong * const self
); gboolean bt_song_pause (const BtSong * const self
); gboolean bt_song_continue (const BtSong * const self
); gboolean bt_song_update_playback_position (const BtSong * const self
); void bt_song_write_to_xml_file (const BtSong * const self
); void bt_song_write_to_highlevel_dot_file (const BtSong * const self
); void bt_song_write_to_lowlevel_dot_file (const BtSong * const self
);
"app" BtApplication* : Read / Write / Construct Only "bin" GstBin* : Read "is-idle" gboolean : Read / Write "is-playing" gboolean : Read "master" BtSinkMachine* : Read / Write "play-pos" gulong : Read / Write "play-rate" gdouble : Read / Write "sequence" BtSequence* : Read "setup" BtSetup* : Read "song-info" BtSongInfo* : Read "song-io" BtSongIO* : Read / Write "unsaved" gboolean : Read / Write "wavetable" BtWavetable* : Read
A song is the top-level container object to manage all song-related objects.
To load or save a song, use a BtSongIO object. These implement loading and saving for different file-formats.
typedef struct _BtSong BtSong;
Song project object (contains BtSongInfo, BtSetup and BtSequence)
BtSong * bt_song_new (const BtApplication * const app
);
Create a new instance. The new song instance automatically has one instance of BtSetup, BtSequence and BtSongInfo. These instances can be retrieved via the respecting properties.
For example use following code to retrive a BtSequence from the song class:
BtSequence *sequence; ... g_object_get(BT_SONG(song), "sequence", &sequence, NULL);
|
the application object the songs belongs to. |
Returns : |
the new instance or NULL in case of an error
|
void bt_song_set_unsaved (const BtSong * const self
,const gboolean unsaved
);
Use this method instead of directly setting the state via g_object_set()
to
avoid double notifies, if the state is unchanged.
|
the song that should be changed |
|
the new state of the songs unsaved flag |
gboolean bt_song_play (const BtSong * const self
);
Starts to play the specified song instance from beginning. This methods emits the "play" signal.
|
the song that should be played |
Returns : |
TRUE for success
|
gboolean bt_song_stop (const BtSong * const self
);
Stops the playback of the specified song instance.
|
the song that should be stopped |
Returns : |
TRUE for success
|
gboolean bt_song_pause (const BtSong * const self
);
Pauses the playback of the specified song instance.
|
the song that should be paused |
Returns : |
TRUE for success
|
gboolean bt_song_continue (const BtSong * const self
);
Continues the playback of the specified song instance.
|
the song that should be paused |
Returns : |
TRUE for success
|
gboolean bt_song_update_playback_position (const BtSong * const self
);
Updates the playback-position counter to fire all notify::playback-pos handlers.
|
the song that should update its playback-pos counter |
Returns : |
FALSE if the song is not playing
|
void bt_song_write_to_xml_file (const BtSong * const self
);
To aid debugging applications one can use this method to write out the whole network of gstreamer elements that form the song into an XML file. The file will be written to '/tmp' and will be named according the 'name' property of the BtSongInfo. This XML file can be loaded into gst-editor.
|
the song that should be written |
void bt_song_write_to_highlevel_dot_file (const BtSong * const self
);
To aid debugging applications one can use this method to write out the whole network of gstreamer elements from the songs perspective into an dot file. The file will be written to '/tmp' and will be named according the 'name' property of the BtSongInfo. This file can be processed with graphviz to get an image.
dot -Tpng -oimage.png graph_highlevel.dot
|
the song that should be written |
void bt_song_write_to_lowlevel_dot_file (const BtSong * const self
);
To aid debugging applications one can use this method to write out the whole network of gstreamer elements that form the song into an dot file. The file will be written to '/tmp' and will be named according the 'name' property of the BtSongInfo. This file can be processed with graphviz to get an image.
dot -Tpng -oimage.png graph_lowlevel.dot
|
the song that should be written |
"app"
property"app" BtApplication* : Read / Write / Construct Only
set application object, the song belongs to.
"is-idle"
property "is-idle" gboolean : Read / Write
request that the song should idle-loop if not playing.
Default value: FALSE
"is-playing"
property "is-playing" gboolean : Read
tell whether the song is playing right now or not.
Default value: FALSE
"play-pos"
property "play-pos" gulong : Read / Write
position of the play cursor of the sequence in timeline bars.
Allowed values: <= G_MAXLONG
"play-rate"
property "play-rate" gdouble : Read / Write
playback rate of the sequence.
Allowed values: [-5,5]
Default value: 1
"unsaved"
property "unsaved" gboolean : Read / Write
tell whether the current state of the song has been saved.
Default value: TRUE