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;
58 [CCode (cname="mpd_songDup0")]
60 [CCode (instance_pos = -1)]
61 public void markup (char[] buffer, string markup);
66 public void set(MPD.Server connection, string file, string tag, string value);
67 public string get(MPD.Server connection, string file, string tag);
70 public bool supported(MPD.Server connection);
74 [CCode (cname="ChangedStatusType", cprefix = "MPD_CST_",cheader_filename = "libmpd/libmpd.h", has_type_id=false)]
76 /** The playlist has changed */
78 /** The song position of the playing song has changed*/
80 /** The songid of the playing song has changed */
82 /** The database has changed. */
84 /** the state of updating the database has changed.*/
86 /** the volume has changed */
88 /** The total time of the currently playing song has changed*/
90 /** The elapsed time of the current song has changed.*/
91 ELAPSED_TIME = 0x0080,
92 /** The crossfade time has changed. */
94 /** The random state is changed. */
96 /** repeat state is changed. */
98 /** Not implemented */
100 /** The state of the player has changed.*/
102 /** The permissions the client has, has changed.*/
104 /** The bitrate of the playing song has changed. */
106 /** the audio format of the playing song changed.*/
107 AUDIOFORMAT = 0x8000,
108 /** the queue has changed */
109 STORED_PLAYLIST = 0x20000,
111 SERVER_ERROR = 0x40000,
112 /** output changed */
114 /** sticker changed */
117 SINGLE_MODE = 0x400000,
118 CONSUME_MODE = 0x800000
121 [CCode (cname="mpd_status_get_bitrate")]
122 public int get_bitrate(MPD.Server server);
123 [CCode (cname="mpd_status_get_samplerate")]
124 public int get_samplerate(MPD.Server server);
125 [CCode (cname="mpd_status_get_channels")]
126 public int get_channels(MPD.Server server);
130 [CCode (cname="MpdDataType", cprefix = "MPD_DATA_TYPE_", cheader_filename = "libmpd/libmpd.h")]
140 [CCode (cname = "mpd_PlaylistFile", free_function = "mpd_freePlaylistFile", copy_function = "mpd_playlistFileDup", cheader_filename = "libmpd/libmpdclient.h,libmpd/libmpd.h")]
143 public class Playlist{
144 [CCode (cname="mpd_newPlaylistFile")]
148 public string *mtime;
151 [CCode (cname = "MpdData", free_function = "mpd_data_free", cheader_filename = "libmpd/libmpd.h")]
154 public Data.Type type;
155 public MPD.Song? song;
157 public Playlist playlist;
159 [CCode (cname="mpd_data_get_next")]
160 [ReturnsModifiedPointer ()]
161 public void next_free();
164 [CCode (cheader_filename="misc.h", cname="misc_sort_mpddata_by_album_disc_track")]
165 [ReturnsModifiedPointer ()]
166 public void sort_album_disc_track();
168 [CCode (cname="misc_mpddata_remove_duplicate_songs")]
169 [ReturnsModifiedPointer ()]
170 public void remove_duplicate_songs();
172 [CCode (cname="mpd_data_get_next_real", cheader_filename="libmpd/libmpd-internal.h")]
173 [ReturnsModifiedPointer ()]
174 public void next(bool free);
176 [CCode (cname="mpd_data_get_first")]
177 public unowned Item? get_first();
179 [CCode (cname="mpd_data_get_first")]
180 [ReturnsModifiedPointer ()]
183 [CCode (cname="mpd_data_concatenate")]
184 [ReturnsModifiedPointer ()]
185 public void concatenate(owned MPD.Data.Item b);
187 [CCode (cname="mpd_new_data_struct_append")]
188 [ReturnsModifiedPointer ()]
189 public void append_new();
192 [CCode (cname = "mpd_SearchStats", free_function = "mpd_freeSearchStats", cheader_filename = "libmpd/libmpdclient.h")]
194 public class SearchStats
196 public int numberOfSongs;
197 public ulong playTime;
201 namespace PlayQueue {
202 [CCode (cname="mpd_playlist_set_priority")]
203 public void set_priority(MPD.Server server, int song_id, int priority);
205 [CCode (cname="mpd_playlist_add")]
206 public void add_song(MPD.Server server, string path);
208 [CCode (cname="mpd_playlist_queue_delete_id")]
209 public void queue_delete_id(MPD.Server server, int song_id);
211 [CCode (cname="mpd_playlist_queue_add")]
212 public void queue_add_song(MPD.Server server, string path);
213 [CCode (cname="mpd_playlist_queue_commit")]
214 public void queue_commit(MPD.Server server);
215 [CCode (cname="mpd_playlist_clear")]
216 public void clear(MPD.Server server);
217 [CCode (cname="mpd_playlist_get_playlist_length")]
218 public int length(MPD.Server server);
220 public void add_artist(MPD.Server server, string artist)
222 MPD.Database.search_start(server,true);
223 MPD.Database.search_add_constraint(server, MPD.Tag.Type.ARTIST, artist);
224 var data = MPD.Database.search_commit(server);
226 data.sort_album_disc_track();
228 MPD.PlayQueue.queue_add_song(server, data.song.file);
231 MPD.PlayQueue.queue_commit(server);
235 public void add_album(MPD.Server server, string? artist, string? album, string? album_artist=null)
237 MPD.Database.search_start(server,true);
238 if(album_artist != null)
239 MPD.Database.search_add_constraint(server, MPD.Tag.Type.ALBUM_ARTIST, album_artist);
241 MPD.Database.search_add_constraint(server, MPD.Tag.Type.ARTIST, artist);
242 MPD.Database.search_add_constraint(server, MPD.Tag.Type.ALBUM, album);
243 var data = MPD.Database.search_commit(server);
245 data.sort_album_disc_track();
247 MPD.PlayQueue.queue_add_song(server, data.song.file);
250 MPD.PlayQueue.queue_commit(server);
256 [CCode (cname="mpd_player_play")]
257 public void play(MPD.Server server);
258 [CCode (cname="mpd_player_play_id")]
259 public void play_id (MPD.Server server, int song_id);
260 public void next(MPD.Server server);
261 public void prev(MPD.Server server);
262 public void pause(MPD.Server server);
263 public void stop(MPD.Server server);
264 public MPD.Player.State get_state(MPD.Server server);
266 [CCode (cprefix="MPD_STATUS_STATE_", cname="int")]
276 public MPD.Data.Item? get_playlist_content(MPD.Server server, string playlist_name);
277 [CCode (cname="mpd_database_playlist_list")]
278 public MPD.Data.Item? get_playlist_list(MPD.Server server);
279 public void playlist_list_add(MPD.Server server, string playlist_name, string path);
280 public void playlist_list_delete(MPD.Server server, string playlist_name, int pos);
282 [CCode (cname="mpd_database_search_field_start")]
283 public void search_field_start(MPD.Server server,MPD.Tag.Type type);
285 [CCode (cname="mpd_database_search_start")]
286 public void search_start(MPD.Server server,bool exact);
287 public MPD.Data.Item? search_commit(MPD.Server server);
289 [CCode (cname="mpd_database_search_stats_start")]
290 public void search_stats_start(MPD.Server server);
291 public MPD.Data.SearchStats? search_stats_commit(MPD.Server server);
293 [CCode (cname="mpd_database_search_add_constraint")]
294 public void search_add_constraint(MPD.Server server, MPD.Tag.Type type, string value);
299 [CCode (cname="mpd_TagItems", cprefix = "MPD_TAG_ITEM_", cheader_filename = "libmpd/libmpdclient.h")]