RCLibPlayer

RCLibPlayer — The player scheduler

Synopsis

#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);

Object Hierarchy

  GObject
   +----RCLibPlayer

Signals

  "random-mode-changed"                            : Run First
  "repeat-mode-changed"                            : Run First

Description

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.

Details

struct RCLibPlayer

struct RCLibPlayer;

The advanced player scheduler. The contents of the RCLibPlayer structure are private and should only be accessed via the provided API.


struct RCLibPlayerClass

struct RCLibPlayerClass {
};

RCLibPlayer class.


enum RCLibPlayerRandomMode

typedef enum {
    RCLIB_PLAYER_RANDOM_NONE,
    RCLIB_PLAYER_RANDOM_SINGLE,
    RCLIB_PLAYER_RANDOM_ALL
} RCLibPlayerRandomMode;

The enum type for random playing mode type.

RCLIB_PLAYER_RANDOM_NONE

no random playing

RCLIB_PLAYER_RANDOM_SINGLE

random playing in current playlist

RCLIB_PLAYER_RANDOM_ALL

random playing in all playlists

enum RCLibPlayerRepeatMode

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.

RCLIB_PLAYER_REPEAT_NONE

no repeat

RCLIB_PLAYER_REPEAT_SINGLE

repeat playing current music

RCLIB_PLAYER_REPEAT_LIST

repeat playing music in current playlist

RCLIB_PLAYER_REPEAT_ALL

repeat playing music in all playlists

rclib_player_exit ()

void                rclib_player_exit                   ();

Unload the running player scheduler instance.


rclib_player_get_instance ()

GObject *           rclib_player_get_instance           ();

Get the running RCLibPlayer instance.

Returns :

The running instance. [transfer none]

rclib_player_get_random_mode ()

RCLibPlayerRandomMode rclib_player_get_random_mode      ();

Get the random mode using now in the player.

Returns :

The random mode.

rclib_player_get_rating_limit ()

gboolean            rclib_player_get_rating_limit       (gfloat *rating,
                                                         gboolean *condition);

Get the rating limit playing mode configuration data.

rating :

the rating value to return. [out][allow-none]

condition :

the condition to return. [out][allow-none]

Returns :

Whether rating limit playing mode is enabled.

rclib_player_get_repeat_mode ()

RCLibPlayerRepeatMode rclib_player_get_repeat_mode      ();

Get the repeat mode using now in the player.

Returns :

The repeat mode.

rclib_player_init ()

void                rclib_player_init                   ();

Initialize the player scheduler.


rclib_player_play_library ()

void                rclib_player_play_library           (const gchar *uri);

Play the URI of the music in the music library.

uri :

the URI of the music item in the library

rclib_player_play_next ()

gboolean            rclib_player_play_next              (gboolean jump,
                                                         gboolean repeat,
                                                         gboolean loop);

Play the next music.

jump :

whether the player should be jump to the next playlist if the playing music is the last one in current playlist

repeat :

whether repeat playing the current music if there is no next one

loop :

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.

rclib_player_play_playlist ()

void                rclib_player_play_playlist          (gpointer iter);

Play the iter to the playlist in the music database.

iter :

the iter to the playlist

rclib_player_play_prev ()

gboolean            rclib_player_play_prev              (gboolean jump,
                                                         gboolean repeat,
                                                         gboolean loop);

Play the previous music.

jump :

whether the player should be jump to the previous playlist if the playing music is the first one in current playlist

repeat :

whether repeat playing the current music if there is no previous one

loop :

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.

rclib_player_set_random_mode ()

void                rclib_player_set_random_mode        (RCLibPlayerRandomMode mode);

Set the random mode for the player.

mode :

the new random mode to set

rclib_player_set_rating_limit ()

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.

state :

enable or disable the rating limit playing mode

rating :

the rating limit value

condition :

the condition

rclib_player_set_repeat_mode ()

void                rclib_player_set_repeat_mode        (RCLibPlayerRepeatMode mode);

Set the repeat mode for the player.

mode :

the new repeat mode to set

rclib_player_signal_connect ()

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.

name :

the name of the signal

callback :

the the GCallback to connect. [scope call]

data :

the user data

Returns :

The handler ID.

rclib_player_signal_disconnect ()

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 :

handler id of the handler to be disconnected

Signal Details

The "random-mode-changed" signal

void                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.

player :

the RCLibPlayer that received the signal

mode :

the new random mode

user_data :

user data set when the signal handler was connected.

The "repeat-mode-changed" signal

void                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.

player :

the RCLibPlayer that received the signal

mode :

the new repeat mode

user_data :

user data set when the signal handler was connected.