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
7623c1c5
Commit
7623c1c5
authored
Feb 22, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SongUpdate: move tag_scan_fallback() to tag/Generic.cxx
parent
de568c84
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
35 deletions
+81
-35
Makefile.am
Makefile.am
+1
-0
SongUpdate.cxx
src/SongUpdate.cxx
+4
-17
FileCommands.cxx
src/command/FileCommands.cxx
+2
-4
EmbeddedCuePlaylistPlugin.cxx
src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx
+3
-7
Generic.cxx
src/tag/Generic.cxx
+34
-0
Generic.hxx
src/tag/Generic.hxx
+34
-0
read_tags.cxx
test/read_tags.cxx
+3
-7
No files found.
Makefile.am
View file @
7623c1c5
...
...
@@ -862,6 +862,7 @@ libtag_a_SOURCES =\
src/tag/VorbisComment.cxx src/tag/VorbisComment.hxx
\
src/tag/ReplayGain.cxx src/tag/ReplayGain.hxx
\
src/tag/MixRamp.cxx src/tag/MixRamp.hxx
\
src/tag/Generic.cxx src/tag/Generic.hxx
\
src/tag/ApeLoader.cxx src/tag/ApeLoader.hxx
\
src/tag/ApeReplayGain.cxx src/tag/ApeReplayGain.hxx
\
src/tag/ApeTag.cxx src/tag/ApeTag.hxx
...
...
src/SongUpdate.cxx
View file @
7623c1c5
...
...
@@ -32,8 +32,7 @@
#include "tag/Tag.hxx"
#include "tag/TagBuilder.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagId3.hxx"
#include "tag/ApeTag.hxx"
#include "tag/Generic.hxx"
#include "TagFile.hxx"
#include "TagStream.hxx"
...
...
@@ -73,17 +72,6 @@ Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent)
#endif
/**
* Attempts to load APE or ID3 tags from the specified file.
*/
static
bool
tag_scan_fallback
(
Path
path
,
const
TagHandler
*
handler
,
void
*
handler_ctx
)
{
return
tag_ape_scan2
(
path
,
handler
,
handler_ctx
)
||
tag_id3_scan
(
path
,
handler
,
handler_ctx
);
}
#ifdef ENABLE_DATABASE
bool
...
...
@@ -112,8 +100,8 @@ Song::UpdateFile(Storage &storage)
return
false
;
if
(
tag_builder
.
IsEmpty
())
tag_scan_fallback
(
path_fs
,
&
full_tag_handler
,
&
tag_builder
);
ScanGenericTags
(
path_fs
,
full_tag_handler
,
&
tag_builder
);
}
mtime
=
info
.
mtime
;
...
...
@@ -165,8 +153,7 @@ DetachedSong::LoadFile(Path path)
return
false
;
if
(
tag_builder
.
IsEmpty
())
tag_scan_fallback
(
path
,
&
full_tag_handler
,
&
tag_builder
);
ScanGenericTags
(
path
,
full_tag_handler
,
&
tag_builder
);
mtime
=
fi
.
GetModificationTime
();
tag_builder
.
Commit
(
tag
);
...
...
src/command/FileCommands.cxx
View file @
7623c1c5
...
...
@@ -31,8 +31,7 @@
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "tag/TagHandler.hxx"
#include "tag/ApeTag.hxx"
#include "tag/TagId3.hxx"
#include "tag/Generic.hxx"
#include "TagStream.hxx"
#include "TagFile.hxx"
#include "storage/StorageInterface.hxx"
...
...
@@ -174,8 +173,7 @@ read_file_comments(Response &r, const Path path_fs)
return
CommandResult
::
ERROR
;
}
tag_ape_scan2
(
path_fs
,
&
print_comment_handler
,
&
r
);
tag_id3_scan
(
path_fs
,
&
print_comment_handler
,
&
r
);
ScanGenericTags
(
path_fs
,
print_comment_handler
,
&
r
);
return
CommandResult
::
OK
;
...
...
src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx
View file @
7623c1c5
...
...
@@ -29,8 +29,7 @@
#include "../SongEnumerator.hxx"
#include "../cue/CueParser.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagId3.hxx"
#include "tag/ApeTag.hxx"
#include "tag/Generic.hxx"
#include "DetachedSong.hxx"
#include "TagFile.hxx"
#include "fs/Traits.hxx"
...
...
@@ -104,11 +103,8 @@ embcue_playlist_open_uri(const char *uri,
const
auto
playlist
=
new
EmbeddedCuePlaylist
();
tag_file_scan
(
path_fs
,
embcue_tag_handler
,
playlist
);
if
(
playlist
->
cuesheet
.
empty
())
{
tag_ape_scan2
(
path_fs
,
&
embcue_tag_handler
,
playlist
);
if
(
playlist
->
cuesheet
.
empty
())
tag_id3_scan
(
path_fs
,
&
embcue_tag_handler
,
playlist
);
}
if
(
playlist
->
cuesheet
.
empty
())
ScanGenericTags
(
path_fs
,
embcue_tag_handler
,
playlist
);
if
(
playlist
->
cuesheet
.
empty
())
{
/* no "CUESHEET" tag found */
...
...
src/tag/Generic.cxx
0 → 100644
View file @
7623c1c5
/*
* Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Generic.hxx"
#include "TagId3.hxx"
#include "ApeTag.hxx"
#include "fs/Path.hxx"
/**
* Attempts to scan APE or ID3 tags from the specified file.
*/
bool
ScanGenericTags
(
Path
path
,
const
TagHandler
&
handler
,
void
*
ctx
)
{
return
tag_ape_scan2
(
path
,
&
handler
,
ctx
)
||
tag_id3_scan
(
path
,
&
handler
,
ctx
);
}
src/tag/Generic.hxx
0 → 100644
View file @
7623c1c5
/*
* Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_TAG_GENERIC_HXX
#define MPD_TAG_GENERIC_HXX
#include "check.h"
struct
TagHandler
;
class
Path
;
/**
* Attempts to scan APE or ID3 tags from the specified file.
*/
bool
ScanGenericTags
(
Path
path
,
const
TagHandler
&
handler
,
void
*
ctx
);
#endif
test/read_tags.cxx
View file @
7623c1c5
...
...
@@ -25,8 +25,7 @@
#include "input/InputStream.hxx"
#include "AudioFormat.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagId3.hxx"
#include "tag/ApeTag.hxx"
#include "tag/Generic.hxx"
#include "util/Error.hxx"
#include "fs/Path.hxx"
#include "thread/Cond.hxx"
...
...
@@ -126,11 +125,8 @@ int main(int argc, char **argv)
return
EXIT_FAILURE
;
}
if
(
empty
)
{
tag_ape_scan2
(
path
,
&
print_handler
,
NULL
);
if
(
empty
)
tag_id3_scan
(
path
,
&
print_handler
,
NULL
);
}
if
(
empty
)
ScanGenericTags
(
path
,
print_handler
,
nullptr
);
return
0
;
}
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