Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
78c0d8cc
Commit
78c0d8cc
authored
Dec 03, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/asx: use class TagBuilder
parent
b23d2ad4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
AsxPlaylistPlugin.cxx
src/playlist/AsxPlaylistPlugin.cxx
+11
-14
No files found.
src/playlist/AsxPlaylistPlugin.cxx
View file @
78c0d8cc
...
...
@@ -23,7 +23,7 @@
#include "MemorySongEnumerator.hxx"
#include "InputStream.hxx"
#include "Song.hxx"
#include "tag/Tag.hxx"
#include "tag/Tag
Builder
.hxx"
#include "util/ASCII.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
...
...
@@ -65,6 +65,8 @@ struct AsxParser {
*/
Song
*
song
;
TagBuilder
tag_builder
;
AsxParser
()
:
state
(
ROOT
)
{}
...
...
@@ -106,18 +108,13 @@ asx_start_element(gcc_unused GMarkupParseContext *context,
attribute_values
,
"href"
);
if
(
href
!=
nullptr
)
{
/* create new song object, and copy
the existing tag over; we cannot
/* create new song object; we cannot
replace the existing song's URI,
because that attribute is
immutable */
Song
*
song
=
Song
::
NewRemote
(
href
);
if
(
parser
->
song
!=
nullptr
)
{
song
->
tag
=
parser
->
song
->
tag
;
parser
->
song
->
tag
=
nullptr
;
if
(
parser
->
song
!=
nullptr
)
parser
->
song
->
Free
();
}
parser
->
song
=
song
;
}
...
...
@@ -145,9 +142,11 @@ asx_end_element(gcc_unused GMarkupParseContext *context,
case
AsxParser
:
:
ENTRY
:
if
(
StringEqualsCaseASCII
(
element_name
,
"entry"
))
{
if
(
strcmp
(
parser
->
song
->
uri
,
"asx:"
)
!=
0
)
if
(
strcmp
(
parser
->
song
->
uri
,
"asx:"
)
!=
0
)
{
assert
(
parser
->
song
->
tag
==
nullptr
);
parser
->
song
->
tag
=
parser
->
tag_builder
.
Commit
();
parser
->
songs
.
emplace_front
(
parser
->
song
);
else
}
else
parser
->
song
->
Free
();
parser
->
state
=
AsxParser
::
ROOT
;
...
...
@@ -171,10 +170,8 @@ asx_text(gcc_unused GMarkupParseContext *context,
case
AsxParser
:
:
ENTRY
:
if
(
parser
->
tag_type
!=
TAG_NUM_OF_ITEM_TYPES
)
{
if
(
parser
->
song
->
tag
==
nullptr
)
parser
->
song
->
tag
=
new
Tag
();
parser
->
song
->
tag
->
AddItem
(
parser
->
tag_type
,
text
,
text_len
);
parser
->
tag_builder
.
AddItem
(
parser
->
tag_type
,
text
,
text_len
);
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment