]> git.sesse.net Git - vlc/commitdiff
activex: sync libvlc_MediaPlayer events between activex and mozilla
authorJean-Paul Saman <jean-paul.saman@m2x.nl>
Fri, 12 Mar 2010 12:19:48 +0000 (13:19 +0100)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>
Thu, 18 Mar 2010 10:16:03 +0000 (11:16 +0100)
projects/activex/axvlc.idl
projects/activex/axvlc.tlb
projects/activex/axvlc_idl.c
projects/activex/axvlc_idl.h
projects/activex/plugin.cpp
projects/activex/plugin.h
src/control/event.c

index 78defb74f9b09b6ff831cd20dfa25a7b8f0ff6b6..de7562ddf213759bc211977cdc1bb3a5951e10e5 100644 (file)
@@ -169,26 +169,21 @@ library AXVLC
     const int DISPID_StopEvent  = 102;\r
 \r
     /* async events from libvlc */\r
-    const int DISPID_NothingSpecialEvent = 200;\r
-    const int DISPID_OpeningEvent = 201;\r
-    const int DISPID_BufferingEvent = 202;\r
-    const int DISPID_PlayingEvent = 203;\r
-    const int DISPID_PausedEvent = 204;\r
-    const int DISPID_ForwardEvent = 205;\r
-    const int DISPID_BackwardEvent = 206;\r
-    const int DISPID_EncounteredErrorEvent = 207;\r
-    const int DISPID_EndReachedEvent = 208;\r
-    const int DISPID_StoppedEvent = 209;\r
-\r
-    const int DISPID_TimeChangedEvent = 210;\r
-    const int DISPID_PositionChangedEvent = 211;\r
-    const int DISPID_SeekableChangedEvent = 212;\r
-    const int DISPID_PausableChangedEvent = 213;\r
-\r
-    const int DISPID_MouseButtonEvent = 214;\r
-    const int DISPID_MouseMovedEvent = 215;\r
-    const int DISPID_MouseClickedEvent = 216;\r
-    const int DISPID_MouseObjectEvent = 217;\r
+    const int DISPID_MediaPlayerNothingSpecialEvent = 200;\r
+    const int DISPID_MediaPlayerOpeningEvent = 201;\r
+    const int DISPID_MediaPlayerBufferingEvent = 202;\r
+    const int DISPID_MediaPlayerPlayingEvent = 203;\r
+    const int DISPID_MediaPlayerPausedEvent = 204;\r
+    const int DISPID_MediaPlayerForwardEvent = 205;\r
+    const int DISPID_MediaPlayerBackwardEvent = 206;\r
+    const int DISPID_MediaPlayerEncounteredErrorEvent = 207;\r
+    const int DISPID_MediaPlayerEndReachedEvent = 208;\r
+    const int DISPID_MediaPlayerStoppedEvent = 209;\r
+\r
+    const int DISPID_MediaPlayerTimeChangedEvent = 210;\r
+    const int DISPID_MediaPlayerPositionChangedEvent = 211;\r
+    const int DISPID_MediaPlayerSeekableChangedEvent = 212;\r
+    const int DISPID_MediaPlayerPausableChangedEvent = 213;\r
 \r
     [\r
       uuid(DF48072F-5EF8-434e-9B40-E2F3AE759B5F),\r
@@ -206,46 +201,35 @@ library AXVLC
             void stop();\r
 \r
             /* asyn events from libvlc */\r
-            [id(DISPID_NothingSpecialEvent), helpstring("Idle state")]\r
-            void idle();\r
-            [id(DISPID_OpeningEvent), helpstring("Opening media")]\r
-            void opening();\r
-            [id(DISPID_BufferingEvent), helpstring("Buffering media")]\r
-            void buffering();\r
-            [id(DISPID_PlayingEvent), helpstring("Media is playing")]\r
-            void playing();\r
-            [id(DISPID_PausedEvent), helpstring("Media is paused")]\r
-            void paused();\r
-            [id(DISPID_ForwardEvent), helpstring("Forward playback")]\r
-            void forward();\r
-            [id(DISPID_BackwardEvent), helpstring("Backward playback")]\r
-            void backward();\r
-            [id(DISPID_EncounteredErrorEvent), helpstring("An error has been encountered")]\r
-            void error();\r
-            [id(DISPID_EndReachedEvent), helpstring("End of playback reached")]\r
-            void ended();\r
-            [id(DISPID_StoppedEvent), helpstring("Playback stopped")]\r
-            void stopped();\r
-\r
-            [id(DISPID_TimeChangedEvent), helpstring("Time changed")]\r
-            void TimeChanged([in] long time);\r
-            [id(DISPID_PositionChangedEvent), helpstring("Position changed")]\r
-            void PositionChanged([in] long position);\r
-            [id(DISPID_SeekableChangedEvent), helpstring("Seek changed")]\r
-            void SeekableChanged([in] VARIANT_BOOL seekable);\r
-            [id(DISPID_PausableChangedEvent), helpstring("Pause setting changed")]\r
-            void PausableChanged([in] VARIANT_BOOL pausable);\r
-\r
-            [id(DISPID_MouseButtonEvent), helpstring("Mouse button pressed")]\r
-            void MouseButton([in] VARIANT_BOOL btn_right, [in] VARIANT_BOOL btn_center,\r
-                [in] VARIANT_BOOL btn_left, [in] VARIANT_BOOL btn_wheel_up,\r
-                [in] VARIANT_BOOL bnt_wheel_down);\r
-            [id(DISPID_MouseMovedEvent), helpstring("Mouse moved")]\r
-            void MouseMoved([in] long x, [in] long y);\r
-            [id(DISPID_MouseClickedEvent), helpstring("Mouse clicked")]\r
-            void MouseClicked([in] VARIANT_BOOL clicked);\r
-            [id(DISPID_MouseObjectEvent), helpstring("Mouse selected holds object")]\r
-            void MouseObject([in] VARIANT_BOOL moved);\r
+            [id(DISPID_MediaPlayerNothingSpecialEvent), helpstring("Idle state")]\r
+            void MediaPlayerNothingSpecial();\r
+            [id(DISPID_MediaPlayerOpeningEvent), helpstring("Opening media")]\r
+            void MediaPlayerOpening();\r
+            [id(DISPID_MediaPlayerBufferingEvent), helpstring("Buffering media")]\r
+            void MediaPlayerBuffering();\r
+            [id(DISPID_MediaPlayerPlayingEvent), helpstring("Media is playing")]\r
+            void MediaPlayerPlaying();\r
+            [id(DISPID_MediaPlayerPausedEvent), helpstring("Media is paused")]\r
+            void MediaPlayerPaused();\r
+            [id(DISPID_MediaPlayerForwardEvent), helpstring("Forward playback")]\r
+            void MediaPlayerForward();\r
+            [id(DISPID_MediaPlayerBackwardEvent), helpstring("Backward playback")]\r
+            void MediaPlayerBackward();\r
+            [id(DISPID_MediaPlayerEncounteredErrorEvent), helpstring("An error has been encountered")]\r
+            void MediaPlayerEncounteredError();\r
+            [id(DISPID_MediaPlayerEndReachedEvent), helpstring("End of playback reached")]\r
+            void MediaPlayerEndReached();\r
+            [id(DISPID_MediaPlayerStoppedEvent), helpstring("Playback stopped")]\r
+            void MediaPlayerStopped();\r
+\r
+            [id(DISPID_MediaPlayerTimeChangedEvent), helpstring("Time changed")]\r
+            void MediaPlayerTimeChanged([in] long time);\r
+            [id(DISPID_MediaPlayerPositionChangedEvent), helpstring("Position changed")]\r
+            void MediaPlayerPositionChanged([in] long position);\r
+            [id(DISPID_MediaPlayerSeekableChangedEvent), helpstring("Seek changed")]\r
+            void MediaPlayerSeekableChanged([in] VARIANT_BOOL seekable);\r
+            [id(DISPID_MediaPlayerPausableChangedEvent), helpstring("Pause setting changed")]\r
+            void MediaPlayerPausableChanged([in] VARIANT_BOOL pausable);\r
     };\r
 \r
     [\r
index 4bc10a0cb9ed2e3f42776fb9bbddeaf4d6ea0950..a65b13ef28bbc73237fa71344794e21dcd199ab4 100644 (file)
Binary files a/projects/activex/axvlc.tlb and b/projects/activex/axvlc.tlb differ
index 60804b397d55973ee3f7d60a5429d7bf3d3387d6..49a90bf57a30498162725c4cdcea70accd71abc2 100644 (file)
@@ -1,4 +1,4 @@
-/*** Autogenerated by WIDL 1.1.36 from axvlc.idl - Do not edit ***/
+/*** Autogenerated by WIDL 1.1.38 from axvlc.idl - Do not edit ***/
 
 #include <rpc.h>
 #include <rpcndr.h>
index 0eb2b09a22ee7efda5a6c26ecb55bea9463e12f8..d7baa93753da6b9533150fc3e842135504d865df 100644 (file)
@@ -1,4 +1,4 @@
-/*** Autogenerated by WIDL 1.1.36 from axvlc.idl - Do not edit ***/
+/*** Autogenerated by WIDL 1.1.38 from axvlc.idl - Do not edit ***/
 
 #include <rpc.h>
 #include <rpcndr.h>
@@ -793,41 +793,33 @@ void __RPC_STUB IVLCControl_put_AutoLoop_Stub(
 
 #define DISPID_StopEvent (102)
 
-#define DISPID_NothingSpecialEvent (200)
+#define DISPID_MediaPlayerNothingSpecialEvent (200)
 
-#define DISPID_OpeningEvent (201)
+#define DISPID_MediaPlayerOpeningEvent (201)
 
-#define DISPID_BufferingEvent (202)
+#define DISPID_MediaPlayerBufferingEvent (202)
 
-#define DISPID_PlayingEvent (203)
+#define DISPID_MediaPlayerPlayingEvent (203)
 
-#define DISPID_PausedEvent (204)
+#define DISPID_MediaPlayerPausedEvent (204)
 
-#define DISPID_ForwardEvent (205)
+#define DISPID_MediaPlayerForwardEvent (205)
 
-#define DISPID_BackwardEvent (206)
+#define DISPID_MediaPlayerBackwardEvent (206)
 
-#define DISPID_EncounteredErrorEvent (207)
+#define DISPID_MediaPlayerEncounteredErrorEvent (207)
 
-#define DISPID_EndReachedEvent (208)
+#define DISPID_MediaPlayerEndReachedEvent (208)
 
-#define DISPID_StoppedEvent (209)
+#define DISPID_MediaPlayerStoppedEvent (209)
 
-#define DISPID_TimeChangedEvent (210)
+#define DISPID_MediaPlayerTimeChangedEvent (210)
 
-#define DISPID_PositionChangedEvent (211)
+#define DISPID_MediaPlayerPositionChangedEvent (211)
 
-#define DISPID_SeekableChangedEvent (212)
+#define DISPID_MediaPlayerSeekableChangedEvent (212)
 
-#define DISPID_PausableChangedEvent (213)
-
-#define DISPID_MouseButtonEvent (214)
-
-#define DISPID_MouseMovedEvent (215)
-
-#define DISPID_MouseClickedEvent (216)
-
-#define DISPID_MouseObjectEvent (217)
+#define DISPID_MediaPlayerPausableChangedEvent (213)
 
 /*****************************************************************************
  * DVLCEvents dispinterface
index cc99dc7c2d7fc1bb46bd0487cbeb2c9e4035c401..0c2f8bde9bf540fd9b45779f488e29e34b533191 100644 (file)
@@ -1007,64 +1007,64 @@ void VLCPlugin::fireOnStopEvent(void)
 /*
  * Async events
  */
-void VLCPlugin::fireOnIdleEvent()
+void VLCPlugin::fireOnMediaPlayerNothingSpecialEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_NothingSpecialEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerNothingSpecialEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnOpeningEvent()
+void VLCPlugin::fireOnMediaPlayerOpeningEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_OpeningEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerOpeningEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnBufferingEvent()
+void VLCPlugin::fireOnMediaPlayerBufferingEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_BufferingEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerBufferingEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnPlayingEvent()
+void VLCPlugin::fireOnMediaPlayerPlayingEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_PlayingEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerPlayingEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnPausedEvent()
+void VLCPlugin::fireOnMediaPlayerPausedEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_PausedEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerPausedEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnErrorEvent()
+void VLCPlugin::fireOnMediaPlayerEncounteredErrorEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_EncounteredErrorEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerEncounteredErrorEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnEndedEvent()
+void VLCPlugin::fireOnMediaPlayerEndReachedEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_EndReachedEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerEndReachedEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnStoppedEvent()
+void VLCPlugin::fireOnMediaPlayerStoppedEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_StoppedEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerStoppedEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnForwardEvent()
+void VLCPlugin::fireOnMediaPlayerForwardEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_ForwardEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerForwardEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnBackwardEvent()
+void VLCPlugin::fireOnMediaPlayerBackwardEvent()
 {
     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
-    vlcConnectionPointContainer->fireEvent(DISPID_BackwardEvent, &dispparamsNoArgs);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerBackwardEvent, &dispparamsNoArgs);
 };
 
 static void handle_input_state_event(const libvlc_event_t* event, void *param)
@@ -1073,97 +1073,97 @@ static void handle_input_state_event(const libvlc_event_t* event, void *param)
     switch( event->type )
     {
         case libvlc_MediaPlayerNothingSpecial:
-            plugin->fireOnIdleEvent();
+            plugin->fireOnMediaPlayerNothingSpecialEvent();
             break;
         case libvlc_MediaPlayerOpening:
-            plugin->fireOnOpeningEvent();
+            plugin->fireOnMediaPlayerOpeningEvent();
             break;
         case libvlc_MediaPlayerBuffering:
-            plugin->fireOnBufferingEvent();
+            plugin->fireOnMediaPlayerBufferingEvent();
             break;
         case libvlc_MediaPlayerPlaying:
-            plugin->fireOnPlayingEvent();
+            plugin->fireOnMediaPlayerPlayingEvent();
             break;
         case libvlc_MediaPlayerPaused:
-            plugin->fireOnPausedEvent();
+            plugin->fireOnMediaPlayerPausedEvent();
             break;
         case libvlc_MediaPlayerStopped:
-            plugin->fireOnStoppedEvent();
+            plugin->fireOnMediaPlayerStoppedEvent();
             break;
         case libvlc_MediaPlayerForward:
-            plugin->fireOnForwardEvent();
+            plugin->fireOnMediaPlayerForwardEvent();
             break;
         case libvlc_MediaPlayerBackward:
-            plugin->fireOnBackwardEvent();
+            plugin->fireOnMediaPlayerBackwardEvent();
             break;
         case libvlc_MediaPlayerEndReached:
-            plugin->fireOnEndedEvent();
+            plugin->fireOnMediaPlayerEndReachedEvent();
             break;
         case libvlc_MediaPlayerEncounteredError:
-            plugin->fireOnErrorEvent();
+            plugin->fireOnMediaPlayerEncounteredErrorEvent();
             break;
     }
 }
 
