Commit f533f3d8 authored by Damien Fouilleul's avatar Damien Fouilleul

ActiveX: misc fixes & improvements

parent bd59418e
......@@ -126,11 +126,11 @@ library AXVLC
properties:
methods:
[id(1), helpstring("Playback in progress")]
void OnPlay();
void Play();
[id(2), helpstring("Playback has paused")]
void OnPause();
void Pause();
[id(3), helpstring("Playback has stopped")]
void OnStop();
void Stop();
};
[
......
No preview for this file type
......@@ -133,7 +133,7 @@ STDMETHODIMP VLCConnectionPoint::EnumConnections(IEnumConnections **ppEnum)
return (NULL != *ppEnum ) ? S_OK : E_OUTOFMEMORY;
};
void VLCConnectionPoint::fireEvent(DISPID dispId, LCID lcid, DISPPARAMS* pDispParams)
void VLCConnectionPoint::fireEvent(DISPID dispId, DISPPARAMS* pDispParams)
{
vector<CONNECTDATA>::iterator end = _connections.end();
vector<CONNECTDATA>::iterator iter = _connections.begin();
......@@ -146,13 +146,7 @@ void VLCConnectionPoint::fireEvent(DISPID dispId, LCID lcid, DISPPARAMS* pDispPa
IDispatch *pDisp;
if( SUCCEEDED(cd.pUnk->QueryInterface(IID_IDispatch, (LPVOID *)&pDisp)) )
{
unsigned int puArgErr;
VARIANT vRes;
if( SUCCEEDED(pDisp->Invoke(dispId, IID_NULL, lcid, DISPATCH_METHOD, pDispParams, &vRes, NULL, &puArgErr)) )
{
VariantClear(&vRes);
}
pDisp->Invoke(dispId, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, pDispParams, NULL, NULL, NULL);
pDisp->Release();
}
}
......@@ -281,9 +275,9 @@ STDMETHODIMP VLCConnectionPointContainer::FindConnectionPoint(REFIID riid, IConn
return NOERROR;
};
void VLCConnectionPointContainer::fireEvent(DISPID dispId, LCID lcid, DISPPARAMS* pDispParams)
void VLCConnectionPointContainer::fireEvent(DISPID dispId, DISPPARAMS* pDispParams)
{
_p_events->fireEvent(dispId,lcid, pDispParams);
_p_events->fireEvent(dispId, pDispParams);
};
void VLCConnectionPointContainer::firePropChangedEvent(DISPID dispId)
......
......@@ -61,7 +61,7 @@ public:
STDMETHODIMP Unadvise(DWORD);
STDMETHODIMP EnumConnections(LPENUMCONNECTIONS *);
void fireEvent(DISPID dispIdMember, LCID lcid, DISPPARAMS* pDispParams);
void fireEvent(DISPID dispIdMember, DISPPARAMS* pDispParams);
void firePropChangedEvent(DISPID dispId);
private:
......@@ -101,7 +101,7 @@ public:
STDMETHODIMP EnumConnectionPoints(LPENUMCONNECTIONPOINTS *);
STDMETHODIMP FindConnectionPoint(REFIID, LPCONNECTIONPOINT *);
void fireEvent(DISPID, LCID, DISPPARAMS*);
void fireEvent(DISPID, DISPPARAMS*);
void firePropChangedEvent(DISPID dispId);
private:
......
......@@ -743,7 +743,7 @@ void VLCPlugin::fireOnPlayEvent(void)
if( _b_sendevents )
{
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
vlcConnectionPointContainer->fireEvent(1, LOCALE_USER_DEFAULT, &dispparamsNoArgs);
vlcConnectionPointContainer->fireEvent(1, &dispparamsNoArgs);
}
};
......@@ -752,7 +752,7 @@ void VLCPlugin::fireOnPauseEvent(void)
if( _b_sendevents )
{
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
vlcConnectionPointContainer->fireEvent(2, LOCALE_USER_DEFAULT, &dispparamsNoArgs);
vlcConnectionPointContainer->fireEvent(2, &dispparamsNoArgs);
}
};
......@@ -761,7 +761,7 @@ void VLCPlugin::fireOnStopEvent(void)
if( _b_sendevents )
{
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
vlcConnectionPointContainer->fireEvent(3, LOCALE_USER_DEFAULT, &dispparamsNoArgs);
vlcConnectionPointContainer->fireEvent(3, &dispparamsNoArgs);
}
};
......@@ -80,7 +80,7 @@ public:
/* custom methods */
HRESULT getTypeLib(ITypeLib **pTL)
{ return LoadRegTypeLib(LIBID_AXVLC, 1, 0, LOCALE_NEUTRAL, pTL); };
{ return LoadRegTypeLib(LIBID_AXVLC, 1, 0, LOCALE_USER_DEFAULT, pTL); };
REFCLSID getClassID(void) { return (REFCLSID)CLSID_VLCPlugin; };
REFIID getDispEventID(void) { return (REFIID)DIID_DVLCEvents; };
......@@ -103,7 +103,7 @@ public:
int getVLCObject(void) { return _i_vlc; };
// initial properties
// control properties
void setSourceURL(const char *url) { _psz_src = strdup(url); };
void setAutoStart(BOOL autostart) { _b_autostart = autostart; };
void setLoopMode(BOOL loopmode) { _b_loopmode = loopmode; };
......@@ -114,12 +114,14 @@ public:
}
};
void setShowDisplay(BOOL show) { _b_showdisplay = show; };
BOOL getShowDisplay(void) { return _b_showdisplay; };
void setSendEvents(BOOL sendevents) { _b_sendevents = sendevents; };
// container events
void onPositionChange(LPCRECT lprcPosRect, LPCRECT lprcClipRect);
void onPaint(PAINTSTRUCT &ps, RECT &pr);
// plugin events
void setSendEvents(BOOL sendevents) { _b_sendevents = sendevents; };
// control events
void fireOnPlayEvent(void);
void fireOnPauseEvent(void);
void fireOnStopEvent(void);
......
......@@ -35,7 +35,7 @@ STDMETHODIMP VLCProvideClassInfo::GetClassInfo(ITypeInfo **ppTI)
HRESULT hr = _p_instance->getTypeLib(&p_typelib);
if( SUCCEEDED(hr) )
{
hr = p_typelib->GetTypeInfoOfGuid(_p_instance->getDispEventID(), ppTI);
hr = p_typelib->GetTypeInfoOfGuid(_p_instance->getClassID(), ppTI);
if( FAILED(hr) )
{
*ppTI = NULL;
......
......@@ -26,31 +26,31 @@ MRL:
</OBJECT>
<SCRIPT LANGUAGE="JScript">
<!--
function vlc::OnPlay()
function vlc::play()
{
alert("Playing");
alert("VLC is Playing");
};
function vlc::OnPause()
function vlc::pause()
{
alert("Paused");
alert("VLC has Paused");
};
function vlc::OnStop()
function vlc::stop()
{
alert("Stopped");
alert("VLC has Stopped");
};
//-->
</SCRIPT>
</TD></TR>
<TR><TD>
<INPUT type=submit value="Play" onClick='document.vlc.play();'>
<INPUT type=submit value="Pause" onClick='document.vlc.pause();'>
<INPUT type=submit value="Stop" onClick='document.vlc.stop();'>
<INPUT type=submit value=" << " onClick='document.vlc.playSlower();'>
<INPUT type=submit value=" >> " onClick='document.vlc.playFaster();'>
<INPUT type=submit value="Mute" onClick='document.vlc.toggleMute();'>
<INPUT type=submit value="Show" onClick='document.vlc.Visible = true;'>
<INPUT type=submit value="Hide" onClick='document.vlc.Visible = false;'>
<INPUT type=submit value="Version" onClick='alert(document.vlc.VersionInfo);'>
<INPUT type=button value="Play" onClick='document.vlc.play();'>
<INPUT type=button value="Stop" onClick='document.vlc.stop();'>
<INPUT type=button value="Pause" onClick='document.vlc.pause();'>
<INPUT type=button value=" << " onClick='document.vlc.playSlower();'>
<INPUT type=button value=" >> " onClick='document.vlc.playFaster();'>
<INPUT type=button value="Mute" onClick='document.vlc.toggleMute();'>
<INPUT type=button value="Show" onClick='document.vlc.Visible = true;'>
<INPUT type=button value="Hide" onClick='document.vlc.Visible = false;'>
<INPUT type=button value="Version" onClick='alert(document.vlc.VersionInfo);'>
</TD></TR>
</TABLE>
</BODY>
......
......@@ -39,7 +39,7 @@ char *CStrFromBSTR(int codePage, BSTR bstr)
{
char *buffer = (char *)malloc(mblen+1);
ZeroMemory(buffer, mblen+1);
if( WideCharToMultiByte(CP_ACP, 0, bstr, len, buffer, mblen, NULL, NULL) )
if( WideCharToMultiByte(codePage, 0, bstr, len, buffer, mblen, NULL, NULL) )
return buffer;
}
}
......
......@@ -132,7 +132,7 @@ STDMETHODIMP VLCControl::get_Visible(VARIANT_BOOL *isVisible)
if( _p_instance->isInPlaceActive() )
*isVisible = _p_instance->isVisible() ? VARIANT_TRUE : VARIANT_FALSE;
else
*isVisible = VARIANT_FALSE;
*isVisible = _p_instance->getShowDisplay() ? VARIANT_TRUE : VARIANT_FALSE;
return NOERROR;
};
......
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