public bool Attach(VLCNative.libvlc_event_type_t event_type, VLCNative.libvlc_callback_t callback) { if (GetTypeName(event_type) == "Unknown Event") { return(false); } Console.WriteLine("Try atach event " + (int)event_type + " = " + GetTypeName(event_type)); int ret = 0; try { ret = VLCNative.Event.libvlc_event_attach(_instance, event_type, callback, (IntPtr)_this); if (ret == 0) { Console.WriteLine("Atach event " + event_type); return(true); } else { Console.Error.WriteLine("Can`t atach event Type: " + GetTypeName(event_type) + " Error:" + ret); } } catch (Exception e) { Console.Error.WriteLine("Can`t atach event Message: " + e.Message); } return(false); }
public string GetTypeName(VLCNative.libvlc_event_type_t event_type) { return(Marshal.PtrToStringAnsi(VLCNative.Event.libvlc_event_type_name(event_type))); }
public void Detach(VLCNative.libvlc_event_type_t event_type, VLCNative.libvlc_callback_t callback) { VLCNative.Event.libvlc_event_detach(_instance, event_type, callback, (IntPtr)_this); }