aboutsummaryrefslogtreecommitdiffstats
path: root/src/DespotifyUtils.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-07-30 20:11:57 +0200
committerMax Kellermann <max@duempel.org>2013-07-30 20:19:53 +0200
commit06f898cc1240a29b293de0e97ad95a4fdc971254 (patch)
tree001a6d3db039cdc03323f3bfddc13b94bde31ce4 /src/DespotifyUtils.cxx
parent6a9ab8bc0e2f5d34803513bb2d94d041a607a58c (diff)
downloadmpd-06f898cc1240a29b293de0e97ad95a4fdc971254.tar.gz
mpd-06f898cc1240a29b293de0e97ad95a4fdc971254.tar.xz
mpd-06f898cc1240a29b293de0e97ad95a4fdc971254.zip
tag: convert to C++
Diffstat (limited to 'src/DespotifyUtils.cxx')
-rw-r--r--src/DespotifyUtils.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/DespotifyUtils.cxx b/src/DespotifyUtils.cxx
index c9a1edf0c..c45722379 100644
--- a/src/DespotifyUtils.cxx
+++ b/src/DespotifyUtils.cxx
@@ -18,7 +18,7 @@
*/
#include "DespotifyUtils.hxx"
-#include "tag.h"
+#include "Tag.hxx"
#include "conf.h"
#include <glib.h>
@@ -77,14 +77,14 @@ void mpd_despotify_unregister_callback(void (*cb)(struct despotify_session *, in
}
-struct tag *mpd_despotify_tag_from_track(struct ds_track *track)
+Tag *
+mpd_despotify_tag_from_track(struct ds_track *track)
{
char tracknum[20];
char comment[80];
char date[20];
- struct tag *tag;
- tag = tag_new();
+ Tag *tag = new Tag();
if (!track->has_meta_data)
return tag;
@@ -93,12 +93,12 @@ struct tag *mpd_despotify_tag_from_track(struct ds_track *track)
g_snprintf(date, sizeof(date), "%d", track->year);
g_snprintf(comment, sizeof(comment), "Bitrate %d Kbps, %sgeo restricted",
track->file_bitrate / 1000, track->geo_restricted ? "" : "not ");
- tag_add_item(tag, TAG_TITLE, track->title);
- tag_add_item(tag, TAG_ARTIST, track->artist->name);
- tag_add_item(tag, TAG_TRACK, tracknum);
- tag_add_item(tag, TAG_ALBUM, track->album);
- tag_add_item(tag, TAG_DATE, date);
- tag_add_item(tag, TAG_COMMENT, comment);
+ tag->AddItem(TAG_TITLE, track->title);
+ tag->AddItem(TAG_ARTIST, track->artist->name);
+ tag->AddItem(TAG_TRACK, tracknum);
+ tag->AddItem(TAG_ALBUM, track->album);
+ tag->AddItem(TAG_DATE, date);
+ tag->AddItem(TAG_COMMENT, comment);
tag->time = track->length / 1000;
return tag;