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
c4537fe6
Commit
c4537fe6
authored
Feb 26, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TagArchive: add TagBuilder overload with ScanGenericTags() fallback
Load APE/ID3 tags from archives.
parent
677334f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
3 deletions
+28
-3
SongUpdate.cxx
src/SongUpdate.cxx
+1
-3
TagArchive.cxx
src/TagArchive.cxx
+15
-0
TagArchive.hxx
src/TagArchive.hxx
+12
-0
No files found.
src/SongUpdate.cxx
View file @
c4537fe6
...
@@ -31,8 +31,6 @@
...
@@ -31,8 +31,6 @@
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderList.hxx"
#include "tag/Tag.hxx"
#include "tag/Tag.hxx"
#include "tag/TagBuilder.hxx"
#include "tag/TagBuilder.hxx"
#include "tag/TagHandler.hxx"
#include "tag/Generic.hxx"
#include "TagFile.hxx"
#include "TagFile.hxx"
#include "TagStream.hxx"
#include "TagStream.hxx"
...
@@ -127,7 +125,7 @@ Song::UpdateFileInArchive(const Storage &storage)
...
@@ -127,7 +125,7 @@ Song::UpdateFileInArchive(const Storage &storage)
return
false
;
return
false
;
TagBuilder
tag_builder
;
TagBuilder
tag_builder
;
if
(
!
tag_archive_scan
(
path_fs
,
full_tag_handler
,
&
tag_builder
))
if
(
!
tag_archive_scan
(
path_fs
,
tag_builder
))
return
false
;
return
false
;
tag_builder
.
Commit
(
tag
);
tag_builder
.
Commit
(
tag
);
...
...
src/TagArchive.cxx
View file @
c4537fe6
...
@@ -20,6 +20,9 @@
...
@@ -20,6 +20,9 @@
#include "config.h"
#include "config.h"
#include "TagArchive.hxx"
#include "TagArchive.hxx"
#include "TagStream.hxx"
#include "TagStream.hxx"
#include "tag/Generic.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagBuilder.hxx"
#include "fs/Path.hxx"
#include "fs/Path.hxx"
#include "util/Error.hxx"
#include "util/Error.hxx"
#include "input/InputStream.hxx"
#include "input/InputStream.hxx"
...
@@ -42,3 +45,15 @@ tag_archive_scan(Path path, const TagHandler &handler, void *handler_ctx)
...
@@ -42,3 +45,15 @@ tag_archive_scan(Path path, const TagHandler &handler, void *handler_ctx)
return
tag_stream_scan
(
*
is
,
handler
,
handler_ctx
);
return
tag_stream_scan
(
*
is
,
handler
,
handler_ctx
);
}
}
bool
tag_archive_scan
(
Path
path
,
TagBuilder
&
builder
)
{
assert
(
!
path
.
IsNull
());
Mutex
mutex
;
Cond
cond
;
InputStreamPtr
is
(
OpenArchiveInputStream
(
path
,
mutex
,
cond
,
IgnoreError
()));
return
is
&&
tag_stream_scan
(
*
is
,
builder
);
}
src/TagArchive.hxx
View file @
c4537fe6
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
class
Path
;
class
Path
;
struct
TagHandler
;
struct
TagHandler
;
class
TagBuilder
;
/**
/**
* Scan the tags of a song file inside an archive. Invokes matching
* Scan the tags of a song file inside an archive. Invokes matching
...
@@ -36,4 +37,15 @@ struct TagHandler;
...
@@ -36,4 +37,15 @@ struct TagHandler;
bool
bool
tag_archive_scan
(
Path
path
,
const
TagHandler
&
handler
,
void
*
handler_ctx
);
tag_archive_scan
(
Path
path
,
const
TagHandler
&
handler
,
void
*
handler_ctx
);
/**
* Scan the tags of a song file inside an archive. Invokes matching
* decoder plugins, and falls back to generic scanners (APE and ID3)
* if no tags were found (but the file was recognized).
*
* @return true if the file was recognized (even if no metadata was
* found)
*/
bool
tag_archive_scan
(
Path
path
,
TagBuilder
&
builder
);
#endif
#endif
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