Commits

fab31 committed eb8c55d

Welcome zicbee-vlc !

Comments (0)

Files changed (7)

+#!python
+"""Bootstrap setuptools installation
+
+If you want to use setuptools in your package's setup.py, just include this
+file in the same directory with it, and add this to the top of your setup.py::
+
+    from ez_setup import use_setuptools
+    use_setuptools()
+
+If you want to require a specific version of setuptools, set a download
+mirror, or use an alternate download directory, you can do so by supplying
+the appropriate options to ``use_setuptools()``.
+
+This file can also be run as a script to install or upgrade setuptools.
+"""
+import sys
+DEFAULT_VERSION = "0.6c8"
+DEFAULT_URL     = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
+
+md5_data = {
+    'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
+    'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
+    'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
+    'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
+    'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
+    'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
+    'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
+    'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
+    'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
+    'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
+    'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
+    'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
+    'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
+    'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
+    'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
+    'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
+    'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
+    'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
+    'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
+    'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
+    'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
+    'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
+    'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
+    'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
+    'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
+    'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
+    'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
+    'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
+    'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
+    'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
+}
+
+import sys, os
+
+def _validate_md5(egg_name, data):
+    if egg_name in md5_data:
+        from md5 import md5
+        digest = md5(data).hexdigest()
+        if digest != md5_data[egg_name]:
+            print >>sys.stderr, (
+                "md5 validation of %s failed!  (Possible download problem?)"
+                % egg_name
+            )
+            sys.exit(2)
+    return data
+
+
+def use_setuptools(
+    version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
+    download_delay=15
+):
+    """Automatically find/download setuptools and make it available on sys.path
+
+    `version` should be a valid setuptools version number that is available
+    as an egg for download under the `download_base` URL (which should end with
+    a '/').  `to_dir` is the directory where setuptools will be downloaded, if
+    it is not already available.  If `download_delay` is specified, it should
+    be the number of seconds that will be paused before initiating a download,
+    should one be required.  If an older version of setuptools is installed,
+    this routine will print a message to ``sys.stderr`` and raise SystemExit in
+    an attempt to abort the calling script.
+    """
+    was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
+    def do_download():
+        egg = download_setuptools(version, download_base, to_dir, download_delay)
+        sys.path.insert(0, egg)
+        import setuptools; setuptools.bootstrap_install_from = egg
+    try:
+        import pkg_resources
+    except ImportError:
+        return do_download()       
+    try:
+        pkg_resources.require("setuptools>="+version); return
+    except pkg_resources.VersionConflict, e:
+        if was_imported:
+            print >>sys.stderr, (
+            "The required version of setuptools (>=%s) is not available, and\n"
+            "can't be installed while this script is running. Please install\n"
+            " a more recent version first, using 'easy_install -U setuptools'."
+            "\n\n(Currently using %r)"
+            ) % (version, e.args[0])
+            sys.exit(2)
+        else:
+            del pkg_resources, sys.modules['pkg_resources']    # reload ok
+            return do_download()
+    except pkg_resources.DistributionNotFound:
+        return do_download()
+
+def download_setuptools(
+    version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
+    delay = 15
+):
+    """Download setuptools from a specified location and return its filename
+
+    `version` should be a valid setuptools version number that is available
+    as an egg for download under the `download_base` URL (which should end
+    with a '/'). `to_dir` is the directory where the egg will be downloaded.
+    `delay` is the number of seconds to pause before an actual download attempt.
+    """
+    import urllib2, shutil
+    egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
+    url = download_base + egg_name
+    saveto = os.path.join(to_dir, egg_name)
+    src = dst = None
+    if not os.path.exists(saveto):  # Avoid repeated downloads
+        try:
+            from distutils import log
+            if delay:
+                log.warn("""
+---------------------------------------------------------------------------
+This script requires setuptools version %s to run (even to display
+help).  I will attempt to download it for you (from
+%s), but
+you may need to enable firewall access for this script first.
+I will start the download in %d seconds.
+
+(Note: if this machine does not have network access, please obtain the file
+
+   %s
+
+and place it in this directory before rerunning this script.)
+---------------------------------------------------------------------------""",
+                    version, download_base, delay, url
+                ); from time import sleep; sleep(delay)
+            log.warn("Downloading %s", url)
+            src = urllib2.urlopen(url)
+            # Read/write all in one block, so we don't create a corrupt file
+            # if the download is interrupted.
+            data = _validate_md5(egg_name, src.read())
+            dst = open(saveto,"wb"); dst.write(data)
+        finally:
+            if src: src.close()
+            if dst: dst.close()
+    return os.path.realpath(saveto)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+def main(argv, version=DEFAULT_VERSION):
+    """Install or upgrade setuptools and EasyInstall"""
+    try:
+        import setuptools
+    except ImportError:
+        egg = None
+        try:
+            egg = download_setuptools(version, delay=0)
+            sys.path.insert(0,egg)
+            from setuptools.command.easy_install import main
+            return main(list(argv)+[egg])   # we're done here
+        finally:
+            if egg and os.path.exists(egg):
+                os.unlink(egg)
+    else:
+        if setuptools.__version__ == '0.0.1':
+            print >>sys.stderr, (
+            "You have an obsolete version of setuptools installed.  Please\n"
+            "remove it from your system entirely before rerunning this script."
+            )
+            sys.exit(2)
+
+    req = "setuptools>="+version
+    import pkg_resources
+    try:
+        pkg_resources.require(req)
+    except pkg_resources.VersionConflict:
+        try:
+            from setuptools.command.easy_install import main
+        except ImportError:
+            from easy_install import main
+        main(list(argv)+[download_setuptools(delay=0)])
+        sys.exit(0) # try to force an exit
+    else:
+        if argv:
+            from setuptools.command.easy_install import main
+            main(argv)
+        else:
+            print "Setuptools version",version,"or greater has been installed."
+            print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
+
+def update_md5(filenames):
+    """Update our built-in md5 registry"""
+
+    import re
+    from md5 import md5
+
+    for name in filenames:
+        base = os.path.basename(name)
+        f = open(name,'rb')
+        md5_data[base] = md5(f.read()).hexdigest()
+        f.close()
+
+    data = ["    %r: %r,\n" % it for it in md5_data.items()]
+    data.sort()
+    repl = "".join(data)
+
+    import inspect
+    srcfile = inspect.getsourcefile(sys.modules[__name__])
+    f = open(srcfile, 'rb'); src = f.read(); f.close()
+
+    match = re.search("\nmd5_data = {\n([^}]+)}", src)
+    if not match:
+        print >>sys.stderr, "Internal error!"
+        sys.exit(2)
+
+    src = src[:match.start(1)] + repl + src[match.end(1):]
+    f = open(srcfile,'w')
+    f.write(src)
+    f.close()
+
+
+if __name__=='__main__':
+    if len(sys.argv)>2 and sys.argv[1]=='--md5update':
+        update_md5(sys.argv[2:])
+    else:
+        main(sys.argv[1:])
+
+
+
+
+
+#!/usr/bin/env python
+import os
+import sys
+try:
+	import setuptools
+except ImportError:
+	from ez_setup import use_setuptools
+	use_setuptools()
+from setuptools import setup, find_packages
+
+VERSION='0.9-wip'
+
+setup (
+        name='zicbee-vlc',
+        version=VERSION,
+        author='Fabien Devaux',
+        author_email='fdev31@gmail.com',
+        url = 'http://zicbee.gnux.info/',
+        download_url='http://zicbee.gnux.info/hg/index.cgi/zicbee-player/archive/wip.tar.bz2',
+        license='BSD',
+        platform='all',
+        description='VLC backend for zicbee project',
+        long_description='''
+ZicBee is a project grouping multiple applications to manage play and handle music databases.
+It takes ideas from Quodlibet and Mpd, both very good music players with their own strengths.
+
+For now there is a Swiss-army knife tool: zicdb
+
+Some plugins for quodlibet has also be developed. ZicBee is fast,
+portable (but not very ported...) and flexible.
+
+While the project is stable and usable (there are online docs and a nice www gui),
+it's mostly interesting for hackers and developers from now, I didn't confront to real users yet :P
+
+See features list, it's mostly handy for people with large databases,
+with optionally multiple computers.
+It can be adapted to handle video too, hacking some bit of code.
+        ''',
+        keywords = 'database music tags metadata management',
+        packages = find_packages(),
+
+        entry_points = """
+        [zicbee.player]
+        vlc = zicbee_vlc:Player
+        """,
+
+        dependency_links = [
+            'eggs',
+            'http://zicbee.gnux.info/files/',
+            'http://webpy.org/',
+            'http://buzhug.sourceforge.net/',
+            'http://code.google.com/p/quodlibet/downloads/list',
+#            'http://sourceforge.net/project/showfiles.php?group_id=167078&package_id=190037&release_id=664931',
+#            'http://code.google.com/p/pyglet/downloads/list',
+            ],
+        classifiers = [
+                'Development Status :: 4 - Beta',
+                'Intended Audience :: Developers',
+#                'Intended Audience :: End Users/Desktop',
+                'Operating System :: OS Independent',
+                'Operating System :: Microsoft :: Windows',
+                'Operating System :: POSIX',
+                'Programming Language :: Python',
+                'Environment :: Console',
+                'Environment :: No Input/Output (Daemon)',
+                'Environment :: X11 Applications',
+                'Natural Language :: English',
+                'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
+                'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
+                'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
+                'Topic :: Software Development',
+                'Topic :: Software Development :: Libraries :: Python Modules',
+                'Topic :: Multimedia :: Sound/Audio :: Players',
+                'Topic :: Multimedia :: Sound/Audio :: Players :: MP3',
+                'Topic :: Text Processing :: Markup',
+                'Topic :: Utilities',
+                ],
+
+        )
+

