EncoderList.cxx 1.83 KB
Newer Older
Max Kellermann's avatar
Max Kellermann committed
1
/*
Max Kellermann's avatar
Max Kellermann committed
2
 * Copyright 2003-2017 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 24 25 26 27 28 29 30
#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"
Max Kellermann's avatar
Max Kellermann committed
31 32 33

#include <string.h>

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

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

67
	return nullptr;
Max Kellermann's avatar
Max Kellermann committed
68
}