aboutsummaryrefslogtreecommitdiffstats
path: root/src/TagPrint.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-12 17:17:50 +0200
committerMax Kellermann <max@duempel.org>2014-07-12 17:42:38 +0200
commit11a9536271d0129539e3fbea6a9f852d02a2b6d6 (patch)
tree04125c86f16c761808d1c589ec7cbf4cc08652cb /src/TagPrint.cxx
parent41a7203c28d2cc7550f1bb05f767950d388326cd (diff)
downloadmpd-11a9536271d0129539e3fbea6a9f852d02a2b6d6.tar.gz
mpd-11a9536271d0129539e3fbea6a9f852d02a2b6d6.tar.xz
mpd-11a9536271d0129539e3fbea6a9f852d02a2b6d6.zip
TagPrint: split tag_print()
Add one method that prints only the tag values, but not the song duration.
Diffstat (limited to 'src/TagPrint.cxx')
-rw-r--r--src/TagPrint.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/TagPrint.cxx b/src/TagPrint.cxx
index 297bf45e3..636eedf4e 100644
--- a/src/TagPrint.cxx
+++ b/src/TagPrint.cxx
@@ -42,12 +42,18 @@ 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 (const auto &i : tag)
- client_printf(client, "%s: %s\n",
- tag_item_names[i.type], i.value);
+ tag_print_values(client, tag);
}