tests/cocos2d_oh_yeah.mp3

Binary file added.

tests/runtests.sh

+#!/bin/sh
+PYTHONPATH=..:/home/fab/devs/zicbee/ nosetests

tests/test_player.py

+import os
+import sys
+from time import sleep
+
+SONGNAME = 'cocos2d_oh_yeah.mp3'
+
+class TestPlayer(object):
+    def setUp(self):
+        from zicbee_vlc import Player
+        self.player = Player()
+        self.player.load(SONGNAME)
+        sleep(0.5)
+
+    def tearDown(self):
+        sleep(0.2)
+        self.player.quit()
+
+    def test_position(self):
+        assert isinstance(self.player.position, int)
+
+    def test_seek(self):
+        self.player.seek(-1)
+
+    def test_reload(self):
+        self.player.load(SONGNAME)
+
+    def test_cache(self):
+        self.player.set_cache(128)
+        self.player.set_cache(4096)
+
+    def test_pause(self):
+        self.player.pause()
+        self.player.pause()
+
+    def test_volume(self):
+        for n in xrange(10):
+            sleep(0.1)
+            self.player.volume(n*10)
+

zicbee_vlc/__init__.py

+# TODO: export fetch_playlist & playlist handling out of player class
+__all__ = ['Player']
+
+from .vlc import Instance
+
+class Player(object):
+    def __init__(self):
+        self.vlc = Instance()
+        self.p = None
+
+    def set_cache(self, val):
+        """ Sets the cache value in kilobytes """
+        pass
+
+    def volume(self, val):
+        """ Sets volume [0-100] """
+        self.vlc.audio_set_volume(val)
+
+    def seek(self, val):
+        """ Seeks specified number of seconds (positive or negative) """
+        if self.p:
+            self.p.set_position(val/100.0 + self.p.get_position())
+
+    def pause(self):
+        """ Toggles pause mode """
+        if self.p:
+            self.p.pause()
+
+    def respawn(self):
+        """ Restarts the player """
+        if self.p:
+            self.p.stop()
+
+    def load(self, uri):
+        """ Loads the specified URI """
+        if self.p:
+            self.p.stop()
+        self.p = self.vlc.media_player_new(uri)
+        self.p.play()
+
+    def quit(self):
+        """ De-initialize player and wait for it to shut down """
+        try:
+            if self.p:
+                self.p.stop()
+        except Exception, e:
+            print "E: %s"%e
+
+    @property
+    def position(self):
+        """ returns the stream position, in seconds """
+        if self.p:
+            return self.p.get_position()*100
+
+

zicbee_vlc/vlc.py

