Player
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 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:
-
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:
-
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:
-
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:
-
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:
-
Returns the mpd play state (play/paused/stop)
- Returns:
- a MpdState
- Examples:
-
testcase.c.
int mpd_player_next |
( |
MpdObj * |
mi |
) |
|
int mpd_player_pause |
( |
MpdObj * |
mi |
) |
|
int mpd_player_play |
( |
MpdObj * |
mi |
) |
|
- Parameters:
-
Sends mpd the play command.
This equals:
- Returns:
- a MpdError
- Examples:
-
testcase.c.
int mpd_player_play_id |
( |
MpdObj * |
mi, |
|
|
int |
id | |
|
) |
| | |
int mpd_player_prev |
( |
MpdObj * |
mi |
) |
|
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 |
) |
|