tag: convert to C++
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user