]> git.sesse.net Git - vlc/commitdiff
Files belonging to patch from, thannoy: Allow future control toolbar to be hidden...
authorJean-Paul Saman <jpsaman@videolan.org>
Fri, 11 Apr 2008 14:56:37 +0000 (16:56 +0200)
committerJean-Paul Saman <jpsaman@videolan.org>
Fri, 11 Apr 2008 15:02:57 +0000 (17:02 +0200)
projects/activex/README.TXT
projects/activex/persistpropbag.cpp
projects/activex/plugin.cpp
projects/activex/plugin.h
projects/activex/vlccontrol2.cpp
projects/activex/vlccontrol2.h

index 8783c8f90f7fd52d493ff6bf28df791f41be68af..aa339ca025a4a3380c97b84f11f13809241192ef 100644 (file)
@@ -28,8 +28,14 @@ export PATH=$PATH:"/cygdrive/c/Program Files/Microsoft Visual Studio/COMMON/MSDe
 export INCLUDE='C:\Program Files\Microsoft Visual Studio\VC98\Include'
 export MIDL="midl"
 
-if you are cross-compiling on Linux, you may be able to use 'widl' which is part of
-the WINE project (http://www.winehq.com), however I have not tested it.
+If you are cross-compiling on Linux, you can use 'widl' which is part of
+the WINE project (http://www.winehq.com). At leat wine-dev-0.9.57 works,
+the comand line to compile IDL should looks like the following :
+
+widl -I/usr/include/wine/windows/ \
+     -h -H axvlc_idl.h -t -T axvlc.tlb -u -U axvlc_idl.c \
+     axvlc.idl
+NOTE: widl breaks compatibility with Visual Basic. If that is important to you then use midl.
 
 II. Debugging
 
@@ -64,7 +70,7 @@ by using the REGSVR32 command, as per following example:
 
 REGSVR32 C:\WINDOWS\AXVLC.DLL
 
-if the control needs to use external VLC plugins (i.e other than built-in ones),
+If the control needs to use external VLC plugins (i.e other than built-in ones),
 make sure that the plugin path is set in the registry as per following example:
 
 [HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC]
@@ -95,23 +101,25 @@ V. Controlling the plugin
 1) Properties
 
 the following public properties can be used to control the plugin from HTML,
-the property panel of Visual Basic and most ActiveX aware applications 
-
-+==========+=========+================================+===============+
-| Name:    | Type:   |   Description:                 | Alias:        |
-+==========+=========+================================+===============+
-| autoplay | boolean | play when control is activated | autostart     |
-+----------+---------+--------------------------------+---------------+
-| autoloop | boolean | loop the playlist              | loop          |
-+----------+---------+--------------------------------+---------------+
-| mrl      | string  | initial MRL in playlist        | src, filename |
-+----------+---------+--------------------------------+---------------+
-| mute     | boolean | mute audio volume              |               |
-+----------+---------+--------------------------------+---------------+
-| visible  | boolean | show/hide control viewport     | showdisplay   |
-+----------+---------+--------------------------------+---------------+
-| volume   | integer | set/get audio volume           |               |
-+----------+---------+--------------------------------+---------------+
+the property panel of Visual Basic and most ActiveX aware applications.
+
++==========+=========+===================================+===============+
+| Name:    | Type:   |   Description:                    | Alias:        |
++==========+=========+===================================+===============+
+| autoplay | boolean | play when control is activated    | autostart     |
++----------+---------+-----------------------------------+---------------+
+| autoloop | boolean | loop the playlist                 | loop          |
++----------+---------+-----------------------------------+---------------+
+| mrl      | string  | initial MRL in playlist           | src, filename |
++----------+---------+-----------------------------------+---------------+
+| mute     | boolean | mute audio volume                 |               |
++----------+---------+-----------------------------------+---------------+
+| visible  | boolean | show/hide control viewport        | showdisplay   |
++----------+---------+-----------------------------------+---------------+
+| volume   | integer | set/get audio volume              |               |
++----------+---------+-----------------------------------+---------------+
+| toolbar  | boolean | set/get visibility of the toolbar |               |
++----------+---------+-----------------------------------+---------------+
 
 the alias column allows to specify an alternative <PARAM name> for the
 property in internet explorer, which is useful to maintain compatibility
@@ -149,12 +157,25 @@ Variables:
 
 Methods:
 
+  *** current interface (0.8.6+) ***
+UUID : 9BE31822-FDAD-461B-AD51-BE1D1C159921
+defined in axvlc.idl as "coclass VLCPlugin2", "interface IVLCControl2"
+
+This interface organize API with several object (like .audio.mute)
+It is currently documented on videolan wiki (may change) at
+http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC
+
+
+  ***  old interface (deprecated)  ***
+UUID : E23FE9C6-778E-49D4-B537-38FCDE4887D8
+defined in axvlc.idl as "coclass VLCPlugin", "interface IVLCControl"
+
 play()
     Play current item the playlist
 
 pause()
     Pause current item in the playlist
-    
+
 stop()
     Stop playing current item in playlist
 
index b53c5113fc3631f718fa5a632deb3bac862d345e..85a31be23aff4b9ca05f651010fa7b84460c1bdd 100644 (file)
@@ -101,6 +101,13 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
         }
     }
 
