aboutsummaryrefslogtreecommitdiffstats
path: root/src/QueuePrint.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/QueuePrint.cxx (renamed from src/queue_print.c)31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/queue_print.c b/src/QueuePrint.cxx
index d149e8b6f..edac7c7ad 100644
--- a/src/queue_print.c
+++ b/src/QueuePrint.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2012 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,13 +18,16 @@
*/
#include "config.h"
-#include "queue_print.h"
+#include "QueuePrint.hxx"
+#include "SongFilter.hxx"
+
+extern "C" {
#include "queue.h"
#include "song.h"
#include "song_print.h"
-#include "locate.h"
#include "client.h"
#include "mapper.h"
+}
/**
* Send detailed information about a range of songs in the queue to a
@@ -92,31 +95,13 @@ queue_print_changes_position(struct client *client, const struct queue *queue,
}
void
-queue_search(struct client *client, const struct queue *queue,
- const struct locate_item_list *criteria)
-{
- unsigned i;
- struct locate_item_list *new_list =
- locate_item_list_casefold(criteria);
-
- for (i = 0; i < queue_length(queue); i++) {
- const struct song *song = queue_get(queue, i);
-
- if (locate_song_search(song, new_list))
- queue_print_song_info(client, queue, i);
- }
-
- locate_item_list_free(new_list);
-}
-
-void
queue_find(struct client *client, const struct queue *queue,
- const struct locate_item_list *criteria)
+ const SongFilter &filter)
{
for (unsigned i = 0; i < queue_length(queue); i++) {
const struct song *song = queue_get(queue, i);
- if (locate_song_match(song, criteria))
+ if (filter.Match(*song))
queue_print_song_info(client, queue, i);
}
}