aboutsummaryrefslogtreecommitdiffstats
path: root/src/mpdclient.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mpdclient: check errorCode only if MPD_ERROR_ACK is setMax Kellermann2008-09-211-1/+2
| | | | | | connection->errorCode has an undefined value when connection->error is not MPD_ERROR_ACK. Read it only if MPD_ERROR_ACK is set, to make valgrind happy.
* mpdclient: fix memory leak in mpdclient_finish_command()Max Kellermann2008-09-211-4/+5
| | | | | During authentication, the message pointer was allocated, but never freed. Allocate it only if it is really used (and freed).
* code style, indent with tabs VIIIMax Kellermann2008-09-211-171/+143
| | | | Follow the same code style als MPD itself.
* mpdclient: don't call screen_status_message()Max Kellermann2008-09-211-2/+0
| | | | The caller should decide how to display error messages.
* Adding crop feature in ncmpcYannick LM2008-09-211-0/+35
| | | | | The "crop" command deletes all songs from the playlist, except the one currently being played.
* filelist: use GPtrArray instead of GListMax Kellermann2008-09-191-5/+4
| | | | | Since we do a lot of indexed accesses to the filelist, a linked list doesn't seem appropriate. Use GPtrArray instead.
* filelist: provide more functions for working with a filelistMax Kellermann2008-09-191-23/+9
| | | | Avoid direct accesses to the filelist struct, provide an API for that.
* filelist: drop "mpdclient" prefixMax Kellermann2008-09-191-2/+2
| | | | | The separate filelist library does not depend on mpdclient, so the prefix is superfluous.
* mpdclient: moved code to filelist.cMax Kellermann2008-09-191-49/+0
| | | | | | | | Move everything which is solely filelist related to filelist.c and filelist.h. Fix the indentation of that file, and provide the struct name "filelist". Don't clear data in mpdclient_filelist_free() before calling g_free(). Constify the "song" parameter to mpdclient_filelist_find_song().
* code style, indent with tabs VIIMax Kellermann2008-09-191-23/+16
| | | | Follow the same code style als MPD itself.
* playlist: removed "updated" flagMax Kellermann2008-09-181-2/+0
| | | | | The caller may check the playlist.id instead of checking the old "updated" flag.
* playlist: added playlist_remove_reuse()Max Kellermann2008-09-171-1/+3
| | | | | | | | | | playlist_remove_reuse() removes a song from the playlist, but does not free it. Use this function in mpdclient_cmd_delete() to fix a segmentation fault: the song pointer was still used after it was freed, by passing it to mpdclient_playlist_callback(). Free the song manually now. Reorganize and simply some code in mpdclient_cmd_delete().
* make several functions return voidMax Kellermann2008-09-171-10/+8
|
* playlist: use playlist_get() instead of playlist_get_song()Max Kellermann2008-09-171-4/+6
|
* code style, indent with tabs IIIMax Kellermann2008-09-171-84/+77
| | | | Follow the same code style als MPD itself.
* mpdclient: call playlist_clear() in mpdclient_playlist_update()Max Kellermann2008-09-171-2/+1
| | | | | | Instead of freeing the playlist with mpdclient_playlist_free(), call playlist_clear() to empty the song list. This fixes a segmentation fault which occured when you cleared the playlist.
* playlist: hide direct accesses in inline functionsMax Kellermann2008-09-161-27/+12
| | | | | | Added functions like playlist_length(), playlist_get(), playlist_replace(), playlist_remove(). Don't access the mpdclient_playlist struct directly.
* mpdclient: added mpdclient_playlist_init(), mpdclient_playlist_clear()Max Kellermann2008-09-161-3/+5
| | | | | | Moved code from mpdclient_new() and mpdclient_playlist_free(). In mpdclient_disconnect(), call mpdclient_playlist_clear() instead of mpdclient_playlist_free() (which is now called in mpdclient_free()).
* mpdclient: moved code to playlist.cMax Kellermann2008-09-161-82/+0
| | | | | | | | | | Move everything which manipulates the mpdclient_playlist struct to playlist.c. Many of the functions get a mpdclient pointer instead of a playlist; this will be changed later. The functions mpdclient_playlist_update() and mpdclient_playlist_update_changes() stay in mpdclient.c for now, since they are tightly connected to the client code.
* song: use struct mpd_songMax Kellermann2008-09-161-27/+27
| | | | | Use a forward declared struct mpd_song instead of the typedef mpd_Song.
* code style, indent with tabs IIMax Kellermann2008-09-161-51/+49
| | | | Follow the same code style als MPD itself.
* use GArray for playlist instead of GListMax Kellermann2008-09-151-87/+65
| | | | | | Using a doubly linked list for the local playlist copy is a huge waste of both memory and CPU cycles. Use GArray instead of GList, which is much faster in this case.
* free info entity while iteratingMax Kellermann2008-09-151-0/+2
| | | | | | Memory leak: the function mpdclient_playlist_update_changes() did not free the entity which was returned by mpd_getNextInfoEntity(). Add a mpd_freeInfoEntity() call at the end of each iteration.
* use size_t and unsigned integersMax Kellermann2008-09-151-3/+3
|
* fix shadow warningsMax Kellermann2008-09-151-13/+13
| | | | | Rename local variables and function parameters, so they don't shadow global variables.
* include cleanupMax Kellermann2008-09-151-8/+7
| | | | | | A header should include all headers which he needs. Move local includes on top, and let foo.c include foo.h in the first line, to automatically test its dependencies.
* const pointersMax Kellermann2008-09-151-7/+7
| | | | | Convert pointers to const whenever it is possible. Fixes all those -Wconst warnings.
* use !NDEBUG instead of DEBUGMax Kellermann2008-09-151-2/+2
| | | | | NDEBUG is more commonly used than DEBUG, e.g. in assert.h. Convert all macros to NDEBUG, and declare NDEBUG when debugging is disabled.
* code style, indent with tabsMax Kellermann2008-09-151-273/+272
| | | | | | | Follow the same code style als MPD itself. This patch only fixes parts of the code which are going to be touched in the following bunch of patches, i.e. there will be more "code style" patches in the future.
* remove unused static functionsMax Kellermann2008-09-151-11/+0
| | | | Also remove some commented code and unused function parameters.
* way too much stuff to describe hereAndreas Obergrusberger2007-02-161-0/+24
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* filelist sorting improvedAndreas Obergrusberger2006-10-281-0/+38
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4953 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* due to bensonk's demand i added a splash screen.Andreas Obergrusberger2006-09-071-2/+4
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4741 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* spelling fixes by avutonAndreas Obergrusberger2006-08-121-1/+1
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4615 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* translation updates, template and german. another little build fixAndreas Obergrusberger2006-08-051-1/+3
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4562 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* patch by jat to fix http://musicpd.org/mantis/view.php?id=1293Andreas Obergrusberger2006-08-041-5/+2
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4548 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added exact_match parameter to mpdclient_filelist_search()Kalle Wallin2005-06-141-4/+45
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3357 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added an experimental artist (browser) screenKalle Wallin2005-06-061-9/+56
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3322 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added a search screenKalle Wallin2004-11-151-0/+34
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2668 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fixed the plchanges codeKalle Wallin2004-07-021-58/+25
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1766 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added _utf8 suffix to all functions that take utf8 arguments.Kalle Wallin2004-06-201-7/+33
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1587 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added the mpdclient_cmd_add_path functionKalle Wallin2004-06-181-0/+12
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1553 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* enabled plchanges, update playlist_length after removing songsKalle Wallin2004-06-171-21/+32
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1525 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* libmpdclient updated (r1507) - added path to mpdclient_cmd_db_update() Kalle Wallin2004-06-161-2/+2
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1508 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Disable plchanges - need to redesign the plchanges codeKalle Wallin2004-06-151-14/+28
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1504 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Sort playlist if needed after plchanges,Kalle Wallin2004-06-151-8/+39
| | | | | | | | update the song position fields in mpdclient_cmd_move, use song id's by default (ENABLE_SONG_ID) git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1495 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Updated error handlingKalle Wallin2004-06-141-11/+10
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1492 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fixed mpdclient_filelist_update()Kalle Wallin2004-06-141-1/+3
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1486 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Major cleanup of the mpd client code (mpc->mpdclient)Kalle Wallin2004-06-141-0/+868
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1481 09075e82-0dd4-0310-85a5-a0d7c8717e4f