diff options
author | Andreas Obergrusberger <tradiaz@yahoo.de> | 2007-02-16 15:42:08 +0000 |
---|---|---|
committer | Andreas Obergrusberger <tradiaz@yahoo.de> | 2007-02-16 15:42:08 +0000 |
commit | ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec (patch) | |
tree | f933858d5f7adbb49ed73e4be6d536eb3963906d /src/mpdclient.c | |
parent | 35c6c1651c0c5d67a5bbba8bf2b5726ba7721a5d (diff) | |
download | mpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.tar.gz mpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.tar.xz mpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.zip |
way too much stuff to describe here
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/mpdclient.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mpdclient.c b/src/mpdclient.c index b13146f38..98743a35d 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -30,6 +30,7 @@ #include "support.h" #include "mpdclient.h" #include "options.h" +#include "strfsong.h" #undef ENABLE_FANCY_PLAYLIST_MANAGMENT_CMD_ADD /* broken with song id's */ #define ENABLE_FANCY_PLAYLIST_MANAGMENT_CMD_DELETE @@ -37,6 +38,8 @@ #define ENABLE_SONG_ID #define ENABLE_PLCHANGES +#define BUFSIZE 1024 + #define MPD_ERROR(c) (c==NULL || c->connection==NULL || c->connection->error) /* from utils.c */ @@ -66,6 +69,27 @@ compare_filelistentry_dir(gconstpointer filelist_entry1, gconstpointer filelist_ return n; } +/* sort by list-format */ +gint +compare_filelistentry_format(gconstpointer filelist_entry1, gconstpointer filelist_entry2) +{ + mpd_InfoEntity *e1, *e2; + char key1[BUFSIZE], key2[BUFSIZE]; + int n = 0; + + e1 = ((filelist_entry_t *)filelist_entry1)->entity; + e2 = ((filelist_entry_t *)filelist_entry2)->entity; + if (e1 && e2 && + e1->type == MPD_INFO_ENTITY_TYPE_SONG && + e2->type == MPD_INFO_ENTITY_TYPE_SONG) + { + strfsong(key1, BUFSIZE, LIST_FORMAT, e1->info.song); + strfsong(key2, BUFSIZE, LIST_FORMAT, e2->info.song); + n = strcmp(key1,key2); + } + return n; +} + /* Error callbacks */ static gint |