1 ### Start of footer.py ###
3 class MediaEvent(ctypes.Structure):
5 ('media_name', ctypes.c_char_p),
6 ('instance_name', ctypes.c_char_p),
9 class EventUnion(ctypes.Union):
11 ('meta_type', ctypes.c_uint),
12 ('new_child', ctypes.c_uint),
13 ('new_duration', ctypes.c_longlong),
14 ('new_status', ctypes.c_int),
15 ('media', ctypes.c_void_p),
16 ('new_state', ctypes.c_uint),
18 ('new_position', ctypes.c_float),
19 ('new_time', ctypes.c_longlong),
20 ('new_title', ctypes.c_int),
21 ('new_seekable', ctypes.c_longlong),
22 ('new_pausable', ctypes.c_longlong),
23 # FIXME: Skipped MediaList and MediaListView...
24 ('filename', ctypes.c_char_p),
25 ('new_length', ctypes.c_longlong),
26 ('media_event', MediaEvent),
29 class Event(ctypes.Structure):
32 ('object', ctypes.c_void_p),
36 # Decorator for callback methods
37 callbackmethod=ctypes.CFUNCTYPE(None, Event, ctypes.c_void_p)
39 # Example callback method
41 def debug_callback(event, data):
42 print "Debug callback method"
43 print "Event:", event.type
46 if __name__ == '__main__':
51 def end_callback(event, data):
57 m=i.media_new(sys.argv[1])
58 p=i.media_player_new()
63 e.event_attach(EventType.MediaPlayerPaused, end_callback, None)
64 gobject.MainLoop().run()