]> git.sesse.net Git - vlc/blobdiff - bindings/python-ctypes/header.py
python-ctypes: implement support for callbacks
[vlc] / bindings / python-ctypes / header.py
index 6684d12e41e7199569d2909073215dcb0dfe81ff..840bb331e4cd9a6d86a6bf4e1a6ba05c3aa0f2c2 100755 (executable)
 # 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 ctypes
 import sys
 
@@ -75,6 +86,9 @@ class LogMessage(ctypes.Structure):
                 ('message', ctypes.c_char_p),
                 ]
 
+    def __str__(self):
+        print "vlc.LogMessage(%d:%s): %s" % (self.severity, self.type, self.message)
+
 class MediaControlPosition(ctypes.Structure):
     _fields_= [
                 ('origin', ctypes.c_ushort),
@@ -131,9 +145,6 @@ class RGBPicture(ctypes.Structure):
     def free(self):
         mediacontrol_RGBPicture__free(self)
 
-# Decorator for callback methods
-callbackmethod=ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_void_p)
-
 def check_vlc_exception(result, func, args):
     """Error checking method for functions using an exception in/out parameter.
     """