summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-30 21:16:45 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-30 21:16:45 +0100
commit312708ff37f4edd0f4d5777b63ffc0af7c7237da (patch)
tree63fdf857a60455853a1b6fd0b8023f16a98f7018 /playlist.c
parent001b2e2d997f8efb6bdeffe5caa1d1a8b3ee9243 (diff)
search window fixed in gtkui plugin
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/playlist.c b/playlist.c
index 19edbb71..70b451aa 100644
--- a/playlist.c
+++ b/playlist.c
@@ -35,6 +35,7 @@
#include "junklib.h"
#include "vfs.h"
#include "conf.h"
+#include "utf8.h"
// 1.0->1.1 changelog:
// added sample-accurate seek positions for sub-tracks
@@ -1771,3 +1772,31 @@ pl_move_items (int iter, playItem_t *drop_before, uint32_t *indexes, int count)
playlist_tail[iter] = tail;
}
}
+
+int
+pl_process_search (const char *text) {
+ playlist_head[PL_SEARCH] = NULL;
+ playlist_tail[PL_SEARCH] = NULL;
+ int search_count = 0;
+ if (*text) {
+ for (playItem_t *it = playlist_head[PL_MAIN]; it; it = it->next[PL_MAIN]) {
+ for (metaInfo_t *m = it->meta; m; m = m->next) {
+// if (strcasestr (m->value, text)) {
+ if (utfcasestr (m->value, text)) {
+ // add to list
+ it->next[PL_SEARCH] = NULL;
+ if (playlist_tail[PL_SEARCH]) {
+ playlist_tail[PL_SEARCH]->next[PL_SEARCH] = it;
+ playlist_tail[PL_SEARCH] = it;
+ }
+ else {
+ playlist_head[PL_SEARCH] = playlist_tail[PL_SEARCH] = it;
+ }
+ search_count++;
+ break;
+ }
+ }
+ }
+ }
+ return search_count;
+}