Commit 04e7bd84 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Files belonging to patch from, thannoy: Allow future control toolbar to be...

Files belonging to patch from, thannoy: Allow future control toolbar to be hidden (default) or shown.
parent d5ec8027
...@@ -28,8 +28,14 @@ export PATH=$PATH:"/cygdrive/c/Program Files/Microsoft Visual Studio/COMMON/MSDe ...@@ -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 INCLUDE='C:\Program Files\Microsoft Visual Studio\VC98\Include'
export MIDL="midl" export MIDL="midl"
if you are cross-compiling on Linux, you may be able to use 'widl' which is part of If you are cross-compiling on Linux, you can use 'widl' which is part of
the WINE project (http://www.winehq.com), however I have not tested it. 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 II. Debugging
...@@ -64,7 +70,7 @@ by using the REGSVR32 command, as per following example: ...@@ -64,7 +70,7 @@ by using the REGSVR32 command, as per following example:
REGSVR32 C:\WINDOWS\AXVLC.DLL 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: make sure that the plugin path is set in the registry as per following example:
[HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC] [HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC]
...@@ -95,23 +101,25 @@ V. Controlling the plugin ...@@ -95,23 +101,25 @@ V. Controlling the plugin
1) Properties 1) Properties
the following public properties can be used to control the plugin from HTML, the following public properties can be used to control the plugin from HTML,
the property panel of Visual Basic and most ActiveX aware applications the property panel of Visual Basic and most ActiveX aware applications.
+==========+=========+================================+===============+ +==========+=========+===================================+===============+
| Name: | Type: | Description: | Alias: | | Name: | Type: | Description: | Alias: |
+==========+=========+================================+===============+ +==========+=========+===================================+===============+
| autoplay | boolean | play when control is activated | autostart | | autoplay | boolean | play when control is activated | autostart |
+----------+---------+--------------------------------+---------------+ +----------+---------+-----------------------------------+---------------+
| autoloop | boolean | loop the playlist | loop | | autoloop | boolean | loop the playlist | loop |
+----------+---------+--------------------------------+---------------+ +----------+---------+-----------------------------------+---------------+
| mrl | string | initial MRL in playlist | src, filename | | mrl | string | initial MRL in playlist | src, filename |
+----------+---------+--------------------------------+---------------+ +----------+---------+-----------------------------------+---------------+
| mute | boolean | mute audio volume | | | mute | boolean | mute audio volume | |
+----------+---------+--------------------------------+---------------+ +----------+---------+-----------------------------------+---------------+
| visible | boolean | show/hide control viewport | showdisplay | | visible | boolean | show/hide control viewport | showdisplay |
+----------+---------+--------------------------------+---------------+ +----------+---------+-----------------------------------+---------------+
| volume | integer | set/get audio volume | | | 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 the alias column allows to specify an alternative <PARAM name> for the
property in internet explorer, which is useful to maintain compatibility property in internet explorer, which is useful to maintain compatibility
...@@ -149,6 +157,19 @@ Variables: ...@@ -149,6 +157,19 @@ Variables:
Methods: 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()
Play current item the playlist Play current item the playlist
......
...@@ -101,6 +101,13 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr ...@@ -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(); SIZEL size = _p_instance->getExtent();
V_VT(&value) = VT_I4; V_VT(&value) = VT_I4;
if( S_OK == pPropBag->Read(OLESTR("extentwidth"), &value, pErrorLog) ) if( S_OK == pPropBag->Read(OLESTR("extentwidth"), &value, pErrorLog) )
...@@ -227,6 +234,11 @@ STDMETHODIMP VLCPersistPropertyBag::Save(LPPROPERTYBAG pPropBag, BOOL fClearDirt ...@@ -227,6 +234,11 @@ STDMETHODIMP VLCPersistPropertyBag::Save(LPPROPERTYBAG pPropBag, BOOL fClearDirt
pPropBag->Write(OLESTR("AutoPlay"), &value); pPropBag->Write(OLESTR("AutoPlay"), &value);
VariantClear(&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(); SIZEL size = _p_instance->getExtent();
V_VT(&value) = VT_I4; V_VT(&value) = VT_I4;
V_I4(&value) = size.cx; V_I4(&value) = size.cx;
......
...@@ -351,6 +351,7 @@ HRESULT VLCPlugin::onInit(void) ...@@ -351,6 +351,7 @@ HRESULT VLCPlugin::onInit(void)
// initialize persistable properties // initialize persistable properties
_b_autoplay = TRUE; _b_autoplay = TRUE;
_b_autoloop = FALSE; _b_autoloop = FALSE;
_b_toolbar = FALSE;
_bstr_baseurl = NULL; _bstr_baseurl = NULL;
_bstr_mrl = NULL; _bstr_mrl = NULL;
_b_visible = TRUE; _b_visible = TRUE;
......
...@@ -111,6 +111,13 @@ public: ...@@ -111,6 +111,13 @@ public:
}; };
inline BOOL getAutoLoop(void) { return _b_autoloop;}; 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); void setVolume(int volume);
int getVolume(void) { return _i_volume; }; int getVolume(void) { return _i_volume; };
...@@ -261,6 +268,7 @@ private: ...@@ -261,6 +268,7 @@ private:
BSTR _bstr_mrl; BSTR _bstr_mrl;
BOOL _b_autoplay; BOOL _b_autoplay;
BOOL _b_autoloop; BOOL _b_autoloop;
BOOL _b_toolbar;
BOOL _b_visible; BOOL _b_visible;
BOOL _b_mute; BOOL _b_mute;
int _i_volume; int _i_volume;
......
...@@ -2728,6 +2728,38 @@ STDMETHODIMP VLCControl2::put_MRL(BSTR mrl) ...@@ -2728,6 +2728,38 @@ STDMETHODIMP VLCControl2::put_MRL(BSTR mrl)
return S_OK; 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) STDMETHODIMP VLCControl2::get_StartTime(long *seconds)
{ {
if( NULL == seconds ) if( NULL == seconds )
......
...@@ -582,6 +582,8 @@ public: ...@@ -582,6 +582,8 @@ public:
STDMETHODIMP put_BaseURL(BSTR url); STDMETHODIMP put_BaseURL(BSTR url);
STDMETHODIMP get_MRL(BSTR *mrl); STDMETHODIMP get_MRL(BSTR *mrl);
STDMETHODIMP put_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 get_StartTime(long *seconds);
STDMETHODIMP put_StartTime(long seconds); STDMETHODIMP put_StartTime(long seconds);
STDMETHODIMP get_VersionInfo(BSTR *version); STDMETHODIMP get_VersionInfo(BSTR *version);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment