LomoPlayer

LomoPlayer

Synopsis

#define             LOMO_PLAYER_E_API
enum                LomoFormat;
                    LomoPlayer;
                    LomoPlayerClass;
enum                LomoPlayerError;
gboolean            (*LomoPlayerHook)                   (LomoPlayer *self,
                                                         LomoPlayerHookEvent event,
                                                         gpointer ret,
                                                         gpointer data);
                    LomoPlayerHookEvent;
enum                LomoPlayerHookType;
                    LomoPlayerVTable;
enum                LomoState;
enum                LomoStateChangeReturn;
#define             lomo_player_append_multiple         (self,
                                                         streams)
#define             lomo_player_append_strv             (self,
                                                         uris)
void                lomo_player_clear                   (LomoPlayer *self);
gboolean            lomo_player_dequeue                 (LomoPlayer *self,
                                                         gint queue_index);
gboolean            lomo_player_get_auto_parse          (LomoPlayer *self);
gboolean            lomo_player_get_auto_play           (LomoPlayer *self);
gboolean            lomo_player_get_can_go_next         (LomoPlayer *self);
gboolean            lomo_player_get_can_go_previous     (LomoPlayer *self);
gint                lomo_player_get_current             (LomoPlayer *self);
#define             lomo_player_get_current_stream      (self)
gboolean            lomo_player_get_gapless_mode        (LomoPlayer *self);
gint64              lomo_player_get_length              (LomoPlayer *self);
gboolean            lomo_player_get_mute                (LomoPlayer *self);
gint                lomo_player_get_n_streams           (LomoPlayer *self);
gint                lomo_player_get_next                (LomoPlayer *self);
LomoStream *        lomo_player_get_nth_stream          (LomoPlayer *self,
                                                         gint index);
const GList *       lomo_player_get_playlist            (LomoPlayer *self);
gint64              lomo_player_get_position            (LomoPlayer *self);
gint                lomo_player_get_previous            (LomoPlayer *self);
gboolean            lomo_player_get_random              (LomoPlayer *self);
gboolean            lomo_player_get_repeat              (LomoPlayer *self);
LomoState           lomo_player_get_state               (LomoPlayer *self);
gint                lomo_player_get_stream_index        (LomoPlayer *self,
                                                         LomoStream *stream);
gint                lomo_player_get_volume              (LomoPlayer *self);
#define             lomo_player_go_next                 (self,
                                                         error)
#define             lomo_player_go_previous             (self,
                                                         error)
void                lomo_player_hook_add                (LomoPlayer *self,
                                                         LomoPlayerHook func,
                                                         gpointer data);
void                lomo_player_hook_remove             (LomoPlayer *self,
                                                         LomoPlayerHook func);
void                lomo_player_insert                  (LomoPlayer *self,
                                                         LomoStream *stream,
                                                         gint index);
void                lomo_player_insert_multiple         (LomoPlayer *self,
                                                         GList *streams,
                                                         gint index);
void                lomo_player_insert_strv             (LomoPlayer *self,
                                                         const gchar *const *uris,
                                                         gint index);
void                lomo_player_insert_uri              (LomoPlayer *self,
                                                         const gchar *uri,
                                                         gint index);
LomoPlayer *        lomo_player_new                     (gchar *option_name,
                                                         ...);
#define             lomo_player_pause                   (self,
                                                         error)
#define             lomo_player_play                    (self,
                                                         error)
gint                lomo_player_queue                   (LomoPlayer *self,
                                                         gint index);
void                lomo_player_queue_clear             (LomoPlayer *self);
gint                lomo_player_queue_get_n_streams     (LomoPlayer *self);
LomoStream *        lomo_player_queue_get_nth_stream    (LomoPlayer *self,
                                                         gint queue_index);
gint                lomo_player_queue_get_stream_index  (LomoPlayer *self,
                                                         LomoStream *stream);
gboolean            lomo_player_remove                  (LomoPlayer *self,
                                                         gint index);
void                lomo_player_set_auto_parse          (LomoPlayer *self,
                                                         gboolean auto_parse);
void                lomo_player_set_auto_play           (LomoPlayer *self,
                                                         gboolean auto_play);
gboolean            lomo_player_set_current             (LomoPlayer *self,
                                                         gint index,
                                                         GError **error);
void                lomo_player_set_gapless_mode        (LomoPlayer *self,
                                                         gboolean gapless_mode);
gboolean            lomo_player_set_mute                (LomoPlayer *self,
                                                         gboolean mute);