+#! /usr/bin/python
+
+#
+# Python ctypes bindings for VLC
+# Copyright (C) 2009 the VideoLAN team
+# $Id: $
+#
+# Authors: Olivier Aubert <olivier.aubert at liris.cnrs.fr>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+#
+
+"""This module provides bindings for the
+U{libvlc<http://wiki.videolan.org/ExternalAPI>} and
+U{MediaControl<http://wiki.videolan.org/MediaControlAPI>} APIs.
+
+You can find documentation at U{http://www.advene.org/download/python-ctypes/}.
+
+Basically, the most important class is L{Instance}, which is used to
+create a libvlc Instance. From this instance, you can then create
+L{MediaPlayer} and L{MediaListPlayer} instances.
+"""
+
+import logging
+import ctypes
+import sys
+
+build_date="Fri Sep 11 15:21:38 2009"
+
+# Used for win32 and MacOS X
+detected_plugin_path=None
+
+if sys.platform == 'linux2':
+    try:
+        dll=ctypes.CDLL('libvlc.so')
+    except OSError:
+        for n in reversed(xrange(3)):
+            try:
+                dll=ctypes.CDLL('libvlc.so.%d'%n)
+                break
+            except OSError:
+                pass
+        else:
+            raise OSError('Unable to find libvlc.so')
+elif sys.platform == 'win32':
+    import ctypes.util
+    import os
+    detected_plugin_path=None
+    path=ctypes.util.find_library('libvlc.dll')
+    if path is None:
+        # Try to use registry settings
+        import _winreg
+        detected_plugin_path_found = None
+        subkey, name = 'Software\\VideoLAN\\VLC','InstallDir'
+        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:
+            try:
+                reg = _winreg.OpenKey(hkey, subkey)
+                detected_plugin_path_found, type_id = _winreg.QueryValueEx(reg, name)
+                _winreg.CloseKey(reg)
+                break
+            except _winreg.error:
+                pass
+        if detected_plugin_path_found:
+            detected_plugin_path = detected_plugin_path_found
+        else:
+            # Try a standard location.
+            p='c:\\Program Files\\VideoLAN\\VLC\\libvlc.dll'
+            if os.path.exists(p):
+                detected_plugin_path=os.path.dirname(p)
+        os.chdir(detected_plugin_path)
+        # If chdir failed, this will not work and raise an exception
+        path='libvlc.dll'
+    else:
+        detected_plugin_path=os.path.dirname(path)
+    dll=ctypes.CDLL(path)
+elif sys.platform == 'darwin':
+    # FIXME: should find a means to configure path
+    d='/Applications/VLC.app'
+    import os
+    if os.path.exists(d):
+        dll=ctypes.CDLL(d+'/Contents/MacOS/lib/libvlc.2.dylib')
+        detected_plugin_path=d+'/Contents/MacOS/modules'
+    else:
+        # Hope some default path is set...
+        dll=ctypes.CDLL('libvlc.2.dylib')
+
+#
+# Generated enum types.
+#
+
+class EventType(ctypes.c_ulong):
+    """ libvlc_core
+LibVLC Available Events
+
+
+    """
+    _names={
+        1: 'MediaSubItemAdded',
+        2: 'MediaDurationChanged',
+        3: 'MediaPreparsedChanged',
+        4: 'MediaFreed',
+        5: 'MediaStateChanged',
+        6: 'MediaPlayerNothingSpecial',
+        7: 'MediaPlayerOpening',
+        8: 'MediaPlayerBuffering',
+        9: 'MediaPlayerPlaying',
+        10: 'MediaPlayerPaused',
+        11: 'MediaPlayerStopped',
+        12: 'MediaPlayerForward',
+        13: 'MediaPlayerBackward',
+        14: 'MediaPlayerEndReached',
+        15: 'MediaPlayerEncounteredError',
+        16: 'MediaPlayerTimeChanged',
+        17: 'MediaPlayerPositionChanged',
+        18: 'MediaPlayerSeekableChanged',
+        19: 'MediaPlayerPausableChanged',
+        20: 'MediaListItemAdded',
+        21: 'MediaListWillAddItem',
+        22: 'MediaListItemDeleted',
+        23: 'MediaListWillDeleteItem',
+        24: 'MediaListViewItemAdded',
+        25: 'MediaListViewWillAddItem',
+        26: 'MediaListViewItemDeleted',
+        27: 'MediaListViewWillDeleteItem',
+        28: 'MediaListPlayerPlayed',
+        29: 'MediaListPlayerNextItemSet',
+        30: 'MediaListPlayerStopped',
+        31: 'MediaDiscovererStarted',
+        32: 'MediaDiscovererEnded',
+        33: 'MediaPlayerTitleChanged',
+        34: 'MediaPlayerSnapshotTaken',
+    }
+
+    def __repr__(self):
+        return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value]))
+
+    def __eq__(self, other):
+        return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value)
+                 or (isinstance(other, (int, long)) and self.value == other ) )
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+EventType.MediaSubItemAdded=EventType(1)
+EventType.MediaDurationChanged=EventType(2)
+EventType.MediaPreparsedChanged=EventType(3)
+EventType.MediaFreed=EventType(4)
+EventType.MediaStateChanged=EventType(5)
+EventType.MediaPlayerNothingSpecial=EventType(6)
+EventType.MediaPlayerOpening=EventType(7)
+EventType.MediaPlayerBuffering=EventType(8)
+EventType.MediaPlayerPlaying=EventType(9)
+EventType.MediaPlayerPaused=EventType(10)
+EventType.MediaPlayerStopped=EventType(11)
+EventType.MediaPlayerForward=EventType(12)
+EventType.MediaPlayerBackward=EventType(13)
+EventType.MediaPlayerEndReached=EventType(14)
+EventType.MediaPlayerEncounteredError=EventType(15)
+EventType.MediaPlayerTimeChanged=EventType(16)
+EventType.MediaPlayerPositionChanged=EventType(17)
+EventType.MediaPlayerSeekableChanged=EventType(18)
+EventType.MediaPlayerPausableChanged=EventType(19)
+EventType.MediaListItemAdded=EventType(20)
+EventType.MediaListWillAddItem=EventType(21)
+EventType.MediaListItemDeleted=EventType(22)
+EventType.MediaListWillDeleteItem=EventType(23)
+EventType.MediaListViewItemAdded=EventType(24)
+EventType.MediaListViewWillAddItem=EventType(25)
+EventType.MediaListViewItemDeleted=EventType(26)
+EventType.MediaListViewWillDeleteItem=EventType(27)
+EventType.MediaListPlayerPlayed=EventType(28)
+EventType.MediaListPlayerNextItemSet=EventType(29)
+EventType.MediaListPlayerStopped=EventType(30)
+EventType.MediaDiscovererStarted=EventType(31)
+EventType.MediaDiscovererEnded=EventType(32)
+EventType.MediaPlayerTitleChanged=EventType(33)
+EventType.MediaPlayerSnapshotTaken=EventType(34)
+
+class Meta(ctypes.c_ulong):
+    """ libvlc_media
+LibVLC Media Meta
+
+
+    """
+    _names={
+        0: 'Title',
+        1: 'Artist',
+        2: 'Genre',
+        3: 'Copyright',
+        4: 'Album',
+        5: 'TrackNumber',
+        6: 'Description',
+        7: 'Rating',
+        8: 'Date',
+        9: 'Setting',
+        10: 'URL',
+        11: 'Language',
+        12: 'NowPlaying',
+        13: 'Publisher',
+        14: 'EncodedBy',
+        15: 'ArtworkURL',
+        16: 'TrackID',
+    }
+
+    def __repr__(self):
+        return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value]))
+
+    def __eq__(self, other):
+        return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value)
+                 or (isinstance(other, (int, long)) and self.value == other ) )
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+Meta.Title=Meta(0)
+Meta.Artist=Meta(1)
+Meta.Genre=Meta(2)
+Meta.Copyright=Meta(3)
+Meta.Album=Meta(4)
+Meta.TrackNumber=Meta(5)
+Meta.Description=Meta(6)
+Meta.Rating=Meta(7)
+Meta.Date=Meta(8)
+Meta.Setting=Meta(9)
+Meta.URL=Meta(10)
+Meta.Language=Meta(11)
+Meta.NowPlaying=Meta(12)
+Meta.Publisher=Meta(13)
+Meta.EncodedBy=Meta(14)
+Meta.ArtworkURL=Meta(15)
+Meta.TrackID=Meta(16)
+
+class State(ctypes.c_ulong):
+    """Note the order of libvlc_state_t enum must match exactly the order of
+See mediacontrol_PlayerStatus, See input_state_e enums,
+and VideoLAN.LibVLC.State (at bindings/cil/src/media.cs).
+Expected states by web plugins are:
+IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4,
+STOPPING=5, ENDED=6, ERROR=7
+
+    """
+    _names={
+        0: 'NothingSpecial',
+        1: 'Opening',
+        2: 'Buffering',
+        3: 'Playing',
+        4: 'Paused',
+        5: 'Stopped',
+        6: 'Ended',
+        7: 'Error',
+    }
+
+    def __repr__(self):
+        return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value]))
+
+    def __eq__(self, other):
+        return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value)
+                 or (isinstance(other, (int, long)) and self.value == other ) )
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+State.NothingSpecial=State(0)
+State.Opening=State(1)
+State.Buffering=State(2)
+State.Playing=State(3)
+State.Paused=State(4)
+State.Stopped=State(5)
+State.Ended=State(6)
+State.Error=State(7)
+
+class AudioOutputDeviceTypes(ctypes.c_ulong):
+    """Audio device types
+
+    """
+    _names={
+        -1: 'Error',
+        1: 'Mono',
+        2: 'Stereo',
+        4: '_2F2R',
+        5: '_3F2R',
+        6: '_5_1',
+        7: '_6_1',
+        8: '_7_1',
+        10: 'SPDIF',
+    }
+
+    def __repr__(self):
+        return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value]))
+
+    def __eq__(self, other):
+        return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value)
+                 or (isinstance(other, (int, long)) and self.value == other ) )
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+AudioOutputDeviceTypes.Error=AudioOutputDeviceTypes(-1)
+AudioOutputDeviceTypes.Mono=AudioOutputDeviceTypes(1)
+AudioOutputDeviceTypes.Stereo=AudioOutputDeviceTypes(2)
+AudioOutputDeviceTypes._2F2R=AudioOutputDeviceTypes(4)
+AudioOutputDeviceTypes._3F2R=AudioOutputDeviceTypes(5)
+AudioOutputDeviceTypes._5_1=AudioOutputDeviceTypes(6)
+AudioOutputDeviceTypes._6_1=AudioOutputDeviceTypes(7)
+AudioOutputDeviceTypes._7_1=AudioOutputDeviceTypes(8)
+AudioOutputDeviceTypes.SPDIF=AudioOutputDeviceTypes(10)
+
+class AudioOutputChannel(ctypes.c_ulong):
+    """Audio channels
+
+    """
+    _names={
+        -1: 'Error',
+        1: 'Stereo',
+        2: 'RStereo',
+        3: 'Left',
+        4: 'Right',
+        5: 'Dolbys',
+    }
+
+    def __repr__(self):
+        return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value]))
+
+    def __eq__(self, other):
+        return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value)
+                 or (isinstance(other, (int, long)) and self.value == other ) )
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+AudioOutputChannel.Error=AudioOutputChannel(-1)
+AudioOutputChannel.Stereo=AudioOutputChannel(1)
+AudioOutputChannel.RStereo=AudioOutputChannel(2)
+AudioOutputChannel.Left=AudioOutputChannel(3)
+AudioOutputChannel.Right=AudioOutputChannel(4)
+AudioOutputChannel.Dolbys=AudioOutputChannel(5)
+
+class PositionOrigin(ctypes.c_ulong):
+    """A position may have different origins:
+ - absolute counts from the movie start
+ - relative counts from the current position
+ - modulo counts from the current position and wraps at the end of the movie
+
+    """
+    _names={
+        0: 'AbsolutePosition',
+        1: 'RelativePosition',
+        2: 'ModuloPosition',
+    }
+
+    def __repr__(self):
+        return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value]))
+
+    def __eq__(self, other):
+        return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value)
+                 or (isinstance(other, (int, long)) and self.value == other ) )
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+PositionOrigin.AbsolutePosition=PositionOrigin(0)
+PositionOrigin.RelativePosition=PositionOrigin(1)
+PositionOrigin.ModuloPosition=PositionOrigin(2)
+
+class PositionKey(ctypes.c_ulong):
+    """Units available in mediacontrol Positions
+ - ByteCount number of bytes
+ - SampleCount number of frames
+ - MediaTime time in milliseconds
+
+    """
+    _names={
+        0: 'ByteCount',
+        1: 'SampleCount',
+        2: 'MediaTime',
+    }
+
+    def __repr__(self):
+        return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value]))
+
+    def __eq__(self, other):
+        return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value)
+                 or (isinstance(other, (int, long)) and self.value == other ) )
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+PositionKey.ByteCount=PositionKey(0)
+PositionKey.SampleCount=PositionKey(1)
+PositionKey.MediaTime=PositionKey(2)
+
+class PlayerStatus(ctypes.c_ulong):
+    """Possible player status
+Note the order of these enums must match exactly the order of
+libvlc_state_t and input_state_e enums.
+
+    """
+    _names={
+        0: 'UndefinedStatus',
+        1: 'InitStatus',
+        2: 'BufferingStatus',
+        3: 'PlayingStatus',
+        4: 'PauseStatus',
+        5: 'StopStatus',
+        6: 'EndStatus',
+        7: 'ErrorStatus',
+    }
+
+    def __repr__(self):
+        return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value]))
+
+    def __eq__(self, other):
+        return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value)
+                 or (isinstance(other, (int, long)) and self.value == other ) )
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+PlayerStatus.UndefinedStatus=PlayerStatus(0)
+PlayerStatus.InitStatus=PlayerStatus(1)
+PlayerStatus.BufferingStatus=PlayerStatus(2)
+PlayerStatus.PlayingStatus=PlayerStatus(3)
+PlayerStatus.PauseStatus=PlayerStatus(4)
+PlayerStatus.StopStatus=PlayerStatus(5)
+PlayerStatus.EndStatus=PlayerStatus(6)
+PlayerStatus.ErrorStatus=PlayerStatus(7)
+
+
+#
+# End of generated enum types.
+#
+
+class ListPOINTER(object):
+    '''Just like a POINTER but accept a list of ctype as an argument.
+    '''
+    def __init__(self, etype):
+        self.etype = etype
+
+    def from_param(self, param):
+        if isinstance(param, (list, tuple)):
+            return (self.etype * len(param))(*param)
+
+class LibVLCException(Exception):
+    """Python exception raised by libvlc methods.
+    """
+    pass
+
+# From libvlc_structures.h
+
+# This is version-dependent, depending on the presence of libvlc_errmsg
+
+if hasattr(dll, 'libvlc_errmsg'):
+    # New-style message passing
+    class VLCException(ctypes.Structure):
+        """libvlc exception.
+        """
+        _fields_= [
+                    ('raised', ctypes.c_int),
+                    ]
+
+        @property
+        def message(self):
+            return dll.libvlc_errmsg()
+
+        def init(self):
+            libvlc_exception_init(self)
+
+        def clear(self):
+            libvlc_exception_clear(self)
+else:
+    # Old-style exceptions
+    class VLCException(ctypes.Structure):
+        """libvlc exception.
+        """
+        _fields_= [
+                    ('raised', ctypes.c_int),
+                    ('code', ctypes.c_int),
+                    ('message', ctypes.c_char_p),
+                    ]
+        def init(self):
+            libvlc_exception_init(self)
+
+        def clear(self):
+            libvlc_exception_clear(self)
+
+class PlaylistItem(ctypes.Structure):
+    _fields_= [
+                ('id', ctypes.c_int),
+                ('uri', ctypes.c_char_p),
+                ('name', ctypes.c_char_p),
+                ]
+
+    def __str__(self):
+        return "PlaylistItem #%d %s (%uri)" % (self.id, self.name, self.uri)
+
+class LogMessage(ctypes.Structure):
+    _fields_= [
+                ('size', ctypes.c_uint),
+                ('severity', ctypes.c_int),
+                ('type', ctypes.c_char_p),
+                ('name', ctypes.c_char_p),
+                ('header', ctypes.c_char_p),
+                ('message', ctypes.c_char_p),
+                ]
+
+    def __init__(self):
+        super(LogMessage, self).__init__()
+        self.size=ctypes.sizeof(self)
+
+    def __str__(self):
+        return "vlc.LogMessage(%d:%s): %s" % (self.severity, self.type, self.message)
+
+class MediaControlPosition(ctypes.Structure):
+    _fields_= [
+                ('origin', PositionOrigin),
+                ('key', PositionKey),
+                ('value', ctypes.c_longlong),
+                ]
+
+    def __init__(self, value=0, origin=None, key=None):
+        # We override the __init__ method so that instanciating the
+        # class with an int as parameter will create the appropriate
+        # default position (absolute position, media time, with the
+        # int as value).
+        super(MediaControlPosition, self).__init__()
+        self.value=value
+        if origin is None:
+            origin=PositionOrigin.AbsolutePosition
+        if key is None:
+            key=PositionKey.MediaTime
+        self.origin=origin
+        self.key=key
+
+    def __str__(self):
+        return "MediaControlPosition %ld (%s, %s)" % (
+            self.value,
+            str(self.origin),
+            str(self.key)
+            )
+
+    @staticmethod
+    def from_param(arg):
+        if isinstance(arg, (int, long)):
+            return MediaControlPosition(arg)
+        else:
+            return arg
+
+class MediaControlException(ctypes.Structure):
+    _fields_= [
+                ('code', ctypes.c_int),
+                ('message', ctypes.c_char_p),
+                ]
+    def init(self):
+        mediacontrol_exception_init(self)
+
+    def clear(self):
+        mediacontrol_exception_free(self)
+
+class MediaControlStreamInformation(ctypes.Structure):
+    _fields_= [
+                ('status', PlayerStatus),
+                ('url', ctypes.c_char_p),
+                ('position', ctypes.c_longlong),
+                ('length', ctypes.c_longlong),
+                ]
+
+    def __str__(self):
+        return "%s (%s) : %ld / %ld" % (self.url or "<No defined URL>",
+                                        str(self.status),
+                                        self.position,
+                                        self.length)
+
+class RGBPicture(ctypes.Structure):
+    _fields_= [
+                ('width', ctypes.c_int),
+                ('height', ctypes.c_int),
+                ('type', ctypes.c_uint32),
+                ('date', ctypes.c_ulonglong),
+                ('size', ctypes.c_int),
+                ('data_pointer', ctypes.c_void_p),
+                ]
+
+    @property
+    def data(self):
+        return ctypes.string_at(self.data_pointer, self.size)
+
+    def __str__(self):
+        return "RGBPicture (%d, %d) - %ld ms - %d bytes" % (self.width, self.height, self.date, self.size)
+
+    def free(self):
+        mediacontrol_RGBPicture__free(self)
+
+def check_vlc_exception(result, func, args):
+    """Error checking method for functions using an exception in/out parameter.
+    """
+    ex=args[-1]
+    if not isinstance(ex, (VLCException, MediaControlException)):
+        logging.warn("python-vlc: error when processing function %s. Please report this as a bug to vlc-devel@videolan.org" % str(func))
+        return result
+    # Take into account both VLCException and MediacontrolException:
+    c=getattr(ex, 'raised', getattr(ex, 'code', 0))
+    if c:
+        raise LibVLCException(ex.message)
+    return result
+
+### End of header.py ###
+class AudioOutput(object):
+
+    def __new__(cls, pointer=None):
+        '''Internal method used for instanciating wrappers from ctypes.
+        '''
+        if pointer is None:
+            raise Exception("Internal method. Surely this class cannot be instanciated by itself.")
+        if pointer == 0:
+            return None
+        else:
+            o=object.__new__(cls)
+            o._as_parameter_=ctypes.c_void_p(pointer)
+            return o
+
+
+    @staticmethod
+    def from_param(arg):
+        '''(INTERNAL) ctypes parameter conversion method.
+        '''
+        return arg._as_parameter_
+
+    if hasattr(dll, 'libvlc_audio_output_list_release'):
+        def list_release(self):
+            """Free the list of available audio outputs
+        """
+            return libvlc_audio_output_list_release(self)
+
+class EventManager(object):
+
+    def __new__(cls, pointer=None):
+        '''Internal method used for instanciating wrappers from ctypes.
+        '''
+        if pointer is None:
+            raise Exception("Internal method. Surely this class cannot be instanciated by itself.")
+        if pointer == 0:
+            return None
+        else:
+            o=object.__new__(cls)
+            o._as_parameter_=ctypes.c_void_p(pointer)
+            return o
+
+
+    @staticmethod
+    def from_param(arg):
+        '''(INTERNAL) ctypes parameter conversion method.
+        '''
+        return arg._as_parameter_
+
+    if hasattr(dll, 'libvlc_event_attach'):
+        def event_attach(self, i_event_type, f_callback, user_data):
+            """Register for an event notification.
+@param i_event_type: the desired event to which we want to listen
+@param f_callback: the function to call when i_event_type occurs
+@param user_data: user provided data to carry with the event
+        """
+            e=VLCException()
+            return libvlc_event_attach(self, i_event_type, f_callback, user_data, e)
+
+    if hasattr(dll, 'libvlc_event_detach'):
+        def event_detach(self, i_event_type, f_callback, p_user_data):
+            """Unregister an event notification.
+@param i_event_type: the desired event to which we want to unregister
+@param f_callback: the function to call when i_event_type occurs
+@param p_user_data: user provided data to carry with the event
+        """
+            e=VLCException()
+            return libvlc_event_detach(self, i_event_type, f_callback, p_user_data, e)
+
+class Instance(object):
+    """Create a new Instance instance.
+
+    It may take as parameter either:
+      - a string
+      - a list of strings as first parameters
+      - the parameters given as the constructor parameters (must be strings)
+      - a MediaControl instance
+
+    """
+
+    @staticmethod
+    def from_param(arg):
+        '''(INTERNAL) ctypes parameter conversion method.
+        '''
+        return arg._as_parameter_
+
+
+    def __new__(cls, *p):
+        if p and p[0] == 0:
+            return None
+        elif p and isinstance(p[0], (int, long)):
+            # instance creation from ctypes
+            o=object.__new__(cls)
+            o._as_parameter_=ctypes.c_void_p(p[0])
+            return o
+        elif len(p) == 1 and isinstance(p[0], basestring):
+            # Only 1 string parameter: should be a parameter line
+            p=p[0].split(' ')
+        elif len(p) == 1 and isinstance(p[0], (tuple, list)):
+            p=p[0]
+
+        if p and isinstance(p[0], MediaControl):
+            return p[0].get_instance()
+        else:
+            if not p and detected_plugin_path is not None:
+                # No parameters passed. Under win32 and MacOS, specify
+                # the detected_plugin_path if present.
+                p=[ 'vlc', '--plugin-path='+ detected_plugin_path ]
+            e=VLCException()
+            return libvlc_new(len(p), p, e)
+
+    def media_player_new(self, uri=None):
+        """Create a new Media Player object.
+
+        @param uri: an optional URI to play in the player.
+        """
+        e=VLCException()
+        p=libvlc_media_player_new(self, e)
+        if uri:
+            p.set_media(self.media_new(uri))
+        p._instance=self
+        return p
+
+    def media_list_player_new(self):
+        """Create an empty Media Player object
+        """
+        e=VLCException()
+        p=libvlc_media_list_player_new(self, e)
+        p._instance=self
+        return p
+
+
+    if hasattr(dll, 'libvlc_get_vlc_id'):
+        def get_vlc_id(self):
+            """Return a libvlc instance identifier for legacy APIs. Use of this
+function is discouraged, you should convert your program to use the
+new API.
+@return: the instance identifier
+        """
+            return libvlc_get_vlc_id(self)
+
+    if hasattr(dll, 'libvlc_release'):
+        def release(self):
+            """Decrement the reference count of a libvlc instance, and destroy it
+if it reaches zero.
+        """
+            return libvlc_release(self)
+
+    if hasattr(dll, 'libvlc_retain'):
+        def retain(self):
+            """Increments the reference count of a libvlc instance.
+The initial reference count is 1 after libvlc_new() returns.
+        """
+            return libvlc_retain(self)
+
+    if hasattr(dll, 'libvlc_add_intf'):
+        def add_intf(self, name):
+            """Try to start a user interface for the libvlc instance.
+@param name: interface name, or NULL for default
+        """
+            e=VLCException()
+            return libvlc_add_intf(self, name, e)
+
+    if hasattr(dll, 'libvlc_wait'):
+        def wait(self):
+            """Waits until an interface causes the instance to exit.
+You should start at least one interface first, using libvlc_add_intf().
+        """
+            return libvlc_wait(self)
+
+    if hasattr(dll, 'libvlc_get_log_verbosity'):
+        def get_log_verbosity(self):
+            """Return the VLC messaging verbosity level.
+@return: verbosity level for messages
+        """
+            e=VLCException()
+            return libvlc_get_log_verbosity(self, e)
+
+    if hasattr(dll, 'libvlc_set_log_verbosity'):
+        def set_log_verbosity(self, level):
+            """Set the VLC messaging verbosity level.
+@param level: log level
+        """
+            e=VLCException()
+            return libvlc_set_log_verbosity(self, level, e)
+
+    if hasattr(dll, 'libvlc_log_open'):
+        def log_open(self):
+            """Open a VLC message log instance.
+@return: log message instance
+        """
+            e=VLCException()
+            return libvlc_log_open(self, e)
+
+    if hasattr(dll, 'libvlc_media_new'):
+        def media_new(self, psz_mrl):
+            """Create a media with the given MRL.
+@param psz_mrl: the MRL to read
+@return: the newly created media
+        """
+            e=VLCException()
+            return libvlc_media_new(self, psz_mrl, e)
+
+    if hasattr(dll, 'libvlc_media_new_as_node'):
+        def media_new_as_node(self, psz_name):
+            """Create a media as an empty node with the passed name.
+@param psz_name: the name of the node
+@return: the new empty media
+        """
+            e=VLCException()
+            return libvlc_media_new_as_node(self, psz_name, e)
+
+    if hasattr(dll, 'libvlc_media_discoverer_new_from_name'):
+        def media_discoverer_new_from_name(self, psz_name):
+            """Discover media service by name.
+@param psz_name: service name
+@return: media discover object
+        """
+            e=VLCException()
+            return libvlc_media_discoverer_new_from_name(self, psz_name, e)
+
+    if hasattr(dll, 'libvlc_media_library_new'):
+        def media_library_new(self):
+            """\ingroup libvlc
+LibVLC Media Library
+
+        """
+            e=VLCException()
+            return libvlc_media_library_new(self, e)
+
+    if hasattr(dll, 'libvlc_media_list_new'):
+        def media_list_new(self):
+            """Create an empty media list.
+@return: empty media list
+        """
+            e=VLCException()
+            return libvlc_media_list_new(self, e)
+
+    if hasattr(dll, 'libvlc_audio_output_list_get'):
+        def audio_output_list_get(self):
+            """Get the list of available audio outputs
+@return: list of available audio outputs, at the end free it with
+        """
+            e=VLCException()
+            return libvlc_audio_output_list_get(self, e)
+
+    if hasattr(dll, 'libvlc_audio_output_set'):
+        def audio_output_set(self, psz_name):
+            """Set the audio output.
+Change will be applied after stop and play.
+@return: true if function succeded
+        """
+            return libvlc_audio_output_set(self, psz_name)
+
+    if hasattr(dll, 'libvlc_audio_output_device_count'):
+        def audio_output_device_count(self, psz_audio_output):
+            """Get count of devices for audio output, these devices are hardware oriented
+like analor or digital output of sound card
+@return: number of devices
+        """
+            return libvlc_audio_output_device_count(self, psz_audio_output)
+
+    if hasattr(dll, 'libvlc_audio_output_device_longname'):
+        def audio_output_device_longname(self, psz_audio_output, i_device):
+            """Get long name of device, if not available short name given
+@param psz_audio_output: - name of audio output, \see libvlc_audio_output_t
+@return: long name of device
+        """
+            return libvlc_audio_output_device_longname(self, psz_audio_output, i_device)
+
+    if hasattr(dll, 'libvlc_audio_output_device_id'):
+        def audio_output_device_id(self, psz_audio_output, i_device):
+            """Get id name of device
+@param psz_audio_output: - name of audio output, \see libvlc_audio_output_t
+@return: id name of device, use for setting device, need to be free after use
+        """
+            return libvlc_audio_output_device_id(self, psz_audio_output, i_device)
+
+    if hasattr(dll, 'libvlc_audio_output_device_set'):
+        def audio_output_device_set(self, psz_audio_output, psz_device_id):
+            """Set device for using
+@param psz_audio_output: - name of audio output, \see libvlc_audio_output_t
+        """
+            return libvlc_audio_output_device_set(self, psz_audio_output, psz_device_id)
+
+    if hasattr(dll, 'libvlc_audio_output_get_device_type'):
+        def audio_output_get_device_type(self):
+            """Get current audio device type. Device type describes something like
+character of output sound - stereo sound, 2.1, 5.1 etc
+@return: the audio devices type \see libvlc_audio_output_device_types_t
+        """
+            e=VLCException()
+            return libvlc_audio_output_get_device_type(self, e)
+
+    if hasattr(dll, 'libvlc_audio_output_set_device_type'):
+        def audio_output_set_device_type(self, device_type):
+            """Set current audio device type.
+@param device_type: the audio device type,
+        """
+            e=VLCException()
+            return libvlc_audio_output_set_device_type(self, device_type, e)
+
+    if hasattr(dll, 'libvlc_audio_toggle_mute'):
+        def audio_toggle_mute(self):
+            """Toggle mute status.
+        """
+            e=VLCException()
+            return libvlc_audio_toggle_mute(self, e)
+
+    if hasattr(dll, 'libvlc_audio_get_mute'):
+        def audio_get_mute(self):
+            """Get current mute status.
+@return: the mute status (boolean)
+        """
+            e=VLCException()
+            return libvlc_audio_get_mute(self, e)
+
+    if hasattr(dll, 'libvlc_audio_set_mute'):
+        def audio_set_mute(self, status):
+            """Set mute status.
+@param status: If status is true then mute, otherwise unmute
+        """
+            e=VLCException()
+            return libvlc_audio_set_mute(self, status, e)
+
+    if hasattr(dll, 'libvlc_audio_get_volume'):
+        def audio_get_volume(self):
+            """Get current audio level.
+@return: the audio level (int)
+        """
+            e=VLCException()
+            return libvlc_audio_get_volume(self, e)
+
+    if hasattr(dll, 'libvlc_audio_set_volume'):
+        def audio_set_volume(self, i_volume):
+            """Set current audio level.
+@param i_volume: the volume (int)
+        """
+            e=VLCException()
+            return libvlc_audio_set_volume(self, i_volume, e)
+
+    if hasattr(dll, 'libvlc_audio_get_channel'):
+        def audio_get_channel(self):
+            """Get current audio channel.
+@return: the audio channel \see libvlc_audio_output_channel_t
+        """
+            e=VLCException()
+            return libvlc_audio_get_channel(self, e)
+
+    if hasattr(dll, 'libvlc_audio_set_channel'):
+        def audio_set_channel(self, channel):
+            """Set current audio channel.
+@param channel: the audio channel, \see libvlc_audio_output_channel_t
+        """
+            e=VLCException()
+            return libvlc_audio_set_channel(self, channel, e)
+
+    if hasattr(dll, 'libvlc_vlm_release'):
+        def vlm_release(self):
+            """Release the vlm instance related to the given libvlc_instance_t
+        """
+            e=VLCException()
+            return libvlc_vlm_release(self, e)
+
+    if hasattr(dll, 'libvlc_vlm_add_broadcast'):
+        def vlm_add_broadcast(self, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop):
+            """Add a broadcast, with one input.
+@param psz_name: the name of the new broadcast
+@param psz_input: the input MRL
+@param psz_output: the output MRL (the parameter to the "sout" variable)
+@param i_options: number of additional options
+@param ppsz_options: additional options
+@param b_enabled: boolean for enabling the new broadcast
+@param b_loop: Should this broadcast be played in loop ?
+        """
+            e=VLCException()
+            return libvlc_vlm_add_broadcast(self, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop, e)
+
+    if hasattr(dll, 'libvlc_vlm_add_vod'):
+        def vlm_add_vod(self, psz_name, psz_input, i_options, ppsz_options, b_enabled, psz_mux):
+            """Add a vod, with one input.
+@param psz_name: the name of the new vod media
+@param psz_input: the input MRL
+@param i_options: number of additional options
+@param ppsz_options: additional options
+@param b_enabled: boolean for enabling the new vod
+@param psz_mux: the muxer of the vod media
+        """
+            e=VLCException()
+            return libvlc_vlm_add_vod(self, psz_name, psz_input, i_options, ppsz_options, b_enabled, psz_mux, e)
+
+    if hasattr(dll, 'libvlc_vlm_del_media'):
+        def vlm_del_media(self, psz_name):
+            """Delete a media (VOD or broadcast).
+@param psz_name: the media to delete
+        """
+            e=VLCException()
+            return libvlc_vlm_del_media(self, psz_name, e)
+
+    if hasattr(dll, 'libvlc_vlm_set_enabled'):
+        def vlm_set_enabled(self, psz_name, b_enabled):
+            """Enable or disable a media (VOD or broadcast).
+@param psz_name: the media to work on
+@param b_enabled: the new status
+        """
+            e=VLCException()
+            return libvlc_vlm_set_enabled(self, psz_name, b_enabled, e)
+
+    if hasattr(dll, 'libvlc_vlm_set_output'):
+        def vlm_set_output(self, psz_name, psz_output):
+            """Set the output for a media.
+@param psz_name: the media to work on
+@param psz_output: the output MRL (the parameter to the "sout" variable)
+        """
+            e=VLCException()
+            return libvlc_vlm_set_output(self, psz_name, psz_output, e)
+
+    if hasattr(dll, 'libvlc_vlm_set_input'):
+        def vlm_set_input(self, psz_name, psz_input):
+            """Set a media's input MRL. This will delete all existing inputs and
+add the specified one.
+@param psz_name: the media to work on
+@param psz_input: the input MRL
+        """
+            e=VLCException()
+            return libvlc_vlm_set_input(self, psz_name, psz_input, e)
+
+    if hasattr(dll, 'libvlc_vlm_add_input'):
+        def vlm_add_input(self, psz_name, psz_input):
+            """Add a media's input MRL. This will add the specified one.
+@param psz_name: the media to work on
+@param psz_input: the input MRL
+        """
+            e=VLCException()
+            return libvlc_vlm_add_input(self, psz_name, psz_input, e)
+
+    if hasattr(dll, 'libvlc_vlm_set_loop'):
+        def vlm_set_loop(self, psz_name, b_loop):
+            """Set a media's loop status.
+@param psz_name: the media to work on
+@param b_loop: the new status
+        """
+            e=VLCException()
+            return libvlc_vlm_set_loop(self, psz_name, b_loop, e)
+
+    if hasattr(dll, 'libvlc_vlm_set_mux'):
+        def vlm_set_mux(self, psz_name, psz_mux):
+            """Set a media's vod muxer.
+@param psz_name: the media to work on
+@param psz_mux: the new muxer
+        """
+            e=VLCException()
+            return libvlc_vlm_set_mux(self, psz_name, psz_mux, e)
+
+    if hasattr(dll, 'libvlc_vlm_change_media'):
+        def vlm_change_media(self, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop):
+            """Edit the parameters of a media. This will delete all existing inputs and
+add the specified one.
+@param psz_name: the name of the new broadcast
+@param psz_input: the input MRL
+@param psz_output: the output MRL (the parameter to the "sout" variable)
+@param i_options: number of additional options
+@param ppsz_options: additional options
+@param b_enabled: boolean for enabling the new broadcast
+@param b_loop: Should this broadcast be played in loop ?
+        """
+            e=VLCException()
+            return libvlc_vlm_change_media(self, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop, e)
+
+    if hasattr(dll, 'libvlc_vlm_play_media'):
+        def vlm_play_media(self, psz_name):
+            """Play the named broadcast.
+@param psz_name: the name of the broadcast
+        """
+            e=VLCException()
+            return libvlc_vlm_play_media(self, psz_name, e)
+
+    if hasattr(dll, 'libvlc_vlm_stop_media'):
+        def vlm_stop_media(self, psz_name):
+            """Stop the named broadcast.
+@param psz_name: the name of the broadcast
+        """
+            e=VLCException()
+            return libvlc_vlm_stop_media(self, psz_name, e)
+
+    if hasattr(dll, 'libvlc_vlm_pause_media'):
+        def vlm_pause_media(self, psz_name):
+            """Pause the named broadcast.
+@param psz_name: the name of the broadcast
+        """
+            e=VLCException()
+            return libvlc_vlm_pause_media(self, psz_name, e)
+
+    if hasattr(dll, 'libvlc_vlm_seek_media'):
+        def vlm_seek_media(self, psz_name, f_percentage):
+            """Seek in the named broadcast.
+@param psz_name: the name of the broadcast
+@param f_percentage: the percentage to seek to
+        """
+            e=VLCException()
+            return libvlc_vlm_seek_media(self, psz_name, f_percentage, e)
+
+    if hasattr(dll, 'libvlc_vlm_show_media'):
+        def vlm_show_media(self, psz_name):
+            """Return information about the named broadcast.
+\bug will always return NULL
+@param psz_name: the name of the broadcast
+@return: string with information about named media
+        """
+            e=VLCException()
+            return libvlc_vlm_show_media(self, psz_name, e)
+
+    if hasattr(dll, 'libvlc_vlm_get_media_instance_position'):
+        def vlm_get_media_instance_position(self, psz_name, i_instance):
+            """Get vlm_media instance position by name or instance id
+@param psz_name: name of vlm media instance
+@param i_instance: instance id
+@return: position as float
+        """
+            e=VLCException()
+            return libvlc_vlm_get_media_instance_position(self, psz_name, i_instance, e)
+
+    if hasattr(dll, 'libvlc_vlm_get_media_instance_time'):
+        def vlm_get_media_instance_time(self, psz_name, i_instance):
+            """Get vlm_media instance time by name or instance id
+@param psz_name: name of vlm media instance
+@param i_instance: instance id
+@return: time as integer
+        """
+            e=VLCException()
+            return libvlc_vlm_get_media_instance_time(self, psz_name, i_instance, e)
+
+    if hasattr(dll, 'libvlc_vlm_get_media_instance_length'):
+        def vlm_get_media_instance_length(self, psz_name, i_instance):
+            """Get vlm_media instance length by name or instance id
+@param psz_name: name of vlm media instance
+@param i_instance: instance id
+@return: length of media item
+        """
+            e=VLCException()
+            return libvlc_vlm_get_media_instance_length(self, psz_name, i_instance, e)
+
+    if hasattr(dll, 'libvlc_vlm_get_media_instance_rate'):
+        def vlm_get_media_instance_rate(self, psz_name, i_instance):
+            """Get vlm_media instance playback rate by name or instance id
+@param psz_name: name of vlm media instance
+@param i_instance: instance id
+@return: playback rate
+        """
+            e=VLCException()
+            return libvlc_vlm_get_media_instance_rate(self, psz_name, i_instance, e)
+
+    if hasattr(dll, 'libvlc_vlm_get_media_instance_title'):
+        def vlm_get_media_instance_title(self, psz_name, i_instance):
+            """Get vlm_media instance title number by name or instance id
+\bug will always return 0
+@param psz_name: name of vlm media instance
+@param i_instance: instance id
+@return: title as number
+        """
+            e=VLCException()
+            return libvlc_vlm_get_media_instance_title(self, psz_name, i_instance, e)
+
+    if hasattr(dll, 'libvlc_vlm_get_media_instance_chapter'):
+        def vlm_get_media_instance_chapter(self, psz_name, i_instance):
+            """Get vlm_media instance chapter number by name or instance id
+\bug will always return 0
+@param psz_name: name of vlm media instance
+@param i_instance: instance id
+@return: chapter as number
+        """
+            e=VLCException()
+            return libvlc_vlm_get_media_instance_chapter(self, psz_name, i_instance, e)
+
+    if hasattr(dll, 'libvlc_vlm_get_media_instance_seekable'):
+        def vlm_get_media_instance_seekable(self, psz_name, i_instance):
+            """Is libvlc instance seekable ?
+\bug will always return 0
+@param psz_name: name of vlm media instance
+@param i_instance: instance id
+@return: 1 if seekable, 0 if not
+        """
+            e=VLCException()
+            return libvlc_vlm_get_media_instance_seekable(self, psz_name, i_instance, e)
+
+    if hasattr(dll, 'mediacontrol_new_from_instance'):
+        def mediacontrol_new_from_instance(self):
+            """Create a MediaControl instance from an existing libvlc instance
+@return: a mediacontrol_Instance
+        """
+            e=MediaControlException()
+            return mediacontrol_new_from_instance(self, e)
+
+class Log(object):
+
+    def __new__(cls, pointer=None):
+        '''Internal method used for instanciating wrappers from ctypes.
+        '''
+        if pointer is None:
+            raise Exception("Internal method. Surely this class cannot be instanciated by itself.")
+        if pointer == 0:
+            return None
+        else:
+            o=object.__new__(cls)
+            o._as_parameter_=ctypes.c_void_p(pointer)
+            return o
+
+
+    @staticmethod
+    def from_param(arg):
+        '''(INTERNAL) ctypes parameter conversion method.
+        '''
+        return arg._as_parameter_
+
+    def __iter__(self):
+        return self.get_iterator()
+
+    def dump(self):
+        return [ str(m) for m in self ]
+
+    if hasattr(dll, 'libvlc_log_close'):
+        def close(self):
+            """Close a VLC message log instance.
+        """
+            e=VLCException()
+            return libvlc_log_close(self, e)
+
+    if hasattr(dll, 'libvlc_log_count'):
+        def count(self):
+            """Returns the number of messages in a log instance.
+@return: number of log messages
+        """
+            e=VLCException()
+            return libvlc_log_count(self, e)
+
+    def __len__(self):
+        e=VLCException()
+        return libvlc_log_count(self, e)
+
+    if hasattr(dll, 'libvlc_log_clear'):
+        def clear(self):
+            """Clear a log instance.
+All messages in the log are removed. The log should be cleared on a
+regular basis to avoid clogging.
+        """
+            e=VLCException()
+            return libvlc_log_clear(self, e)
+
+    if hasattr(dll, 'libvlc_log_get_iterator'):
+        def get_iterator(self):
+            """Allocate and returns a new iterator to messages in log.
+@return: log iterator object
+        """
+            e=VLCException()
+            return libvlc_log_get_iterator(self, e)
+
+class LogIterator(object):
+
+    def __new__(cls, pointer=None):
+        '''Internal method used for instanciating wrappers from ctypes.
+        '''
+        if pointer is None:
+            raise Exception("Internal method. Surely this class cannot be instanciated by itself.")
+        if pointer == 0:
+            return None
+        else:
+            o=object.__new__(cls)
+            o._as_parameter_=ctypes.c_void_p(pointer)
+            return o
+
+
+    @staticmethod
+    def from_param(arg):
+        '''(INTERNAL) ctypes parameter conversion method.
+        '''
+        return arg._as_parameter_
+
+    def __iter__(self):
+        return self
+
+    def next(self):
+        if not self.has_next():
+            raise StopIteration
+        buf=LogMessage()
+        e=VLCException()
+        ret=libvlc_log_iterator_next(self, buf, e)
+        return ret.contents
+
+
+    if hasattr(dll, 'libvlc_log_iterator_free'):
+        def free(self):
+            """Release a previoulsy allocated iterator.
+        """
+            e=VLCException()
+            return libvlc_log_iterator_free(self, e)
+
+    if hasattr(dll, 'libvlc_log_iterator_has_next'):
+        def has_next(self):
+            """Return whether log iterator has more messages.
+@return: true if iterator has more message objects, else false
+        """
+            e=VLCException()
+            return libvlc_log_iterator_has_next(self, e)
+
+class Media(object):
+
+    def __new__(cls, pointer=None):
+        '''Internal method used for instanciating wrappers from ctypes.
+        '''
+        if pointer is None:
+            raise Exception("Internal method. Surely this class cannot be instanciated by itself.")
+        if pointer == 0:
+            return None
+        else:
+            o=object.__new__(cls)
+            o._as_parameter_=ctypes.c_void_p(pointer)
+            return o
+
+
+    @staticmethod
+    def from_param(arg):
+        '''(INTERNAL) ctypes parameter conversion method.
+        '''
+        return arg._as_parameter_
+
+    if hasattr(dll, 'libvlc_media_add_option'):
+        def add_option(self, ppsz_options):
+            """Add an option to the media.
+This option will be used to determine how the media_player will
+read the media. This allows to use VLC's advanced
+reading/streaming options on a per-media basis.
+The options are detailed in vlc --long-help, for instance "--sout-all"
+@param ppsz_options: the options (as a string)
+        """
+            e=VLCException()
+            return libvlc_media_add_option(self, ppsz_options, e)
+
+    if hasattr(dll, 'libvlc_media_add_option_untrusted'):
+        def add_option_untrusted(self, ppsz_options):
+            """Add an option to the media from an untrusted source.
+This option will be used to determine how the media_player will
+read the media. This allows to use VLC's advanced
+reading/streaming options on a per-media basis.
+The options are detailed in vlc --long-help, for instance "--sout-all"
+@param ppsz_options: the options (as a string)
+        """
+            e=VLCException()
+            return libvlc_media_add_option_untrusted(self, ppsz_options, e)
+
+    if hasattr(dll, 'libvlc_media_retain'):
+        def retain(self):
+            """Retain a reference to a media descriptor object (libvlc_media_t). Use
+libvlc_media_release() to decrement the reference count of a
+media descriptor object.
+        """
+            return libvlc_media_retain(self)
+
+    if hasattr(dll, 'libvlc_media_release'):
+        def release(self):
+            """Decrement the reference count of a media descriptor object. If the
+reference count is 0, then libvlc_media_release() will release the
+media descriptor object. It will send out an libvlc_MediaFreed event
+to all listeners. If the media descriptor object has been released it
+should not be used again.
+        """
+            return libvlc_media_release(self)
+
+    if hasattr(dll, 'libvlc_media_get_mrl'):
+        def get_mrl(self):
+            """Get the media resource locator (mrl) from a media descriptor object
+@return: string with mrl of media descriptor object
+        """
+            e=VLCException()
+            return libvlc_media_get_mrl(self, e)
+
+    if hasattr(dll, 'libvlc_media_duplicate'):
+        def duplicate(self):
+            """Duplicate a media descriptor object.
+        """
+            return libvlc_media_duplicate(self)
+
+    if hasattr(dll, 'libvlc_media_get_meta'):
+        def get_meta(self, e_meta):
+            """Read the meta of the media.
+@param e_meta_desc: the meta to read
+@return: the media's meta
+        """
+            e=VLCException()
+            return libvlc_media_get_meta(self, e_meta, e)
+
+    if hasattr(dll, 'libvlc_media_get_state'):
+        def get_state(self):
+            """Get current state of media descriptor object. Possible media states
+are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
+libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
+libvlc_Stopped, libvlc_Ended,
+libvlc_Error).
+See libvlc_state_t
+@return: state of media descriptor object
+        """
+            e=VLCException()
+            return libvlc_media_get_state(self, e)
+
+    if hasattr(dll, 'libvlc_media_subitems'):
+        def subitems(self):
+            """Get subitems of media descriptor object. This will increment
+the reference count of supplied media descriptor object. Use
+libvlc_media_list_release() to decrement the reference counting.
+@return: list of media descriptor subitems or NULL
+        """
+            e=VLCException()
+            return libvlc_media_subitems(self, e)
+
+    if hasattr(dll, 'libvlc_media_event_manager'):
+        def event_manager(self):
+            """Get event manager from media descriptor object.
+NOTE: this function doesn't increment reference counting.
+@return: event manager object
+        """
+            e=VLCException()
+            return libvlc_media_event_manager(self, e)
+
+    if hasattr(dll, 'libvlc_media_get_duration'):
+        def get_duration(self):
+            """Get duration of media descriptor object item.
+@return: duration of media item
+        """
+            e=VLCException()
+            return libvlc_media_get_duration(self, e)
+
+    if hasattr(dll, 'libvlc_media_is_preparsed'):
+        def is_preparsed(self):
+            """Get preparsed status for media descriptor object.
+@return: true if media object has been preparsed otherwise it returns false
+        """
+            e=VLCException()
+            return libvlc_media_is_preparsed(self, e)
+
+    if hasattr(dll, 'libvlc_media_set_user_data'):
+        def set_user_data(self, p_new_user_data):
+            """Sets media descriptor's user_data. user_data is specialized data
+accessed by the host application, VLC.framework uses it as a pointer to
+an native object that references a libvlc_media_t pointer
+@param p_new_user_data: pointer to user data
+        """
+            e=VLCException()
+            return libvlc_media_set_user_data(self, p_new_user_data, e)
+
+    if hasattr(dll, 'libvlc_media_get_user_data'):
+        def get_user_data(self):
+            """Get media descriptor's user_data. user_data is specialized data
+accessed by the host application, VLC.framework uses it as a pointer to
+an native object that references a libvlc_media_t pointer
+        """
+            e=VLCException()
+            return libvlc_media_get_user_data(self, e)
+
+    if hasattr(dll, 'libvlc_media_player_new_from_media'):
+        def player_new_from_media(self):
+            """Create a Media Player object from a Media
+        """
+            e=VLCException()
+            return libvlc_media_player_new_from_media(self, e)
+
+class MediaControl(object):
+    """Create a new MediaControl instance
+
+    It may take as parameter either:
+      - a string
+      - a list of strings as first parameters
+      - the parameters given as the constructor parameters (must be strings)
+      - a vlc.Instance
+
+    """
+
+    @staticmethod
+    def from_param(arg):
+        '''(INTERNAL) ctypes parameter conversion method.
+        '''
+        return arg._as_parameter_
+
+
+    def __new__(cls, *p):
+        if p and p[0] == 0:
+            return None
+        elif p and isinstance(p[0], (int, long)):
+            # instance creation from ctypes
+            o=object.__new__(cls)
+            o._as_parameter_=ctypes.c_void_p(p[0])
+            return o
+        elif len(p) == 1 and isinstance(p[0], basestring):
+            # Only 1 string parameter: should be a parameter line
+            p=p[0].split(' ')
+        elif len(p) == 1 and isinstance(p[0], (tuple, list)):
+            p=p[0]
+
+        if p and isinstance(p[0], Instance):
+            e=MediaControlException()
+            return mediacontrol_new_from_instance(p[0], e)
+        else:
+            if not p and detected_plugin_path is not None:
+                # No parameters passed. Under win32 and MacOS, specify
+                # the detected_plugin_path if present.
+                p=[ 'vlc', '--plugin-path='+ detected_plugin_path ]
+            e=MediaControlException()
+            return mediacontrol_new(len(p), p, e)
+
+    def get_media_position(self, origin=PositionOrigin.AbsolutePosition, key=PositionKey.MediaTime):
+        e=MediaControlException()
+        p=mediacontrol_get_media_position(self, origin, key, e)
+        if p:
+            return p.contents
+        else:
+            return None
+
+    def set_media_position(self, pos):
+        """Set the media position.
+
+        @param pos: a MediaControlPosition or an integer (in ms)
+        """
+        if not isinstance(pos, MediaControlPosition):
+            pos=MediaControlPosition(long(pos))
+        e=MediaControlException()
+        mediacontrol_set_media_position(self, pos, e)
+
+    def start(self, pos=0):
+        """Start the player at the given position.
+
+        @param pos: a MediaControlPosition or an integer (in ms)
+        """
+        if not isinstance(pos, MediaControlPosition):
+            pos=MediaControlPosition(long(pos))
+        e=MediaControlException()
+        mediacontrol_start(self, pos, e)
+
+    def snapshot(self, pos=0):
+        """Take a snapshot.
+
+        Note: the position parameter is not properly implemented. For
+        the moment, the only valid position is the 0-relative position
+        (i.e. the current position).
+
+        @param pos: a MediaControlPosition or an integer (in ms)
+        """
+        if not isinstance(pos, MediaControlPosition):
+            pos=MediaControlPosition(long(pos))
+        e=MediaControlException()
+        p=mediacontrol_snapshot(self, pos, e)
+        if p:
+            snap=p.contents
+            # FIXME: there is a bug in the current mediacontrol_snapshot
+            # implementation, which sets an incorrect date.
+            # Workaround here:
+            snap.date=self.get_media_position().value
+            return snap
+        else:
+            return None
+
+    def display_text(self, message='', begin=0, end=1000):
+        """Display a caption between begin and end positions.
+
+        @param message: the caption to display
+        @param begin: the begin position
+        @param end: the end position
+        """
+        if not isinstance(begin, MediaControlPosition):
+            begin=self.value2position(begin)
+        if not isinstance(end, MediaControlPosition):
+            end=self.value2position(end)
+        e=MediaControlException()
+        mediacontrol_display_text(self, message, begin, end, e)
+
+    def get_stream_information(self, key=PositionKey.MediaTime):
+        """Return information about the stream.
+        """
+        e=MediaControlException()
+        return mediacontrol_get_stream_information(self, key, e).contents
+
+
+    if hasattr(dll, 'mediacontrol_get_libvlc_instance'):
+        def get_instance(self):
+            """Get the associated libvlc instance
+@return: a libvlc instance
+        """
+            return mediacontrol_get_libvlc_instance(self)
+
+    if hasattr(dll, 'mediacontrol_get_media_player'):
+        def get_media_player(self):
+            """Get the associated libvlc_media_player
+@return: a libvlc_media_player_t instance
+        """
+            return mediacontrol_get_media_player(self)
+
+    if hasattr(dll, 'mediacontrol_pause'):
+        def pause(self):
+            """Pause the movie at a given position
+        """
+            e=MediaControlException()
+            return mediacontrol_pause(self, e)
+
+    if hasattr(dll, 'mediacontrol_resume'):
+        def resume(self):
+            """Resume the movie at a given position
+        """
+            e=MediaControlException()
+            return mediacontrol_resume(self, e)
+
+    if hasattr(dll, 'mediacontrol_stop'):
+        def stop(self):
+            """Stop the movie at a given position
+        """
+            e=MediaControlException()
+            return mediacontrol_stop(self, e)
+
+    if hasattr(dll, 'mediacontrol_exit'):
+        def exit(self):
+            """Exit the player
+        """
+            return mediacontrol_exit(self)
+
+    if hasattr(dll, 'mediacontrol_set_mrl'):
+        def set_mrl(self, psz_file):
+            """Set the MRL to be played.
+@param psz_file: the MRL
+        """
+            e=MediaControlException()
+            return mediacontrol_set_mrl(self, psz_file, e)
+
+    if hasattr(dll, 'mediacontrol_get_mrl'):
+        def get_mrl(self):
+            """Get the MRL to be played.
+        """
+            e=MediaControlException()
+            return mediacontrol_get_mrl(self, e)
+
+    if hasattr(dll, 'mediacontrol_sound_get_volume'):
+        def sound_get_volume(self):
+            """Get the current audio level, normalized in [0..100]
+@return: the volume
+        """
+            e=MediaControlException()
+            return mediacontrol_sound_get_volume(self, e)
+
+    if hasattr(dll, 'mediacontrol_sound_set_volume'):
+        def sound_set_volume(self, volume):
+            """Set the audio level
+@param volume: the volume (normalized in [0..100])
+        """
+            e=MediaControlException()
+            return mediacontrol_sound_set_volume(self, volume, e)
+
+    if hasattr(dll, 'mediacontrol_set_visual'):
+        def set_visual(self, visual_id):
+            """Set the video output window
+@param visual_id: the Xid or HWND, depending on the platform
+        """
+            e=MediaControlException()
+            return mediacontrol_set_visual(self, visual_id, e)
+
+    if hasattr(dll, 'mediacontrol_get_rate'):
+        def get_rate(self):
+            """Get the current playing rate, in percent
+@return: the rate
+        """
+            e=MediaControlException()
+            return mediacontrol_get_rate(self, e)
+
+    if hasattr(dll, 'mediacontrol_set_rate'):
+        def set_rate(self, rate):
+            """Set the playing rate, in percent
+@param rate: the desired rate
+        """
+            e=MediaControlException()
+            return mediacontrol_set_rate(self, rate, e)
+
+    if hasattr(dll, 'mediacontrol_get_fullscreen'):
+        def get_fullscreen(self):
+            """Get current fullscreen status
+@return: the fullscreen status
+        """
+            e=MediaControlException()
+            return mediacontrol_get_fullscreen(self, e)
+
+    if hasattr(dll, 'mediacontrol_set_fullscreen'):
+        def set_fullscreen(self, b_fullscreen):
+            """Set fullscreen status
+@param b_fullscreen: the desired status
+        """
+            e=MediaControlException()
+            return mediacontrol_set_fullscreen(self, b_fullscreen, e)
+
+class MediaDiscoverer(object):
+
+    def __new__(cls, pointer=None):
+        '''Internal method used for instanciating wrappers from ctypes.
+        '''
+        if pointer is None:
+            raise Exception("Internal method. Surely this class cannot be instanciated by itself.")
+        if pointer == 0:
+            return None
+        else:
+            o=object.__new__(cls)
+            o._as_parameter_=ctypes.c_void_p(pointer)
+            return o
+
+
+    @staticmethod
+    def from_param(arg):
+        '''(INTERNAL) ctypes parameter conversion method.
+        '''
+        return arg._as_parameter_
+
+    if hasattr(dll, 'libvlc_media_discoverer_release'):
+        def release(self):
+            """Release media discover object. If the reference count reaches 0, then
+the object will be released.
+        """
+            return libvlc_media_discoverer_release(self)
+
+    if hasattr(dll, 'libvlc_media_discoverer_localized_name'):
+        def localized_name(self):
+            """Get media service discover object its localized name.
+@return: localized name
+        """
+            return libvlc_media_discoverer_localized_name(self)