Udo Richter wrote:
cwieninger@gmx.de wrote:
I was asked, if I could expose some functionality of epgsearch (searching the EPG, calling the extended timer edit menu) to other plugins. I plan to do this, like the timeline plugin does to check for timer conflicts in other plugins:
Another way to tunnel information from one plugin to another is to use SetupParse("==epgsearch-tunnel-v1.0==",(char*)&data) for it. If, for some reason, the plugin doesn't know this tunnel (wrong version, wrong plugin), the function will most likely ignore this call and return false.
A far better way would be of course if VDR's cPlugin would have such a general purpose interface. My approach would be like this:
virtual bool ExtensionInterface(const char *ExtensionId, void *Data)
Plugins return false unless ExtensionId matches a known unique protocol ID. If the plugin supports this protocol, true will be returned in any case. If *Data is not NULL, it points to a protocol-specific buffer. If *Data is NULL, this is just a protocol-supported call.
cPluginManager should have methods to call ExtensionInterface for all plugins (broadcast-like), or for all plugins until one plugin returns true (find one that offers the interface).
@Klaus: I can implement that if interested.
Why don't you just give your plugin a dedicated function that does exactly what you want? You'll just need to typecast the cPlugin pointer you have to the particular type and can then call that plugin's additional functions.
Or am I missing something here?
Klaus