1
/**************************************************************************
2
Lightspark, a free flash player implementation
4
Copyright (C) 2009,2010 Alessandro Pignotti (a.pignotti@sssup.it)
6
This program is free software: you can redistribute it and/or modify
7
it under the terms of the GNU Lesser General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
**************************************************************************/
20
#ifndef PLUGINMANAGER_H
21
#define PLUGINMANAGER_H
25
#include <boost/filesystem.hpp>
27
#include "interfaces/IPlugin.h"
30
using namespace boost::filesystem;
32
//convenience typedef for the pointers to the 2 functions we expect to find in the plugin libraries
33
typedef IPlugin * ( *PLUGIN_FACTORY ) ();
34
typedef void ( *PLUGIN_CLEANUP ) ( IPlugin * );
44
vector<PluginModule *> pluginsList;
46
void addPluginToList ( IPlugin *o_plugin, string pathToPlugin );
47
void removePluginFromList ( string plugin_path );
48
int32_t findPluginInList ( string desiredname = "", string desiredbackend = "", string desiredpath = "",
49
HMODULE hdesiredLoadPlugin = NULL, IPlugin *o_desiredPlugin = NULL );
50
void loadPlugin ( uint32_t desiredindex );
51
void unloadPlugin ( uint32_t desiredIndex );
55
vector<string *> get_backendsList ( PLUGIN_TYPES typeSearched );
56
IPlugin *get_plugin ( string desiredBackend );
57
void release_plugin ( IPlugin *o_plugin );
63
friend class PluginManager;
65
string pluginName; //plugin name
66
PLUGIN_TYPES pluginType; //plugin type to be able to filter them
67
string backendName; //backend (can be something like pulseaudio, opengl, ffmpeg)
68
string pluginPath; //full path to the plugin file
69
bool enabled; //should it be enabled (if the audio backend is present)?
70
HMODULE hLoadedPlugin; //when loaded, handle to the plugin so we can unload it later
71
IPlugin *oLoadedPlugin; //when instanciated, object to the class