gboolean            lomo_player_set_position            (LomoPlayer *self,
                                                         gint64 position);
void                lomo_player_set_random              (LomoPlayer *self,
                                                         gboolean val);
void                lomo_player_set_repeat              (LomoPlayer *self,
                                                         gboolean val);
gboolean            lomo_player_set_state               (LomoPlayer *self,
                                                         LomoState state,
                                                         GError **error);
gboolean            lomo_player_set_volume              (LomoPlayer *self,
                                                         gint val);
gint64              lomo_player_stats_get_stream_time_played
                                                        (LomoPlayer *self);
#define             lomo_player_stop                    (self,
                                                         error)

Object Hierarchy

  GObject
   +----LomoPlayer

Properties

  "auto-parse"               gboolean              : Read / Write / Construct
  "auto-play"                gboolean              : Read / Write / Construct
  "can-go-next"              gboolean              : Read
  "can-go-previous"          gboolean              : Read
  "current"                  gint                  : Read / Write / Construct
  "gapless-mode"             gboolean              : Read / Write / Construct
  "mute"                     gboolean              : Read / Write / Construct
  "position"                 gint64                : Read / Write
  "random"                   gboolean              : Read / Write / Construct
  "repeat"                   gboolean              : Read / Write / Construct
  "state"                    LomoStateEnumType     : Read / Write / Construct
  "volume"                   gint                  : Read / Write / Construct

Signals

  "all-tags"                                       : Run Last
  "change"                                         : Run Last
  "clear"                                          : Run Last
  "dequeue"                                        : Run Last
  "eos"                                            : Run Last
  "error"                                          : Run Last
  "insert"                                         : Run Last
  "mute"                                           : Run Last
  "pause"                                          : Run Last
  "play"                                           : Run Last
  "pre-change"                                     : Run Last
  "queue"                                          : Run Last
  "queue-clear"                                    : Run Last
  "random"                                         : Run Last
  "remove"                                         : Run Last
  "repeat"                                         : Run Last
  "seek"                                           : Run Last
  "state-changed"                                  : Run Last
  "stop"                                           : Run Last
  "tag"                                            : Run Last
  "volume"                                         : Run Last

Description

Details

LOMO_PLAYER_E_API

#define LOMO_PLAYER_E_API

enum LomoFormat

typedef enum {
	LOMO_FORMAT_INVALID = -1,
	LOMO_FORMAT_TIME    = 0,
	LOMO_FORMAT_PERCENT = 1,

	LOMO_FORMAT_N_FORMATS
} LomoFormat;

Define in which format data is expressed

LOMO_FORMAT_INVALID

Invalid format

LOMO_FORMAT_TIME

Format is time

LOMO_FORMAT_PERCENT

Format is precent

LOMO_FORMAT_N_FORMATS

Helper define

LomoPlayer

typedef struct _LomoPlayer LomoPlayer;

LomoPlayerClass

typedef struct {
} LomoPlayerClass;

enum LomoPlayerError

typedef enum {
	LOMO_PLAYER_ERROR_MISSING_METHOD = 1,
	LOMO_PLAYER_ERROR_MISSING_PIPELINE,
	LOMO_PLAYER_ERROR_UNKNOW_STATE,
	LOMO_PLAYER_ERROR_SET_STATE,
	LOMO_PLAYER_ERROR_BLOCK_BY_HOOK
} LomoPlayerError;

LOMO_PLAYER_ERROR_MISSING_METHOD

Method is not implemented

LOMO_PLAYER_ERROR_MISSING_PIPELINE

Pipeline is missing

LOMO_PLAYER_ERROR_UNKNOW_STATE

Pipeline's state is unknow

LOMO_PLAYER_ERROR_SET_STATE

State cannot be set

LOMO_PLAYER_ERROR_BLOCK_BY_HOOK

Action was blocked by hook

LomoPlayerHook ()

gboolean            (*LomoPlayerHook)                   (LomoPlayer *self,
                                                         LomoPlayerHookEvent event,
                                                         gpointer ret,
                                                         gpointer data);

Handles hook events

self :

A LomoPlayer

event :

The LomoPlayerHookEvent to handle

ret :

Alternative value for return

data :

User data

Returns :

TRUE if event was handle and stop the default implementation, FALSE if other hooks and default implementation should be called

LomoPlayerHookEvent

