Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public string GetTypeName(VLCNative.libvlc_event_type_t event_type)
 {
     return(Marshal.PtrToStringAnsi(VLCNative.Event.libvlc_event_type_name(event_type)));
 }
Ejemplo n.º 3
0
 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);
 }