+    V_VT(&value) = VT_BOOL;
+    if( S_OK == pPropBag->Read(OLESTR("toolbar"), &value, pErrorLog) )
+    {
+        _p_instance->setShowToolbar(V_BOOL(&value) != VARIANT_FALSE);
+        VariantClear(&value);
+    }
+
     SIZEL size = _p_instance->getExtent();
     V_VT(&value) = VT_I4;
     if( S_OK == pPropBag->Read(OLESTR("extentwidth"), &value, pErrorLog) )
@@ -227,6 +234,11 @@ STDMETHODIMP VLCPersistPropertyBag::Save(LPPROPERTYBAG pPropBag, BOOL fClearDirt
     pPropBag->Write(OLESTR("AutoPlay"), &value);
     VariantClear(&value);
 
+    V_VT(&value) = VT_BOOL;
+    V_BOOL(&value) = _p_instance->getShowToolbar()? VARIANT_TRUE : VARIANT_FALSE;
+    pPropBag->Write(OLESTR("Toolbar"), &value);
+    VariantClear(&value);
+
     SIZEL size = _p_instance->getExtent();
     V_VT(&value) = VT_I4;
     V_I4(&value) = size.cx;
index 1f0e94263603578605a8fbe617152b2b32e7f451..5aa6400e4c290fd6421754fa3b7fc85e9f31233e 100644 (file)
@@ -349,15 +349,16 @@ HRESULT VLCPlugin::onInit(void)
     if( NULL == _p_libvlc )
     {
         // initialize persistable properties
-        _b_autoplay = TRUE;
-        _b_autoloop = FALSE;
+        _b_autoplay   = TRUE;
+        _b_autoloop   = FALSE;
+        _b_toolbar    = FALSE;
         _bstr_baseurl = NULL;
-        _bstr_mrl = NULL;
-        _b_visible = TRUE;
-        _b_mute = FALSE;
-        _i_volume = 50;
-        _i_time   = 0;
-        _i_backcolor = 0;
+        _bstr_mrl     = NULL;
+        _b_visible    = TRUE;
+        _b_mute       = FALSE;
+        _i_volume     = 50;
+        _i_time       = 0;
+        _i_backcolor  = 0;
         // set default/preferred size (320x240) pixels in HIMETRIC
         HDC hDC = CreateDevDC(NULL);
         _extent.cx = 320;
index c2612e4879d7da3e9928a4147d2926d034e5f5be..ebf17029865e2021c2fbb09da8e37c96e3d59cb3 100644 (file)
@@ -111,6 +111,13 @@ public:
     };
     inline BOOL getAutoLoop(void) { return _b_autoloop;};
 
+    inline void setShowToolbar(BOOL showtoolbar)
+    {
+        _b_toolbar = showtoolbar;
+        setDirty(TRUE);
+    };
+    inline BOOL getShowToolbar(void) { return _b_toolbar;};
+
     void setVolume(int volume);
     int getVolume(void) { return _i_volume; };
 
@@ -261,6 +268,7 @@ private:
     BSTR _bstr_mrl;
     BOOL _b_autoplay;
     BOOL _b_autoloop;
+    BOOL _b_toolbar;
     BOOL _b_visible;
     BOOL _b_mute;
     int  _i_volume;
index 21acf544717d6a14aca81cf8fe28105d7ea9274a..26548c0ac026e033e8ee0ab5b20188e69ad9f596 100644 (file)
@@ -2728,6 +2728,38 @@ STDMETHODIMP VLCControl2::put_MRL(BSTR mrl)
     return S_OK;
 };
 
+
+STDMETHODIMP VLCControl2::get_Toolbar(VARIANT_BOOL *visible)
+{
+    if( NULL == visible )
+        return E_POINTER;
+
+    /*
+     * Note to developpers
+     *
+     * Returning the _b_toolbar is closer to the method specification.
+     * But returning True when toolbar is not implemented so not displayed
+     * could be bad for ActiveX users which rely on this value to show their
+     * own toolbar if not provided by the ActiveX.
+     *
+     * This is the reason why FALSE is returned, until toolbar get implemented.
+     */
+
+    /* DISABLED for now */
+    //  *visible = _p_instance->getShowToolbar() ? VARIANT_TRUE: VARIANT_FALSE;
+
+    *visible = VARIANT_FALSE;
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCControl2::put_Toolbar(VARIANT_BOOL visible)
+{
+    _p_instance->setShowToolbar((VARIANT_FALSE != visible) ? TRUE: FALSE);
+    return S_OK;
+};
+
+
 STDMETHODIMP VLCControl2::get_StartTime(long *seconds)
 {
     if( NULL == seconds )
index 1e73729be04a460920daa24de0934db4b21adf72..7596676d0a1a3213c0a35d3e7e9fc69ae47d0b2f 100644 (file)
@@ -582,6 +582,8 @@ public:
     STDMETHODIMP put_BaseURL(BSTR url);
     STDMETHODIMP get_MRL(BSTR *mrl);
     STDMETHODIMP put_MRL(BSTR mrl);
+    STDMETHODIMP get_Toolbar(VARIANT_BOOL *visible);
+    STDMETHODIMP put_Toolbar(VARIANT_BOOL visible);
     STDMETHODIMP get_StartTime(long *seconds);
     STDMETHODIMP put_StartTime(long seconds);
     STDMETHODIMP get_VersionInfo(BSTR *version);