Ejemplo n.º 1
0
        /**
         *
         */
        private void RegisterEventListener()
        {
            Logger.Debug("RegisterEventListener()");
            callback = new VlcVideoPlayerCallbackDelegate(HandleEvent);
            IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(callback);

            foreach (int value in Enum.GetValues(typeof(libvlc_event_e)))
            {
                // The native event manager reports that it does not support
                // libvlc_MediaListPlayerPlayed or libvlc_MediaListPlayerStopped
                if (value >= (int)libvlc_event_e.libvlc_MediaListPlayerNextItemSet && value <= (int)libvlc_event_e.libvlc_MediaListPlayerNextItemSet)
                {
                    Logger.Debug("event={}", (libvlc_event_e)value);
                    int result = LibVlc.libvlc_event_attach(mediaListPlayerEventManager, value, callbackPtr, IntPtr.Zero);
                    Logger.Debug("result={}", result);
                }
            }
        }
Ejemplo n.º 2
0
 /**
  *
  */
 private void DeregisterEventListener()
 {
     Logger.Debug("DeregisterEventListener()");
     if (callback != null)
     {
         IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(callback);
         foreach (int value in Enum.GetValues(typeof(libvlc_event_e)))
         {
             // The native event manager reports that it does not support
             // libvlc_MediaListPlayerPlayed or libvlc_MediaListPlayerStopped
             if (value >= (int)libvlc_event_e.libvlc_MediaListPlayerNextItemSet && value <= (int)libvlc_event_e.libvlc_MediaListPlayerNextItemSet)
             {
                 Logger.Debug("event={}", (libvlc_event_e)value);
                 LibVlc.libvlc_event_detach(mediaListPlayerEventManager, value, callbackPtr, IntPtr.Zero);
             }
         }
         callback = null;
     }
 }
 /**
  *
  */
 private void DeregisterEventListener() {
     Logger.Debug("DeregisterEventListener()");
     if(callback != null) {
         IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(callback);
         foreach(int value in Enum.GetValues(typeof(libvlc_event_e))) {
             // The native event manager reports that it does not support
             // libvlc_MediaListPlayerPlayed or libvlc_MediaListPlayerStopped
             if(value >= (int)libvlc_event_e.libvlc_MediaListPlayerNextItemSet && value <= (int)libvlc_event_e.libvlc_MediaListPlayerNextItemSet) {
                 Logger.Debug("event={}", (libvlc_event_e)value);
                 LibVlc.libvlc_event_detach(mediaListPlayerEventManager, value, callbackPtr, IntPtr.Zero);
             }
         }
         callback = null;
     }
 }
 /**
  * 
  */
 private void RegisterEventListener() {
     Logger.Debug("RegisterEventListener()");
     callback = new VlcVideoPlayerCallbackDelegate(HandleEvent);
     IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(callback);
     foreach(int value in Enum.GetValues(typeof(libvlc_event_e))) {
         // The native event manager reports that it does not support
         // libvlc_MediaListPlayerPlayed or libvlc_MediaListPlayerStopped
         if(value >= (int)libvlc_event_e.libvlc_MediaListPlayerNextItemSet && value <= (int)libvlc_event_e.libvlc_MediaListPlayerNextItemSet) {
             Logger.Debug("event={}", (libvlc_event_e)value);
             int result = LibVlc.libvlc_event_attach(mediaListPlayerEventManager, value, callbackPtr, IntPtr.Zero);
             Logger.Debug("result={}", result);
         }
     }
 }