aboutsummaryrefslogtreecommitdiffstats
path: root/src/mpdclient.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-10-02moved code to charset.cMax Kellermann1-1/+1
Move everything which deals with UTF-8 strings and character set conversion to charset.c, header charset.h.
2008-10-02removed LIST_FORMAT, STATUS_FORMATMax Kellermann1-3/+2
Use options.list_format and options.status_format directly instead of these two macros.
2008-10-02removed the debugging function D()Max Kellermann1-27/+1
gdb is for debugging. We don't need D() calls littered all over.
2008-09-25filelist: removed attribute "updated"Max Kellermann1-2/+0
Since all screen updating is now on demand, we don't need this flag anymore.
2008-09-21mpdclient: check errorCode only if MPD_ERROR_ACK is setMax Kellermann1-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.
2008-09-21mpdclient: fix memory leak in mpdclient_finish_command()Max Kellermann1-4/+5
During authentication, the message pointer was allocated, but never freed. Allocate it only if it is really used (and freed).
2008-09-21code style, indent with tabs VIIIMax Kellermann1-171/+143
Follow the same code style als MPD itself.
2008-09-21mpdclient: don't call screen_status_message()Max Kellermann1-2/+0
The caller should decide how to display error messages.
2008-09-21Adding crop feature in ncmpcYannick LM1-0/+35
The "crop" command deletes all songs from the playlist, except the one currently being played.
2008-09-19filelist: use GPtrArray instead of GListMax Kellermann1-5/+4
Since we do a lot of indexed accesses to the filelist, a linked list doesn't seem appropriate. Use GPtrArray instead.
2008-09-19filelist: provide more functions for working with a filelistMax Kellermann1-23/+9
Avoid direct accesses to the filelist struct, provide an API for that.
2008-09-19filelist: drop "mpdclient" prefixMax Kellermann1-2/+2
The separate filelist library does not depend on mpdclient, so the prefix is superfluous.
2008-09-19mpdclient: moved code to filelist.cMax Kellermann1-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().
2008-09-19code style, indent with tabs VIIMax Kellermann1-23/+16
Follow the same code style als MPD itself.
2008-09-18playlist: removed "updated" flagMax Kellermann1-2/+0
The caller may check the playlist.id instead of checking the old "updated" flag.
2008-09-17playlist: added playlist_remove_reuse()Max Kellermann1-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().
2008-09-17make several functions return voidMax Kellermann1-10/+8
2008-09-17playlist: use playlist_get() instead of playlist_get_song()Max Kellermann1-4/+6
2008-09-17code style, indent with tabs IIIMax Kellermann1-84/+77
Follow the same code style als MPD itself.
2008-09-17mpdclient: call playlist_clear() in mpdclient_playlist_update()Max Kellermann1-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.
2008-09-16playlist: hide direct accesses in inline functionsMax Kellermann1-27/+12
Added functions like playlist_length(), playlist_get(), playlist_replace(), playlist_remove(). Don't access the mpdclient_playlist struct directly.
2008-09-16mpdclient: added mpdclient_playlist_init(), mpdclient_playlist_clear()Max Kellermann1-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()).
2008-09-16mpdclient: moved code to playlist.cMax Kellermann1-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.
2008-09-16song: use struct mpd_songMax Kellermann1-27/+27
Use a forward declared struct mpd_song instead of the typedef mpd_Song.
2008-09-16code style, indent with tabs IIMax Kellermann1-51/+49
Follow the same code style als MPD itself.
2008-09-15use GArray for playlist instead of GListMax Kellermann1-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.
2008-09-15free info entity while iteratingMax Kellermann1-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.
2008-09-15use size_t and unsigned integersMax Kellermann1-3/+3
2008-09-15fix shadow warningsMax Kellermann1-13/+13
Rename local variables and function parameters, so they don't shadow global variables.
2008-09-15include cleanupMax Kellermann1-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.
2008-09-15const pointersMax Kellermann1-7/+7
Convert pointers to const whenever it is possible. Fixes all those -Wconst warnings.
2008-09-15use !NDEBUG instead of DEBUGMax Kellermann1-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.
2008-09-15code style, indent with tabsMax Kellermann1-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.
2008-09-15remove unused static functionsMax Kellermann1-11/+0
Also remove some commented code and unused function parameters.
2007-02-16way too much stuff to describe hereAndreas Obergrusberger1-0/+24
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-10-28filelist sorting improvedAndreas Obergrusberger1-0/+38
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4953 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-09-07due to bensonk's demand i added a splash screen.Andreas Obergrusberger1-2/+4
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4741 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-12spelling fixes by avutonAndreas Obergrusberger1-1/+1
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4615 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-05translation updates, template and german. another little build fixAndreas Obergrusberger1-1/+3
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4562 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-04patch by jat to fix http://musicpd.org/mantis/view.php?id=1293Andreas Obergrusberger1-5/+2
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4548 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-06-14Added exact_match parameter to mpdclient_filelist_search()Kalle Wallin1-4/+45
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3357 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-06-06Added an experimental artist (browser) screenKalle Wallin1-9/+56
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3322 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-15Added a search screenKalle Wallin1-0/+34
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2668 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-02Fixed the plchanges codeKalle Wallin1-58/+25
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1766 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-20Added _utf8 suffix to all functions that take utf8 arguments.Kalle Wallin1-7/+33
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1587 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-18Added the mpdclient_cmd_add_path functionKalle Wallin1-0/+12
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1553 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-17enabled plchanges, update playlist_length after removing songsKalle Wallin1-21/+32
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1525 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-16libmpdclient updated (r1507) - added path to mpdclient_cmd_db_update() Kalle Wallin1-2/+2
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1508 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-15Disable plchanges - need to redesign the plchanges codeKalle Wallin1-14/+28
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1504 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-15Sort playlist if needed after plchanges,Kalle Wallin1-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