Commit d91f6dc1 authored by Max Kellermann's avatar Max Kellermann

playlist/extm3u: use class TagBuilder

parent 78c0d8cc
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "SongEnumerator.hxx" #include "SongEnumerator.hxx"
#include "Song.hxx" #include "Song.hxx"
#include "tag/Tag.hxx" #include "tag/Tag.hxx"
#include "tag/TagBuilder.hxx"
#include "util/StringUtil.hxx" #include "util/StringUtil.hxx"
#include "TextInputStream.hxx" #include "TextInputStream.hxx"
...@@ -72,7 +73,6 @@ extm3u_parse_tag(const char *line) ...@@ -72,7 +73,6 @@ extm3u_parse_tag(const char *line)
long duration; long duration;
char *endptr; char *endptr;
const char *name; const char *name;
Tag *tag;
duration = strtol(line, &endptr, 10); duration = strtol(line, &endptr, 10);
if (endptr[0] != ',') if (endptr[0] != ',')
...@@ -89,16 +89,16 @@ extm3u_parse_tag(const char *line) ...@@ -89,16 +89,16 @@ extm3u_parse_tag(const char *line)
object */ object */
return NULL; return NULL;
tag = new Tag(); TagBuilder tag;
tag->time = duration; tag.SetTime(duration);
/* unfortunately, there is no real specification for the /* unfortunately, there is no real specification for the
EXTM3U format, so we must assume that the string after the EXTM3U format, so we must assume that the string after the
comma is opaque, and is just the song name*/ comma is opaque, and is just the song name*/
if (*name != 0) if (*name != 0)
tag->AddItem(TAG_NAME, name); tag.AddItem(TAG_NAME, name);
return tag; return tag.Commit();
} }
Song * Song *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment