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
bc23a6bb
Commit
bc23a6bb
authored
Jan 08, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/TagBuilder: overload Commit() returning a Tag object
parent
ac1983ea
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
12 deletions
+24
-12
FlacCommon.cxx
src/decoder/FlacCommon.cxx
+2
-2
FlacMetadata.cxx
src/decoder/FlacMetadata.cxx
+4
-4
FlacMetadata.hxx
src/decoder/FlacMetadata.hxx
+2
-3
OpusDecoderPlugin.cxx
src/decoder/OpusDecoderPlugin.cxx
+1
-2
CurlInputPlugin.cxx
src/input/CurlInputPlugin.cxx
+1
-1
TagBuilder.cxx
src/tag/TagBuilder.cxx
+8
-0
TagBuilder.hxx
src/tag/TagBuilder.hxx
+6
-0
No files found.
src/decoder/FlacCommon.cxx
View file @
bc23a6bb
...
...
@@ -103,8 +103,8 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
decoder_mixramp
(
data
->
decoder
,
flac_parse_mixramp
(
block
));
flac_vorbis_comments_to_tag
(
data
->
tag
,
&
block
->
data
.
vorbis_comment
)
;
data
->
tag
=
flac_vorbis_comments_to_tag
(
&
block
->
data
.
vorbis_comment
);
break
;
default
:
break
;
...
...
src/decoder/FlacMetadata.cxx
View file @
bc23a6bb
...
...
@@ -24,6 +24,7 @@
#include "tag/TagHandler.hxx"
#include "tag/TagTable.hxx"
#include "tag/TagBuilder.hxx"
#include "tag/Tag.hxx"
#include "ReplayGainInfo.hxx"
#include "util/ASCII.hxx"
#include "util/SplitString.hxx"
...
...
@@ -199,13 +200,12 @@ flac_scan_metadata(const FLAC__StreamMetadata *block,
}
}
void
flac_vorbis_comments_to_tag
(
Tag
&
tag
,
const
FLAC__StreamMetadata_VorbisComment
*
comment
)
Tag
flac_vorbis_comments_to_tag
(
const
FLAC__StreamMetadata_VorbisComment
*
comment
)
{
TagBuilder
tag_builder
;
flac_scan_comments
(
comment
,
&
add_tag_handler
,
&
tag_builder
);
tag_builder
.
Commit
(
tag
);
return
tag_builder
.
Commit
(
);
}
void
...
...
src/decoder/FlacMetadata.hxx
View file @
bc23a6bb
...
...
@@ -130,9 +130,8 @@ flac_parse_replay_gain(ReplayGainInfo &rgi,
MixRampInfo
flac_parse_mixramp
(
const
FLAC__StreamMetadata
*
block
);
void
flac_vorbis_comments_to_tag
(
Tag
&
tag
,
const
FLAC__StreamMetadata_VorbisComment
*
comment
);
Tag
flac_vorbis_comments_to_tag
(
const
FLAC__StreamMetadata_VorbisComment
*
comment
);
void
flac_scan_metadata
(
const
FLAC__StreamMetadata
*
block
,
...
...
src/decoder/OpusDecoderPlugin.cxx
View file @
bc23a6bb
...
...
@@ -292,8 +292,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet)
!
tag_builder
.
IsEmpty
())
{
decoder_replay_gain
(
decoder
,
&
rgi
);
Tag
tag
;
tag_builder
.
Commit
(
tag
);
Tag
tag
=
tag_builder
.
Commit
();
cmd
=
decoder_tag
(
decoder
,
input_stream
,
std
::
move
(
tag
));
}
else
cmd
=
decoder_get_command
(
decoder
);
...
...
src/input/CurlInputPlugin.cxx
View file @
bc23a6bb
...
...
@@ -782,7 +782,7 @@ copy_icy_tag(struct input_curl *c)
if
(
!
c
->
meta_name
.
empty
()
&&
!
tag
->
HasType
(
TAG_NAME
))
{
TagBuilder
tag_builder
(
std
::
move
(
*
tag
));
tag_builder
.
AddItem
(
TAG_NAME
,
c
->
meta_name
.
c_str
());
tag_builder
.
Commit
(
*
tag
);
*
tag
=
tag_builder
.
Commit
(
);
}
c
->
tag
=
tag
;
...
...
src/tag/TagBuilder.cxx
View file @
bc23a6bb
...
...
@@ -133,6 +133,14 @@ TagBuilder::Commit(Tag &tag)
Clear
();
}
Tag
TagBuilder
::
Commit
()
{
Tag
tag
;
Commit
(
tag
);
return
tag
;
}
Tag
*
TagBuilder
::
CommitNew
()
{
...
...
src/tag/TagBuilder.hxx
View file @
bc23a6bb
...
...
@@ -97,6 +97,12 @@ public:
void
Commit
(
Tag
&
tag
);
/**
* Create a new #Tag instance from data in this object. This
* object is empty afterwards.
*/
Tag
Commit
();
/**
* Create a new #Tag instance from data in this object. The
* returned object is owned by the caller. This object is
* empty afterwards.
...
...
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