2009-03-02 20:13:08 +01:00
|
|
|
/*
|
2017-01-03 20:48:59 +01:00
|
|
|
* Copyright 2003-2017 The Music Player Daemon Project
|
2009-03-02 20:13:08 +01:00
|
|
|
* 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.
|
2009-03-13 18:43:16 +01:00
|
|
|
*
|
|
|
|
* 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.
|
2009-03-02 20:13:08 +01:00
|
|
|
*/
|
|
|
|
|
2013-01-25 22:43:01 +01:00
|
|
|
#ifndef MPD_INPUT_PLUGIN_HXX
|
|
|
|
#define MPD_INPUT_PLUGIN_HXX
|
2009-03-02 20:13:08 +01:00
|
|
|
|
2014-03-02 00:17:32 +01:00
|
|
|
#ifdef WIN32
|
|
|
|
#include <windows.h>
|
|
|
|
/* damn you, windows.h! */
|
|
|
|
#ifdef ERROR
|
|
|
|
#undef ERROR
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2015-01-21 22:13:44 +01:00
|
|
|
struct ConfigBlock;
|
2017-01-25 23:07:50 +01:00
|
|
|
class Mutex;
|
|
|
|
class Cond;
|
2014-05-11 15:34:48 +02:00
|
|
|
class InputStream;
|
2009-03-02 20:13:08 +01:00
|
|
|
|
2013-10-17 10:20:57 +02:00
|
|
|
struct InputPlugin {
|
2009-03-02 23:08:17 +01:00
|
|
|
const char *name;
|
|
|
|
|
2009-03-02 20:45:50 +01:00
|
|
|
/**
|
|
|
|
* Global initialization. This method is called when MPD starts.
|
|
|
|
*
|
2016-09-09 15:11:52 +02:00
|
|
|
* Throws #PluginUnavailable if the plugin is not available
|
|
|
|
* and shall be disabled.
|
2016-09-05 12:05:54 +02:00
|
|
|
*
|
|
|
|
* Throws std::runtime_error on (fatal) error.
|
2009-03-02 20:45:50 +01:00
|
|
|
*/
|
2016-09-05 12:05:54 +02:00
|
|
|
void (*init)(const ConfigBlock &block);
|
2009-03-02 20:45:50 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Global deinitialization. Called once before MPD shuts
|
|
|
|
* down (only if init() has returned true).
|
|
|
|
*/
|
2015-03-03 20:05:08 +01:00
|
|
|
void (*finish)();
|
2009-03-02 20:45:50 +01:00
|
|
|
|
2016-09-09 15:37:06 +02:00
|
|
|
/**
|
|
|
|
* Throws std::runtime_error on error.
|
|
|
|
*/
|
2013-10-23 22:08:59 +02:00
|
|
|
InputStream *(*open)(const char *uri,
|
2016-09-09 15:37:06 +02:00
|
|
|
Mutex &mutex, Cond &cond);
|
2009-03-02 20:13:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|