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
cde6a3a0
Commit
cde6a3a0
authored
Jul 29, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_handler: convert to C++
parent
96b76306
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
58 additions
and
63 deletions
+58
-63
Makefile.am
Makefile.am
+5
-5
ApeTag.cxx
src/ApeTag.cxx
+1
-1
SongUpdate.cxx
src/SongUpdate.cxx
+1
-4
TagHandler.cxx
src/TagHandler.cxx
+11
-10
TagHandler.hxx
src/TagHandler.hxx
+12
-12
TagId3.cxx
src/TagId3.cxx
+1
-1
UpdateContainer.cxx
src/UpdateContainer.cxx
+1
-4
AdPlugDecoderPlugin.cxx
src/decoder/AdPlugDecoderPlugin.cxx
+1
-1
AudiofileDecoderPlugin.cxx
src/decoder/AudiofileDecoderPlugin.cxx
+1
-1
DsdLib.cxx
src/decoder/DsdLib.cxx
+1
-1
DsdiffDecoderPlugin.cxx
src/decoder/DsdiffDecoderPlugin.cxx
+2
-2
DsfDecoderPlugin.cxx
src/decoder/DsfDecoderPlugin.cxx
+1
-1
FaadDecoderPlugin.cxx
src/decoder/FaadDecoderPlugin.cxx
+1
-1
FfmpegDecoderPlugin.cxx
src/decoder/FfmpegDecoderPlugin.cxx
+1
-1
FfmpegMetaData.cxx
src/decoder/FfmpegMetaData.cxx
+1
-1
FlacMetadata.cxx
src/decoder/FlacMetadata.cxx
+1
-1
GmeDecoderPlugin.cxx
src/decoder/GmeDecoderPlugin.cxx
+1
-1
MadDecoderPlugin.cxx
src/decoder/MadDecoderPlugin.cxx
+1
-1
MikmodDecoderPlugin.cxx
src/decoder/MikmodDecoderPlugin.cxx
+1
-1
ModplugDecoderPlugin.cxx
src/decoder/ModplugDecoderPlugin.cxx
+1
-1
MpcdecDecoderPlugin.cxx
src/decoder/MpcdecDecoderPlugin.cxx
+1
-1
Mpg123DecoderPlugin.cxx
src/decoder/Mpg123DecoderPlugin.cxx
+1
-1
OpusDecoderPlugin.cxx
src/decoder/OpusDecoderPlugin.cxx
+1
-1
OpusTags.cxx
src/decoder/OpusTags.cxx
+1
-1
SndfileDecoderPlugin.cxx
src/decoder/SndfileDecoderPlugin.cxx
+1
-1
VorbisComments.cxx
src/decoder/VorbisComments.cxx
+1
-1
VorbisDecoderPlugin.cxx
src/decoder/VorbisDecoderPlugin.cxx
+1
-1
WavpackDecoderPlugin.cxx
src/decoder/WavpackDecoderPlugin.cxx
+1
-1
WildmidiDecoderPlugin.cxx
src/decoder/WildmidiDecoderPlugin.cxx
+1
-1
sidplay_decoder_plugin.cxx
src/decoder/sidplay_decoder_plugin.cxx
+1
-1
EmbeddedCuePlaylistPlugin.cxx
src/playlist/EmbeddedCuePlaylistPlugin.cxx
+1
-1
read_tags.cxx
test/read_tags.cxx
+1
-1
No files found.
Makefile.am
View file @
cde6a3a0
...
...
@@ -226,7 +226,7 @@ src_mpd_SOURCES = \
src/TagPool.cxx src/TagPool.hxx
\
src/TagPrint.cxx src/TagPrint.hxx
\
src/TagSave.cxx src/TagSave.hxx
\
src/
tag_handler.c src/tag_handler.h
\
src/
TagHandler.cxx src/TagHandler.hxx
\
src/TagFile.cxx src/TagFile.hxx
\
src/TextFile.cxx src/TextFile.hxx
\
src/TextInputStream.cxx
\
...
...
@@ -1138,7 +1138,7 @@ test_dump_playlist_SOURCES = test/dump_playlist.cxx \
$(DECODER_SRC)
\
src/IOThread.cxx
\
src/Song.cxx src/Tag.cxx src/TagNames.c src/TagPool.cxx src/TagSave.cxx
\
src/
tag_handler.c
src/TagFile.cxx
\
src/
TagHandler.cxx
src/TagFile.cxx
\
src/audio_check.c
\
src/TextInputStream.cxx
\
src/cue/CueParser.cxx src/cue/CueParser.hxx
\
...
...
@@ -1164,7 +1164,7 @@ test_run_decoder_LDADD = \
test_run_decoder_SOURCES
=
test
/run_decoder.cxx
\
test
/stdbin.h
\
src/IOThread.cxx
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx src/
tag_handler.c
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx src/
TagHandler.cxx
\
src/ReplayGainInfo.cxx
\
src/fd_util.c
\
src/audio_check.c
\
...
...
@@ -1187,7 +1187,7 @@ test_read_tags_LDADD = \
$(GLIB_LIBS)
test_read_tags_SOURCES
=
test
/read_tags.cxx
\
src/IOThread.cxx
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx src/
tag_handler.c
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx src/
TagHandler.cxx
\
src/ReplayGainInfo.cxx
\
src/fd_util.c
\
src/audio_check.c
\
...
...
@@ -1199,7 +1199,7 @@ test_dump_rva2_LDADD = \
$(GLIB_LIBS)
test_dump_rva2_SOURCES
=
test
/dump_rva2.cxx
\
src/riff.c src/aiff.c
\
src/
tag_handler.c
\
src/
TagHandler.cxx
\
src/TagId3.cxx
\
src/TagRva2.cxx
endif
...
...
src/ApeTag.cxx
View file @
cde6a3a0
...
...
@@ -22,7 +22,7 @@
#include "ApeLoader.hxx"
#include "tag.h"
#include "tag_table.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
const
struct
tag_table
ape_tags
[]
=
{
{
"album artist"
,
TAG_ALBUM_ARTIST
},
...
...
src/SongUpdate.cxx
View file @
cde6a3a0
...
...
@@ -28,13 +28,10 @@
#include "input_stream.h"
#include "DecoderPlugin.hxx"
#include "DecoderList.hxx"
#include "TagHandler.hxx"
#include "TagId3.hxx"
#include "ApeTag.hxx"
extern
"C"
{
#include "tag_handler.h"
}
#include <glib.h>
#include <assert.h>
...
...
src/
tag_handler.c
→
src/
TagHandler.cxx
View file @
cde6a3a0
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,14 +18,14 @@
*/
#include "config.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <glib.h>
static
void
add_tag_duration
(
unsigned
seconds
,
void
*
ctx
)
{
struct
tag
*
tag
=
ctx
;
struct
tag
*
tag
=
(
struct
tag
*
)
ctx
;
tag
->
time
=
seconds
;
}
...
...
@@ -33,28 +33,29 @@ add_tag_duration(unsigned seconds, void *ctx)
static
void
add_tag_tag
(
enum
tag_type
type
,
const
char
*
value
,
void
*
ctx
)
{
struct
tag
*
tag
=
ctx
;
struct
tag
*
tag
=
(
struct
tag
*
)
ctx
;
tag_add_item
(
tag
,
type
,
value
);
}
const
struct
tag_handler
add_tag_handler
=
{
.
duration
=
add_tag_duration
,
.
tag
=
add_tag_tag
,
add_tag_duration
,
add_tag_tag
,
nullptr
,
};
static
void
full_tag_pair
(
const
char
*
name
,
G_GNUC_UNUSED
const
char
*
value
,
void
*
ctx
)
{
struct
tag
*
tag
=
ctx
;
struct
tag
*
tag
=
(
struct
tag
*
)
ctx
;
if
(
g_ascii_strcasecmp
(
name
,
"cuesheet"
)
==
0
)
tag
->
has_playlist
=
true
;
}
const
struct
tag_handler
full_tag_handler
=
{
.
duration
=
add_tag_duration
,
.
tag
=
add_tag_tag
,
.
pair
=
full_tag_pair
,
add_tag_duration
,
add_tag_tag
,
full_tag_pair
,
};
src/
tag_handler.h
→
src/
TagHandler.hxx
View file @
cde6a3a0
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_TAG_HANDLER_H
#define MPD_TAG_HANDLER_H
#ifndef MPD_TAG_HANDLER_H
XX
#define MPD_TAG_HANDLER_H
XX
#include "check.h"
#include "tag.h"
...
...
@@ -55,9 +55,9 @@ static inline void
tag_handler_invoke_duration
(
const
struct
tag_handler
*
handler
,
void
*
ctx
,
unsigned
seconds
)
{
assert
(
handler
!=
NULL
);
assert
(
handler
!=
nullptr
);
if
(
handler
->
duration
!=
NULL
)
if
(
handler
->
duration
!=
nullptr
)
handler
->
duration
(
seconds
,
ctx
);
}
...
...
@@ -65,11 +65,11 @@ static inline void
tag_handler_invoke_tag
(
const
struct
tag_handler
*
handler
,
void
*
ctx
,
enum
tag_type
type
,
const
char
*
value
)
{
assert
(
handler
!=
NULL
);
assert
(
handler
!=
nullptr
);
assert
((
unsigned
)
type
<
TAG_NUM_OF_ITEM_TYPES
);
assert
(
value
!=
NULL
);
assert
(
value
!=
nullptr
);
if
(
handler
->
tag
!=
NULL
)
if
(
handler
->
tag
!=
nullptr
)
handler
->
tag
(
type
,
value
,
ctx
);
}
...
...
@@ -77,11 +77,11 @@ static inline void
tag_handler_invoke_pair
(
const
struct
tag_handler
*
handler
,
void
*
ctx
,
const
char
*
name
,
const
char
*
value
)
{
assert
(
handler
!=
NULL
);
assert
(
name
!=
NULL
);
assert
(
value
!=
NULL
);
assert
(
handler
!=
nullptr
);
assert
(
name
!=
nullptr
);
assert
(
value
!=
nullptr
);
if
(
handler
->
pair
!=
NULL
)
if
(
handler
->
pair
!=
nullptr
)
handler
->
pair
(
name
,
value
,
ctx
);
}
...
...
src/TagId3.cxx
View file @
cde6a3a0
...
...
@@ -19,7 +19,7 @@
#include "config.h"
#include "TagId3.hxx"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "tag_table.h"
#include "tag.h"
...
...
src/UpdateContainer.cxx
View file @
cde6a3a0
...
...
@@ -27,10 +27,7 @@
#include "DecoderPlugin.hxx"
#include "Mapper.hxx"
#include "fs/Path.hxx"
extern
"C"
{
#include "tag_handler.h"
}
#include "TagHandler.hxx"
#include <glib.h>
...
...
src/decoder/AdPlugDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -19,7 +19,7 @@
#include "config.h"
#include "AdPlugDecoderPlugin.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "DecoderAPI.hxx"
extern
"C"
{
...
...
src/decoder/AudiofileDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -21,7 +21,7 @@
#include "AudiofileDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "audio_check.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <audiofile.h>
#include <af_vfs.h>
...
...
src/decoder/DsdLib.cxx
View file @
cde6a3a0
...
...
@@ -27,7 +27,7 @@
#include "DsdLib.hxx"
#include "DecoderAPI.hxx"
#include "util/bit_reverse.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "TagId3.hxx"
#include <unistd.h>
...
...
src/decoder/DsdiffDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -31,9 +31,9 @@
#include "DecoderAPI.hxx"
#include "audio_check.h"
#include "util/bit_reverse.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "DsdLib.hxx"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <unistd.h>
#include <stdio.h>
/* for SEEK_SET, SEEK_CUR */
...
...
src/decoder/DsfDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -33,7 +33,7 @@
#include "audio_check.h"
#include "util/bit_reverse.h"
#include "DsdLib.hxx"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <unistd.h>
#include <stdio.h>
/* for SEEK_SET, SEEK_CUR */
...
...
src/decoder/FaadDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -22,7 +22,7 @@
#include "DecoderAPI.hxx"
#include "DecoderBuffer.hxx"
#include "audio_check.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <neaacdec.h>
...
...
src/decoder/FfmpegDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -24,7 +24,7 @@
#include "FfmpegDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "FfmpegMetaData.hxx"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "InputStream.hxx"
extern
"C"
{
...
...
src/decoder/FfmpegMetaData.cxx
View file @
cde6a3a0
...
...
@@ -23,7 +23,7 @@
#include "config.h"
#include "FfmpegMetaData.hxx"
#include "tag_table.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "ffmpeg"
...
...
src/decoder/FlacMetadata.cxx
View file @
cde6a3a0
...
...
@@ -25,7 +25,7 @@ extern "C" {
}
#include "tag.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "tag_table.h"
#include "replay_gain_info.h"
...
...
src/decoder/GmeDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -21,7 +21,7 @@
#include "GmeDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "audio_check.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "util/UriUtil.hxx"
#include <glib.h>
...
...
src/decoder/MadDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -23,7 +23,7 @@
#include "conf.h"
#include "TagId3.hxx"
#include "TagRva2.hxx"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "audio_check.h"
#include <assert.h>
...
...
src/decoder/MikmodDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -21,7 +21,7 @@
#include "MikmodDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "mpd_error.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <glib.h>
#include <mikmod.h>
...
...
src/decoder/ModplugDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -20,7 +20,7 @@
#include "config.h"
#include "ModplugDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <glib.h>
#include <modplug.h>
...
...
src/decoder/MpcdecDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -21,7 +21,7 @@
#include "MpcdecDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "audio_check.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#ifdef MPC_IS_OLD_API
#include <mpcdec/mpcdec.h>
...
...
src/decoder/Mpg123DecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -21,7 +21,7 @@
#include "Mpg123DecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "audio_check.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <glib.h>
...
...
src/decoder/OpusDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -27,7 +27,7 @@
#include "DecoderAPI.hxx"
#include "OggCodec.hxx"
#include "audio_check.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "InputStream.hxx"
#include <opus.h>
...
...
src/decoder/OpusTags.cxx
View file @
cde6a3a0
...
...
@@ -21,7 +21,7 @@
#include "OpusTags.hxx"
#include "OpusReader.hxx"
#include "XiphTags.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <stdint.h>
#include <string.h>
...
...
src/decoder/SndfileDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -21,7 +21,7 @@
#include "SndfileDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "audio_check.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include <sndfile.h>
...
...
src/decoder/VorbisComments.cxx
View file @
cde6a3a0
...
...
@@ -22,7 +22,7 @@
#include "XiphTags.h"
#include "tag.h"
#include "tag_table.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "replay_gain_info.h"
#include <glib.h>
...
...
src/decoder/VorbisDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -29,7 +29,7 @@ extern "C" {
#include "audio_check.h"
}
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#ifndef HAVE_TREMOR
#define OV_EXCLUDE_STATIC_CALLBACKS
...
...
src/decoder/WavpackDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -26,7 +26,7 @@ extern "C" {
#include "audio_check.h"
}
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "ApeTag.hxx"
#include <wavpack/wavpack.h>
...
...
src/decoder/WildmidiDecoderPlugin.cxx
View file @
cde6a3a0
...
...
@@ -20,7 +20,7 @@
#include "config.h"
#include "WildmidiDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "glib_compat.h"
#include <glib.h>
...
...
src/decoder/sidplay_decoder_plugin.cxx
View file @
cde6a3a0
...
...
@@ -21,7 +21,7 @@
#include "../DecoderAPI.hxx"
extern
"C"
{
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
}
#include <errno.h>
...
...
src/playlist/EmbeddedCuePlaylistPlugin.cxx
View file @
cde6a3a0
...
...
@@ -27,7 +27,7 @@
#include "EmbeddedCuePlaylistPlugin.hxx"
#include "PlaylistPlugin.hxx"
#include "tag.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "TagId3.hxx"
#include "ApeTag.hxx"
#include "Song.hxx"
...
...
test/read_tags.cxx
View file @
cde6a3a0
...
...
@@ -24,7 +24,7 @@
#include "InputInit.hxx"
#include "InputStream.hxx"
#include "audio_format.h"
#include "
tag_handler.h
"
#include "
TagHandler.hxx
"
#include "TagId3.hxx"
#include "ApeTag.hxx"
...
...
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