EncoderList.cxx 1.89 KB
Newer Older
Max Kellermann's avatar
Max Kellermann committed
1
/*
Max Kellermann's avatar
Max Kellermann committed
2
 * Copyright 2003-2020 The Music Player Daemon Project
Max Kellermann's avatar
Max Kellermann committed
3 4 5 6 7 8 9 10 11 12 13
 * http://www.musicpd.org
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
14 15 16 17
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Max Kellermann's avatar
Max Kellermann committed
18 19
 */

20
#include "config.h"
21
#include "EncoderList.hxx"
22
#include "EncoderPlugin.hxx"
23
#include "encoder/Features.h"
24 25 26 27 28 29 30 31
#include "plugins/NullEncoderPlugin.hxx"
#include "plugins/WaveEncoderPlugin.hxx"
#include "plugins/VorbisEncoderPlugin.hxx"
#include "plugins/OpusEncoderPlugin.hxx"
#include "plugins/FlacEncoderPlugin.hxx"
#include "plugins/ShineEncoderPlugin.hxx"
#include "plugins/LameEncoderPlugin.hxx"
#include "plugins/TwolameEncoderPlugin.hxx"
32
#include "decoder/Features.h"
Max Kellermann's avatar
Max Kellermann committed
33 34 35

#include <string.h>

36
const EncoderPlugin *const encoder_plugins[] = {
37
	&null_encoder_plugin,
38
#ifdef ENABLE_VORBISENC
39
	&vorbis_encoder_plugin,
40
#endif
41
#ifdef ENABLE_OPUS
42 43
	&opus_encoder_plugin,
#endif
44
#ifdef ENABLE_LAME
45
	&lame_encoder_plugin,
46
#endif
47
#ifdef ENABLE_TWOLAME
48
	&twolame_encoder_plugin,
49 50 51
#endif
#ifdef ENABLE_WAVE_ENCODER
	&wave_encoder_plugin,
52 53 54
#endif
#ifdef ENABLE_FLAC_ENCODER
	&flac_encoder_plugin,
Andrée Ekroth's avatar
Andrée Ekroth committed
55
#endif
56
#ifdef ENABLE_SHINE
Andrée Ekroth's avatar
Andrée Ekroth committed
57
	&shine_encoder_plugin,
58
#endif
59
	nullptr
Max Kellermann's avatar
Max Kellermann committed
60 61
};

62
const EncoderPlugin *
Max Kellermann's avatar
Max Kellermann committed
63 64
encoder_plugin_get(const char *name)
{
65 66 67
	encoder_plugins_for_each(plugin)
		if (strcmp(plugin->name, name) == 0)
			return plugin;
Max Kellermann's avatar
Max Kellermann committed
68

69
	return nullptr;
Max Kellermann's avatar
Max Kellermann committed
70
}