VLC Python EventManager callback type?

后端 未结 2 1135
无人共我
无人共我 2020-12-30 04:53

I\'m having trouble attaching an event handler to tell when a song has finished playing when using the VLC Python bindings. The event_attach function is complaining about th

2条回答
  •  抹茶落季
    2020-12-30 05:39

    Found it, VLC.py includes a small decorator ctypes function for wrapping callbacks:

    callbackmethod=ctypes.CFUNCTYPE(None, Event, ctypes.c_void_p)

    To use:

    @callbackmethod
    def SongFinished(self, data):
        print data
    

    .event_attach(vlc.EventType.MediaPlayerEndReached, SongFinished, 1)

提交回复
热议问题