![]() |
![]() |
![]() |
LibRhythmCat Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
#include <rclib-player.h> struct RCLibPlayer; struct RCLibPlayerClass; enum RCLibPlayerRandomMode; enum RCLibPlayerRepeatMode; void rclib_player_exit (); GObject * rclib_player_get_instance (); RCLibPlayerRandomMode rclib_player_get_random_mode (); gboolean rclib_player_get_rating_limit (gfloat *rating
,gboolean *condition
); RCLibPlayerRepeatMode rclib_player_get_repeat_mode (); void rclib_player_init (); void rclib_player_play_library (const gchar *uri
); gboolean rclib_player_play_next (gboolean jump
,gboolean repeat
,gboolean loop
); void rclib_player_play_playlist (gpointer iter
); gboolean rclib_player_play_prev (gboolean jump
,gboolean repeat
,gboolean loop
); void rclib_player_set_random_mode (RCLibPlayerRandomMode mode
); void rclib_player_set_rating_limit (gboolean state
,gfloat rating
,gboolean condition
); void rclib_player_set_repeat_mode (RCLibPlayerRepeatMode mode
); gulong rclib_player_signal_connect (const gchar *name
,GCallback callback
,gpointer data
); void rclib_player_signal_disconnect (gulong handler_id
);
The RCLibPlayer is a class which schedules the player, like sequential playing, repeat playing, and random playing. The playing mode can be set easily by the given API.
struct RCLibPlayer;
The advanced player scheduler. The contents of the RCLibPlayer structure are private and should only be accessed via the provided API.
typedef enum { RCLIB_PLAYER_RANDOM_NONE, RCLIB_PLAYER_RANDOM_SINGLE, RCLIB_PLAYER_RANDOM_ALL } RCLibPlayerRandomMode;
The enum type for random playing mode type.
typedef enum { RCLIB_PLAYER_REPEAT_NONE, RCLIB_PLAYER_REPEAT_SINGLE, RCLIB_PLAYER_REPEAT_LIST, RCLIB_PLAYER_REPEAT_ALL } RCLibPlayerRepeatMode;
The enum type for repeat playing mode type.
GObject * rclib_player_get_instance ();
Get the running RCLibPlayer instance.
Returns : |
The running instance. [transfer none] |
RCLibPlayerRandomMode rclib_player_get_random_mode ();
Get the random mode using now in the player.
Returns : |
The random mode. |
gboolean rclib_player_get_rating_limit (gfloat *rating
,gboolean *condition
);
Get the rating limit playing mode configuration data.
|
the rating value to return. [out][allow-none] |
|
the condition to return. [out][allow-none] |
Returns : |
Whether rating limit playing mode is enabled. |
RCLibPlayerRepeatMode rclib_player_get_repeat_mode ();
Get the repeat mode using now in the player.
Returns : |
The repeat mode. |
void rclib_player_play_library (const gchar *uri
);
Play the URI of the music in the music library.
|
the URI of the music item in the library |
gboolean rclib_player_play_next (gboolean jump
,gboolean repeat
,gboolean loop
);
Play the next music.
|
whether the player should be jump to the next playlist if the playing music is the last one in current playlist |
|
whether repeat playing the current music if there is no next one |
|
whether the player should be jump to the first playlist if the playing one is the last |
Returns : |
Whether the player is set to play. |
void rclib_player_play_playlist (gpointer iter
);
Play the iter to the playlist in the music database.
|
the iter to the playlist |
gboolean rclib_player_play_prev (gboolean jump
,gboolean repeat
,gboolean loop
);
Play the previous music.
|
whether the player should be jump to the previous playlist if the playing music is the first one in current playlist |
|
whether repeat playing the current music if there is no previous one |
|
whether the player should be jump to the last playlist if the playing one is the first |
Returns : |
Whether the player is set to play. |
void rclib_player_set_random_mode (RCLibPlayerRandomMode mode
);
Set the random mode for the player.
|
the new random mode to set |
void rclib_player_set_rating_limit (gboolean state
,gfloat rating
,gboolean condition
);
Set the rating limit playing mode. if condition
is set to TRUE,
the player will play the music whose rating is less or equal than
the rating limit value, if it is FALSE, the player will play the
the music whose rating is more or equal than the rating limit.
|
enable or disable the rating limit playing mode |
|
the rating limit value |
|
the condition |
void rclib_player_set_repeat_mode (RCLibPlayerRepeatMode mode
);
Set the repeat mode for the player.
|
the new repeat mode to set |
gulong rclib_player_signal_connect (const gchar *name
,GCallback callback
,gpointer data
);
Connect the GCallback function to the given signal for the running instance of RCLibPlayer object.
|
the name of the signal |
|
the the GCallback to connect. [scope call] |
|
the user data |
Returns : |
The handler ID. |
void rclib_player_signal_disconnect (gulong handler_id
);
Disconnects a handler from the running RCLibPlayer instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The handler_id becomes invalid and may be reused.
|
handler id of the handler to be disconnected |
"random-mode-changed"
signalvoid user_function (RCLibPlayer *player,
guint mode,
gpointer user_data) : Run First
The ::random-mode-changed signal is emitted when a new random playing mode has been set.
|
the RCLibPlayer that received the signal |
|
the new random mode |
|
user data set when the signal handler was connected. |
"repeat-mode-changed"
signalvoid user_function (RCLibPlayer *player,
guint mode,
gpointer user_data) : Run First
The ::repeat-mode-changed signal is emitted when a new repeat playing mode has been set.
|
the RCLibPlayer that received the signal |
|
the new repeat mode |
|
user data set when the signal handler was connected. |