typedef struct {
	LomoPlayerHookType type;
	gint64 old, new;    // seek
	gint volume;        // volume
	LomoStream *stream; // insert, remove, queue, dequeue, tag, all_tags
	gint pos;           // insert, remove
	gint queue_pos;     // queue, dequeue
	gint from, to;      // change
	const gchar *tag;   // tag
	gboolean value;     // random, repeat, mute
	GError *error;      // error
} LomoPlayerHookEvent;

Packs relative for a concrete event, depending the type of the event more or less fields will be set, others will be unconcrete.

LomoPlayerHookType type;

Type of the event

gint64 old;

Old position (seek type event)

gint64 new;

New position (seek type event)

gint volume;

Volumen value (volume type event)

LomoStream *stream;

Stream object (insert, remove, queue, dequeue, tag and all_tags event types)

gint pos;

Position (insert and remove event types)

gint queue_pos;

Queue position (queue and dequeue event types)

gint from;

From position (change event type)

gint to;

From position (change event type)

const gchar *tag;

Tag value (tag event type)

gboolean value;

TRUE or FALSE (randonm, repeat and mute event types)

GError *error;

A GError (error event type)

enum LomoPlayerHookType

typedef enum {
	LOMO_PLAYER_HOOK_PLAY,
	LOMO_PLAYER_HOOK_PAUSE,
	LOMO_PLAYER_HOOK_STOP,
	LOMO_PLAYER_HOOK_SEEK,
	LOMO_PLAYER_HOOK_VOLUME,
	LOMO_PLAYER_HOOK_MUTE,
	LOMO_PLAYER_HOOK_INSERT,
	LOMO_PLAYER_HOOK_REMOVE,
	LOMO_PLAYER_HOOK_QUEUE,
	LOMO_PLAYER_HOOK_DEQUEUE,
	LOMO_PLAYER_HOOK_QUEUE_CLEAR,
	LOMO_PLAYER_HOOK_CHANGE,
	LOMO_PLAYER_HOOK_CLEAR,
	LOMO_PLAYER_HOOK_REPEAT,
	LOMO_PLAYER_HOOK_RANDOM,
	LOMO_PLAYER_HOOK_EOS,
	LOMO_PLAYER_HOOK_ERROR,
	LOMO_PLAYER_HOOK_TAG,
	LOMO_PLAYER_HOOK_ALL_TAGS
} LomoPlayerHookType;

Determines the type of hook

LOMO_PLAYER_HOOK_PLAY

Play hook

LOMO_PLAYER_HOOK_PAUSE

Pause hook

LOMO_PLAYER_HOOK_STOP

Stop hook

LOMO_PLAYER_HOOK_SEEK

Seek hook

LOMO_PLAYER_HOOK_VOLUME

Volume hook

LOMO_PLAYER_HOOK_MUTE

Mute hook

LOMO_PLAYER_HOOK_INSERT

Insert hook

LOMO_PLAYER_HOOK_REMOVE

Remove hook

LOMO_PLAYER_HOOK_QUEUE

Queue hook

LOMO_PLAYER_HOOK_DEQUEUE

Dequeue hook

LOMO_PLAYER_HOOK_QUEUE_CLEAR

Queue clear hook

LOMO_PLAYER_HOOK_CHANGE

Changed hook

LOMO_PLAYER_HOOK_CLEAR

Clear hook

LOMO_PLAYER_HOOK_REPEAT

Repeat hook

LOMO_PLAYER_HOOK_RANDOM

Random hook

LOMO_PLAYER_HOOK_EOS

EOS hook

LOMO_PLAYER_HOOK_ERROR

Error hook

LOMO_PLAYER_HOOK_TAG

Tag hook

LOMO_PLAYER_HOOK_ALL_TAGS

All tags hook

LomoPlayerVTable

typedef struct {
	GstElement*          (*set_uri)   (GstElement *old_pipeline, const gchar *uri, GHashTable *opts);

	GstStateChangeReturn (*set_state) (GstElement *pipeline, GstState state);
	GstState             (*get_state) (GstElement *pipeline);

	gboolean (*set_position) (GstElement *pipeline, GstFormat  format, gint64  position);
	gboolean (*get_position) (GstElement *pipeline, GstFormat *format, gint64 *position);
	gboolean (*get_length)   (GstElement *pipeline, GstFormat *format, gint64 *duration);

	// 0 lowest, 100 highest (there is not a common range over all posible
	// sinks, so make it relative and let vfunc set it
	gboolean (*set_volume) (GstElement *pipeline, gint volume);
	gint     (*get_volume) (GstElement *pipeline);

	// Can be omited
	gboolean (*set_mute) (GstElement *pipeline, gboolean mute);
	gboolean (*get_mute) (GstElement *pipeline);
} LomoPlayerVTable;

