When is an addon not an addon?
#1
During a recent effort to document addon development for XBMC and coming at it from the point of view of a complete beginner to the subject, I struggled with what exactly constitutes an addon, a plugin, a script etc. Granted, this is in no small part due to reading some existing documentation aimed at pre Dharma XBMC. So I thought I'd post this and see what others think about the subject. I stress, this is my own point of view.

From my research, XBMC is now classing all userland supplied (and a lot of in-built functionality,) as an "addon" and have provided new functionality to manage installing, updating and managing addons from within XBMC itself, a great step forward that will simplify distribution and therefore give greater incentive to addon developers. But this leads to some problems;

Addons can be classified into 4 groups;
  • repository - adds alternative addon repositories to the addon manager
  • plugin - adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.
  • script - a runnable, standalone, program that will appear in the XBMC program section and can take over the console, e.g. Rss editor
  • skin - a skin definition and its supporting script files

The repository and skin addon types are fairly well self contained. It's in the plugin and script types that I believe some confusion exists. There are a couple of issues;

  1. Symantics - There is an uncontrolled blurring of what a plugin type actually means
  2. Missing definition - an additional type is required

Symantics
According to existing documentation, a plugin is supposed to add to the functionality of the existing XBMC system. Its principle purpose is to add additional content to the system and achieve this by integrating into the UI that XBMC defines for content retrieval, i.e. the directory and file listing. This is well supported by the XBMC Python API and the basic construction of a plugin is relatively straightforward. The API also provides a mechanism whereby a developer can tell the system under which section of the main menu the plugin should appear as an addon in the extension point <provides> tag of the addons.xml definition file, (i.e audio, video, image or executable, which correspond to the Music, Video, Pictures and Program menu items.) Similarly a 'script' is well supported by the API and is expected to run in its own window, effectively outside the control of XBMC.)

Here is the first problem, we have a duplication in defining a script. A program script can be defined in two ways;
  • As a script, with an extension type of xbmc.python.script
  • As a plugin, as an extension type xbmc.python.pluginsource that provides an executable

The second problem I have found is that there is nothing to stop a developer breaking the convention of providing content with their plugin that breaks the establish UI guidelines. The Grooveshark addon does just that. It does not provide content in a directory listing as I believe is intended, but runs as a program and takes over the XBMC console. You cannot for instance display a picture slide show at the same time as using Grooveshark. Please note I have nothing against Grooveshark as a program, it is a great bit of software and I use regularly myself, I am simply using it to exemplify a problem. The core of the issue is that it acts in a non conformist manner and breaks the XBMC UI convention. As Apple are very quick to tell us when someone tries to break UI in a phone app, don't do it - it confuses the user.

Missing definition
The current definition of a plugin is I think, inappropriate. It actually describes a 'Content Provider'. in that the software package adds content to XBMC. What is missing (unless I have completely missed it somewhere,) is a true plugin or "Extension", that adds functionality to XBMC. An Extension would allow developers to extend the context menu by hooking in new functionality. For example, how about the ability to rotate an incorrectly aligned image whilst browsing your pictures or even an editor option that calls up GIMP (or some other user definable editor,). An extension could provide this by adding a new option to the context menu. A second type of 'extension' could be used to hook into playback operation by perhaps adding support for media file types that aren't supported in the standard XBMC build. there may be others.

I have my own thoughts on how these issues could be addressed, but I was really just wondering if Addon devs perceived the same issues.
System info: Asrock ION330HT-BD (Intel Atom 330 4 core i686) connected to Sony KDL-Z5800 TV using hdmi via Onkyo TX-SR507 AV Amp. [Old Config Ubuntu 12.04. (Linux 3.2.0-32-generic-pae ) XBMCBuntu (Eden 11.0 Git:unknown Compiled Mar 24 2012). OpenGL 3.3.0 NVIDIA 280.13] New Config unknown - no working XBMC at moment!
Reply
#2
The purpose of a "plugin" is basically additional content as you suggest - thus the reason the extension is "pluginsource".

Some may well abuse this to larger or smaller extent (the "big picture" 'plugin' for instance effectively shows a slideshow of images - it's more like a script in that regard), as once you're in python pretty much anything goes.

I don't really have a problem with this necessarily - part of the reason that some "plugins" act more like "scripts" is due to the fact that previously "scripts" resided in a separate listing and did not list alongside videos/music etc. Now, both scripts and plugins are listed in the UI under "<type> Addons" for just this reason - there's not necessarily any difference between them, and the user in particular needn't care about the distinction.

In addition to the general scripts, there are also specific ones (weather, lyrics, subtitles). The plan for the future is to move those into clearly specified "services" and have XBMC handle the UI for them (they thus become easier to skin and better integrated in general).

And yes, there is no way to hook into the context menu in particular (though plugins can do this within their own listing) or to provide another player directly (although external players are kinda related to that I guess - they're not provided as addons though).

Obviously as we go forward we'll be adding other addon types and further refining the ones we have already - the web interface is a new one for instance.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
When is an addon not an addon?0