[vdr] [ANNOUNCE] New patch: MainMenuHooks

Udo Richter udo_richter at gmx.de
Mon Feb 26 21:41:28 CET 2007


Frank Schmirler wrote:
> this patch allows plugins to replace the VDR mainmenus "Schedule", "Channels",
> "Timers" and "Recordings" by a different implementation.
> 
> There are already a few plugins around which do something like that, using
> their own idea of a patch. So Tobias Grimm, Martin Prochnow, Christian
> Wieninger and me made an effort to find a common solution for the problem. The
> patch is based on a suggestion of Christian Wieninger back in March 2006
> (http://www.linuxtv.org/pipermail/vdr/2006-March/008234.html). It is meant to
> be an interim solution for VDR 1.4 until (maybe) VDR 1.5 introduces an
> official API for this purpose.

After taking a short look at the patch, I think that this could be done 
in a more elegant way.

> +    case osSchedule:
> +        if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu))
> +            menu = new cMenuSchedule;
> +        else
> +            state = osContinue;
> +        break;

The service functions are meant to be a solution for plugin-to-plugin 
communication, since in that case there's no access to the other's 
symbol space. In this case however, the VDR headers can easily be 
extended, so there's enough room to do a normal interface.

For the menu hooks, I would suggest to implement a common base class, 
that a plugin must derive a copy of, to register a new handler. 
Basically, the same way it already works for cStatus, or other things 
like devices and skins.

Basically, I think its worth considering such an interface to allow to 
replace standard dialogs. However, the user should always have the 
choice whether he wants to keep the originals or use the replacements.

Cheers,

Udo



More information about the vdr mailing list