add comment to strfsong parser
[libmpd.git] / src / libmpd-player.h
blob45bf1ad0dd811c1226d442257eabd577445396fe
1 /*
2 * Copyright (C) 2004-2005 Qball Cow <Qball@qballcow.nl>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 /**
22 * @defgroup Player Player
23 * These functions allow the client to control the player part of mpd.
24 * To use the read functions you need "read" permission on mpd.
25 * To use the control functions you need "control" and "read" permission on mpd.
27 /* @{*/
28 #ifndef __MPD_LIB_PLAYER__
29 #define __MPD_LIB_PLAYER__
31 /**
32 * Enum representing the possible states of the player
35 typedef enum {
36 /** The player is paused */
37 MPD_PLAYER_PAUSE = MPD_STATUS_STATE_PAUSE,
38 /** The player is playing */
39 MPD_PLAYER_PLAY = MPD_STATUS_STATE_PLAY,
40 /** The player is stopped */
41 MPD_PLAYER_STOP = MPD_STATUS_STATE_STOP,
42 /** The player is in an unknown state */
43 MPD_PLAYER_UNKNOWN = MPD_STATUS_STATE_UNKNOWN
44 } MpdState;
46 /**
47 * \param mi a #MpdObj
49 * Sends mpd the play command.
51 * This equals:
52 * @code
53 * mpd_player_play_id(mi, -1);
54 * @endcode
56 * @returns a #MpdError
58 int mpd_player_play(MpdObj * mi);
61 /**
63 * \param mi a #MpdObj
64 * \param id a songid.
66 * Plays the song with id
68 * @returns a #MpdError
70 int mpd_player_play_id(MpdObj * mi, int id);
73 /**
74 * \param mi a #MpdObj
76 * Sends mpd the stop command.
78 * @returns a #MpdError
80 int mpd_player_stop(MpdObj * mi);
83 /**
84 * \param mi a #MpdObj
86 * Sends mpd the next command.
88 * @returns a #MpdError
90 int mpd_player_next(MpdObj * mi);
93 /**
94 * \param mi a #MpdObj
96 * Sends mpd the prev command.
98 * @returns a #MpdError
100 int mpd_player_prev(MpdObj * mi);
104 * \param mi a #MpdObj
106 * Sends mpd the pause command.
108 * @returns a #MpdError
110 int mpd_player_pause(MpdObj * mi);
114 * \param mi a #MpdObj
116 * Returns the mpd play state (play/paused/stop)
118 * @returns a #MpdState
120 int mpd_player_get_state(MpdObj * mi);
123 * \param mi a #MpdObj
125 * Returns the id of the currently playing song
127 * @returns the songid of the playing song
129 int mpd_player_get_current_song_id(MpdObj * mi);
133 * \param mi a #MpdObj
135 * Returns the position of the currently playing song in the playlist
137 * @returns the position of the playing song
139 int mpd_player_get_current_song_pos(MpdObj * mi);
143 * \param mi a #MpdObj
145 * Get the state of repeat: 1 if enabled, 0 when disabled.
147 * @returns the state of repeat
149 int mpd_player_get_repeat(MpdObj * mi);
153 * \param mi a #MpdObj
154 * \param repeat New state of repeat (1 is enabled, 0 is disabled)
156 * Enable/disabled repeat
158 * @returns 0 when succesfull
160 int mpd_player_set_repeat(MpdObj * mi, int repeat);
162 * \param mi a #MpdObj
164 * Get the state of random: 1 if enabled, 0 when disabled.
166 * @returns the state of random
169 int mpd_player_get_random(MpdObj * mi);
171 * @param mi a #MpdObj
172 * @param random New state of random (1 is enabled, 0 is disabled)
174 * Enable/disabled random
176 * @returns 0 when succesfull
178 int mpd_player_set_random(MpdObj * mi, int random);
182 * @param mi a #MpdObj
183 * @param sec Position to seek to. (in seconds)
185 * Seek through the current song.
186 * @returns a #MpdError
188 int mpd_player_seek(MpdObj * mi, int sec);
190 #endif
192 /*@}*/