Commit d664baff authored by Max Kellermann's avatar Max Kellermann

audio_{parser,config}: convert to C++

parent 3275d4c6
......@@ -54,7 +54,6 @@ mpd_headers = \
src/ape.h \
src/audio_format.h \
src/audio_check.h \
src/audio_parser.h \
src/output_internal.h \
src/output_api.h \
src/filter_internal.h \
......@@ -132,10 +131,10 @@ src_mpd_SOURCES = \
src/thread/GLibCond.hxx \
src/clock.c src/clock.h \
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_format.c \
src/audio_parser.c \
src/AudioParser.cxx src/AudioParser.hxx \
src/protocol/ArgParser.cxx src/protocol/ArgParser.hxx \
src/protocol/Result.cxx src/protocol/Result.hxx \
src/CommandError.cxx src/CommandError.hxx \
......@@ -1244,7 +1243,7 @@ test_run_filter_SOURCES = test/run_filter.cxx \
src/tokenizer.c src/utils.c src/string_util.c \
src/audio_check.c \
src/audio_format.c \
src/audio_parser.c \
src/AudioParser.cxx \
src/ReplayGainInfo.cxx \
src/AudioCompress/compress.c
......@@ -1264,7 +1263,7 @@ test_run_encoder_SOURCES = test/run_encoder.cxx \
src/Tag.cxx src/TagNames.c src/TagPool.cxx \
src/audio_check.c \
src/audio_format.c \
src/audio_parser.c
src/AudioParser.cxx
test_run_encoder_LDADD = \
$(ENCODER_LIBS) \
$(TAG_LIBS) \
......@@ -1283,7 +1282,7 @@ test_test_vorbis_encoder_SOURCES = test/test_vorbis_encoder.c \
src/Tag.cxx src/TagNames.c src/TagPool.cxx \
src/audio_check.c \
src/audio_format.c \
src/audio_parser.c \
src/AudioParser.cxx \
src/pcm_buffer.c \
$(ENCODER_SRC)
test_test_vorbis_encoder_CPPFLAGS = $(AM_CPPFLAGS) \
......@@ -1299,15 +1298,15 @@ endif
test_software_volume_SOURCES = test/software_volume.cxx \
test/stdbin.h \
src/audio_check.c \
src/audio_parser.c
src/AudioParser.cxx
test_software_volume_LDADD = \
$(PCM_LIBS) \
$(GLIB_LIBS)
test_run_normalize_SOURCES = test/run_normalize.c \
test_run_normalize_SOURCES = test/run_normalize.cxx \
test/stdbin.h \
src/audio_check.c \
src/audio_parser.c \
src/AudioParser.cxx \
src/AudioCompress/compress.c
test_run_normalize_LDADD = \
$(GLIB_LIBS)
......@@ -1316,7 +1315,7 @@ test_run_convert_SOURCES = test/run_convert.cxx \
src/dsd2pcm/dsd2pcm.c \
src/audio_format.c \
src/audio_check.c \
src/audio_parser.c
src/AudioParser.cxx
test_run_convert_LDADD = \
$(PCM_LIBS) \
libutil.a \
......@@ -1339,7 +1338,7 @@ test_run_output_SOURCES = test/run_output.cxx \
src/IOThread.cxx \
src/audio_check.c \
src/audio_format.c \
src/audio_parser.c \
src/AudioParser.cxx \
src/timer.c src/clock.c \
src/Tag.cxx src/TagNames.c src/TagPool.cxx \
src/Page.cxx \
......
......@@ -19,6 +19,10 @@ struct CompressorConfig {
struct Compressor;
#ifdef __cplusplus
extern "C" {
#endif
//! Create a new compressor (use history value of 0 for default)
struct Compressor *Compressor_new(unsigned int history);
......@@ -34,7 +38,12 @@ struct CompressorConfig *Compressor_getConfig(struct Compressor *);
//! Process 16-bit signed data
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: functions for getting at the peak/gain/clip history buffers (for monitoring)
#endif
......@@ -18,14 +18,12 @@
*/
#include "config.h"
#include "audio_config.h"
#include "AudioConfig.hxx"
#include "audio_format.h"
#include "audio_parser.h"
#include "AudioParser.hxx"
#include "conf.h"
#include "mpd_error.h"
#include <glib.h>
static struct audio_format configured_audio_format;
void getOutputAudioFormat(const struct audio_format *inAudioFormat,
......
......@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_AUDIO_CONFIG_H
#define MPD_AUDIO_CONFIG_H
#ifndef MPD_AUDIO_CONFIG_HXX
#define MPD_AUDIO_CONFIG_HXX
struct audio_format;
......
......@@ -23,7 +23,7 @@
*/
#include "config.h"
#include "audio_parser.h"
#include "AudioParser.hxx"
#include "audio_format.h"
#include "audio_check.h"
#include "gcc.h"
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -22,19 +22,13 @@
* Parser functions for audio related objects.
*/
#ifndef AUDIO_PARSER_H
#define AUDIO_PARSER_H
#ifndef MPD_AUDIO_PARSER_HXX
#define MPD_AUDIO_PARSER_HXX
#include "gerror.h"
#include <stdbool.h>
struct audio_format;
#ifdef __cplusplus
extern "C" {
#endif
/**
* Parses a string in the form "SAMPLE_RATE:BITS:CHANNELS" into an
* #audio_format.
......@@ -50,8 +44,4 @@ bool
audio_format_parse(struct audio_format *dest, const char *src,
bool mask, GError **error_r);
#ifdef __cplusplus
}
#endif
#endif
......@@ -19,11 +19,7 @@
#include "config.h"
#include "decoder_api.h"
extern "C" {
#include "audio_config.h"
}
#include "AudioConfig.hxx"
#include "replay_gain_config.h"
#include "MusicChunk.hxx"
#include "MusicBuffer.hxx"
......
......@@ -51,11 +51,11 @@
#include "PlaylistRegistry.hxx"
#include "ZeroconfGlue.hxx"
#include "DecoderList.hxx"
#include "AudioConfig.hxx"
extern "C" {
#include "daemon.h"
#include "stats.h"
#include "audio_config.h"
#include "pcm_resample.h"
}
......
......@@ -22,10 +22,10 @@
#include "OutputList.hxx"
#include "FilterConfig.hxx"
#include "output_api.h"
#include "AudioParser.hxx"
extern "C" {
#include "output_internal.h"
#include "audio_parser.h"
#include "mixer_control.h"
#include "mixer_type.h"
#include "mixer_list.h"
......
......@@ -35,6 +35,10 @@ audio_format_quark(void)
return g_quark_from_static_string("audio_format");
}
#ifdef __cplusplus
extern "C" {
#endif
bool
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,
enum sample_format sample_format, unsigned channels,
GError **error_r);
#ifdef __cplusplus
}
#endif
#endif
......@@ -24,7 +24,7 @@
*/
#include "config.h"
#include "audio_parser.h"
#include "AudioParser.hxx"
#include "audio_format.h"
#include "pcm_convert.h"
#include "conf.h"
......
......@@ -21,7 +21,7 @@
#include "encoder_list.h"
#include "encoder_plugin.h"
#include "audio_format.h"
#include "audio_parser.h"
#include "AudioParser.hxx"
#include "conf.h"
#include "stdbin.h"
......
......@@ -20,11 +20,7 @@
#include "config.h"
#include "conf.h"
#include "fs/Path.hxx"
extern "C" {
#include "audio_parser.h"
}
#include "AudioParser.hxx"
#include "audio_format.h"
#include "filter_plugin.h"
#include "pcm_volume.h"
......
......@@ -25,7 +25,7 @@
#include "config.h"
#include "AudioCompress/compress.h"
#include "audio_parser.h"
#include "AudioParser.hxx"
#include "audio_format.h"
#include "stdbin.h"
......@@ -58,7 +58,7 @@ int main(int argc, char **argv)
return 1;
}
} else
audio_format_init(&audio_format, 48000, 16, 2);
audio_format_init(&audio_format, 48000, SAMPLE_FORMAT_S16, 2);
compressor = Compressor_new(0);
......
......@@ -26,11 +26,11 @@
#include "GlobalEvents.hxx"
#include "IOThread.hxx"
#include "fs/Path.hxx"
#include "AudioParser.hxx"
extern "C" {
#include "output_plugin.h"
#include "output_internal.h"
#include "audio_parser.h"
#include "filter_registry.h"
#include "pcm_convert.h"
}
......
......@@ -25,7 +25,7 @@
#include "config.h"
#include "pcm_volume.h"
#include "audio_parser.h"
#include "AudioParser.hxx"
#include "audio_format.h"
#include "stdbin.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment