mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
- Improved responsiveness inside CAM menus. - Added handling of the 'Close MMI' tag to avoid error log messages with CAMs that actually use it. - Now waiting at startup until all DVB devices are ready. This includes having all CAMs initialized and ready to decrypt, so that no more "channel not available" happens if VDR is started with the current channel being an encrypted one, or a timer on such a channel hits right after starting VDR. - Fixed cVideoRepacker to better handle errors in data (thanks to Reinhard Nissl). - Fixed cDvbTuner to avoid lockups on NPTL systems (thanks to Marcel Wiesweg). - Added 'Service' functions to the plugin interface (thanks to Udo Richter). See PLUGINS.html, section "Custom services" for details. - Replaced the get/put_unaligned() macros from <asm/unaligned.h> with own inline functions to avoid problems on platforms that don't provide these (thanks to David Woodhouse for his help).
100 lines
2.6 KiB
C++
100 lines
2.6 KiB
C++
/*
|
|
* plugin.h: The VDR plugin interface
|
|
*
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
* how to reach the author.
|
|
*
|
|
* $Id: plugin.h 1.9 2005/08/21 09:32:08 kls Exp $
|
|
*/
|
|
|
|
#ifndef __PLUGIN_H
|
|
#define __PLUGIN_H
|
|
|
|
#include "i18n.h"
|
|
#include "menuitems.h"
|
|
#include "osdbase.h"
|
|
#include "tools.h"
|
|
|
|
#define VDRPLUGINCREATOR(PluginClass) extern "C" void *VDRPluginCreator(void) { return new PluginClass; }
|
|
|
|
class cPlugin {
|
|
friend class cDll;
|
|
friend class cPluginManager;
|
|
private:
|
|
static char *configDirectory;
|
|
const char *name;
|
|
bool started;
|
|
void SetName(const char *s);
|
|
public:
|
|
cPlugin(void);
|
|
virtual ~cPlugin();
|
|
|
|
const char *Name(void) { return name; }
|
|
virtual const char *Version(void) = 0;
|
|
virtual const char *Description(void) = 0;
|
|
virtual const char *CommandLineHelp(void);
|
|
|
|
virtual bool ProcessArgs(int argc, char *argv[]);
|
|
virtual bool Initialize(void);
|
|
virtual bool Start(void);
|
|
virtual void Stop(void);
|
|
virtual void Housekeeping(void);
|
|
|
|
virtual const char *MainMenuEntry(void);
|
|
virtual cOsdObject *MainMenuAction(void);
|
|
|
|
virtual cMenuSetupPage *SetupMenu(void);
|
|
virtual bool SetupParse(const char *Name, const char *Value);
|
|
void SetupStore(const char *Name, const char *Value = NULL);
|
|
void SetupStore(const char *Name, int Value);
|
|
|
|
void RegisterI18n(const tI18nPhrase * const Phrases);
|
|
|
|
virtual bool Service(const char *Id, void *Data = NULL);
|
|
|
|
static void SetConfigDirectory(const char *Dir);
|
|
static const char *ConfigDirectory(const char *PluginName = NULL);
|
|
};
|
|
|
|
class cDll : public cListObject {
|
|
private:
|
|
char *fileName;
|
|
char *args;
|
|
void *handle;
|
|
cPlugin *plugin;
|
|
public:
|
|
cDll(const char *FileName, const char *Args);
|
|
virtual ~cDll();
|
|
bool Load(bool Log = false);
|
|
cPlugin *Plugin(void) { return plugin; }
|
|
};
|
|
|
|
class cDlls : public cList<cDll> {};
|
|
|
|
class cPluginManager {
|
|
private:
|
|
static cPluginManager *pluginManager;
|
|
char *directory;
|
|
time_t lastHousekeeping;
|
|
int nextHousekeeping;
|
|
cDlls dlls;
|
|
public:
|
|
cPluginManager(const char *Directory);
|
|
virtual ~cPluginManager();
|
|
void SetDirectory(const char *Directory);
|
|
void AddPlugin(const char *Args);
|
|
bool LoadPlugins(bool Log = false);
|
|
bool InitializePlugins(void);
|
|
bool StartPlugins(void);
|
|
void Housekeeping(void);
|
|
static bool HasPlugins(void);
|
|
static cPlugin *GetPlugin(int Index);
|
|
static cPlugin *GetPlugin(const char *Name);
|
|
static cPlugin *CallFirstService(const char *Id, void *Data = NULL);
|
|
static bool CallAllServices(const char *Id, void *Data = NULL);
|
|
void StopPlugins(void);
|
|
void Shutdown(void);
|
|
};
|
|
|
|
#endif //__PLUGIN_H
|