Override default methods from LomoPlayer. This method for override methods will be replaced with class methods for LomoPlayer in the future.

set_uri ()

Method to create or reset a GstElement for new URI

set_state ()

Method to set state on a GstElement

get_state ()

Method to get volume from a GstElement

set_position ()

Method to set position from a GstElement in the specified format

get_position ()

Method to get position and format from a GstElement

get_length ()

Method to get the lenght of the stream currently in GstElement

set_volume ()

Method to set the volume on a GstElement

get_volume ()

Method to get the volume from a GstElement

set_mute ()

Method to set mute on a GstElement. [allow-none]

get_mute ()

Method to get mute on a GstElement. [allow-none]

enum LomoState

typedef enum {
	LOMO_STATE_INVALID = -1,
	LOMO_STATE_STOP    = 0,
	LOMO_STATE_PLAY    = 1,
	LOMO_STATE_PAUSE   = 2,

	LOMO_STATE_N_STATES
} LomoState;

Defines the state of the LomoPlayer object

LOMO_STATE_INVALID

Invalid state

LOMO_STATE_STOP

Stop state

LOMO_STATE_PLAY

Play state

LOMO_STATE_PAUSE

Pause state

LOMO_STATE_N_STATES

Helper define

enum LomoStateChangeReturn

typedef enum {
	LOMO_STATE_CHANGE_SUCCESS     = GST_STATE_CHANGE_SUCCESS,
	LOMO_STATE_CHANGE_ASYNC       = GST_STATE_CHANGE_ASYNC,
	LOMO_STATE_CHANGE_NO_PREROLL  = GST_STATE_CHANGE_NO_PREROLL,
	LOMO_STATE_CHANGE_FAILURE     = GST_STATE_CHANGE_FAILURE,
} LomoStateChangeReturn;

Defines how the state change is performed after a lomo_player_set_state() call

LOMO_STATE_CHANGE_SUCCESS

The state has changed

LOMO_STATE_CHANGE_ASYNC

State change will append async

LOMO_STATE_CHANGE_NO_PREROLL

See GST_STATE_CHANGE_NO_PREROLL

LOMO_STATE_CHANGE_FAILURE

State change has failed.

lomo_player_append_multiple()

#define lomo_player_append_multiple(self, streams) lomo_player_insert_multiple(self, streams, -1)

lomo_player_append_strv()

#define lomo_player_append_strv(self, uris)        lomo_player_insert_strv(self, uris, -1)

lomo_player_clear ()

void                lomo_player_clear                   (LomoPlayer *self);

lomo_player_dequeue ()

gboolean            lomo_player_dequeue                 (LomoPlayer *self,
                                                         gint queue_index);

Removes the element indicated by queue_pos from the queue

self :

a LomoPlayer

queue_index :

Index of the queue to dequeue

Returns :

TRUE if element was dequeue, FALSE if queue_pos was invalid

lomo_player_get_auto_parse ()

gboolean            lomo_player_get_auto_parse          (LomoPlayer *self);

Gets the auto-parse property value.

self :

a LomoPlayer

Returns :

The auto-parse property value.

lomo_player_get_auto_play ()

gboolean            lomo_player_get_auto_play           (LomoPlayer *self);

Gets the auto-play property value.

self :

a LomoPlayer

Returns :

The auto-play property value.

lomo_player_get_can_go_next ()

gboolean            lomo_player_get_can_go_next         (LomoPlayer *self);

Gets the value of the 'can-go-next' property

self :

A LomoPlayer

Returns :

The value

lomo_player_get_can_go_previous ()

gboolean            lomo_player_get_can_go_previous     (LomoPlayer *self);

Gets the value of the 'can-go-previous' property

self :

A LomoPlayer

Returns :

The value

lomo_player_get_current ()

gint                lomo_player_get_current             (LomoPlayer *self);

Gets the index for the current active stream in the player

self :

A LomoPlayer

Returns :

the index

lomo_player_get_current_stream()

#define lomo_player_get_current_stream(self) lomo_player_get_nth_stream(self, lomo_player_get_current(self))

lomo_player_get_gapless_mode ()

gboolean            lomo_player_get_gapless_mode        (LomoPlayer *self);

Returns whether the gapless mode is active or not

self :

