SongFilter: convert to a C++ class

This commit is contained in:
Max Kellermann
2012-08-29 19:27:03 +02:00
parent 04a9dec952
commit 333d226ed0
20 changed files with 210 additions and 241 deletions

View File

@@ -18,10 +18,10 @@
*/
#include "config.h"
#include "QueuePrint.hxx"
#include "SongFilter.hxx"
extern "C" {
#include "queue_print.h"
#include "queue.h"
#include "song.h"
#include "song_print.h"
@@ -96,12 +96,12 @@ queue_print_changes_position(struct client *client, const struct queue *queue,
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_list_song_match(song, criteria))
if (filter.Match(*song))
queue_print_song_info(client, queue, i);
}
}