-void VLCPlugin::fireOnTimeChangedEvent(long time)
+void VLCPlugin::fireOnMediaPlayerTimeChangedEvent(long time)
 {
     VARIANT varPos;
     DISPPARAMS params = { &varPos, NULL, 1, 0 };
     varPos.vt = VT_I4;
     varPos.lVal = time;
-    vlcConnectionPointContainer->fireEvent(DISPID_TimeChangedEvent, &params);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerTimeChangedEvent, &params);
 };
 
 static void handle_time_changed_event(const libvlc_event_t* event, void *param)
 {
     VLCPlugin *plugin = (VLCPlugin*)param;
-    plugin->fireOnTimeChangedEvent(event->u.media_player_time_changed.new_time);
+    plugin->fireOnMediaPlayerTimeChangedEvent(event->u.media_player_time_changed.new_time);
 }
 
-void VLCPlugin::fireOnPositionChangedEvent(long position)
+void VLCPlugin::fireOnMediaPlayerPositionChangedEvent(long position)
 {
     VARIANT varPos;
     DISPPARAMS params = { &varPos, NULL, 1, 0 };
     varPos.vt = VT_I4;
     varPos.lVal = position;
-    vlcConnectionPointContainer->fireEvent(DISPID_PositionChangedEvent, &params);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerPositionChangedEvent, &params);
 };
 
 static void handle_position_changed_event(const libvlc_event_t* event, void *param)
 {
     VLCPlugin *plugin = (VLCPlugin*)param;
-    plugin->fireOnPositionChangedEvent(event->u.media_player_position_changed.new_position);
+    plugin->fireOnMediaPlayerPositionChangedEvent(event->u.media_player_position_changed.new_position);
 }
 
 #define B(val) ((val) ? 0xFFFF : 0x0000)
