mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
- Completely switched to the new CVS HEAD version of the linux-dvb driver. The NEWSTRUCT compile time switch is now obsolete. The required driver is now the CVS HEAD version dated 2002-11-01 or later. - Adjusted the INSTALL file to the 1.1.x version. - Only accepting key presses from the current remote control when learning (thanks to Oliver Endriss). - Fixed the EPG scanner, which broke 'Transfer Mode' as soon as it kicked in (thanks to Oliver Endriss for reporting this one). - Fixed handling audio tracks in cDvbDevice. - Updated channels.conf.terr (thanks to Uwe Scheffler). - Fixed displaying the group separators in the channel display (thanks to Martin Hammerschmid for pointing out this one). - The Makefile now includes the file Make.config (if present in the VDR source directory), which allows the user to overwrite several settings with individual values (suggested by Andreas Schultz). The VDR distribution archive does not contain this file in order to not overwrite a user defined file. There is a Make.config.template which contains the default values of the macros the user can overwrite. - Since there have been changes to the 'newplugin' script authors of plugins may want to newly create their plugins' Makefiles with the new version of this script, and adapt them to their individual needs (make sure you don't overwrite your existing plugin directory - make a backup copy first!). - Fixed reading EPG data via the SVDRP command PUTE (it changed the current service ID). - Fixed closing all dup'ed file descriptors in cPipe. - Implemented a plugin interface for additional audio processing (see PLUGINS.html under "Dolby Digital"). The functionality of the '-a' command line option has been reactivated. Since the author doesn't have any Dolby Digital equipment this may or may not work as expected. There may still be some places where a call to cAudios::Clear() or cAudios::Mute() is necessary. Those with Dolby Digital equipment should please take a look at this and maybe send patches. Replaying Dolby Digital in ways other than through VDR's '-a' option will have to be implemented as plugins. Those who have written patches for VDR version 1.0.x should convert their work into the proper plugins for version 1.1.x. Note to authors of cPlayer derived plugins: please read the modified comments in device.h regarding the member functions cDevice::Clear(), cDevice::Mute() and cDevice::PlayAudio(). Derived classes must call these base class member functions to make sure all registered cAudio objects are properly handled. Also note that the return type of cDevice::PlayAudio() has been changed to 'void', since this function always has to accept the entire data block immediately and there is nothing that could be reasonably done in case an error occurs in one of the cAudio objects. - Now checking the driver's DVB_API_VERSION in dvbdevice.h. Since VDR now requires a driver dated 2002-11-01 or later the MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT and DVB_DRIVER_VERSION stuff has been replaced with DO_REC_AND_PLAY_ON_PRIMARY_DEVICE, which can be used to disable simultaneous recording and replaying on the primary DVB device in case there are problems with this.
151 lines
4.2 KiB
C
151 lines
4.2 KiB
C
/*
|
|
* hello.c: A plugin for the Video Disk Recorder
|
|
*
|
|
* See the README file for copyright information and how to reach the author.
|
|
*
|
|
* $Id: hello.c 1.9 2002/11/01 10:16:53 kls Exp $
|
|
*/
|
|
|
|
#include <getopt.h>
|
|
#include <stdlib.h>
|
|
#include <vdr/interface.h>
|
|
#include <vdr/plugin.h>
|
|
#include "i18n.h"
|
|
|
|
static const char *VERSION = "0.0.8";
|
|
static const char *DESCRIPTION = "A friendly greeting";
|
|
static const char *MAINMENUENTRY = "Hello";
|
|
|
|
class cPluginHello : public cPlugin {
|
|
private:
|
|
// Add any member variables or functions you may need here.
|
|
const char *option_a;
|
|
bool option_b;
|
|
public:
|
|
cPluginHello(void);
|
|
virtual ~cPluginHello();
|
|
virtual const char *Version(void) { return VERSION; }
|
|
virtual const char *Description(void) { return tr(DESCRIPTION); }
|
|
virtual const char *CommandLineHelp(void);
|
|
virtual bool ProcessArgs(int argc, char *argv[]);
|
|
virtual bool Start(void);
|
|
virtual void Housekeeping(void);
|
|
virtual const char *MainMenuEntry(void) { return tr(MAINMENUENTRY); }
|
|
virtual cOsdMenu *MainMenuAction(void);
|
|
virtual cMenuSetupPage *SetupMenu(void);
|
|
virtual bool SetupParse(const char *Name, const char *Value);
|
|
};
|
|
|
|
// Global variables that control the overall behaviour:
|
|
|
|
int GreetingTime = 3;
|
|
int UseAlternateGreeting = false;
|
|
|
|
// --- cMenuSetupHello -------------------------------------------------------
|
|
|
|
class cMenuSetupHello : public cMenuSetupPage {
|
|
private:
|
|
int newGreetingTime;
|
|
int newUseAlternateGreeting;
|
|
protected:
|
|
virtual void Store(void);
|
|
public:
|
|
cMenuSetupHello(void);
|
|
};
|
|
|
|
cMenuSetupHello::cMenuSetupHello(void)
|
|
{
|
|
newGreetingTime = GreetingTime;
|
|
newUseAlternateGreeting = UseAlternateGreeting;
|
|
Add(new cMenuEditIntItem( tr("Greeting time (s)"), &newGreetingTime));
|
|
Add(new cMenuEditBoolItem(tr("Use alternate greeting"), &newUseAlternateGreeting));
|
|
}
|
|
|
|
void cMenuSetupHello::Store(void)
|
|
{
|
|
SetupStore("GreetingTime", GreetingTime = newGreetingTime);
|
|
SetupStore("UseAlternateGreeting", UseAlternateGreeting = newUseAlternateGreeting);
|
|
}
|
|
|
|
// --- cPluginHello ----------------------------------------------------------
|
|
|
|
cPluginHello::cPluginHello(void)
|
|
{
|
|
// Initialize any member variables here.
|
|
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
|
|
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
|
|
option_a = NULL;
|
|
option_b = false;
|
|
}
|
|
|
|
cPluginHello::~cPluginHello()
|
|
{
|
|
// Clean up after yourself!
|
|
}
|
|
|
|
const char *cPluginHello::CommandLineHelp(void)
|
|
{
|
|
// Return a string that describes all known command line options.
|
|
return " -a ABC, --aaa=ABC do something nice with ABC\n"
|
|
" -b, --bbb activate 'plan B'\n";
|
|
}
|
|
|
|
bool cPluginHello::ProcessArgs(int argc, char *argv[])
|
|
{
|
|
// Implement command line argument processing here if applicable.
|
|
static struct option long_options[] = {
|
|
{ "aaa", required_argument, NULL, 'a' },
|
|
{ "bbb", no_argument, NULL, 'b' },
|
|
{ NULL }
|
|
};
|
|
|
|
int c;
|
|
while ((c = getopt_long(argc, argv, "a:b", long_options, NULL)) != -1) {
|
|
switch (c) {
|
|
case 'a': option_a = optarg;
|
|
break;
|
|
case 'b': option_b = true;
|
|
break;
|
|
default: return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
bool cPluginHello::Start(void)
|
|
{
|
|
// Start any background activities the plugin shall perform.
|
|
RegisterI18n(Phrases);
|
|
return true;
|
|
}
|
|
|
|
void cPluginHello::Housekeeping(void)
|
|
{
|
|
// Perform any cleanup or other regular tasks.
|
|
}
|
|
|
|
cOsdMenu *cPluginHello::MainMenuAction(void)
|
|
{
|
|
// Perform the action when selected from the main VDR menu.
|
|
Interface->Confirm(UseAlternateGreeting ? tr("Howdy folks!") : tr("Hello world!"), GreetingTime);
|
|
return NULL;
|
|
}
|
|
|
|
cMenuSetupPage *cPluginHello::SetupMenu(void)
|
|
{
|
|
// Return a setup menu in case the plugin supports one.
|
|
return new cMenuSetupHello;
|
|
}
|
|
|
|
bool cPluginHello::SetupParse(const char *Name, const char *Value)
|
|
{
|
|
// Parse your own setup parameters and store their values.
|
|
if (!strcasecmp(Name, "GreetingTime")) GreetingTime = atoi(Value);
|
|
else if (!strcasecmp(Name, "UseAlternateGreeting")) UseAlternateGreeting = atoi(Value);
|
|
else
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
VDRPLUGINCREATOR(cPluginHello); // Don't touch this!
|