libmpd  0.19.0
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_get_consume (MpdObj *mi)
int mpd_player_get_single (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)
int mpd_player_get_next_song_pos (MpdObj *mi)
int mpd_player_get_next_song_id (MpdObj *mi)
int mpd_player_set_single (MpdObj *mi, int single)
int mpd_player_set_consume (MpdObj *mi, int consume)

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_consume ( MpdObj *  mi)
Parameters:
mia #MpdObj

Get the state of consume mode: 1 if enabled, 0 when disabled.

Returns:
the state of consume
int mpd_player_get_current_song_id ( MpdObj *  mi)
Parameters:
mia #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:
mia #MpdObj

Returns the position of the currently playing song in the playlist

Returns:
the position of the playing song
int mpd_player_get_next_song_id ( MpdObj *  mi)
int mpd_player_get_next_song_pos ( MpdObj *  mi)
int mpd_player_get_random ( MpdObj *  mi)
Parameters:
mia #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:
mia #MpdObj

Get the state of repeat: 1 if enabled, 0 when disabled.

Returns:
the state of repeat
Examples:
testcase.c.
int mpd_player_get_single ( MpdObj *  mi)
Parameters:
mia #MpdObj

Get the state of single mode: 1 if enabled, 0 when disabled.

Returns:
the state of single
int mpd_player_get_state ( MpdObj *  mi)
Parameters:
mia #MpdObj

Returns the mpd play state (play/paused/stop)

Returns:
a MpdState
Examples:
testcase.c.
int mpd_player_next ( MpdObj *  mi)
Parameters:
mia #MpdObj

Sends mpd the next command.

Returns:
a #MpdError
Examples:
testcase.c.
int mpd_player_pause ( MpdObj *  mi)
Parameters:
mia #MpdObj

Sends mpd the pause command.

Returns:
a #MpdError
Examples:
testcase.c.
int mpd_player_play ( MpdObj *  mi)
Parameters:
mia #MpdObj

Sends mpd the play command.

This equals:

Returns:
a #MpdError
Examples:
testcase.c.
int mpd_player_play_id ( MpdObj *  mi,
int  id 
)
Parameters:
mia #MpdObj
ida songid.

Plays the song with id

Returns:
a #MpdError
Examples:
testcase.c.
int mpd_player_prev ( MpdObj *  mi)
Parameters:
mia #MpdObj

Sends mpd the prev command.

Returns:
a #MpdError
Examples:
testcase.c.
int mpd_player_seek ( MpdObj *  mi,
int  sec 
)
Parameters:
mia #MpdObj
secPosition to seek to. (in seconds)

Seek through the current song.

Returns:
a #MpdError
int mpd_player_set_consume ( MpdObj *  mi,
int  consume 
)
Parameters:
mia #MpdObj
consumethe state of consume mode

Enable/disable consume mode. (consume = 1 is enabled, consume = 0 disabled)

int mpd_player_set_random ( MpdObj *  mi,
int  random 
)
Parameters:
mia #MpdObj
randomNew 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:
mia #MpdObj
repeatNew state of repeat (1 is enabled, 0 is disabled)

Enable/disabled repeat

Returns:
0 when successful
Examples:
testcase.c.
int mpd_player_set_single ( MpdObj *  mi,
int  single 
)
Parameters:
mia #MpdObj
singlethe state of single mode

Enable/disable single mode. (single = 1 is enabled, single = 0 disabled)

Returns:
a #MpdError
int mpd_player_stop ( MpdObj *  mi)
Parameters:
mia #MpdObj

Sends mpd the stop command.

Returns:
a #MpdError
Examples:
testcase.c.