[vlc-commits] ActiveX: switch to vlc_player_options

Sergey Radionov git at videolan.org
Sat Jan 21 22:59:03 CET 2012


npapi-vlc | branch: master | Sergey Radionov <RSATom at gmail.com> | Sat Jan 14 18:35:56 2012 +0700| [2c5ef2f2609bcd300dcd6d0d14fc0f8d6977ced6] | committer: Cheng Sun

ActiveX: switch to vlc_player_options

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=2c5ef2f2609bcd300dcd6d0d14fc0f8d6977ced6
---

 activex/plugin.cpp |    8 ++++----
 activex/plugin.h   |   16 +++++++---------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/activex/plugin.cpp b/activex/plugin.cpp
index 6bd3462..c22d6f7 100644
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -217,7 +217,7 @@ extern HMODULE DllGetModule();
 
 VLCPlugin::VLCPlugin(VLCPluginClass *p_class, LPUNKNOWN pUnkOuter) :
     _inplacewnd(NULL),
-    _WindowsManager(DllGetModule(), _ViewRC),
+    _WindowsManager(DllGetModule(), _ViewRC, this),
     _p_class(p_class),
     _i_ref(1UL),
     _p_libvlc(NULL),
@@ -402,9 +402,9 @@ HRESULT VLCPlugin::onInit(void)
     if( NULL == _p_libvlc )
     {
         // initialize persistable properties
-        _b_autoplay   = TRUE;
+        set_autoplay(true);
         _b_autoloop   = FALSE;
-        _b_toolbar    = FALSE;
+        set_show_toolbar(false);
         _bstr_baseurl = NULL;
         _bstr_mrl     = NULL;
         _b_visible    = TRUE;
@@ -750,7 +750,7 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
         if( FAILED(result) )
             return result;
 
-        if( _b_autoplay && playlist_select(0) )
+        if( get_autoplay() && playlist_select(0) )
         {
             libvlc_media_player_play(_p_mplayer);
             fireOnPlayEvent();
diff --git a/activex/plugin.h b/activex/plugin.h
index e64a18e..bc63428 100644
--- a/activex/plugin.h
+++ b/activex/plugin.h
@@ -32,6 +32,8 @@
 #include <vlc/vlc.h>
 
 #include "../common/win32_fullscreen.h"
+#include "../common/vlc_player_options.h"
+
 extern "C" const GUID CLSID_VLCPlugin;
 extern "C" const GUID CLSID_VLCPlugin2;
 extern "C" const GUID LIBID_AXVLC;
@@ -73,11 +75,9 @@ private:
     LPPICTURE   _inplace_picture;
 };
 
-struct VLCPlugin : public IUnknown
+struct VLCPlugin : public IUnknown, public vlc_player_options
 {
-
 public:
-
     VLCPlugin(VLCPluginClass *p_class, LPUNKNOWN pUnkOuter);
 
     /* IUnknown methods */
@@ -103,10 +103,10 @@ public:
 
     inline void setAutoPlay(BOOL autoplay)
     {
-        _b_autoplay = autoplay;
+        set_autoplay(autoplay != FALSE);
         setDirty(TRUE);
     };
-    inline BOOL getAutoPlay(void) { return _b_autoplay; };
+    inline BOOL getAutoPlay(void) { return get_autoplay()? TRUE : FALSE; };
 
     inline void setAutoLoop(BOOL autoloop)
     {
@@ -117,10 +117,10 @@ public:
 
     inline void setShowToolbar(BOOL showtoolbar)
     {
-        _b_toolbar = showtoolbar;
+        set_show_toolbar(showtoolbar != FALSE);
         setDirty(TRUE);
     };
-    inline BOOL getShowToolbar(void) { return _b_toolbar;};
+    inline BOOL getShowToolbar(void) { return get_show_toolbar() ? TRUE : FALSE; };
 
     void setVolume(int volume);
     int getVolume(void) { return _i_volume; };
@@ -380,9 +380,7 @@ private:
     // persistable properties
     BSTR _bstr_baseurl;
     BSTR _bstr_mrl;
-    BOOL _b_autoplay;
     BOOL _b_autoloop;
-    BOOL _b_toolbar;
     BOOL _b_visible;
     BOOL _b_mute;
     int  _i_volume;



More information about the vlc-commits mailing list