test/{read_conf,run_filter}: convert to C++
This commit is contained in:
parent
84eb95466b
commit
eb8922f346
@ -1045,7 +1045,7 @@ endif
|
|||||||
|
|
||||||
test_read_conf_LDADD = \
|
test_read_conf_LDADD = \
|
||||||
$(GLIB_LIBS)
|
$(GLIB_LIBS)
|
||||||
test_read_conf_SOURCES = test/read_conf.c \
|
test_read_conf_SOURCES = test/read_conf.cxx \
|
||||||
src/ConfigFile.cxx src/tokenizer.c src/utils.c src/string_util.c
|
src/ConfigFile.cxx src/tokenizer.c src/utils.c src/string_util.c
|
||||||
|
|
||||||
test_run_resolver_LDADD = \
|
test_run_resolver_LDADD = \
|
||||||
@ -1183,7 +1183,7 @@ endif
|
|||||||
test_run_filter_LDADD = \
|
test_run_filter_LDADD = \
|
||||||
$(FILTER_LIBS) \
|
$(FILTER_LIBS) \
|
||||||
$(GLIB_LIBS)
|
$(GLIB_LIBS)
|
||||||
test_run_filter_SOURCES = test/run_filter.c \
|
test_run_filter_SOURCES = test/run_filter.cxx \
|
||||||
test/FakeReplayGainConfig.cxx \
|
test/FakeReplayGainConfig.cxx \
|
||||||
test/stdbin.h \
|
test/stdbin.h \
|
||||||
src/filter_plugin.c \
|
src/filter_plugin.c \
|
||||||
|
@ -25,11 +25,11 @@
|
|||||||
#include "audio_format.h"
|
#include "audio_format.h"
|
||||||
#include "replay_gain_info.h"
|
#include "replay_gain_info.h"
|
||||||
#include "replay_gain_config.h"
|
#include "replay_gain_config.h"
|
||||||
|
#include "mixer_control.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "pcm_buffer.h"
|
#include "pcm_buffer.h"
|
||||||
#include "pcm_volume.h"
|
#include "pcm_volume.h"
|
||||||
#include "mixer_control.h"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -74,6 +74,10 @@ struct filter_plugin {
|
|||||||
GError **error_r);
|
GError **error_r);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of the specified filter plugin.
|
* Creates a new instance of the specified filter plugin.
|
||||||
*
|
*
|
||||||
@ -147,4 +151,8 @@ filter_filter(struct filter *filter, const void *src, size_t src_size,
|
|||||||
size_t *dest_size_r,
|
size_t *dest_size_r,
|
||||||
GError **error_r);
|
GError **error_r);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,6 +33,10 @@ struct mixer;
|
|||||||
struct mixer_plugin;
|
struct mixer_plugin;
|
||||||
struct config_param;
|
struct config_param;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
struct mixer *
|
struct mixer *
|
||||||
mixer_new(const struct mixer_plugin *plugin, void *ao,
|
mixer_new(const struct mixer_plugin *plugin, void *ao,
|
||||||
const struct config_param *param,
|
const struct config_param *param,
|
||||||
@ -60,4 +64,8 @@ mixer_get_volume(struct mixer *mixer, GError **error_r);
|
|||||||
bool
|
bool
|
||||||
mixer_set_volume(struct mixer *mixer, unsigned volume, GError **error_r);
|
mixer_set_volume(struct mixer *mixer, unsigned volume, GError **error_r);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
* Copyright (C) 2003-2013 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
|
@ -19,7 +19,11 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
#include "audio_parser.h"
|
#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"
|
||||||
@ -75,7 +79,7 @@ load_filter(const char *name)
|
|||||||
param = find_named_config_block("filter", name);
|
param = find_named_config_block("filter", name);
|
||||||
if (param == NULL) {
|
if (param == NULL) {
|
||||||
g_printerr("No such configured filter: %s\n", name);
|
g_printerr("No such configured filter: %s\n", name);
|
||||||
return false;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
filter = filter_configured_new(param, &error);
|
filter = filter_configured_new(param, &error);
|
Loading…
Reference in New Issue
Block a user