Player


Enumerations

enum  MpdState { MPD_PLAYER_PAUSE = MPD_STATUS_STATE_PAUSE, MPD_PLAYER_PLAY = MPD_STATUS_STATE_PLAY, MPD_PLAYER_STOP = MPD_STATUS_STATE_STOP, MPD_PLAYER_UNKNOWN = MPD_STATUS_STATE_UNKNOWN }

Functions

int mpd_player_play (MpdObj *mi)
int mpd_player_play_id (MpdObj *mi, int id)
int mpd_player_stop (MpdObj *mi)
int mpd_player_next (MpdObj *mi)
int mpd_player_prev (MpdObj *mi)
int mpd_player_pause (MpdObj *mi)
int mpd_player_get_state (MpdObj *mi)
int mpd_player_get_current_song_id (MpdObj *mi)
int mpd_player_get_current_song_pos (MpdObj *mi)
int mpd_player_get_repeat (MpdObj *mi)
int mpd_player_set_repeat (MpdObj *mi, int repeat)
int mpd_player_get_random (MpdObj *mi)
int mpd_player_set_random (MpdObj *mi, int random)
int mpd_player_seek (MpdObj *mi, int sec)

Detailed Description

These functions allow the client to control the player part of mpd. To use the read functions you need "read" permission on mpd. To use the control functions you need "control" and "read" permission on mpd.

Enumeration Type Documentation

enum MpdState

Enum representing the possible states of the player

Enumerator:
MPD_PLAYER_PAUSE  The player is paused
MPD_PLAYER_PLAY  The player is playing
MPD_PLAYER_STOP  The player is stopped
MPD_PLAYER_UNKNOWN  The player is in an unknown state

Definition at line 34 of file libmpd-player.h.


Function Documentation

int mpd_player_get_current_song_id ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Returns the id of the currently playing song

Returns:
the songid of the playing song

int mpd_player_get_current_song_pos ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Returns the position of the currently playing song in the playlist

Returns:
the position of the playing song

int mpd_player_get_random ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Get the state of random: 1 if enabled, 0 when disabled.

Returns:
the state of random
Examples:
testcase.c.

int mpd_player_get_repeat ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Get the state of repeat: 1 if enabled, 0 when disabled.

Returns:
the state of repeat
Examples:
testcase.c.

int mpd_player_get_state ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Returns the mpd play state (play/paused/stop)

Returns:
a MpdState
Examples:
testcase.c.

int mpd_player_next ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Sends mpd the next command.

Returns:
a MpdError
Examples:
testcase.c.

int mpd_player_pause ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Sends mpd the pause command.

Returns:
a MpdError
Examples:
testcase.c.

int mpd_player_play ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Sends mpd the play command.

This equals:

Returns:
a MpdError
Examples:
testcase.c.

int mpd_player_play_id ( MpdObj mi,
int  id 
)

Parameters:
mi a MpdObj
id a songid.
Plays the song with id

Returns:
a MpdError
Examples:
testcase.c.

int mpd_player_prev ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Sends mpd the prev command.

Returns:
a MpdError
Examples:
testcase.c.

int mpd_player_seek ( MpdObj mi,
int  sec 
)

Parameters:
mi a MpdObj
sec Position to seek to. (in seconds)
Seek through the current song.
Returns:
a MpdError

int mpd_player_set_random ( MpdObj mi,
int  random 
)

Parameters:
mi a MpdObj
random New state of random (1 is enabled, 0 is disabled)
Enable/disable random

Returns:
0 when successful
Examples:
testcase.c.

int mpd_player_set_repeat ( MpdObj mi,
int  repeat 
)

Parameters:
mi a MpdObj
repeat New state of repeat (1 is enabled, 0 is disabled)
Enable/disabled repeat

Returns:
0 when successful
Examples:
testcase.c.

int mpd_player_stop ( MpdObj mi  ) 

Parameters:
mi a MpdObj
Sends mpd the stop command.

Returns:
a MpdError
Examples:
testcase.c.


Copyright 2006 Qball Cow