A LomoPlayer

Returns :

TRUE if gapless mode is enabled

lomo_player_get_length ()

gint64              lomo_player_get_length              (LomoPlayer *self);

lomo_player_get_mute ()

gboolean            lomo_player_get_mute                (LomoPlayer *self);

Gets current mute value

self :

a LomoPlayer

Returns :

current mute value

lomo_player_get_n_streams ()

gint                lomo_player_get_n_streams           (LomoPlayer *self);

lomo_player_get_next ()

gint                lomo_player_get_next                (LomoPlayer *self);

Gets the position of the next stream in the playlist following random and repeat behaviours

self :

a LomoPlayer

Returns :

the position of the next stream, or -1 if none

lomo_player_get_nth_stream ()

LomoStream *        lomo_player_get_nth_stream          (LomoPlayer *self,
                                                         gint index);

Gets the LomoStream at the given position

self :

a LomoPlayer

index :

the index of the LomoStream, starting from 0

Returns :

the LomoStream, or NULL if index is off the list. [transfer none]

lomo_player_get_playlist ()

const GList *       lomo_player_get_playlist            (LomoPlayer *self);

Gets current playlist

self :

a LomoPlayer

Returns :

a GList of LomoStream. Should not be modified. [element-type Lomo.Stream][transfer none]

lomo_player_get_position ()

gint64              lomo_player_get_position            (LomoPlayer *self);

lomo_player_get_previous ()

gint                lomo_player_get_previous            (LomoPlayer *self);

Gets the position of the previous stream in the playlist following random and repeat behaviours

self :

a LomoPlayer

Returns :

the position of the previous stream, or -1 if none

lomo_player_get_random ()

gboolean            lomo_player_get_random              (LomoPlayer *self);

Gets current value of the random behaviour

self :

a LomoPlayer

Returns :

TRUE if repeat is applied, FALSE otherwise

lomo_player_get_repeat ()

gboolean            lomo_player_get_repeat              (LomoPlayer *self);

Gets current value of the repeat behaviour

self :

a LomoPlayer

Returns :

TRUE if repeat is applied, FALSE otherwise

lomo_player_get_state ()

LomoState           lomo_player_get_state               (LomoPlayer *self);

Gets current state from self

self :

The LomoPlayer

Returns :

a LomoState representing current state

lomo_player_get_stream_index ()

gint                lomo_player_get_stream_index        (LomoPlayer *self,
                                                         LomoStream *stream);

lomo_player_get_volume ()

gint                lomo_player_get_volume              (LomoPlayer *self);

Gets current volume (between 0 and 100)

self :

a LomoPlayer

Returns :

current volume

lomo_player_go_next()

#define lomo_player_go_next(self,error)      lomo_player_set_current(self, lomo_player_get_next(self), error)

lomo_player_go_previous()

#define lomo_player_go_previous(self,error)  lomo_player_set_current(self, lomo_player_get_previous(self), error)

lomo_player_hook_add ()

void                lomo_player_hook_add                (LomoPlayer *self,
                                                         LomoPlayerHook func,
                                                         gpointer data);

Add a hook to the hook system

self :

a LomoPlayer

func :

a LomoPlayerHook function. [scope call]

data :

data to pass to func or NULL to ignore

lomo_player_hook_remove ()

void                lomo_player_hook_remove             (LomoPlayer *self,
                                                         LomoPlayerHook func);

Remove a hook from the hook system

self :

a LomoPlayer

func :

a LomoPlayerHook function. [scope call]

lomo_player_insert ()

void                lomo_player_insert                  (LomoPlayer *self,
                                                         LomoStream *stream,
                                                         gint index);

Inserts a LomoStream in the internal playlist

self :

a LomoPlayer

stream :

a LomoStream which will be owner by self. [transfer none]

index :

position to insert the element, If this is negative, or is larger than the number of elements in the list, the new element is added on to the end of the list.

lomo_player_insert_multiple ()

void                lomo_player_insert_multiple         (LomoPlayer *self,
                                                         GList *streams,
                                                         gint index);

Inserts multiple streams in the internal playlist

self :

a LomoPlayer

streams :

a GList of LomoStream which will be owned by self. [transfer none]

index :

Index to insert the elements, If this is negative, or is larger than the number of elements in the list, the new elements are added on to the end of the list.

lomo_player_insert_strv ()

void                lomo_player_insert_strv             (LomoPlayer *self,
                                                         const gchar *const *uris,
                                                         gint index);

Inserts multiple URIs into self