-void VLCPlugin::fireOnSeekableChangedEvent(VARIANT_BOOL seekable)
+void VLCPlugin::fireOnMediaPlayerSeekableChangedEvent(VARIANT_BOOL seekable)
 {
     VARIANT varSeek;
     DISPPARAMS params = { &varSeek, NULL, 1, 0 };
     varSeek.vt = VT_BOOL;
     varSeek.boolVal = seekable;
-    vlcConnectionPointContainer->fireEvent(DISPID_SeekableChangedEvent, &params);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerSeekableChangedEvent, &params);
 };
 
 static void handle_seekable_changed_event(const libvlc_event_t* event, void *param)
 {
     VLCPlugin *plugin = (VLCPlugin*)param;
-    plugin->fireOnSeekableChangedEvent(B(event->u.media_player_seekable_changed.new_seekable));
+    plugin->fireOnMediaPlayerSeekableChangedEvent(B(event->u.media_player_seekable_changed.new_seekable));
 }
 
-void VLCPlugin::fireOnPausableChangedEvent(VARIANT_BOOL pausable)
+void VLCPlugin::fireOnMediaPlayerPausableChangedEvent(VARIANT_BOOL pausable)
 {
     VARIANT varPause;
     DISPPARAMS params = { &varPause, NULL, 1, 0 };
     varPause.vt = VT_BOOL;
     varPause.boolVal = pausable;
-    vlcConnectionPointContainer->fireEvent(DISPID_PausableChangedEvent, &params);
+    vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerPausableChangedEvent, &params);
 };
 
 static void handle_pausable_changed_event(const libvlc_event_t* event, void *param)
 {
     VLCPlugin *plugin = (VLCPlugin*)param;
-    plugin->fireOnPausableChangedEvent(B(event->u.media_player_pausable_changed.new_pausable));
+    plugin->fireOnMediaPlayerPausableChangedEvent(B(event->u.media_player_pausable_changed.new_pausable));
 }
 #undef B
 
