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
d664baff
Commit
d664baff
authored
Jan 30, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audio_{parser,config}: convert to C++
parent
3275d4c6
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
45 additions
and
49 deletions
+45
-49
Makefile.am
Makefile.am
+10
-11
compress.h
src/AudioCompress/compress.h
+9
-0
AudioConfig.cxx
src/AudioConfig.cxx
+2
-4
AudioConfig.hxx
src/AudioConfig.hxx
+2
-2
AudioParser.cxx
src/AudioParser.cxx
+1
-1
AudioParser.hxx
src/AudioParser.hxx
+3
-13
DecoderAPI.cxx
src/DecoderAPI.cxx
+1
-5
Main.cxx
src/Main.cxx
+1
-1
OutputInit.cxx
src/OutputInit.cxx
+1
-1
audio_check.h
src/audio_check.h
+8
-0
run_convert.cxx
test/run_convert.cxx
+1
-1
run_encoder.cxx
test/run_encoder.cxx
+1
-1
run_filter.cxx
test/run_filter.cxx
+1
-5
run_normalize.cxx
test/run_normalize.cxx
+2
-2
run_output.cxx
test/run_output.cxx
+1
-1
software_volume.cxx
test/software_volume.cxx
+1
-1
No files found.
Makefile.am
View file @
d664baff
...
@@ -54,7 +54,6 @@ mpd_headers = \
...
@@ -54,7 +54,6 @@ mpd_headers = \
src/ape.h
\
src/ape.h
\
src/audio_format.h
\
src/audio_format.h
\
src/audio_check.h
\
src/audio_check.h
\
src/audio_parser.h
\
src/output_internal.h
\
src/output_internal.h
\
src/output_api.h
\
src/output_api.h
\
src/filter_internal.h
\
src/filter_internal.h
\
...
@@ -132,10 +131,10 @@ src_mpd_SOURCES = \
...
@@ -132,10 +131,10 @@ src_mpd_SOURCES = \
src/thread/GLibCond.hxx
\
src/thread/GLibCond.hxx
\
src/clock.c src/clock.h
\
src/clock.c src/clock.h
\
src/notify.cxx src/notify.hxx
\
src/notify.cxx src/notify.hxx
\
src/
audio_config.c src/audio_config.h
\
src/
AudioConfig.cxx src/AudioConfig.hxx
\
src/audio_check.c
\
src/audio_check.c
\
src/audio_format.c
\
src/audio_format.c
\
src/
audio_parser.c
\
src/
AudioParser.cxx src/AudioParser.hxx
\
src/protocol/ArgParser.cxx src/protocol/ArgParser.hxx
\
src/protocol/ArgParser.cxx src/protocol/ArgParser.hxx
\
src/protocol/Result.cxx src/protocol/Result.hxx
\
src/protocol/Result.cxx src/protocol/Result.hxx
\
src/CommandError.cxx src/CommandError.hxx
\
src/CommandError.cxx src/CommandError.hxx
\
...
@@ -1244,7 +1243,7 @@ test_run_filter_SOURCES = test/run_filter.cxx \
...
@@ -1244,7 +1243,7 @@ test_run_filter_SOURCES = test/run_filter.cxx \
src/tokenizer.c src/utils.c src/string_util.c
\
src/tokenizer.c src/utils.c src/string_util.c
\
src/audio_check.c
\
src/audio_check.c
\
src/audio_format.c
\
src/audio_format.c
\
src/
audio_parser.c
\
src/
AudioParser.cxx
\
src/ReplayGainInfo.cxx
\
src/ReplayGainInfo.cxx
\
src/AudioCompress/compress.c
src/AudioCompress/compress.c
...
@@ -1264,7 +1263,7 @@ test_run_encoder_SOURCES = test/run_encoder.cxx \
...
@@ -1264,7 +1263,7 @@ test_run_encoder_SOURCES = test/run_encoder.cxx \
src/Tag.cxx src/TagNames.c src/TagPool.cxx
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx
\
src/audio_check.c
\
src/audio_check.c
\
src/audio_format.c
\
src/audio_format.c
\
src/
audio_parser.c
src/
AudioParser.cxx
test_run_encoder_LDADD
=
\
test_run_encoder_LDADD
=
\
$(ENCODER_LIBS)
\
$(ENCODER_LIBS)
\
$(TAG_LIBS)
\
$(TAG_LIBS)
\
...
@@ -1283,7 +1282,7 @@ test_test_vorbis_encoder_SOURCES = test/test_vorbis_encoder.c \
...
@@ -1283,7 +1282,7 @@ test_test_vorbis_encoder_SOURCES = test/test_vorbis_encoder.c \
src/Tag.cxx src/TagNames.c src/TagPool.cxx
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx
\
src/audio_check.c
\
src/audio_check.c
\
src/audio_format.c
\
src/audio_format.c
\
src/
audio_parser.c
\
src/
AudioParser.cxx
\
src/pcm_buffer.c
\
src/pcm_buffer.c
\
$(ENCODER_SRC)
$(ENCODER_SRC)
test_test_vorbis_encoder_CPPFLAGS
=
$(AM_CPPFLAGS)
\
test_test_vorbis_encoder_CPPFLAGS
=
$(AM_CPPFLAGS)
\
...
@@ -1299,15 +1298,15 @@ endif
...
@@ -1299,15 +1298,15 @@ endif
test_software_volume_SOURCES
=
test
/software_volume.cxx
\
test_software_volume_SOURCES
=
test
/software_volume.cxx
\
test
/stdbin.h
\
test
/stdbin.h
\
src/audio_check.c
\
src/audio_check.c
\
src/
audio_parser.c
src/
AudioParser.cxx
test_software_volume_LDADD
=
\
test_software_volume_LDADD
=
\
$(PCM_LIBS)
\
$(PCM_LIBS)
\
$(GLIB_LIBS)
$(GLIB_LIBS)
test_run_normalize_SOURCES
=
test
/run_normalize.c
\
test_run_normalize_SOURCES
=
test
/run_normalize.c
xx
\
test
/stdbin.h
\
test
/stdbin.h
\
src/audio_check.c
\
src/audio_check.c
\
src/
audio_parser.c
\
src/
AudioParser.cxx
\
src/AudioCompress/compress.c
src/AudioCompress/compress.c
test_run_normalize_LDADD
=
\
test_run_normalize_LDADD
=
\
$(GLIB_LIBS)
$(GLIB_LIBS)
...
@@ -1316,7 +1315,7 @@ test_run_convert_SOURCES = test/run_convert.cxx \
...
@@ -1316,7 +1315,7 @@ test_run_convert_SOURCES = test/run_convert.cxx \
src/dsd2pcm/dsd2pcm.c
\
src/dsd2pcm/dsd2pcm.c
\
src/audio_format.c
\
src/audio_format.c
\
src/audio_check.c
\
src/audio_check.c
\
src/
audio_parser.c
src/
AudioParser.cxx
test_run_convert_LDADD
=
\
test_run_convert_LDADD
=
\
$(PCM_LIBS)
\
$(PCM_LIBS)
\
libutil.a
\
libutil.a
\
...
@@ -1339,7 +1338,7 @@ test_run_output_SOURCES = test/run_output.cxx \
...
@@ -1339,7 +1338,7 @@ test_run_output_SOURCES = test/run_output.cxx \
src/IOThread.cxx
\
src/IOThread.cxx
\
src/audio_check.c
\
src/audio_check.c
\
src/audio_format.c
\
src/audio_format.c
\
src/
audio_parser.c
\
src/
AudioParser.cxx
\
src/timer.c src/clock.c
\
src/timer.c src/clock.c
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx
\
src/Page.cxx
\
src/Page.cxx
\
...
...
src/AudioCompress/compress.h
View file @
d664baff
...
@@ -19,6 +19,10 @@ struct CompressorConfig {
...
@@ -19,6 +19,10 @@ struct CompressorConfig {
struct
Compressor
;
struct
Compressor
;
#ifdef __cplusplus
extern
"C"
{
#endif
//! Create a new compressor (use history value of 0 for default)
//! Create a new compressor (use history value of 0 for default)
struct
Compressor
*
Compressor_new
(
unsigned
int
history
);
struct
Compressor
*
Compressor_new
(
unsigned
int
history
);
...
@@ -34,7 +38,12 @@ struct CompressorConfig *Compressor_getConfig(struct Compressor *);
...
@@ -34,7 +38,12 @@ struct CompressorConfig *Compressor_getConfig(struct Compressor *);
//! Process 16-bit signed data
//! Process 16-bit signed data
void
Compressor_Process_int16
(
struct
Compressor
*
,
int16_t
*
data
,
unsigned
int
count
);
void
Compressor_Process_int16
(
struct
Compressor
*
,
int16_t
*
data
,
unsigned
int
count
);
#ifdef __cplusplus
}
#endif
//! TODO: Compressor_Process_int32, Compressor_Process_float, others as needed
//! TODO: Compressor_Process_int32, Compressor_Process_float, others as needed
//! TODO: functions for getting at the peak/gain/clip history buffers (for monitoring)
//! TODO: functions for getting at the peak/gain/clip history buffers (for monitoring)
#endif
#endif
src/
audio_config.c
→
src/
AudioConfig.cxx
View file @
d664baff
...
@@ -18,14 +18,12 @@
...
@@ -18,14 +18,12 @@
*/
*/
#include "config.h"
#include "config.h"
#include "
audio_config.h
"
#include "
AudioConfig.hxx
"
#include "audio_format.h"
#include "audio_format.h"
#include "
audio_parser.h
"
#include "
AudioParser.hxx
"
#include "conf.h"
#include "conf.h"
#include "mpd_error.h"
#include "mpd_error.h"
#include <glib.h>
static
struct
audio_format
configured_audio_format
;
static
struct
audio_format
configured_audio_format
;
void
getOutputAudioFormat
(
const
struct
audio_format
*
inAudioFormat
,
void
getOutputAudioFormat
(
const
struct
audio_format
*
inAudioFormat
,
...
...
src/
audio_config.h
→
src/
AudioConfig.hxx
View file @
d664baff
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
*/
#ifndef MPD_AUDIO_CONFIG_H
#ifndef MPD_AUDIO_CONFIG_H
XX
#define MPD_AUDIO_CONFIG_H
#define MPD_AUDIO_CONFIG_H
XX
struct
audio_format
;
struct
audio_format
;
...
...
src/
audio_parser.c
→
src/
AudioParser.cxx
View file @
d664baff
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
*/
*/
#include "config.h"
#include "config.h"
#include "
audio_parser.h
"
#include "
AudioParser.hxx
"
#include "audio_format.h"
#include "audio_format.h"
#include "audio_check.h"
#include "audio_check.h"
#include "gcc.h"
#include "gcc.h"
...
...
src/
audio_parser.h
→
src/
AudioParser.hxx
View file @
d664baff
/*
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
* http://www.musicpd.org
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
...
@@ -22,19 +22,13 @@
...
@@ -22,19 +22,13 @@
* Parser functions for audio related objects.
* Parser functions for audio related objects.
*/
*/
#ifndef
AUDIO_PARSER_H
#ifndef
MPD_AUDIO_PARSER_HXX
#define
AUDIO_PARSER_H
#define
MPD_AUDIO_PARSER_HXX
#include "gerror.h"
#include "gerror.h"
#include <stdbool.h>
struct
audio_format
;
struct
audio_format
;
#ifdef __cplusplus
extern
"C"
{
#endif
/**
/**
* Parses a string in the form "SAMPLE_RATE:BITS:CHANNELS" into an
* Parses a string in the form "SAMPLE_RATE:BITS:CHANNELS" into an
* #audio_format.
* #audio_format.
...
@@ -50,8 +44,4 @@ bool
...
@@ -50,8 +44,4 @@ bool
audio_format_parse
(
struct
audio_format
*
dest
,
const
char
*
src
,
audio_format_parse
(
struct
audio_format
*
dest
,
const
char
*
src
,
bool
mask
,
GError
**
error_r
);
bool
mask
,
GError
**
error_r
);
#ifdef __cplusplus
}
#endif
#endif
#endif
src/DecoderAPI.cxx
View file @
d664baff
...
@@ -19,11 +19,7 @@
...
@@ -19,11 +19,7 @@
#include "config.h"
#include "config.h"
#include "decoder_api.h"
#include "decoder_api.h"
#include "AudioConfig.hxx"
extern
"C"
{
#include "audio_config.h"
}
#include "replay_gain_config.h"
#include "replay_gain_config.h"
#include "MusicChunk.hxx"
#include "MusicChunk.hxx"
#include "MusicBuffer.hxx"
#include "MusicBuffer.hxx"
...
...
src/Main.cxx
View file @
d664baff
...
@@ -51,11 +51,11 @@
...
@@ -51,11 +51,11 @@
#include "PlaylistRegistry.hxx"
#include "PlaylistRegistry.hxx"
#include "ZeroconfGlue.hxx"
#include "ZeroconfGlue.hxx"
#include "DecoderList.hxx"
#include "DecoderList.hxx"
#include "AudioConfig.hxx"
extern
"C"
{
extern
"C"
{
#include "daemon.h"
#include "daemon.h"
#include "stats.h"
#include "stats.h"
#include "audio_config.h"
#include "pcm_resample.h"
#include "pcm_resample.h"
}
}
...
...
src/OutputInit.cxx
View file @
d664baff
...
@@ -22,10 +22,10 @@
...
@@ -22,10 +22,10 @@
#include "OutputList.hxx"
#include "OutputList.hxx"
#include "FilterConfig.hxx"
#include "FilterConfig.hxx"
#include "output_api.h"
#include "output_api.h"
#include "AudioParser.hxx"
extern
"C"
{
extern
"C"
{
#include "output_internal.h"
#include "output_internal.h"
#include "audio_parser.h"
#include "mixer_control.h"
#include "mixer_control.h"
#include "mixer_type.h"
#include "mixer_type.h"
#include "mixer_list.h"
#include "mixer_list.h"
...
...
src/audio_check.h
View file @
d664baff
...
@@ -35,6 +35,10 @@ audio_format_quark(void)
...
@@ -35,6 +35,10 @@ audio_format_quark(void)
return
g_quark_from_static_string
(
"audio_format"
);
return
g_quark_from_static_string
(
"audio_format"
);
}
}
#ifdef __cplusplus
extern
"C"
{
#endif
bool
bool
audio_check_sample_rate
(
unsigned
long
sample_rate
,
GError
**
error_r
);
audio_check_sample_rate
(
unsigned
long
sample_rate
,
GError
**
error_r
);
...
@@ -52,4 +56,8 @@ audio_format_init_checked(struct audio_format *af, unsigned long sample_rate,
...
@@ -52,4 +56,8 @@ audio_format_init_checked(struct audio_format *af, unsigned long sample_rate,
enum
sample_format
sample_format
,
unsigned
channels
,
enum
sample_format
sample_format
,
unsigned
channels
,
GError
**
error_r
);
GError
**
error_r
);
#ifdef __cplusplus
}
#endif
#endif
#endif
test/run_convert.cxx
View file @
d664baff
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
*/
*/
#include "config.h"
#include "config.h"
#include "
audio_parser.h
"
#include "
AudioParser.hxx
"
#include "audio_format.h"
#include "audio_format.h"
#include "pcm_convert.h"
#include "pcm_convert.h"
#include "conf.h"
#include "conf.h"
...
...
test/run_encoder.cxx
View file @
d664baff
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include "encoder_list.h"
#include "encoder_list.h"
#include "encoder_plugin.h"
#include "encoder_plugin.h"
#include "audio_format.h"
#include "audio_format.h"
#include "
audio_parser.h
"
#include "
AudioParser.hxx
"
#include "conf.h"
#include "conf.h"
#include "stdbin.h"
#include "stdbin.h"
...
...
test/run_filter.cxx
View file @
d664baff
...
@@ -20,11 +20,7 @@
...
@@ -20,11 +20,7 @@
#include "config.h"
#include "config.h"
#include "conf.h"
#include "conf.h"
#include "fs/Path.hxx"
#include "fs/Path.hxx"
#include "AudioParser.hxx"
extern
"C"
{
#include "audio_parser.h"
}
#include "audio_format.h"
#include "audio_format.h"
#include "filter_plugin.h"
#include "filter_plugin.h"
#include "pcm_volume.h"
#include "pcm_volume.h"
...
...
test/run_normalize.c
→
test/run_normalize.c
xx
View file @
d664baff
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include "config.h"
#include "config.h"
#include "AudioCompress/compress.h"
#include "AudioCompress/compress.h"
#include "
audio_parser.h
"
#include "
AudioParser.hxx
"
#include "audio_format.h"
#include "audio_format.h"
#include "stdbin.h"
#include "stdbin.h"
...
@@ -58,7 +58,7 @@ int main(int argc, char **argv)
...
@@ -58,7 +58,7 @@ int main(int argc, char **argv)
return
1
;
return
1
;
}
}
}
else
}
else
audio_format_init
(
&
audio_format
,
48000
,
16
,
2
);
audio_format_init
(
&
audio_format
,
48000
,
SAMPLE_FORMAT_S
16
,
2
);
compressor
=
Compressor_new
(
0
);
compressor
=
Compressor_new
(
0
);
...
...
test/run_output.cxx
View file @
d664baff
...
@@ -26,11 +26,11 @@
...
@@ -26,11 +26,11 @@
#include "GlobalEvents.hxx"
#include "GlobalEvents.hxx"
#include "IOThread.hxx"
#include "IOThread.hxx"
#include "fs/Path.hxx"
#include "fs/Path.hxx"
#include "AudioParser.hxx"
extern
"C"
{
extern
"C"
{
#include "output_plugin.h"
#include "output_plugin.h"
#include "output_internal.h"
#include "output_internal.h"
#include "audio_parser.h"
#include "filter_registry.h"
#include "filter_registry.h"
#include "pcm_convert.h"
#include "pcm_convert.h"
}
}
...
...
test/software_volume.cxx
View file @
d664baff
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include "config.h"
#include "config.h"
#include "pcm_volume.h"
#include "pcm_volume.h"
#include "
audio_parser.h
"
#include "
AudioParser.hxx
"
#include "audio_format.h"
#include "audio_format.h"
#include "stdbin.h"
#include "stdbin.h"
...
...
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