1 [CCode (cprefix = "mpd_", cheader_filename = "libmpd/libmpd.h")]
4 [CCode (cname = "MpdObj",cprefix="mpd_", cheader_filename="libmpd/libmpd.h")]
7 [CCode (cname="mpd_check_connected")]
8 public bool check_connected();
10 public bool connected { get { return check_connected();}}
12 public MPD.Song playlist_get_song(int songid);
13 public unowned MPD.Song playlist_get_current_song();
14 public int player_get_next_song_id();
15 [CCode (cname="mpd_server_get_database_update_time")]
16 public int get_database_update_time();
17 [CCode (cname="mpd_status_db_is_updating")]
18 public bool is_updating_database();
19 [CCode (cname="mpd_server_tag_supported")]
20 public bool tag_supported(MPD.Tag.Type tag);
22 [CCode (cname="MpdServerCommand", cprefix="MPD_SERVER_COMMAND_") ]
30 [CCode (cname="mpd_server_check_command_allowed") ]
31 public Command check_command_allowed(string command);
37 [CCode (cname = "mpd_Song",free_function = "mpd_freeSong",copy_function = "mpd_songDup",has_type_id = false,cheader_filename = "libmpd/libmpdclient.h,libmpd/libmpd.h,misc.h")]
40 [CCode (cname = "mpd_newSong")]
43 public string? artist;
50 public string? performer;
52 public string? comment;
53 public string? albumartist;
59 [CCode (cname="mpd_songDup0")]
61 [CCode (instance_pos = -1)]
62 public void markup (char[] buffer, string markup);
67 public void set(MPD.Server connection, string file, string tag, string value);
68 public string get(MPD.Server connection, string file, string tag);
71 public bool supported(MPD.Server connection);
75 [CCode (cname="ChangedStatusType", cprefix = "MPD_CST_",cheader_filename = "libmpd/libmpd.h", has_type_id=false)]
77 /** The playlist has changed */
79 /** The song position of the playing song has changed*/
81 /** The songid of the playing song has changed */
83 /** The database has changed. */
85 /** the state of updating the database has changed.*/
87 /** the volume has changed */
89 /** The total time of the currently playing song has changed*/
91 /** The elapsed time of the current song has changed.*/
92 ELAPSED_TIME = 0x0080,
93 /** The crossfade time has changed. */
95 /** The random state is changed. */
97 /** repeat state is changed. */
99 /** Not implemented */
101 /** The state of the player has changed.*/
103 /** The permissions the client has, has changed.*/
105 /** The bitrate of the playing song has changed. */
107 /** the audio format of the playing song changed.*/
108 AUDIOFORMAT = 0x8000,
109 /** the queue has changed */
110 STORED_PLAYLIST = 0x20000,
112 SERVER_ERROR = 0x40000,
113 /** output changed */
115 /** sticker changed */
118 SINGLE_MODE = 0x400000,
119 CONSUME_MODE = 0x800000
122 [CCode (cname="mpd_status_get_bitrate")]
123 public int get_bitrate(MPD.Server server);
124 [CCode (cname="mpd_status_get_samplerate")]
125 public int get_samplerate(MPD.Server server);
126 [CCode (cname="mpd_status_get_channels")]
127 public int get_channels(MPD.Server server);
131 [CCode (cname="MpdDataType", cprefix = "MPD_DATA_TYPE_", cheader_filename = "libmpd/libmpd.h")]
141 [CCode (cname = "mpd_PlaylistFile", free_function = "mpd_freePlaylistFile", copy_function = "mpd_playlistFileDup", cheader_filename = "libmpd/libmpdclient.h,libmpd/libmpd.h")]
144 public class Playlist{
145 [CCode (cname="mpd_newPlaylistFile")]
149 public string *mtime;
152 [CCode (cname = "MpdData", free_function = "mpd_data_free", cheader_filename = "libmpd/libmpd.h")]
155 public Data.Type type;
156 public MPD.Song? song;
158 public Playlist playlist;
160 [CCode (cname="mpd_data_get_next")]
161 [ReturnsModifiedPointer ()]
162 public void next_free();
165 [CCode (cheader_filename="misc.h", cname="misc_sort_mpddata_by_album_disc_track")]
166 [ReturnsModifiedPointer ()]
167 public void sort_album_disc_track();
169 [CCode (cname="misc_mpddata_remove_duplicate_songs")]
170 [ReturnsModifiedPointer ()]
171 public void remove_duplicate_songs();
173 [CCode (cname="mpd_data_get_next_real", cheader_filename="libmpd/libmpd-internal.h")]
174 [ReturnsModifiedPointer ()]
175 public void next(bool free);
177 [CCode (cname="mpd_data_get_first")]
178 public unowned Item? get_first();
180 [CCode (cname="mpd_data_get_first")]
181 [ReturnsModifiedPointer ()]
184 [CCode (cname="mpd_data_concatenate")]
185 [ReturnsModifiedPointer ()]
186 public void concatenate(owned MPD.Data.Item b);
188 [CCode (cname="mpd_new_data_struct_append")]
189 [ReturnsModifiedPointer ()]
190 public void append_new();
193 [CCode (cname = "mpd_SearchStats", free_function = "mpd_freeSearchStats", cheader_filename = "libmpd/libmpdclient.h")]
195 public class SearchStats
197 public int numberOfSongs;
198 public ulong playTime;
202 namespace PlayQueue {
203 [CCode (cname="mpd_playlist_set_priority")]
204 public void set_priority(MPD.Server server, int song_id, int priority);
206 [CCode (cname="mpd_playlist_add")]
207 public void add_song(MPD.Server server, string path);
209 [CCode (cname="mpd_playlist_add_get_id")]
210 public int add_song_get_id(MPD.Server server, string path);
212 [CCode (cname="mpd_playlist_move_id")]
213 public void song_move_id(MPD.Server server, int songid, int position);
215 [CCode (cname="mpd_playlist_queue_delete_id")]
216 public void queue_delete_id(MPD.Server server, int song_id);
218 [CCode (cname="mpd_playlist_queue_load")]
219 public void queue_load_playlist(MPD.Server server, string path);
221 [CCode (cname="mpd_playlist_queue_add")]
222 public void queue_add_song(MPD.Server server, string path);
223 [CCode (cname="mpd_playlist_queue_commit")]
224 public void queue_commit(MPD.Server server);
225 [CCode (cname="mpd_playlist_clear")]
226 public void clear(MPD.Server server);
227 [CCode (cname="mpd_playlist_get_playlist_length")]
228 public int length(MPD.Server server);
230 public void add_artist(MPD.Server server, string artist)
232 MPD.Database.search_start(server,true);
233 MPD.Database.search_add_constraint(server, MPD.Tag.Type.ARTIST, artist);
234 var data = MPD.Database.search_commit(server);
236 data.sort_album_disc_track();
238 MPD.PlayQueue.queue_add_song(server, data.song.file);
241 MPD.PlayQueue.queue_commit(server);
245 public void add_album(MPD.Server server, string? artist, string? album, string? album_artist=null)
247 MPD.Database.search_start(server,true);
248 if(album_artist != null)
249 MPD.Database.search_add_constraint(server, MPD.Tag.Type.ALBUM_ARTIST, album_artist);
251 MPD.Database.search_add_constraint(server, MPD.Tag.Type.ARTIST, artist);
252 MPD.Database.search_add_constraint(server, MPD.Tag.Type.ALBUM, album);
253 var data = MPD.Database.search_commit(server);
255 data.sort_album_disc_track();
257 MPD.PlayQueue.queue_add_song(server, data.song.file);
260 MPD.PlayQueue.queue_commit(server);
266 [CCode (cname="mpd_player_play")]
267 public void play(MPD.Server server);
268 [CCode (cname="mpd_player_play_id")]
269 public void play_id (MPD.Server server, int song_id);
270 public void next(MPD.Server server);
271 public void prev(MPD.Server server);
272 public void pause(MPD.Server server);
273 public void stop(MPD.Server server);
274 public MPD.Player.State get_state(MPD.Server server);
276 [CCode (cprefix="MPD_STATUS_STATE_", cname="int")]
286 public MPD.Data.Item? get_playlist_content(MPD.Server server, string playlist_name);
287 [CCode (cname="mpd_database_playlist_list")]
288 public MPD.Data.Item? get_playlist_list(MPD.Server server);
289 public void playlist_list_add(MPD.Server server, string playlist_name, string path);
290 public void playlist_list_delete(MPD.Server server, string playlist_name, int pos);
291 public void playlist_clear(MPD.Server server, string playlist_name);
292 public void playlist_move(MPD.Server server, string playlist_name, int old_pos, int new_pos);
294 [CCode (cname="mpd_database_search_field_start")]
295 public void search_field_start(MPD.Server server,MPD.Tag.Type type);
297 [CCode (cname="mpd_database_search_start")]
298 public void search_start(MPD.Server server,bool exact);
299 public MPD.Data.Item? search_commit(MPD.Server server);
301 [CCode (cname="mpd_database_search_stats_start")]
302 public void search_stats_start(MPD.Server server);
303 public MPD.Data.SearchStats? search_stats_commit(MPD.Server server);
305 [CCode (cname="mpd_database_search_add_constraint")]
306 public void search_add_constraint(MPD.Server server, MPD.Tag.Type type, string value);
311 [CCode (cname="mpd_TagItems", cprefix = "MPD_TAG_ITEM_", cheader_filename = "libmpd/libmpdclient.h")]