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
cccbcf51
Commit
cccbcf51
authored
Feb 23, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/{Id3,Ape}: remove Path overloads
parent
a1e680fe
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
34 additions
and
155 deletions
+34
-155
ApeLoader.cxx
src/tag/ApeLoader.cxx
+0
-18
ApeLoader.hxx
src/tag/ApeLoader.hxx
+0
-10
ApeReplayGain.cxx
src/tag/ApeReplayGain.cxx
+0
-20
ApeReplayGain.hxx
src/tag/ApeReplayGain.hxx
+0
-4
ApeTag.cxx
src/tag/ApeTag.cxx
+0
-18
ApeTag.hxx
src/tag/ApeTag.hxx
+0
-10
Id3Load.cxx
src/tag/Id3Load.cxx
+0
-18
Id3Load.hxx
src/tag/Id3Load.hxx
+0
-10
TagId3.cxx
src/tag/TagId3.cxx
+0
-24
TagId3.hxx
src/tag/TagId3.hxx
+0
-15
ReadApeTags.cxx
test/ReadApeTags.cxx
+18
-1
dump_rva2.cxx
test/dump_rva2.cxx
+16
-7
No files found.
src/tag/ApeLoader.cxx
View file @
cccbcf51
...
...
@@ -20,11 +20,7 @@
#include "config.h"
#include "ApeLoader.hxx"
#include "system/ByteOrder.hxx"
#include "fs/Path.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "util/StringView.hxx"
#include "util/Error.hxx"
...
...
@@ -108,17 +104,3 @@ tag_ape_scan(InputStream &is, ApeTagCallback callback)
return
true
;
}
bool
tag_ape_scan
(
Path
path_fs
,
ApeTagCallback
callback
)
{
Mutex
mutex
;
Cond
cond
;
std
::
unique_ptr
<
InputStream
>
is
(
OpenLocalInputStream
(
path_fs
,
mutex
,
cond
,
IgnoreError
()));
if
(
!
is
)
return
false
;
return
tag_ape_scan
(
*
is
,
callback
);
}
src/tag/ApeLoader.hxx
View file @
cccbcf51
...
...
@@ -42,14 +42,4 @@ typedef std::function<bool(unsigned long flags, const char *key,
bool
tag_ape_scan
(
InputStream
&
is
,
ApeTagCallback
callback
);
/**
* Scans the APE tag values from a file.
*
* @param path_fs the path of the file in filesystem encoding
* @return false if the file could not be opened or if no APE tag is
* present
*/
bool
tag_ape_scan
(
Path
path_fs
,
ApeTagCallback
callback
);
#endif
src/tag/ApeReplayGain.cxx
View file @
cccbcf51
...
...
@@ -21,12 +21,9 @@
#include "ApeReplayGain.hxx"
#include "ApeLoader.hxx"
#include "ReplayGain.hxx"
#include "fs/Path.hxx"
#include "util/ASCII.hxx"
#include "util/StringView.hxx"
#include <string.h>
#include <stdlib.h>
static
bool
replay_gain_ape_callback
(
unsigned
long
flags
,
const
char
*
key
,
...
...
@@ -63,20 +60,3 @@ replay_gain_ape_read(InputStream &is, ReplayGainInfo &info)
return
tag_ape_scan
(
is
,
callback
)
&&
found
;
}
bool
replay_gain_ape_read
(
Path
path_fs
,
ReplayGainInfo
&
info
)
{
bool
found
=
false
;
auto
callback
=
[
&
info
,
&
found
]
(
unsigned
long
flags
,
const
char
*
key
,
StringView
value
)
{
found
|=
replay_gain_ape_callback
(
flags
,
key
,
value
,
info
);
return
true
;
};
return
tag_ape_scan
(
path_fs
,
callback
)
&&
found
;
}
src/tag/ApeReplayGain.hxx
View file @
cccbcf51
...
...
@@ -23,13 +23,9 @@
#include "check.h"
class
InputStream
;
class
Path
;
struct
ReplayGainInfo
;
bool
replay_gain_ape_read
(
InputStream
&
is
,
ReplayGainInfo
&
info
);
bool
replay_gain_ape_read
(
Path
path_fs
,
ReplayGainInfo
&
info
);
#endif
src/tag/ApeTag.cxx
View file @
cccbcf51
...
...
@@ -23,7 +23,6 @@
#include "Tag.hxx"
#include "TagTable.hxx"
#include "TagHandler.hxx"
#include "fs/Path.hxx"
#include "util/StringView.hxx"
#include <string>
...
...
@@ -121,20 +120,3 @@ tag_ape_scan2(InputStream &is,
return
tag_ape_scan
(
is
,
callback
)
&&
recognized
;
}
bool
tag_ape_scan2
(
Path
path_fs
,
const
TagHandler
&
handler
,
void
*
handler_ctx
)
{
bool
recognized
=
false
;
auto
callback
=
[
handler
,
handler_ctx
,
&
recognized
]
(
unsigned
long
flags
,
const
char
*
key
,
StringView
value
)
{
recognized
|=
tag_ape_import_item
(
flags
,
key
,
value
,
handler
,
handler_ctx
);
return
true
;
};
return
tag_ape_scan
(
path_fs
,
callback
)
&&
recognized
;
}
src/tag/ApeTag.hxx
View file @
cccbcf51
...
...
@@ -22,7 +22,6 @@
#include "TagTable.hxx"
class
Path
;
class
InputStream
;
struct
TagHandler
;
...
...
@@ -37,13 +36,4 @@ bool
tag_ape_scan2
(
InputStream
&
is
,
const
TagHandler
&
handler
,
void
*
handler_ctx
);
/**
* Scan the APE tags of a file.
*
* @param path_fs the path of the file in filesystem encoding
*/
bool
tag_ape_scan2
(
Path
path_fs
,
const
TagHandler
&
handler
,
void
*
handler_ctx
);
#endif
src/tag/Id3Load.cxx
View file @
cccbcf51
...
...
@@ -24,11 +24,7 @@
#include "Log.hxx"
#include "Riff.hxx"
#include "Aiff.hxx"
#include "fs/Path.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include <id3tag.h>
...
...
@@ -225,17 +221,3 @@ tag_id3_load(InputStream &is)
return
tag
;
}
UniqueId3Tag
tag_id3_load
(
Path
path_fs
,
Error
&
error
)
{
Mutex
mutex
;
Cond
cond
;
std
::
unique_ptr
<
InputStream
>
is
(
OpenLocalInputStream
(
path_fs
,
mutex
,
cond
,
error
));
if
(
!
is
)
return
nullptr
;
return
tag_id3_load
(
*
is
);
}
src/tag/Id3Load.hxx
View file @
cccbcf51
...
...
@@ -23,7 +23,6 @@
#include "check.h"
#include "Id3Unique.hxx"
class
Path
;
class
Error
;
class
InputStream
;
...
...
@@ -36,13 +35,4 @@ class InputStream;
UniqueId3Tag
tag_id3_load
(
InputStream
&
is
);
/**
* Loads the ID3 tags from the file into a libid3tag object.
*
* @return nullptr on error or if no ID3 tag was found in the file (no
* Error will be set)
*/
UniqueId3Tag
tag_id3_load
(
Path
path_fs
,
Error
&
error
);
#endif
src/tag/TagId3.cxx
View file @
cccbcf51
...
...
@@ -359,27 +359,3 @@ tag_id3_scan(InputStream &is,
scan_id3_tag
(
tag
.
get
(),
handler
,
handler_ctx
);
return
true
;
}
bool
tag_id3_scan
(
Path
path_fs
,
const
TagHandler
&
handler
,
void
*
handler_ctx
)
{
UniqueId3Tag
tag
;
try
{
Error
error
;
tag
=
tag_id3_load
(
path_fs
,
error
);
if
(
tag
==
nullptr
)
{
if
(
error
.
IsDefined
())
LogError
(
error
);
return
false
;
}
}
catch
(
const
std
::
runtime_error
&
e
)
{
LogError
(
e
);
return
false
;
}
scan_id3_tag
(
tag
.
get
(),
handler
,
handler_ctx
);
return
true
;
}
src/tag/TagId3.hxx
View file @
cccbcf51
...
...
@@ -24,7 +24,6 @@
#include "Compiler.h"
class
InputStream
;
class
Path
;
struct
TagHandler
;
struct
Tag
;
struct
id3_tag
;
...
...
@@ -35,10 +34,6 @@ bool
tag_id3_scan
(
InputStream
&
is
,
const
TagHandler
&
handler
,
void
*
handler_ctx
);
bool
tag_id3_scan
(
Path
path_fs
,
const
TagHandler
&
handler
,
void
*
handler_ctx
);
Tag
*
tag_id3_import
(
id3_tag
*
);
...
...
@@ -52,8 +47,6 @@ scan_id3_tag(id3_tag *tag,
#else
#include "fs/Path.hxx"
static
inline
bool
tag_id3_scan
(
gcc_unused
InputStream
&
is
,
gcc_unused
const
TagHandler
&
handler
,
...
...
@@ -62,14 +55,6 @@ tag_id3_scan(gcc_unused InputStream &is,
return
false
;
}
static
inline
bool
tag_id3_scan
(
gcc_unused
Path
path_fs
,
gcc_unused
const
TagHandler
&
handler
,
gcc_unused
void
*
handler_ctx
)
{
return
false
;
}
#endif
#endif
test/ReadApeTags.cxx
View file @
cccbcf51
...
...
@@ -19,8 +19,14 @@
#include "config.h"
#include "tag/ApeLoader.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "fs/Path.hxx"
#include "Log.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "util/StringView.hxx"
#include "util/Error.hxx"
#include <stdlib.h>
#include <stdio.h>
...
...
@@ -55,7 +61,18 @@ main(int argc, char **argv)
}
const
Path
path
=
Path
::
FromFS
(
argv
[
1
]);
if
(
!
tag_ape_scan
(
path
,
MyApeTagCallback
))
{
Mutex
mutex
;
Cond
cond
;
Error
error
;
auto
is
=
OpenLocalInputStream
(
path
,
mutex
,
cond
,
error
);
if
(
!
is
)
{
LogError
(
error
);
return
EXIT_FAILURE
;
}
if
(
!
tag_ape_scan
(
*
is
,
MyApeTagCallback
))
{
fprintf
(
stderr
,
"error
\n
"
);
return
EXIT_FAILURE
;
}
...
...
test/dump_rva2.cxx
View file @
cccbcf51
...
...
@@ -22,8 +22,12 @@
#include "tag/TagRva2.hxx"
#include "ReplayGainInfo.hxx"
#include "config/ConfigGlobal.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "util/Error.hxx"
#include "fs/Path.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "Log.hxx"
#include <id3tag.h>
...
...
@@ -54,16 +58,21 @@ int main(int argc, char **argv)
return
EXIT_FAILURE
;
}
const
char
*
path
=
argv
[
1
];
const
Path
path
=
Path
::
FromFS
(
argv
[
1
]);
Mutex
mutex
;
Cond
cond
;
Error
error
;
const
auto
tag
=
tag_id3_load
(
Path
::
FromFS
(
path
),
error
);
if
(
tag
==
NULL
)
{
if
(
error
.
IsDefined
())
LogError
(
error
);
else
fprintf
(
stderr
,
"No ID3 tag found
\n
"
);
auto
is
=
OpenLocalInputStream
(
path
,
mutex
,
cond
,
error
);
if
(
!
is
)
{
LogError
(
error
);
return
EXIT_FAILURE
;
}
const
auto
tag
=
tag_id3_load
(
*
is
);
if
(
tag
==
NULL
)
{
fprintf
(
stderr
,
"No ID3 tag found
\n
"
);
return
EXIT_FAILURE
;
}
...
...
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