![]() |
![]() |
![]() |
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> struct BtSong; struct BtSongClass; gboolean bt_song_continue (const BtSong * const self
); BtSong * bt_song_new (const BtApplication * const app
); gboolean bt_song_pause (const BtSong * const self
); gboolean bt_song_play (const BtSong * const self
); gboolean bt_song_stop (const BtSong * const self
); gboolean bt_song_update_playback_position (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 "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.
One can seek in a song by setting the "play-pos" property. Likewise one can watch the property to display the playback position.
The "play-rate" property can be used to change the playback speed and direction.
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 |
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 |
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_play (const BtSong * const self
);
Starts to play the specified song instance from beginning. This methods toggles the "is-playing" property.
|
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_update_playback_position (const BtSong * const self
);
Updates the playback-position counter to fire all "play-pos" notify handlers.
|
the song that should update its playback-pos counter |
Returns : |
FALSE if the song is not playing |
"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