index 388e7329d1b4bbdd6842278641a06374079317b9..9c1003221a62ce2b1ac328a4ebf3a8dadc2c803d 100644 (file)
@@ -239,21 +239,21 @@ public:
     void fireOnStopEvent(void);
 
     // async events;
-    void fireOnIdleEvent();
-    void fireOnOpeningEvent();
-    void fireOnBufferingEvent();
-    void fireOnPlayingEvent();
-    void fireOnPausedEvent();
-    void fireOnErrorEvent();
-    void fireOnEndedEvent();
-    void fireOnStoppedEvent();
-    void fireOnForwardEvent();
-    void fireOnBackwardEvent();
-
-    void fireOnTimeChangedEvent(long time);
-    void fireOnPositionChangedEvent(long position);
-    void fireOnSeekableChangedEvent(VARIANT_BOOL seekable);
-    void fireOnPausableChangedEvent(VARIANT_BOOL pausable);
+    void fireOnMediaPlayerNothingSpecialEvent();
+    void fireOnMediaPlayerOpeningEvent();
+    void fireOnMediaPlayerBufferingEvent();
+    void fireOnMediaPlayerPlayingEvent();
+    void fireOnMediaPlayerPausedEvent();
+    void fireOnMediaPlayerForwardEvent();
+    void fireOnMediaPlayerBackwardEvent();
+    void fireOnMediaPlayerEncounteredErrorEvent();
+    void fireOnMediaPlayerEndReachedEvent();
+    void fireOnMediaPlayerStoppedEvent();
+
+    void fireOnMediaPlayerTimeChangedEvent(long time);
+    void fireOnMediaPlayerPositionChangedEvent(long position);
+    void fireOnMediaPlayerSeekableChangedEvent(VARIANT_BOOL seekable);
+    void fireOnMediaPlayerPausableChangedEvent(VARIANT_BOOL pausable);
 
     // controlling IUnknown interface
     LPUNKNOWN pUnkOuter;
index b145d24fbe2c3052429cf03bfa9ac71e84194c00..2ce0a23970d5bf8eb25fba5993bf02efd13835d3 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * event.c: New libvlc event control API
  *****************************************************************************
- * Copyright (C) 2007 the VideoLAN team
+ * Copyright (C) 2007-2010 the VideoLAN team
  * $Id $
  *
  * Authors: Filippo Carone <filippo@carone.org>