self :

a LomoPlayer

uris :

a NULL-terminated array of URIs. [transfer none][array zero-terminated=1][element-type utf8]

index :

Index to insert the elements, If this is negative, or is larger than the number of elements in the list, the new elements are added on to the end of the list.

lomo_player_insert_uri ()

void                lomo_player_insert_uri              (LomoPlayer *self,
                                                         const gchar *uri,
                                                         gint index);

Inserts a LomoStream in the internal playlist

self :

a LomoPlayer

uri :

a URI

index :

position to insert the element, If this is negative, or is larger than the number of elements in the list, the new element is added on to the end of the list.

lomo_player_new ()

LomoPlayer *        lomo_player_new                     (gchar *option_name,
                                                         ...);

Creates a new LomoPlayer with options

option_name :

First option name

Varargs :

A NULL-terminated pairs of option-name,option-value

Returns :

the new created LomoPlayer

lomo_player_pause()

#define lomo_player_pause(self,error) lomo_player_set_state(self, LOMO_STATE_PAUSE, error)

lomo_player_play()

#define lomo_player_play(self,error)  lomo_player_set_state(self, LOMO_STATE_PLAY,  error)

lomo_player_queue ()

gint                lomo_player_queue                   (LomoPlayer *self,
                                                         gint index);

Queues the element for inmediate play after active element

self :

a LomoPlayer

index :

position of the element to queue

Returns :

index of the elemement in the queue

lomo_player_queue_clear ()

void                lomo_player_queue_clear             (LomoPlayer *self);

Removes all LomoStream queued

self :

a LomoPlayer

lomo_player_queue_get_n_streams ()

gint                lomo_player_queue_get_n_streams     (LomoPlayer *self);

Returns the number of streams in the queue

self :

A LomoPlayer

Returns :

Number of streams

lomo_player_queue_get_nth_stream ()

LomoStream *        lomo_player_queue_get_nth_stream    (LomoPlayer *self,
                                                         gint queue_index);

Gets the LomoStream at the given position in the queue

self :

a LomoPlayer

queue_index :

The queue index of the element, starting from 0

Returns :

the LomoStream, or NULL if the position is off the end of the queue. [transfer none]

lomo_player_queue_get_stream_index ()

gint                lomo_player_queue_get_stream_index  (LomoPlayer *self,
                                                         LomoStream *stream);

lomo_player_remove ()

gboolean            lomo_player_remove                  (LomoPlayer *self,
                                                         gint index);

Removes a LomoStream from the internal playlist using and index This also implies a reference decrease on the element

self :

a LomoPlayer

index :

Index of the LomoStream to remove

Returns :

TRUE is position was remove, FALSE otherwise

lomo_player_set_auto_parse ()

void                lomo_player_set_auto_parse          (LomoPlayer *self,
                                                         gboolean auto_parse);

Sets the auto-parse property value.

self :

a LomoPlayer

auto_parse :

new value for auto-parse property

lomo_player_set_auto_play ()

void                lomo_player_set_auto_play           (LomoPlayer *self,
                                                         gboolean auto_play);

Sets the auto-play property value.

self :

a LomoPlayer

auto_play :

new value for auto-play property

lomo_player_set_current ()

gboolean            lomo_player_set_current             (LomoPlayer *self,
                                                         gint index,
                                                         GError **error);

Gets the current active item

self :

An LomoPlayer

index :

Index

error :

Location for errors

Returns :

TRUE on successfull, FALSE otherwise

lomo_player_set_gapless_mode ()

void                lomo_player_set_gapless_mode        (LomoPlayer *self,
                                                         gboolean gapless_mode);

Enables or disables the gapless mode

self :

A LomoPlayer

gapless_mode :

Whatever the gapless mode has to be actived or not

lomo_player_set_mute ()

gboolean            lomo_player_set_mute                (LomoPlayer *self,
                                                         gboolean mute);

Sets mute

self :

a LomoPlayer

mute :

new value for mute

Returns :

TRUE on success, FALSE if an error ocurred

lomo_player_set_position ()

gboolean            lomo_player_set_position            (LomoPlayer *self,
                                                         gint64 position);

lomo_player_set_random ()

void                lomo_player_set_random              (LomoPlayer *self,
                                                         gboolean val);

Sets the value of the random behaviour, if value is TRUE playlist will be randomized

self :

a LomoPlayer

val :

Value for random behaviour

lomo_player_set_repeat ()

