filter/Convert: add convert_filter_prepare()
This commit is contained in:
parent
9250819b75
commit
a3d71f4b91
@ -132,6 +132,12 @@ const FilterPlugin convert_filter_plugin = {
|
|||||||
convert_filter_init,
|
convert_filter_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PreparedFilter *
|
||||||
|
convert_filter_prepare() noexcept
|
||||||
|
{
|
||||||
|
return new PreparedConvertFilter();
|
||||||
|
}
|
||||||
|
|
||||||
Filter *
|
Filter *
|
||||||
convert_filter_new(const AudioFormat in_audio_format,
|
convert_filter_new(const AudioFormat in_audio_format,
|
||||||
const AudioFormat out_audio_format)
|
const AudioFormat out_audio_format)
|
||||||
|
@ -20,9 +20,13 @@
|
|||||||
#ifndef MPD_CONVERT_FILTER_PLUGIN_HXX
|
#ifndef MPD_CONVERT_FILTER_PLUGIN_HXX
|
||||||
#define MPD_CONVERT_FILTER_PLUGIN_HXX
|
#define MPD_CONVERT_FILTER_PLUGIN_HXX
|
||||||
|
|
||||||
|
class PreparedFilter;
|
||||||
class Filter;
|
class Filter;
|
||||||
struct AudioFormat;
|
struct AudioFormat;
|
||||||
|
|
||||||
|
PreparedFilter *
|
||||||
|
convert_filter_prepare() noexcept;
|
||||||
|
|
||||||
Filter *
|
Filter *
|
||||||
convert_filter_new(AudioFormat in_audio_format,
|
convert_filter_new(AudioFormat in_audio_format,
|
||||||
AudioFormat out_audio_format);
|
AudioFormat out_audio_format);
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "filter/FilterPlugin.hxx"
|
#include "filter/FilterPlugin.hxx"
|
||||||
#include "filter/FilterRegistry.hxx"
|
#include "filter/FilterRegistry.hxx"
|
||||||
#include "filter/plugins/AutoConvertFilterPlugin.hxx"
|
#include "filter/plugins/AutoConvertFilterPlugin.hxx"
|
||||||
|
#include "filter/plugins/ConvertFilterPlugin.hxx"
|
||||||
#include "filter/plugins/ReplayGainFilterPlugin.hxx"
|
#include "filter/plugins/ReplayGainFilterPlugin.hxx"
|
||||||
#include "filter/plugins/ChainFilterPlugin.hxx"
|
#include "filter/plugins/ChainFilterPlugin.hxx"
|
||||||
#include "filter/plugins/VolumeFilterPlugin.hxx"
|
#include "filter/plugins/VolumeFilterPlugin.hxx"
|
||||||
@ -249,11 +250,8 @@ AudioOutput::Setup(EventLoop &event_loop,
|
|||||||
|
|
||||||
/* the "convert" filter must be the last one in the chain */
|
/* the "convert" filter must be the last one in the chain */
|
||||||
|
|
||||||
auto *f = filter_new(&convert_filter_plugin, ConfigBlock());
|
|
||||||
assert(f != nullptr);
|
|
||||||
|
|
||||||
filter_chain_append(*prepared_filter, "convert",
|
filter_chain_append(*prepared_filter, "convert",
|
||||||
convert_filter.Set(f));
|
convert_filter.Set(convert_filter_prepare()));
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioOutput *
|
AudioOutput *
|
||||||
|
Loading…
Reference in New Issue
Block a user