Beispiel #1
0
/**
 * rb_player_set_time:
 * @player:	a #RBPlayer
 * @newtime:	seek target position in seconds
 *
 * Attempts to seek in the current stream.  The player
 * may ignore this if the stream is not seekable.
 * The seek may take place asynchronously.
 */
void
rb_player_set_time (RBPlayer *player, gint64 newtime)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	iface->set_time (player, newtime);
}
Beispiel #2
0
/**
 * rb_player_get_time:
 * @player:	a #RBPlayer
 *
 * Returns the current playback for the current stream in nanoseconds.
 *
 * Return value: playback position
 */
gint64
rb_player_get_time (RBPlayer *player)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->get_time (player);
}
Beispiel #3
0
/**
 * rb_player_get_volume:
 * @player:	a #RBPlayer
 *
 * Returns the current volume level, between 0.0 and 1.0.
 *
 * Return value: current output volume level
 */
float
rb_player_get_volume (RBPlayer *player)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->get_volume (player);
}
Beispiel #4
0
/**
 * rb_player_seekable:
 * @player:	a #RBPlayer
 *
 * Determines whether seeking is supported for the current stream.
 *
 * Return value: TRUE if the current stream is seekable
 */
gboolean
rb_player_seekable (RBPlayer *player)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->seekable (player);
}
Beispiel #5
0
/**
 * rb_player_playing:
 * @player:	a #RBPlayer.
 *
 * Determines whether the player is currently playing a stream.
 * A stream is playing if it's not paused or being faded out.
 *
 * Return value: TRUE if playing
 */
gboolean
rb_player_playing (RBPlayer *player)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->playing (player);
}
Beispiel #6
0
/**
 * rb_player_set_volume:
 * @player:	a #RBPlayer
 * @volume:	new output volume level
 *
 * Adjusts the output volume level.  This affects all streams.
 * The player may use a hardware volume control to implement
 * this volume adjustment.
 */
void
rb_player_set_volume (RBPlayer *player, float volume)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	iface->set_volume (player, volume);
}
Beispiel #7
0
/**
 * rb_player_play:
 * @player:	a #RBPlayer
 * @play_type:  requested playback start type
 * @crossfade:	requested crossfade duration (nanoseconds)
 * @error:	returns error information
 *
 * Starts playback of the most recently opened stream.
 * if @play_type is #RB_PLAYER_PLAY_CROSSFADE, the player
 * may attempt to crossfade the new stream with any existing
 * streams.  If it does this, the it will use @crossfade as the
 * duration of the fade.
 *
 * If @play_type is #RB_PLAYER_PLAY_AFTER_EOS, 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 @play_type is #RB_PLAYER_PLAY_REPLACE, the player will stop any
 * existing stream before starting the new stream. It may do
 * this anyway, regardless of the value of @play_type.
 *
 * 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.
 *
 * Return value: %TRUE if playback started successfully
 */
gboolean
rb_player_play (RBPlayer *player, RBPlayerPlayType play_type, gint64 crossfade, GError **error)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->play (player, play_type, crossfade, error);
}
Beispiel #8
0
/**
 * rb_player_pause:
 * @player:	a #RBPlayer
 *
 * Pauses playback of the most recently started stream.  Any
 * streams being faded out may continue until the fade is
 * complete.
 */
void
rb_player_pause (RBPlayer *player)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	iface->pause (player);
}
Beispiel #9
0
/**
 * rb_player_close:
 * @player:	a #RBPlayer
 * @uri:	optionally, the URI of the stream to close
 * @error:	returns error information
 *
 * 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.
 *
 * Return value: TRUE if a stream was found and closed
 */
gboolean
rb_player_close (RBPlayer *player, const char *uri, GError **error)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->close (player, uri, error);
}
Beispiel #10
0
/**
 * rb_player_opened:
 * @player: 	a #RBPlayer
 *
 * Determines whether a stream has been prepared for playback.
 *
 * Return value: TRUE if a stream is prepared for playback
 */
gboolean
rb_player_opened (RBPlayer *player)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->opened (player);
}
Beispiel #11
0
/**
 * rb_player_open:
 * @player:	a #RBPlayer
 * @uri:	URI to open
 * @stream_data: arbitrary data to associate with the stream
 * @stream_data_destroy: function to call to destroy the stream data
 * @error:	returns error information
 *
 * 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.
 *
 * Return value: TRUE if the stream preparation was not unsuccessful
 */
gboolean
rb_player_open (RBPlayer *player, const char *uri, gpointer stream_data, GDestroyNotify stream_data_destroy, GError **error)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->open (player, uri, stream_data, stream_data_destroy, error);
}
/**
 * rb_player_play:
 * @player:	a #RBPlayer
 * @crossfade:	requested crossfade duration
 * @error:	returns error information
 *
 * 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.
 *
 * Return value: TRUE if playback started successfully
 */
gboolean
rb_player_play (RBPlayer *player, gint crossfade, GError **error)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	return iface->play (player, crossfade, error);
}
Beispiel #13
0
/**
 * rb_player_multiple_open:
 * @player:	a #RBPlayer
 *
 * Determines whether the player supports multiple open streams.
 *
 * Return value: TRUE if multiple open is supported
 */
gboolean
rb_player_multiple_open (RBPlayer *player)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	if (iface->multiple_open)
		return iface->multiple_open (player);
	else
		return FALSE;
}
/**
 * rb_player_set_replaygain:
 * @player:	a #RBPlayer
 * @uri:	URI of stream to adjust
 * @track_gain: ReplayGain track gain level
 * @track_peak: ReplayGain track peak level
 * @album_gain: ReplayGain album gain level
 * @album_peak: ReplayGain album peak level
 *
 * Sets ReplayGain values for a stream
 */
void
rb_player_set_replaygain (RBPlayer *player,
			  const char *uri,
			  double track_gain, double track_peak,
			  double album_gain, double album_peak)
{
	RBPlayerIface *iface = RB_PLAYER_GET_IFACE (player);

	iface->set_replaygain (player, uri, track_gain, track_peak, album_gain, album_peak);
}