buildscc | 08 Mar 2012 | | projects
Lan-Tunes is a collaborative multimedia server written in python by Allan Wirth that is licensed under the MIT License. You can see what we’ve been playing at http://www.last.fm/user/builds. Version 0.1 is planned for release by the end of March 2012. 0.1 Beta will be coming slightly before.
You can download the wrapper script here.
The bzr repository for Lan-Tunes can be found on Launchpad at http://launchpad.net/lan-tunes.
To see the current bug list check the launchpad bug tracker at https://bugs.launchpad.net/lan-tunes.
Creating new plugins for Lan-Tunes is easy. Plugins fall into two categories, frontends and backends. Backends plugins add new media types to display, whereas frontend plugins mostly either modify the playlist state or respond to changes in the playlist. For example, youtube is a backend plugin whereas last.fm is a frontend.
Creating a new frontend plugin is easy. A frontend plugin is merely a module (or package, if the plugin requires multiple source files) that defines a class Plugin that subclasses FrontendPlugin (from src/frontendplugin.py). Plugin must have the same constructor signature as FrontendPlugin and must also call FrontendPlugin’s constructor. Frontend plugins are designed to run in their own thread, although they are not required to (for example, the lastfm plugin has no thread of its own).
Frontend plugins that require their own thread should override the functions run() and kill(). run() will be called in a separate thread, and calling kill from the main thread SHOULD cause run to return (and ideally join with it). Note: Because run will be in a separate thread, all calls to GUI methods must be made through the util.idle_add interface in order to avoid locking problems.
Frontend plugins can also connect to the methods of the playlistmanager object that they are passed in the constructor.
For an example of a simple, non-threaded plugin see src/frontends/lastfm/init.py.
For additional documentation see src/frontendplugin.py.
Backend plugins are slightly more complicated. Like a frontend plugin, a backend plugin is merely a module (or package) that defines a class Plugin that subclasses BackendPlugin (from src/backendplugin.py). Again, Plugin must have the same constructor signature as BackendPlugin and must call BackendPlugin’s constructor. Unlike frontend plugins, backend plugins do not explicitly have their own threads (although they can for playback).
The following methods of BackendPlugin must be overridden: