![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
enum RBPlayerError; #define RB_PLAYER_ERROR GQuark rb_player_error_quark (void); RBPlayer* rb_player_new (gboolean want_crossfade, GError **error); gboolean rb_player_open (RBPlayer *player, const char *uri, gpointer stream_data, GDestroyNotify stream_data_destroy, GError **error); gboolean rb_player_opened (RBPlayer *player); gboolean rb_player_close (RBPlayer *player, const char *uri, GError **error); gboolean rb_player_play (RBPlayer *player, gint crossfade, GError **error); void rb_player_pause (RBPlayer *player); gboolean rb_player_playing (RBPlayer *player); void rb_player_set_volume (RBPlayer *player, float volume); float rb_player_get_volume (RBPlayer *player); void rb_player_set_replaygain (RBPlayer *player, const char *uri, double track_gain, double track_peak, double album_gain, double album_peak); gboolean rb_player_seekable (RBPlayer *player); void rb_player_set_time (RBPlayer *player, long time ); long rb_player_get_time (RBPlayer *player);
typedef enum { RB_PLAYER_ERROR_NO_AUDIO, RB_PLAYER_ERROR_GENERAL, RB_PLAYER_ERROR_INTERNAL } RBPlayerError;
RBPlayer* rb_player_new (gboolean want_crossfade, GError **error);
Creates a new player object.
|
if TRUE, try to use a backend that supports crossfading and other track transitions. |
|
returns error information |
Returns : |
gboolean rb_player_open (RBPlayer *player, const char *uri, gpointer stream_data, GDestroyNotify stream_data_destroy, GError **error);
Prepares a stream for playback. Depending on the player implementation, this may stop any existing stream being played. The stream preparation process may continue asynchronously, in which case errors may be reported from rb_player_play or using the 'error' signal.
returns
TRUE if the stream preparation was not unsuccessful
|
a RBPlayer |
|
URI to open |
|
arbitrary data to associate with the stream |
|
function to call to destroy the stream data |
|
returns error information |
Returns : |
gboolean rb_player_opened (RBPlayer *player);
|
a RBPlayer
returns TRUE if a stream is prepared for playback
|
Returns : |
gboolean rb_player_close (RBPlayer *player, const char *uri, GError **error);
If a URI is specified, this will close the stream corresponding
to that URI and free any resources related resources. If uri
is NULL, this will close all streams.
If no streams remain open after this call, the audio device will be released.
returns
TRUE if a stream was found and closed
|
a RBPlayer |
|
optionally, the URI of the stream to close |
|
returns error information |
Returns : |
gboolean rb_player_play (RBPlayer *player, gint crossfade, GError **error);
Starts playback of the most recently opened stream.
If crossfade
is greater than zero, the player may attempt
to crossfade the new stream with any existing streams.
If crossfade
is zero, the player may attempt to start the
stream immediately after the current playing stream reaches
EOS. This may or may not result in the phenomemon known
as 'gapless playback'.
If crossfade
is less than zero, the player will stop any
existing stream before starting the new stream. It may do
this anyway, regardless of the value of crossfade
.
The 'playing-stream' signal will be emitted when the new stream is actually playing. This may be before or after control returns to the caller.
returns
: TRUE if playback started successfully
|
a RBPlayer |
|
requested crossfade duration |
|
returns error information |
Returns : |
void rb_player_pause (RBPlayer *player);
Pauses playback of the most recently started stream. Any streams being faded out may continue until the fade is complete.
|
a RBPlayer |
gboolean rb_player_playing (RBPlayer *player);
|
a RBPlayer |
Returns : |
TRUE if a stream is currently being played (not paused or being faded out). |
void rb_player_set_volume (RBPlayer *player, float volume);
Adjusts the output volume level. This affects all streams. The player may use a hardware volume control to implement this volume adjustment.
|
a RBPlayer |
|
new output volume level |
float rb_player_get_volume (RBPlayer *player);
|
a RBPlayer |
Returns : |
current output volume level |
void rb_player_set_replaygain (RBPlayer *player, const char *uri, double track_gain, double track_peak, double album_gain, double album_peak);
Sets ReplayGain values for a stream
|
a RBPlayer |
|
URI of stream to adjust |
|
ReplayGain track gain level |
|
ReplayGain track peak level |
|
ReplayGain album gain level |
|
ReplayGain album peak level |
gboolean rb_player_seekable (RBPlayer *player);
|
a RBPlayer |
Returns : |
TRUE if the current stream is seekable |
void rb_player_set_time (RBPlayer *player, long time );
Attempts to seek in the current stream. The player may ignore this if the stream is not seekable. The seek may take place asynchronously.
|
a RBPlayer |
|