diff options
Diffstat (limited to 'src/TagPrint.cxx')
-rw-r--r-- | src/TagPrint.cxx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/TagPrint.cxx b/src/TagPrint.cxx index 1191bd37c..636eedf4e 100644 --- a/src/TagPrint.cxx +++ b/src/TagPrint.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -21,8 +21,9 @@ #include "TagPrint.hxx" #include "tag/Tag.hxx" #include "tag/TagSettings.h" -#include "Song.hxx" -#include "Client.hxx" +#include "client/Client.hxx" + +#define SONG_TIME "Time: " void tag_print_types(Client &client) { @@ -35,14 +36,24 @@ void tag_print_types(Client &client) } } +void +tag_print(Client &client, TagType type, const char *value) +{ + client_printf(client, "%s: %s\n", tag_item_names[type], value); +} + +void +tag_print_values(Client &client, const Tag &tag) +{ + for (const auto &i : tag) + client_printf(client, "%s: %s\n", + tag_item_names[i.type], i.value); +} + void tag_print(Client &client, const Tag &tag) { if (tag.time >= 0) client_printf(client, SONG_TIME "%i\n", tag.time); - for (unsigned i = 0; i < tag.num_items; i++) { - client_printf(client, "%s: %s\n", - tag_item_names[tag.items[i]->type], - tag.items[i]->value); - } + tag_print_values(client, tag); } |