2010-08-10, 18:43
Hi folks,
currently I am writing for my self a small script inside of XBMC with python. However, there are so much pitfalls when adding functionality to XBMC by python. For example it is really hard to have script running in background and update window content while running. It seems that scripts has most benefit of producing its content only once (static) and not being run always in the background (dynamic). Another problem with python is, it is not that efficient as C/C++ would be
So, I though on adding support for loading dynamic libraries (dll or so). For example one can add a method XBMC.LoadDynamicPlugin(file.dll) to scripts. This will force to load a dll which can then perform any action within XBMC. For example one can write new weather dynamic plugin and remove it completely out of the main XBMC code. When loading Weather.dll it will add its windows directly to the WindowManager and maybe add a new Job to JobManager. This is just an example, how this feature can be used.
I just want to know if somebody would be interested in that? I could imagine that this could improve "Skinnability" further, since really dynamic things would be then possible.
One then need to discuss how the interface of such dynamic/shared libraries would looks like. I could imagine to provide following external methods within such a shared library:
// return true if this plugin is compatible with the XBMC version from which one it was loaded
bool IsCompatibleWith(int majorXBMCVersion, int minorXBMCVersion, int svnRev = -1);
// initialize plugin (here plugin do the main integration part within XBMC)
bool Initialize();
// say to plugin that we would like to stop it, it should release anything it has used
void Remove();
I think changes to the main XBMC code would be not that big. One just need to have some kind of new global DynamicPluginManager class instance.
Any ideas or comments on that?
Regards,
art
currently I am writing for my self a small script inside of XBMC with python. However, there are so much pitfalls when adding functionality to XBMC by python. For example it is really hard to have script running in background and update window content while running. It seems that scripts has most benefit of producing its content only once (static) and not being run always in the background (dynamic). Another problem with python is, it is not that efficient as C/C++ would be
So, I though on adding support for loading dynamic libraries (dll or so). For example one can add a method XBMC.LoadDynamicPlugin(file.dll) to scripts. This will force to load a dll which can then perform any action within XBMC. For example one can write new weather dynamic plugin and remove it completely out of the main XBMC code. When loading Weather.dll it will add its windows directly to the WindowManager and maybe add a new Job to JobManager. This is just an example, how this feature can be used.
I just want to know if somebody would be interested in that? I could imagine that this could improve "Skinnability" further, since really dynamic things would be then possible.
One then need to discuss how the interface of such dynamic/shared libraries would looks like. I could imagine to provide following external methods within such a shared library:
// return true if this plugin is compatible with the XBMC version from which one it was loaded
bool IsCompatibleWith(int majorXBMCVersion, int minorXBMCVersion, int svnRev = -1);
// initialize plugin (here plugin do the main integration part within XBMC)
bool Initialize();
// say to plugin that we would like to stop it, it should release anything it has used
void Remove();
I think changes to the main XBMC code would be not that big. One just need to have some kind of new global DynamicPluginManager class instance.
Any ideas or comments on that?
Regards,
art