void                lomo_player_set_repeat              (LomoPlayer *self,
                                                         gboolean val);

Sets the value of the repeat behaviour

self :

a LomoPlayer

val :

Value for repeat behaviour

lomo_player_set_state ()

gboolean            lomo_player_set_state               (LomoPlayer *self,
                                                         LomoState state,
                                                         GError **error);

Changes state of self to state.

self :

The LomoPlayer

state :

The LomoState to set

error :

Location to store error (if any)

Returns :

TRUE if successful, FALSE otherwise

lomo_player_set_volume ()

gboolean            lomo_player_set_volume              (LomoPlayer *self,
                                                         gint val);

Sets volume, val must be between 0 and 100

self :

a LomoPlayer

val :

new value for volume

Returns :

TRUE on success, FALSE if an error ocurred

lomo_player_stats_get_stream_time_played ()

gint64              lomo_player_stats_get_stream_time_played
                                                        (LomoPlayer *self);

self :

a LomoPlayer

Returns :

Microseconds stream was played

lomo_player_stop()

#define lomo_player_stop(self,error)  lomo_player_set_state(self, LOMO_STATE_STOP,  error)

Property Details

The "auto-parse" property

  "auto-parse"               gboolean              : Read / Write / Construct

Control if LomoPlayer must parse automatically all inserted streams

Default value: TRUE


The "auto-play" property

  "auto-play"                gboolean              : Read / Write / Construct

Control if LomoPlayer should auto start play when any stream is available

Default value: FALSE


The "can-go-next" property

  "can-go-next"              gboolean              : Read

Check if player can forward in playlist

Default value: FALSE


The "can-go-previous" property

  "can-go-previous"          gboolean              : Read

Check if player can backwards in playlist

Default value: FALSE


The "current" property

  "current"                  gint                  : Read / Write / Construct

Current active stream

Allowed values: >= G_MAXULONG

Default value: -1


The "gapless-mode" property

  "gapless-mode"             gboolean              : Read / Write / Construct

Gapless mode.

Default value: TRUE


The "mute" property

  "mute"                     gboolean              : Read / Write / Construct

Mute value, TRUE or FALSE

Default value: FALSE


The "position" property

  "position"                 gint64                : Read / Write

Position within the stream

Allowed values: >= -1

Default value: 0


The "random" property

  "random"                   gboolean              : Read / Write / Construct

Enables or disables random mode

Default value: FALSE


The "repeat" property

  "repeat"                   gboolean              : Read / Write / Construct

Enables or disables repeat mode

Default value: FALSE


The "state" property

  "state"                    LomoStateEnumType     : Read / Write / Construct

State of the player

Default value: LOMO_STATE_STOP


The "volume" property

  "volume"                   gint                  : Read / Write / Construct

Volume value, from 0 to 100.

Allowed values: [0,100]

Default value: 50

Signal Details

The "all-tags" signal

void                user_function                      (LomoPlayer *lomo,
                                                        GObject    *stream,
                                                        gpointer    user_data)      : Run Last

Emitted when all (or no more to be discoverd) tag are found for a LomoStream

lomo :

the object that received the signal

stream :

LomoStream which discoved all his tags

user_data :

user data set when the signal handler was connected.

The "change" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gint        from,
                                                        gint        to,
                                                        gpointer    user_data)      : Run Last

Emitted when the active element in the internal playlist changes

lomo :

the object that received the signal

from :

Active element before the change

to :

Active element after the change

user_data :

user data set when the signal handler was connected.

The "clear" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gpointer    user_data)      : Run Last

Emitted when the playlist of a LomoPlayer is cleared

lomo :

the object that received the signal

user_data :

user data set when the signal handler was connected.

The "dequeue" signal

void                user_function                      (LomoPlayer *lomo,
                                                        GObject    *stream,
                                                        gint        position,
                                                        gint        arg3,
                                                        gpointer    user_data)      : Run Last

Emitted when a LomoStream is dequeue inside a LomoPlayer

lomo :

the object that received the signal

stream :

LomoStream object that was removed

position :

last position of the stream in the queue

user_data :

user data set when the signal handler was connected.

The "eos" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gpointer    user_data)      : Run Last

Emitted when current stream reaches end of stream, think about end of file for file descriptors.

lomo :

the object that received the signal

user_data :

user data set when the signal handler was connected.

The "error" signal

void                user_function                      (LomoPlayer *lomo,
                                                        GObject    *error,
                                                        gpointer    arg2,
                                                        gpointer    user_data)      : Run Last

