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
a78b2d84
Commit
a78b2d84
authored
Oct 20, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TagType: rename enum tag_type to TagType
parent
cf4d80fc
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
94 additions
and
94 deletions
+94
-94
DatabaseHelpers.cxx
src/DatabaseHelpers.cxx
+2
-2
DatabaseHelpers.hxx
src/DatabaseHelpers.hxx
+1
-1
DatabasePlugin.hxx
src/DatabasePlugin.hxx
+1
-1
DatabasePrint.cxx
src/DatabasePrint.cxx
+3
-3
DatabaseSave.cxx
src/DatabaseSave.cxx
+1
-1
IcyMetaDataParser.cxx
src/IcyMetaDataParser.cxx
+1
-1
IcyMetaDataServer.cxx
src/IcyMetaDataServer.cxx
+1
-1
IcyMetaDataServer.hxx
src/IcyMetaDataServer.hxx
+1
-1
SongSave.cxx
src/SongSave.cxx
+1
-1
SongSort.cxx
src/SongSort.cxx
+3
-3
CueParser.cxx
src/cue/CueParser.cxx
+3
-3
ProxyDatabasePlugin.cxx
src/db/ProxyDatabasePlugin.cxx
+5
-5
SimpleDatabasePlugin.cxx
src/db/SimpleDatabasePlugin.cxx
+1
-1
SimpleDatabasePlugin.hxx
src/db/SimpleDatabasePlugin.hxx
+1
-1
AdPlugDecoderPlugin.cxx
src/decoder/AdPlugDecoderPlugin.cxx
+1
-1
DsdiffDecoderPlugin.cxx
src/decoder/DsdiffDecoderPlugin.cxx
+1
-1
FfmpegMetaData.cxx
src/decoder/FfmpegMetaData.cxx
+2
-2
FlacMetadata.cxx
src/decoder/FlacMetadata.cxx
+2
-2
OpusTags.cxx
src/decoder/OpusTags.cxx
+1
-1
VorbisComments.cxx
src/decoder/VorbisComments.cxx
+2
-2
WavpackDecoderPlugin.cxx
src/decoder/WavpackDecoderPlugin.cxx
+2
-2
HttpdOutputPlugin.cxx
src/output/HttpdOutputPlugin.cxx
+1
-1
RoarOutputPlugin.cxx
src/output/RoarOutputPlugin.cxx
+1
-1
AsxPlaylistPlugin.cxx
src/playlist/AsxPlaylistPlugin.cxx
+1
-1
RssPlaylistPlugin.cxx
src/playlist/RssPlaylistPlugin.cxx
+1
-1
XspfPlaylistPlugin.cxx
src/playlist/XspfPlaylistPlugin.cxx
+1
-1
ApeTag.cxx
src/tag/ApeTag.cxx
+3
-3
Tag.cxx
src/tag/Tag.cxx
+9
-9
Tag.hxx
src/tag/Tag.hxx
+10
-10
TagBuilder.cxx
src/tag/TagBuilder.cxx
+3
-3
TagBuilder.hxx
src/tag/TagBuilder.hxx
+3
-3
TagHandler.cxx
src/tag/TagHandler.cxx
+1
-1
TagHandler.hxx
src/tag/TagHandler.hxx
+2
-2
TagId3.cxx
src/tag/TagId3.cxx
+7
-7
TagItem.hxx
src/tag/TagItem.hxx
+2
-2
TagPool.cxx
src/tag/TagPool.cxx
+4
-4
TagPool.hxx
src/tag/TagPool.hxx
+1
-1
TagTable.cxx
src/tag/TagTable.cxx
+2
-2
TagTable.hxx
src/tag/TagTable.hxx
+3
-3
TagType.h
src/tag/TagType.h
+2
-2
read_tags.cxx
test/read_tags.cxx
+1
-1
No files found.
src/DatabaseHelpers.cxx
View file @
a78b2d84
...
@@ -37,7 +37,7 @@ struct StringLess {
...
@@ -37,7 +37,7 @@ struct StringLess {
typedef
std
::
set
<
const
char
*
,
StringLess
>
StringSet
;
typedef
std
::
set
<
const
char
*
,
StringLess
>
StringSet
;
static
bool
static
bool
CollectTags
(
StringSet
&
set
,
enum
tag_t
ype
tag_type
,
Song
&
song
)
CollectTags
(
StringSet
&
set
,
TagT
ype
tag_type
,
Song
&
song
)
{
{
Tag
*
tag
=
song
.
tag
;
Tag
*
tag
=
song
.
tag
;
if
(
tag
==
nullptr
)
if
(
tag
==
nullptr
)
...
@@ -59,7 +59,7 @@ CollectTags(StringSet &set, enum tag_type tag_type, Song &song)
...
@@ -59,7 +59,7 @@ CollectTags(StringSet &set, enum tag_type tag_type, Song &song)
bool
bool
VisitUniqueTags
(
const
Database
&
db
,
const
DatabaseSelection
&
selection
,
VisitUniqueTags
(
const
Database
&
db
,
const
DatabaseSelection
&
selection
,
enum
tag_t
ype
tag_type
,
TagT
ype
tag_type
,
VisitString
visit_string
,
VisitString
visit_string
,
Error
&
error
)
Error
&
error
)
{
{
...
...
src/DatabaseHelpers.hxx
View file @
a78b2d84
...
@@ -31,7 +31,7 @@ struct DatabaseStats;
...
@@ -31,7 +31,7 @@ struct DatabaseStats;
bool
bool
VisitUniqueTags
(
const
Database
&
db
,
const
DatabaseSelection
&
selection
,
VisitUniqueTags
(
const
Database
&
db
,
const
DatabaseSelection
&
selection
,
enum
tag_t
ype
tag_type
,
TagT
ype
tag_type
,
VisitString
visit_string
,
VisitString
visit_string
,
Error
&
error
);
Error
&
error
);
...
...
src/DatabasePlugin.hxx
View file @
a78b2d84
...
@@ -125,7 +125,7 @@ public:
...
@@ -125,7 +125,7 @@ public:
* Visit all unique tag values.
* Visit all unique tag values.
*/
*/
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
enum
tag_t
ype
tag_type
,
TagT
ype
tag_type
,
VisitString
visit_string
,
VisitString
visit_string
,
Error
&
error
)
const
=
0
;
Error
&
error
)
const
=
0
;
...
...
src/DatabasePrint.cxx
View file @
a78b2d84
...
@@ -208,7 +208,7 @@ PrintSongURIVisitor(Client &client, Song &song)
...
@@ -208,7 +208,7 @@ PrintSongURIVisitor(Client &client, Song &song)
}
}
static
bool
static
bool
PrintUniqueTag
(
Client
&
client
,
enum
tag_t
ype
tag_type
,
PrintUniqueTag
(
Client
&
client
,
TagT
ype
tag_type
,
const
char
*
value
)
const
char
*
value
)
{
{
client_printf
(
client
,
"%s: %s
\n
"
,
tag_item_names
[
tag_type
],
value
);
client_printf
(
client
,
"%s: %s
\n
"
,
tag_item_names
[
tag_type
],
value
);
...
@@ -234,8 +234,8 @@ listAllUniqueTags(Client &client, int type,
...
@@ -234,8 +234,8 @@ listAllUniqueTags(Client &client, int type,
}
else
{
}
else
{
using
namespace
std
::
placeholders
;
using
namespace
std
::
placeholders
;
const
auto
f
=
std
::
bind
(
PrintUniqueTag
,
std
::
ref
(
client
),
const
auto
f
=
std
::
bind
(
PrintUniqueTag
,
std
::
ref
(
client
),
(
enum
tag_t
ype
)
type
,
_1
);
(
TagT
ype
)
type
,
_1
);
return
db
->
VisitUniqueTags
(
selection
,
(
enum
tag_t
ype
)
type
,
return
db
->
VisitUniqueTags
(
selection
,
(
TagT
ype
)
type
,
f
,
error
);
f
,
error
);
}
}
}
}
src/DatabaseSave.cxx
View file @
a78b2d84
...
@@ -117,7 +117,7 @@ db_load_internal(TextFile &file, Directory &music_root, Error &error)
...
@@ -117,7 +117,7 @@ db_load_internal(TextFile &file, Directory &music_root, Error &error)
}
}
}
else
if
(
g_str_has_prefix
(
line
,
DB_TAG_PREFIX
))
{
}
else
if
(
g_str_has_prefix
(
line
,
DB_TAG_PREFIX
))
{
const
char
*
name
=
line
+
sizeof
(
DB_TAG_PREFIX
)
-
1
;
const
char
*
name
=
line
+
sizeof
(
DB_TAG_PREFIX
)
-
1
;
enum
tag_t
ype
tag
=
tag_name_parse
(
name
);
TagT
ype
tag
=
tag_name_parse
(
name
);
if
(
tag
==
TAG_NUM_OF_ITEM_TYPES
)
{
if
(
tag
==
TAG_NUM_OF_ITEM_TYPES
)
{
error
.
Format
(
db_domain
,
error
.
Format
(
db_domain
,
"Unrecognized tag '%s', "
"Unrecognized tag '%s', "
...
...
src/IcyMetaDataParser.cxx
View file @
a78b2d84
...
@@ -66,7 +66,7 @@ IcyMetaDataParser::Data(size_t length)
...
@@ -66,7 +66,7 @@ IcyMetaDataParser::Data(size_t length)
}
}
static
void
static
void
icy_add_item
(
Tag
&
tag
,
enum
tag_t
ype
type
,
const
char
*
value
)
icy_add_item
(
Tag
&
tag
,
TagT
ype
type
,
const
char
*
value
)
{
{
size_t
length
=
strlen
(
value
);
size_t
length
=
strlen
(
value
);
...
...
src/IcyMetaDataServer.cxx
View file @
a78b2d84
...
@@ -84,7 +84,7 @@ icy_server_metadata_string(const char *stream_title, const char* stream_url)
...
@@ -84,7 +84,7 @@ icy_server_metadata_string(const char *stream_title, const char* stream_url)
}
}
Page
*
Page
*
icy_server_metadata_page
(
const
Tag
&
tag
,
const
enum
tag_t
ype
*
types
)
icy_server_metadata_page
(
const
Tag
&
tag
,
const
TagT
ype
*
types
)
{
{
const
gchar
*
tag_items
[
TAG_NUM_OF_ITEM_TYPES
];
const
gchar
*
tag_items
[
TAG_NUM_OF_ITEM_TYPES
];
gint
last_item
,
item
;
gint
last_item
,
item
;
...
...
src/IcyMetaDataServer.hxx
View file @
a78b2d84
...
@@ -34,6 +34,6 @@ icy_server_metadata_header(const char *name,
...
@@ -34,6 +34,6 @@ icy_server_metadata_header(const char *name,
const
char
*
content_type
,
int
metaint
);
const
char
*
content_type
,
int
metaint
);
Page
*
Page
*
icy_server_metadata_page
(
const
Tag
&
tag
,
const
enum
tag_t
ype
*
types
);
icy_server_metadata_page
(
const
Tag
&
tag
,
const
TagT
ype
*
types
);
#endif
#endif
src/SongSave.cxx
View file @
a78b2d84
...
@@ -61,7 +61,7 @@ song_load(TextFile &file, Directory *parent, const char *uri,
...
@@ -61,7 +61,7 @@ song_load(TextFile &file, Directory *parent, const char *uri,
?
Song
::
NewFile
(
uri
,
parent
)
?
Song
::
NewFile
(
uri
,
parent
)
:
Song
::
NewRemote
(
uri
);
:
Song
::
NewRemote
(
uri
);
char
*
line
,
*
colon
;
char
*
line
,
*
colon
;
enum
tag_t
ype
type
;
TagT
ype
type
;
const
char
*
value
;
const
char
*
value
;
TagBuilder
tag
;
TagBuilder
tag
;
...
...
src/SongSort.cxx
View file @
a78b2d84
...
@@ -33,7 +33,7 @@ extern "C" {
...
@@ -33,7 +33,7 @@ extern "C" {
#include <stdlib.h>
#include <stdlib.h>
static
const
char
*
static
const
char
*
tag_get_value_checked
(
const
Tag
*
tag
,
enum
tag_t
ype
type
)
tag_get_value_checked
(
const
Tag
*
tag
,
TagT
ype
type
)
{
{
return
tag
!=
nullptr
return
tag
!=
nullptr
?
tag
->
GetValue
(
type
)
?
tag
->
GetValue
(
type
)
...
@@ -58,7 +58,7 @@ compare_utf8_string(const char *a, const char *b)
...
@@ -58,7 +58,7 @@ compare_utf8_string(const char *a, const char *b)
*/
*/
static
int
static
int
compare_string_tag_item
(
const
Tag
*
a
,
const
Tag
*
b
,
compare_string_tag_item
(
const
Tag
*
a
,
const
Tag
*
b
,
enum
tag_t
ype
type
)
TagT
ype
type
)
{
{
return
compare_utf8_string
(
tag_get_value_checked
(
a
,
type
),
return
compare_utf8_string
(
tag_get_value_checked
(
a
,
type
),
tag_get_value_checked
(
b
,
type
));
tag_get_value_checked
(
b
,
type
));
...
@@ -84,7 +84,7 @@ compare_number_string(const char *a, const char *b)
...
@@ -84,7 +84,7 @@ compare_number_string(const char *a, const char *b)
}
}
static
int
static
int
compare_tag_item
(
const
Tag
*
a
,
const
Tag
*
b
,
enum
tag_t
ype
type
)
compare_tag_item
(
const
Tag
*
a
,
const
Tag
*
b
,
TagT
ype
type
)
{
{
return
compare_number_string
(
tag_get_value_checked
(
a
,
type
),
return
compare_number_string
(
tag_get_value_checked
(
a
,
type
),
tag_get_value_checked
(
b
,
type
));
tag_get_value_checked
(
b
,
type
));
...
...
src/cue/CueParser.cxx
View file @
a78b2d84
...
@@ -109,7 +109,7 @@ cue_next_value(char **pp)
...
@@ -109,7 +109,7 @@ cue_next_value(char **pp)
}
}
static
void
static
void
cue_add_tag
(
Tag
&
tag
,
enum
tag_t
ype
type
,
char
*
p
)
cue_add_tag
(
Tag
&
tag
,
TagT
ype
type
,
char
*
p
)
{
{
const
char
*
value
=
cue_next_value
(
&
p
);
const
char
*
value
=
cue_next_value
(
&
p
);
if
(
value
!=
nullptr
)
if
(
value
!=
nullptr
)
...
@@ -124,7 +124,7 @@ cue_parse_rem(char *p, Tag &tag)
...
@@ -124,7 +124,7 @@ cue_parse_rem(char *p, Tag &tag)
if
(
type
==
nullptr
)
if
(
type
==
nullptr
)
return
;
return
;
enum
tag_t
ype
type2
=
tag_name_parse_i
(
type
);
TagT
ype
type2
=
tag_name_parse_i
(
type
);
if
(
type2
!=
TAG_NUM_OF_ITEM_TYPES
)
if
(
type2
!=
TAG_NUM_OF_ITEM_TYPES
)
cue_add_tag
(
tag
,
type2
,
p
);
cue_add_tag
(
tag
,
type2
,
p
);
}
}
...
@@ -198,7 +198,7 @@ CueParser::Feed2(char *p)
...
@@ -198,7 +198,7 @@ CueParser::Feed2(char *p)
CD artist, while at track-level it specifies the
CD artist, while at track-level it specifies the
track artist." */
track artist." */
enum
tag_t
ype
type
=
state
==
TRACK
TagT
ype
type
=
state
==
TRACK
?
TAG_ARTIST
?
TAG_ARTIST
:
TAG_ALBUM_ARTIST
;
:
TAG_ALBUM_ARTIST
;
...
...
src/db/ProxyDatabasePlugin.cxx
View file @
a78b2d84
...
@@ -63,7 +63,7 @@ public:
...
@@ -63,7 +63,7 @@ public:
Error
&
error
)
const
override
;
Error
&
error
)
const
override
;
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
enum
tag_t
ype
tag_type
,
TagT
ype
tag_type
,
VisitString
visit_string
,
VisitString
visit_string
,
Error
&
error
)
const
override
;
Error
&
error
)
const
override
;
...
@@ -78,7 +78,7 @@ protected:
...
@@ -78,7 +78,7 @@ protected:
static
constexpr
Domain
libmpdclient_domain
(
"libmpdclient"
);
static
constexpr
Domain
libmpdclient_domain
(
"libmpdclient"
);
static
constexpr
struct
{
static
constexpr
struct
{
enum
tag_t
ype
d
;
TagT
ype
d
;
enum
mpd_tag_type
s
;
enum
mpd_tag_type
s
;
}
tag_table
[]
=
{
}
tag_table
[]
=
{
{
TAG_ARTIST
,
MPD_TAG_ARTIST
},
{
TAG_ARTIST
,
MPD_TAG_ARTIST
},
...
@@ -103,7 +103,7 @@ static constexpr struct {
...
@@ -103,7 +103,7 @@ static constexpr struct {
gcc_const
gcc_const
static
enum
mpd_tag_type
static
enum
mpd_tag_type
Convert
(
enum
tag_t
ype
tag_type
)
Convert
(
TagT
ype
tag_type
)
{
{
for
(
auto
i
=
&
tag_table
[
0
];
i
->
d
!=
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
for
(
auto
i
=
&
tag_table
[
0
];
i
->
d
!=
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
if
(
i
->
d
==
tag_type
)
if
(
i
->
d
==
tag_type
)
...
@@ -248,7 +248,7 @@ Visit(struct mpd_connection *connection,
...
@@ -248,7 +248,7 @@ Visit(struct mpd_connection *connection,
}
}
static
void
static
void
Copy
(
TagBuilder
&
tag
,
enum
tag_t
ype
d_tag
,
Copy
(
TagBuilder
&
tag
,
TagT
ype
d_tag
,
const
struct
mpd_song
*
song
,
enum
mpd_tag_type
s_tag
)
const
struct
mpd_song
*
song
,
enum
mpd_tag_type
s_tag
)
{
{
...
@@ -405,7 +405,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
...
@@ -405,7 +405,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
bool
bool
ProxyDatabase
::
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
ProxyDatabase
::
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
enum
tag_t
ype
tag_type
,
TagT
ype
tag_type
,
VisitString
visit_string
,
VisitString
visit_string
,
Error
&
error
)
const
Error
&
error
)
const
{
{
...
...
src/db/SimpleDatabasePlugin.cxx
View file @
a78b2d84
...
@@ -263,7 +263,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
...
@@ -263,7 +263,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
bool
bool
SimpleDatabase
::
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
SimpleDatabase
::
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
enum
tag_t
ype
tag_type
,
TagT
ype
tag_type
,
VisitString
visit_string
,
VisitString
visit_string
,
Error
&
error
)
const
Error
&
error
)
const
{
{
...
...
src/db/SimpleDatabasePlugin.hxx
View file @
a78b2d84
...
@@ -77,7 +77,7 @@ public:
...
@@ -77,7 +77,7 @@ public:
Error
&
error
)
const
override
;
Error
&
error
)
const
override
;
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
enum
tag_t
ype
tag_type
,
TagT
ype
tag_type
,
VisitString
visit_string
,
VisitString
visit_string
,
Error
&
error
)
const
override
;
Error
&
error
)
const
override
;
...
...
src/decoder/AdPlugDecoderPlugin.cxx
View file @
a78b2d84
...
@@ -81,7 +81,7 @@ adplug_file_decode(struct decoder *decoder, const char *path_fs)
...
@@ -81,7 +81,7 @@ adplug_file_decode(struct decoder *decoder, const char *path_fs)
}
}
static
void
static
void
adplug_scan_tag
(
enum
tag_t
ype
type
,
const
std
::
string
&
value
,
adplug_scan_tag
(
TagT
ype
type
,
const
std
::
string
&
value
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
if
(
!
value
.
empty
())
if
(
!
value
.
empty
())
...
...
src/decoder/DsdiffDecoderPlugin.cxx
View file @
a78b2d84
...
@@ -202,7 +202,7 @@ static void
...
@@ -202,7 +202,7 @@ static void
dsdiff_handle_native_tag
(
struct
input_stream
*
is
,
dsdiff_handle_native_tag
(
struct
input_stream
*
is
,
const
struct
tag_handler
*
handler
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
,
input_stream
::
offset_type
tagoffset
,
void
*
handler_ctx
,
input_stream
::
offset_type
tagoffset
,
enum
tag_t
ype
type
)
TagT
ype
type
)
{
{
if
(
!
dsdlib_skip_to
(
nullptr
,
is
,
tagoffset
))
if
(
!
dsdlib_skip_to
(
nullptr
,
is
,
tagoffset
))
return
;
return
;
...
...
src/decoder/FfmpegMetaData.cxx
View file @
a78b2d84
...
@@ -36,7 +36,7 @@ static const struct tag_table ffmpeg_tags[] = {
...
@@ -36,7 +36,7 @@ static const struct tag_table ffmpeg_tags[] = {
};
};
static
void
static
void
ffmpeg_copy_metadata
(
enum
tag_t
ype
type
,
ffmpeg_copy_metadata
(
TagT
ype
type
,
AVDictionary
*
m
,
const
char
*
name
,
AVDictionary
*
m
,
const
char
*
name
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
...
@@ -63,7 +63,7 @@ ffmpeg_scan_dictionary(AVDictionary *dict,
...
@@ -63,7 +63,7 @@ ffmpeg_scan_dictionary(AVDictionary *dict,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
ffmpeg_copy_metadata
(
tag_t
ype
(
i
),
dict
,
tag_item_names
[
i
],
ffmpeg_copy_metadata
(
TagT
ype
(
i
),
dict
,
tag_item_names
[
i
],
handler
,
handler_ctx
);
handler
,
handler_ctx
);
for
(
const
struct
tag_table
*
i
=
ffmpeg_tags
;
for
(
const
struct
tag_table
*
i
=
ffmpeg_tags
;
...
...
src/decoder/FlacMetadata.cxx
View file @
a78b2d84
...
@@ -152,7 +152,7 @@ flac_comment_value(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
...
@@ -152,7 +152,7 @@ flac_comment_value(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
*/
*/
static
bool
static
bool
flac_copy_comment
(
const
FLAC__StreamMetadata_VorbisComment_Entry
*
entry
,
flac_copy_comment
(
const
FLAC__StreamMetadata_VorbisComment_Entry
*
entry
,
const
char
*
name
,
enum
tag_t
ype
tag_type
,
const
char
*
name
,
TagT
ype
tag_type
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
const
char
*
value
;
const
char
*
value
;
...
@@ -193,7 +193,7 @@ flac_scan_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
...
@@ -193,7 +193,7 @@ flac_scan_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
if
(
flac_copy_comment
(
entry
,
if
(
flac_copy_comment
(
entry
,
tag_item_names
[
i
],
(
enum
tag_t
ype
)
i
,
tag_item_names
[
i
],
(
TagT
ype
)
i
,
handler
,
handler_ctx
))
handler
,
handler_ctx
))
return
;
return
;
}
}
...
...
src/decoder/OpusTags.cxx
View file @
a78b2d84
...
@@ -34,7 +34,7 @@ ScanOneOpusTag(const char *name, const char *value,
...
@@ -34,7 +34,7 @@ ScanOneOpusTag(const char *name, const char *value,
tag_handler_invoke_pair
(
handler
,
ctx
,
name
,
value
);
tag_handler_invoke_pair
(
handler
,
ctx
,
name
,
value
);
if
(
handler
->
tag
!=
nullptr
)
{
if
(
handler
->
tag
!=
nullptr
)
{
enum
tag_t
ype
t
=
tag_table_lookup_i
(
xiph_tags
,
name
);
TagT
ype
t
=
tag_table_lookup_i
(
xiph_tags
,
name
);
if
(
t
!=
TAG_NUM_OF_ITEM_TYPES
)
if
(
t
!=
TAG_NUM_OF_ITEM_TYPES
)
tag_handler_invoke_tag
(
handler
,
ctx
,
t
,
value
);
tag_handler_invoke_tag
(
handler
,
ctx
,
t
,
value
);
}
}
...
...
src/decoder/VorbisComments.cxx
View file @
a78b2d84
...
@@ -84,7 +84,7 @@ vorbis_comments_to_replay_gain(struct replay_gain_info *rgi, char **comments)
...
@@ -84,7 +84,7 @@ vorbis_comments_to_replay_gain(struct replay_gain_info *rgi, char **comments)
*/
*/
static
bool
static
bool
vorbis_copy_comment
(
const
char
*
comment
,
vorbis_copy_comment
(
const
char
*
comment
,
const
char
*
name
,
enum
tag_t
ype
tag_type
,
const
char
*
name
,
TagT
ype
tag_type
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
const
char
*
value
;
const
char
*
value
;
...
@@ -122,7 +122,7 @@ vorbis_scan_comment(const char *comment,
...
@@ -122,7 +122,7 @@ vorbis_scan_comment(const char *comment,
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
if
(
vorbis_copy_comment
(
comment
,
if
(
vorbis_copy_comment
(
comment
,
tag_item_names
[
i
],
tag_t
ype
(
i
),
tag_item_names
[
i
],
TagT
ype
(
i
),
handler
,
handler_ctx
))
handler
,
handler_ctx
))
return
;
return
;
}
}
...
...
src/decoder/WavpackDecoderPlugin.cxx
View file @
a78b2d84
...
@@ -260,7 +260,7 @@ wavpack_replaygain(struct replay_gain_info *replay_gain_info,
...
@@ -260,7 +260,7 @@ wavpack_replaygain(struct replay_gain_info *replay_gain_info,
static
void
static
void
wavpack_scan_tag_item
(
WavpackContext
*
wpc
,
const
char
*
name
,
wavpack_scan_tag_item
(
WavpackContext
*
wpc
,
const
char
*
name
,
enum
tag_t
ype
type
,
TagT
ype
type
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
char
buffer
[
1024
];
char
buffer
[
1024
];
...
@@ -312,7 +312,7 @@ wavpack_scan_file(const char *fname,
...
@@ -312,7 +312,7 @@ wavpack_scan_file(const char *fname,
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
{
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
{
const
char
*
name
=
tag_item_names
[
i
];
const
char
*
name
=
tag_item_names
[
i
];
if
(
name
!=
nullptr
)
if
(
name
!=
nullptr
)
wavpack_scan_tag_item
(
wpc
,
name
,
(
enum
tag_t
ype
)
i
,
wavpack_scan_tag_item
(
wpc
,
name
,
(
TagT
ype
)
i
,
handler
,
handler_ctx
);
handler
,
handler_ctx
);
}
}
...
...
src/output/HttpdOutputPlugin.cxx
View file @
a78b2d84
...
@@ -514,7 +514,7 @@ HttpdOutput::SendTag(const Tag *tag)
...
@@ -514,7 +514,7 @@ HttpdOutput::SendTag(const Tag *tag)
if
(
metadata
!=
NULL
)
if
(
metadata
!=
NULL
)
metadata
->
Unref
();
metadata
->
Unref
();
static
constexpr
tag_t
ype
types
[]
=
{
static
constexpr
TagT
ype
types
[]
=
{
TAG_ALBUM
,
TAG_ARTIST
,
TAG_TITLE
,
TAG_ALBUM
,
TAG_ARTIST
,
TAG_TITLE
,
TAG_NUM_OF_ITEM_TYPES
TAG_NUM_OF_ITEM_TYPES
};
};
...
...
src/output/RoarOutputPlugin.cxx
View file @
a78b2d84
...
@@ -316,7 +316,7 @@ roar_play(struct audio_output *ao, const void *chunk, size_t size,
...
@@ -316,7 +316,7 @@ roar_play(struct audio_output *ao, const void *chunk, size_t size,
}
}
static
const
char
*
static
const
char
*
roar_tag_convert
(
enum
tag_t
ype
type
,
bool
*
is_uuid
)
roar_tag_convert
(
TagT
ype
type
,
bool
*
is_uuid
)
{
{
*
is_uuid
=
false
;
*
is_uuid
=
false
;
switch
(
type
)
switch
(
type
)
...
...
src/playlist/AsxPlaylistPlugin.cxx
View file @
a78b2d84
...
@@ -57,7 +57,7 @@ struct AsxParser {
...
@@ -57,7 +57,7 @@ struct AsxParser {
* valid if state==ENTRY. TAG_NUM_OF_ITEM_TYPES means there
* valid if state==ENTRY. TAG_NUM_OF_ITEM_TYPES means there
* is no (known) tag.
* is no (known) tag.
*/
*/
enum
tag_t
ype
tag
;
TagT
ype
tag
;
/**
/**
* The current song. It is allocated after the "location"
* The current song. It is allocated after the "location"
...
...
src/playlist/RssPlaylistPlugin.cxx
View file @
a78b2d84
...
@@ -57,7 +57,7 @@ struct RssParser {
...
@@ -57,7 +57,7 @@ struct RssParser {
* valid if state==ITEM. TAG_NUM_OF_ITEM_TYPES means there
* valid if state==ITEM. TAG_NUM_OF_ITEM_TYPES means there
* is no (known) tag.
* is no (known) tag.
*/
*/
enum
tag_t
ype
tag
;
TagT
ype
tag
;
/**
/**
* The current song. It is allocated after the "location"
* The current song. It is allocated after the "location"
...
...
src/playlist/XspfPlaylistPlugin.cxx
View file @
a78b2d84
...
@@ -57,7 +57,7 @@ struct XspfParser {
...
@@ -57,7 +57,7 @@ struct XspfParser {
* valid if state==TRACK. TAG_NUM_OF_ITEM_TYPES means there
* valid if state==TRACK. TAG_NUM_OF_ITEM_TYPES means there
* is no (known) tag.
* is no (known) tag.
*/
*/
enum
tag_t
ype
tag
;
TagT
ype
tag
;
/**
/**
* The current song. It is allocated after the "location"
* The current song. It is allocated after the "location"
...
...
src/tag/ApeTag.cxx
View file @
a78b2d84
...
@@ -34,10 +34,10 @@ const struct tag_table ape_tags[] = {
...
@@ -34,10 +34,10 @@ const struct tag_table ape_tags[] = {
{
nullptr
,
TAG_NUM_OF_ITEM_TYPES
}
{
nullptr
,
TAG_NUM_OF_ITEM_TYPES
}
};
};
static
enum
tag_t
ype
static
TagT
ype
tag_ape_name_parse
(
const
char
*
name
)
tag_ape_name_parse
(
const
char
*
name
)
{
{
enum
tag_t
ype
type
=
tag_table_lookup_i
(
ape_tags
,
name
);
TagT
ype
type
=
tag_table_lookup_i
(
ape_tags
,
name
);
if
(
type
==
TAG_NUM_OF_ITEM_TYPES
)
if
(
type
==
TAG_NUM_OF_ITEM_TYPES
)
type
=
tag_name_parse_i
(
name
);
type
=
tag_name_parse_i
(
name
);
...
@@ -58,7 +58,7 @@ tag_ape_import_item(unsigned long flags,
...
@@ -58,7 +58,7 @@ tag_ape_import_item(unsigned long flags,
tag_handler_invoke_pair
(
handler
,
handler_ctx
,
key
,
value
);
tag_handler_invoke_pair
(
handler
,
handler_ctx
,
key
,
value
);
enum
tag_t
ype
type
=
tag_ape_name_parse
(
key
);
TagT
ype
type
=
tag_ape_name_parse
(
key
);
if
(
type
==
TAG_NUM_OF_ITEM_TYPES
)
if
(
type
==
TAG_NUM_OF_ITEM_TYPES
)
return
false
;
return
false
;
...
...
src/tag/Tag.cxx
View file @
a78b2d84
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include <assert.h>
#include <assert.h>
#include <string.h>
#include <string.h>
enum
tag_t
ype
TagT
ype
tag_name_parse
(
const
char
*
name
)
tag_name_parse
(
const
char
*
name
)
{
{
assert
(
name
!=
nullptr
);
assert
(
name
!=
nullptr
);
...
@@ -36,13 +36,13 @@ tag_name_parse(const char *name)
...
@@ -36,13 +36,13 @@ tag_name_parse(const char *name)
assert
(
tag_item_names
[
i
]
!=
nullptr
);
assert
(
tag_item_names
[
i
]
!=
nullptr
);
if
(
strcmp
(
name
,
tag_item_names
[
i
])
==
0
)
if
(
strcmp
(
name
,
tag_item_names
[
i
])
==
0
)
return
(
enum
tag_t
ype
)
i
;
return
(
TagT
ype
)
i
;
}
}
return
TAG_NUM_OF_ITEM_TYPES
;
return
TAG_NUM_OF_ITEM_TYPES
;
}
}
enum
tag_t
ype
TagT
ype
tag_name_parse_i
(
const
char
*
name
)
tag_name_parse_i
(
const
char
*
name
)
{
{
assert
(
name
!=
nullptr
);
assert
(
name
!=
nullptr
);
...
@@ -51,7 +51,7 @@ tag_name_parse_i(const char *name)
...
@@ -51,7 +51,7 @@ tag_name_parse_i(const char *name)
assert
(
tag_item_names
[
i
]
!=
nullptr
);
assert
(
tag_item_names
[
i
]
!=
nullptr
);
if
(
g_ascii_strcasecmp
(
name
,
tag_item_names
[
i
])
==
0
)
if
(
g_ascii_strcasecmp
(
name
,
tag_item_names
[
i
])
==
0
)
return
(
enum
tag_t
ype
)
i
;
return
(
TagT
ype
)
i
;
}
}
return
TAG_NUM_OF_ITEM_TYPES
;
return
TAG_NUM_OF_ITEM_TYPES
;
...
@@ -166,7 +166,7 @@ Tag::MergeReplace(Tag *base, Tag *add)
...
@@ -166,7 +166,7 @@ Tag::MergeReplace(Tag *base, Tag *add)
}
}
const
char
*
const
char
*
Tag
::
GetValue
(
tag_t
ype
type
)
const
Tag
::
GetValue
(
TagT
ype
type
)
const
{
{
assert
(
type
<
TAG_NUM_OF_ITEM_TYPES
);
assert
(
type
<
TAG_NUM_OF_ITEM_TYPES
);
...
@@ -178,13 +178,13 @@ Tag::GetValue(tag_type type) const
...
@@ -178,13 +178,13 @@ Tag::GetValue(tag_type type) const
}
}
bool
bool
Tag
::
HasType
(
tag_t
ype
type
)
const
Tag
::
HasType
(
TagT
ype
type
)
const
{
{
return
GetValue
(
type
)
!=
nullptr
;
return
GetValue
(
type
)
!=
nullptr
;
}
}
void
void
Tag
::
AddItemInternal
(
tag_t
ype
type
,
const
char
*
value
,
size_t
len
)
Tag
::
AddItemInternal
(
TagT
ype
type
,
const
char
*
value
,
size_t
len
)
{
{
unsigned
int
i
=
num_items
;
unsigned
int
i
=
num_items
;
...
@@ -206,7 +206,7 @@ Tag::AddItemInternal(tag_type type, const char *value, size_t len)
...
@@ -206,7 +206,7 @@ Tag::AddItemInternal(tag_type type, const char *value, size_t len)
}
}
void
void
Tag
::
AddItem
(
tag_t
ype
type
,
const
char
*
value
,
size_t
len
)
Tag
::
AddItem
(
TagT
ype
type
,
const
char
*
value
,
size_t
len
)
{
{
if
(
ignore_tag_items
[
type
])
if
(
ignore_tag_items
[
type
])
return
;
return
;
...
@@ -218,7 +218,7 @@ Tag::AddItem(tag_type type, const char *value, size_t len)
...
@@ -218,7 +218,7 @@ Tag::AddItem(tag_type type, const char *value, size_t len)
}
}
void
void
Tag
::
AddItem
(
tag_t
ype
type
,
const
char
*
value
)
Tag
::
AddItem
(
TagT
ype
type
,
const
char
*
value
)
{
{
AddItem
(
type
,
value
,
strlen
(
value
));
AddItem
(
type
,
value
,
strlen
(
value
));
}
}
src/tag/Tag.hxx
View file @
a78b2d84
...
@@ -110,7 +110,7 @@ struct Tag {
...
@@ -110,7 +110,7 @@ struct Tag {
* @param value the value of the tag item (not null-terminated)
* @param value the value of the tag item (not null-terminated)
* @param len the length of #value
* @param len the length of #value
*/
*/
void
AddItem
(
tag_t
ype
type
,
const
char
*
value
,
size_t
len
);
void
AddItem
(
TagT
ype
type
,
const
char
*
value
,
size_t
len
);
/**
/**
* Appends a new tag item.
* Appends a new tag item.
...
@@ -119,11 +119,11 @@ struct Tag {
...
@@ -119,11 +119,11 @@ struct Tag {
* @param type the type of the new tag item
* @param type the type of the new tag item
* @param value the value of the tag item (null-terminated)
* @param value the value of the tag item (null-terminated)
*/
*/
void
AddItem
(
tag_t
ype
type
,
const
char
*
value
);
void
AddItem
(
TagT
ype
type
,
const
char
*
value
);
/**
/**
* Merges the data from two tags. If both tags share data for the
* Merges the data from two tags. If both tags share data for the
* same
tag_t
ype, only data from "add" is used.
* same
TagT
ype, only data from "add" is used.
*
*
* @return a newly allocated tag
* @return a newly allocated tag
*/
*/
...
@@ -144,35 +144,35 @@ struct Tag {
...
@@ -144,35 +144,35 @@ struct Tag {
* is present in this tag object.
* is present in this tag object.
*/
*/
gcc_pure
gcc_pure
const
char
*
GetValue
(
tag_t
ype
type
)
const
;
const
char
*
GetValue
(
TagT
ype
type
)
const
;
/**
/**
* Checks whether the tag contains one or more items with
* Checks whether the tag contains one or more items with
* the specified type.
* the specified type.
*/
*/
gcc_pure
gcc_pure
bool
HasType
(
tag_t
ype
type
)
const
;
bool
HasType
(
TagT
ype
type
)
const
;
private
:
private
:
void
AddItemInternal
(
tag_t
ype
type
,
const
char
*
value
,
size_t
len
);
void
AddItemInternal
(
TagT
ype
type
,
const
char
*
value
,
size_t
len
);
};
};
/**
/**
* Parse the string, and convert it into a #
tag_t
ype. Returns
* Parse the string, and convert it into a #
TagT
ype. Returns
* #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
* #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
*/
*/
gcc_pure
gcc_pure
enum
tag_t
ype
TagT
ype
tag_name_parse
(
const
char
*
name
);
tag_name_parse
(
const
char
*
name
);
/**
/**
* Parse the string, and convert it into a #
tag_t
ype. Returns
* Parse the string, and convert it into a #
TagT
ype. Returns
* #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
* #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
*
*
* Case does not matter.
* Case does not matter.
*/
*/
gcc_pure
gcc_pure
enum
tag_t
ype
TagT
ype
tag_name_parse_i
(
const
char
*
name
);
tag_name_parse_i
(
const
char
*
name
);
#endif
#endif
src/tag/TagBuilder.cxx
View file @
a78b2d84
...
@@ -75,7 +75,7 @@ TagBuilder::Commit()
...
@@ -75,7 +75,7 @@ TagBuilder::Commit()
}
}
inline
void
inline
void
TagBuilder
::
AddItemInternal
(
tag_t
ype
type
,
const
char
*
value
,
size_t
length
)
TagBuilder
::
AddItemInternal
(
TagT
ype
type
,
const
char
*
value
,
size_t
length
)
{
{
assert
(
value
!=
nullptr
);
assert
(
value
!=
nullptr
);
assert
(
length
>
0
);
assert
(
length
>
0
);
...
@@ -96,7 +96,7 @@ TagBuilder::AddItemInternal(tag_type type, const char *value, size_t length)
...
@@ -96,7 +96,7 @@ TagBuilder::AddItemInternal(tag_type type, const char *value, size_t length)
}
}
void
void
TagBuilder
::
AddItem
(
tag_t
ype
type
,
const
char
*
value
,
size_t
length
)
TagBuilder
::
AddItem
(
TagT
ype
type
,
const
char
*
value
,
size_t
length
)
{
{
assert
(
value
!=
nullptr
);
assert
(
value
!=
nullptr
);
...
@@ -107,7 +107,7 @@ TagBuilder::AddItem(tag_type type, const char *value, size_t length)
...
@@ -107,7 +107,7 @@ TagBuilder::AddItem(tag_type type, const char *value, size_t length)
}
}
void
void
TagBuilder
::
AddItem
(
tag_t
ype
type
,
const
char
*
value
)
TagBuilder
::
AddItem
(
TagT
ype
type
,
const
char
*
value
)
{
{
assert
(
value
!=
nullptr
);
assert
(
value
!=
nullptr
);
...
...
src/tag/TagBuilder.hxx
View file @
a78b2d84
...
@@ -116,7 +116,7 @@ public:
...
@@ -116,7 +116,7 @@ public:
* @param len the length of #value
* @param len the length of #value
*/
*/
gcc_nonnull_all
gcc_nonnull_all
void
AddItem
(
tag_t
ype
type
,
const
char
*
value
,
size_t
length
);
void
AddItem
(
TagT
ype
type
,
const
char
*
value
,
size_t
length
);
/**
/**
* Appends a new tag item.
* Appends a new tag item.
...
@@ -125,11 +125,11 @@ public:
...
@@ -125,11 +125,11 @@ public:
* @param value the value of the tag item (null-terminated)
* @param value the value of the tag item (null-terminated)
*/
*/
gcc_nonnull_all
gcc_nonnull_all
void
AddItem
(
tag_t
ype
type
,
const
char
*
value
);
void
AddItem
(
TagT
ype
type
,
const
char
*
value
);
private
:
private
:
gcc_nonnull_all
gcc_nonnull_all
void
AddItemInternal
(
tag_t
ype
type
,
const
char
*
value
,
size_t
length
);
void
AddItemInternal
(
TagT
ype
type
,
const
char
*
value
,
size_t
length
);
};
};
#endif
#endif
src/tag/TagHandler.cxx
View file @
a78b2d84
...
@@ -32,7 +32,7 @@ add_tag_duration(unsigned seconds, void *ctx)
...
@@ -32,7 +32,7 @@ add_tag_duration(unsigned seconds, void *ctx)
}
}
static
void
static
void
add_tag_tag
(
enum
tag_t
ype
type
,
const
char
*
value
,
void
*
ctx
)
add_tag_tag
(
TagT
ype
type
,
const
char
*
value
,
void
*
ctx
)
{
{
TagBuilder
&
tag
=
*
(
TagBuilder
*
)
ctx
;
TagBuilder
&
tag
=
*
(
TagBuilder
*
)
ctx
;
...
...
src/tag/TagHandler.hxx
View file @
a78b2d84
...
@@ -42,7 +42,7 @@ struct tag_handler {
...
@@ -42,7 +42,7 @@ struct tag_handler {
* @param the value of the tag; the pointer will become
* @param the value of the tag; the pointer will become
* invalid after returning
* invalid after returning
*/
*/
void
(
*
tag
)(
enum
tag_t
ype
type
,
const
char
*
value
,
void
*
ctx
);
void
(
*
tag
)(
TagT
ype
type
,
const
char
*
value
,
void
*
ctx
);
/**
/**
* A name-value pair has been read. It is the codec specific
* A name-value pair has been read. It is the codec specific
...
@@ -63,7 +63,7 @@ tag_handler_invoke_duration(const struct tag_handler *handler, void *ctx,
...
@@ -63,7 +63,7 @@ tag_handler_invoke_duration(const struct tag_handler *handler, void *ctx,
static
inline
void
static
inline
void
tag_handler_invoke_tag
(
const
struct
tag_handler
*
handler
,
void
*
ctx
,
tag_handler_invoke_tag
(
const
struct
tag_handler
*
handler
,
void
*
ctx
,
enum
tag_t
ype
type
,
const
char
*
value
)
TagT
ype
type
,
const
char
*
value
)
{
{
assert
(
handler
!=
nullptr
);
assert
(
handler
!=
nullptr
);
assert
((
unsigned
)
type
<
TAG_NUM_OF_ITEM_TYPES
);
assert
((
unsigned
)
type
<
TAG_NUM_OF_ITEM_TYPES
);
...
...
src/tag/TagId3.cxx
View file @
a78b2d84
...
@@ -134,7 +134,7 @@ import_id3_string(bool is_id3v1, const id3_ucs4_t *ucs4)
...
@@ -134,7 +134,7 @@ import_id3_string(bool is_id3v1, const id3_ucs4_t *ucs4)
*/
*/
static
void
static
void
tag_id3_import_text_frame
(
struct
id3_tag
*
tag
,
const
struct
id3_frame
*
frame
,
tag_id3_import_text_frame
(
struct
id3_tag
*
tag
,
const
struct
id3_frame
*
frame
,
enum
tag_t
ype
type
,
TagT
ype
type
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
id3_ucs4_t
const
*
ucs4
;
id3_ucs4_t
const
*
ucs4
;
...
@@ -182,7 +182,7 @@ tag_id3_import_text_frame(struct id3_tag *tag, const struct id3_frame *frame,
...
@@ -182,7 +182,7 @@ tag_id3_import_text_frame(struct id3_tag *tag, const struct id3_frame *frame,
* 4.2). This is a wrapper for tag_id3_import_text_frame().
* 4.2). This is a wrapper for tag_id3_import_text_frame().
*/
*/
static
void
static
void
tag_id3_import_text
(
struct
id3_tag
*
tag
,
const
char
*
id
,
enum
tag_t
ype
type
,
tag_id3_import_text
(
struct
id3_tag
*
tag
,
const
char
*
id
,
TagT
ype
type
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
const
struct
id3_frame
*
frame
;
const
struct
id3_frame
*
frame
;
...
@@ -203,7 +203,7 @@ tag_id3_import_text(struct id3_tag *tag, const char *id, enum tag_type type,
...
@@ -203,7 +203,7 @@ tag_id3_import_text(struct id3_tag *tag, const char *id, enum tag_type type,
*/
*/
static
void
static
void
tag_id3_import_comment_frame
(
struct
id3_tag
*
tag
,
tag_id3_import_comment_frame
(
struct
id3_tag
*
tag
,
const
struct
id3_frame
*
frame
,
enum
tag_t
ype
type
,
const
struct
id3_frame
*
frame
,
TagT
ype
type
,
const
struct
tag_handler
*
handler
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
void
*
handler_ctx
)
{
{
...
@@ -236,7 +236,7 @@ tag_id3_import_comment_frame(struct id3_tag *tag,
...
@@ -236,7 +236,7 @@ tag_id3_import_comment_frame(struct id3_tag *tag,
* wrapper for tag_id3_import_comment_frame().
* wrapper for tag_id3_import_comment_frame().
*/
*/
static
void
static
void
tag_id3_import_comment
(
struct
id3_tag
*
tag
,
const
char
*
id
,
enum
tag_t
ype
type
,
tag_id3_import_comment
(
struct
id3_tag
*
tag
,
const
char
*
id
,
TagT
ype
type
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
{
const
struct
id3_frame
*
frame
;
const
struct
id3_frame
*
frame
;
...
@@ -247,10 +247,10 @@ tag_id3_import_comment(struct id3_tag *tag, const char *id, enum tag_type type,
...
@@ -247,10 +247,10 @@ tag_id3_import_comment(struct id3_tag *tag, const char *id, enum tag_type type,
}
}
/**
/**
* Parse a TXXX name, and convert it to a
tag_t
ype enum value.
* Parse a TXXX name, and convert it to a
TagT
ype enum value.
* Returns TAG_NUM_OF_ITEM_TYPES if the TXXX name is not understood.
* Returns TAG_NUM_OF_ITEM_TYPES if the TXXX name is not understood.
*/
*/
static
enum
tag_t
ype
static
TagT
ype
tag_id3_parse_txxx_name
(
const
char
*
name
)
tag_id3_parse_txxx_name
(
const
char
*
name
)
{
{
static
const
struct
tag_table
txxx_tags
[]
=
{
static
const
struct
tag_table
txxx_tags
[]
=
{
...
@@ -277,7 +277,7 @@ tag_id3_import_musicbrainz(struct id3_tag *id3_tag,
...
@@ -277,7 +277,7 @@ tag_id3_import_musicbrainz(struct id3_tag *id3_tag,
for
(
unsigned
i
=
0
;;
++
i
)
{
for
(
unsigned
i
=
0
;;
++
i
)
{
const
struct
id3_frame
*
frame
;
const
struct
id3_frame
*
frame
;
id3_utf8_t
*
name
,
*
value
;
id3_utf8_t
*
name
,
*
value
;
enum
tag_t
ype
type
;
TagT
ype
type
;
frame
=
id3_tag_findframe
(
id3_tag
,
"TXXX"
,
i
);
frame
=
id3_tag_findframe
(
id3_tag
,
"TXXX"
,
i
);
if
(
frame
==
nullptr
)
if
(
frame
==
nullptr
)
...
...
src/tag/TagItem.hxx
View file @
a78b2d84
...
@@ -24,13 +24,13 @@
...
@@ -24,13 +24,13 @@
#include "Compiler.h"
#include "Compiler.h"
/**
/**
* One tag value. It is a mapping of #
tag_t
ype to am arbitrary string
* One tag value. It is a mapping of #
TagT
ype to am arbitrary string
* value. Each tag can have multiple items of one tag type (although
* value. Each tag can have multiple items of one tag type (although
* few clients support that).
* few clients support that).
*/
*/
struct
TagItem
{
struct
TagItem
{
/** the type of this item */
/** the type of this item */
enum
tag_t
ype
type
;
TagT
ype
type
;
/**
/**
* the value of this tag; this is a variable length string
* the value of this tag; this is a variable length string
...
...
src/tag/TagPool.cxx
View file @
a78b2d84
...
@@ -39,7 +39,7 @@ struct slot {
...
@@ -39,7 +39,7 @@ struct slot {
static
struct
slot
*
slots
[
NUM_SLOTS
];
static
struct
slot
*
slots
[
NUM_SLOTS
];
static
inline
unsigned
static
inline
unsigned
calc_hash_n
(
enum
tag_t
ype
type
,
const
char
*
p
,
size_t
length
)
calc_hash_n
(
TagT
ype
type
,
const
char
*
p
,
size_t
length
)
{
{
unsigned
hash
=
5381
;
unsigned
hash
=
5381
;
...
@@ -52,7 +52,7 @@ calc_hash_n(enum tag_type type, const char *p, size_t length)
...
@@ -52,7 +52,7 @@ calc_hash_n(enum tag_type type, const char *p, size_t length)
}
}
static
inline
unsigned
static
inline
unsigned
calc_hash
(
enum
tag_t
ype
type
,
const
char
*
p
)
calc_hash
(
TagT
ype
type
,
const
char
*
p
)
{
{
unsigned
hash
=
5381
;
unsigned
hash
=
5381
;
...
@@ -71,7 +71,7 @@ tag_item_to_slot(TagItem *item)
...
@@ -71,7 +71,7 @@ tag_item_to_slot(TagItem *item)
}
}
static
struct
slot
*
slot_alloc
(
struct
slot
*
next
,
static
struct
slot
*
slot_alloc
(
struct
slot
*
next
,
enum
tag_t
ype
type
,
TagT
ype
type
,
const
char
*
value
,
int
length
)
const
char
*
value
,
int
length
)
{
{
struct
slot
*
slot
;
struct
slot
*
slot
;
...
@@ -87,7 +87,7 @@ static struct slot *slot_alloc(struct slot *next,
...
@@ -87,7 +87,7 @@ static struct slot *slot_alloc(struct slot *next,
}
}
TagItem
*
TagItem
*
tag_pool_get_item
(
enum
tag_t
ype
type
,
const
char
*
value
,
size_t
length
)
tag_pool_get_item
(
TagT
ype
type
,
const
char
*
value
,
size_t
length
)
{
{
struct
slot
**
slot_p
,
*
slot
;
struct
slot
**
slot_p
,
*
slot
;
...
...
src/tag/TagPool.hxx
View file @
a78b2d84
...
@@ -28,7 +28,7 @@ extern Mutex tag_pool_lock;
...
@@ -28,7 +28,7 @@ extern Mutex tag_pool_lock;
struct
TagItem
;
struct
TagItem
;
TagItem
*
TagItem
*
tag_pool_get_item
(
enum
tag_t
ype
type
,
const
char
*
value
,
size_t
length
);
tag_pool_get_item
(
TagT
ype
type
,
const
char
*
value
,
size_t
length
);
TagItem
*
TagItem
*
tag_pool_dup_item
(
TagItem
*
item
);
tag_pool_dup_item
(
TagItem
*
item
);
...
...
src/tag/TagTable.cxx
View file @
a78b2d84
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
* Returns TAG_NUM_OF_ITEM_TYPES if the specified name was not found
* Returns TAG_NUM_OF_ITEM_TYPES if the specified name was not found
* in the table.
* in the table.
*/
*/
tag_t
ype
TagT
ype
tag_table_lookup
(
const
struct
tag_table
*
table
,
const
char
*
name
)
tag_table_lookup
(
const
struct
tag_table
*
table
,
const
char
*
name
)
{
{
for
(;
table
->
name
!=
nullptr
;
++
table
)
for
(;
table
->
name
!=
nullptr
;
++
table
)
...
@@ -43,7 +43,7 @@ tag_table_lookup(const struct tag_table *table, const char *name)
...
@@ -43,7 +43,7 @@ tag_table_lookup(const struct tag_table *table, const char *name)
* Returns TAG_NUM_OF_ITEM_TYPES if the specified name was not found
* Returns TAG_NUM_OF_ITEM_TYPES if the specified name was not found
* in the table.
* in the table.
*/
*/
tag_t
ype
TagT
ype
tag_table_lookup_i
(
const
struct
tag_table
*
table
,
const
char
*
name
)
tag_table_lookup_i
(
const
struct
tag_table
*
table
,
const
char
*
name
)
{
{
for
(;
table
->
name
!=
nullptr
;
++
table
)
for
(;
table
->
name
!=
nullptr
;
++
table
)
...
...
src/tag/TagTable.hxx
View file @
a78b2d84
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
struct
tag_table
{
struct
tag_table
{
const
char
*
name
;
const
char
*
name
;
enum
tag_t
ype
type
;
TagT
ype
type
;
};
};
/**
/**
...
@@ -35,7 +35,7 @@ struct tag_table {
...
@@ -35,7 +35,7 @@ struct tag_table {
* in the table.
* in the table.
*/
*/
gcc_pure
gcc_pure
tag_t
ype
TagT
ype
tag_table_lookup
(
const
tag_table
*
table
,
const
char
*
name
);
tag_table_lookup
(
const
tag_table
*
table
,
const
char
*
name
);
/**
/**
...
@@ -44,7 +44,7 @@ tag_table_lookup(const tag_table *table, const char *name);
...
@@ -44,7 +44,7 @@ tag_table_lookup(const tag_table *table, const char *name);
* in the table.
* in the table.
*/
*/
gcc_pure
gcc_pure
tag_t
ype
TagT
ype
tag_table_lookup_i
(
const
tag_table
*
table
,
const
char
*
name
);
tag_table_lookup_i
(
const
tag_table
*
table
,
const
char
*
name
);
#endif
#endif
src/tag/TagType.h
View file @
a78b2d84
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
/**
/**
* Codes for the type of a tag item.
* Codes for the type of a tag item.
*/
*/
enum
tag_t
ype
enum
TagT
ype
#ifdef __cplusplus
#ifdef __cplusplus
/* the size of this enum is 1 byte; this is only relevant for C++
/* the size of this enum is 1 byte; this is only relevant for C++
code; the only C sources including this header don't use instances
code; the only C sources including this header don't use instances
...
@@ -59,7 +59,7 @@ enum tag_type
...
@@ -59,7 +59,7 @@ enum tag_type
};
};
/**
/**
* An array of strings, which map the #
tag_t
ype to its machine
* An array of strings, which map the #
TagT
ype to its machine
* readable name (specific to the MPD protocol).
* readable name (specific to the MPD protocol).
*/
*/
extern
const
char
*
const
tag_item_names
[];
extern
const
char
*
const
tag_item_names
[];
...
...
test/read_tags.cxx
View file @
a78b2d84
...
@@ -124,7 +124,7 @@ print_duration(unsigned seconds, gcc_unused void *ctx)
...
@@ -124,7 +124,7 @@ print_duration(unsigned seconds, gcc_unused void *ctx)
}
}
static
void
static
void
print_tag
(
enum
tag_t
ype
type
,
const
char
*
value
,
gcc_unused
void
*
ctx
)
print_tag
(
TagT
ype
type
,
const
char
*
value
,
gcc_unused
void
*
ctx
)
{
{
g_print
(
"[%s]=%s
\n
"
,
tag_item_names
[
type
],
value
);
g_print
(
"[%s]=%s
\n
"
,
tag_item_names
[
type
],
value
);
empty
=
false
;
empty
=
false
;
...
...
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