Emitted when some error was ocurred.

lomo :

the object that received the signal

error :

error ocurred

user_data :

user data set when the signal handler was connected.

The "insert" signal

void                user_function                      (LomoPlayer *lomo,
                                                        GObject    *stream,
                                                        gint        position,
                                                        gpointer    user_data)      : Run Last

Emitted when a LomoStream is inserted into LomoPlayer

lomo :

the object that received the signal

stream :

LomoStream object that was added

position :

position of the stream in the playlist

user_data :

user data set when the signal handler was connected.

The "mute" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gboolean    mute,
                                                        gpointer    user_data)      : Run Last

Emitted when LomoPlayer mutes or unmutes

lomo :

the object that received the signal

mute :

Current value state of mute

user_data :

user data set when the signal handler was connected.

The "pause" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gpointer    user_data)      : Run Last

Emitted when LomoPlayer changes his state to LOMO_STATE_PAUSE

lomo :

the object that received the signal

user_data :

user data set when the signal handler was connected.

The "play" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gpointer    user_data)      : Run Last

Emitted when LomoPlayer changes his state to LOMO_STATE_PLAY

lomo :

the object that received the signal

user_data :

user data set when the signal handler was connected.

The "pre-change" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gpointer    user_data)      : Run Last

Emitted before an change event

Note

This signal is deprecated, use LomoPlayerHook as a replacement

lomo :

the object that received the signal

from :

active stream at the current instant

to :

active stream after the change will be completed

user_data :

user data set when the signal handler was connected.

The "queue" signal

void                user_function                      (LomoPlayer *lomo,
                                                        GObject    *stream,
                                                        gint        position,
                                                        gint        arg3,
                                                        gpointer    user_data)      : Run Last

Emitted when a LomoStream is queued inside a LomoPlayer

lomo :

the object that received the signal

stream :

LomoStream object that was queued

position :

position of the stream in the queue

user_data :

user data set when the signal handler was connected.

The "queue-clear" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gpointer    user_data)      : Run Last

Emitted when the queue of a LomoPlayer is cleared

lomo :

the object that received the signal

user_data :

user data set when the signal handler was connected.

The "random" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gboolean    repeat,
                                                        gpointer    user_data)      : Run Last

Emitted when value of the random behaviour changes

lomo :

the object that received the signal

repeat :

value of random behaviour

user_data :

user data set when the signal handler was connected.

The "remove" signal

void                user_function                      (LomoPlayer *lomo,
                                                        GObject    *stream,
                                                        gint        position,
                                                        gpointer    user_data)      : Run Last

Emitted when a LomoStream is remove from LomoPlayer

lomo :

the object that received the signal

stream :

LomoStream object that was removed

position :

last position of the stream in the playlist

user_data :

user data set when the signal handler was connected.

The "repeat" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gboolean    repeat,
                                                        gpointer    user_data)      : Run Last

Emitted when value of the repeat behaviour changes

lomo :

the object that received the signal

repeat :

value of repeat behaviour

user_data :

user data set when the signal handler was connected.

The "seek" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gint64      from,
                                                        gint64      to,
                                                        gpointer    user_data)      : Run Last

Emitted when LomoPlayer seeks in a stream

lomo :

the object that received the signal

from :

Position before the seek

to :

Position after the seek

user_data :

user data set when the signal handler was connected.

The "state-changed" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gpointer    user_data)      : Run Last

Emitted when LomoPlayer changes his state.

lomo :

the object that received the signal

user_data :

user data set when the signal handler was connected.

The "stop" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gpointer    user_data)      : Run Last

Emitted when LomoPlayer changes his state to LOMO_STATE_STOP

lomo :

the object that received the signal

user_data :

user data set when the signal handler was connected.

The "tag" signal

void                user_function                      (LomoPlayer *lomo,
                                                        GObject    *stream,
                                                        gchar      *tag,
                                                        gpointer    user_data)      : Run Last

Emitted when some tag is found in a stream.

lomo :

the object that received the signal

stream :

LomoStream that gives a new tag. [type LomoStream]

tag :

Discoved tag

user_data :

user data set when the signal handler was connected.

The "volume" signal

void                user_function                      (LomoPlayer *lomo,
                                                        gint        volume,
                                                        gpointer    user_data)      : Run Last

Emitted when LomoPlayer changes his volume

lomo :

the object that received the signal

volume :

New value of volume (between 0 and 100)

user_data :

user data set when the signal handler was connected.