Commit 80158ffa authored by Damien Fouilleul's avatar Damien Fouilleul

- activex: added configuration interface

parent c127e730
......@@ -38,6 +38,8 @@ SOURCES_activex = \
viewobject.h \
vlccontrol.cpp \
vlccontrol.h \
vlcconfiguration.cpp \
vlcconfiguration.h \
vlccontrol2.cpp \
vlccontrol2.h \
plugin.cpp \
......
......@@ -43,7 +43,7 @@ library AXVLC
importlib("stdole2.tlb");
enum VLCPlaylistMode
typedef [public] enum VLCPlaylistMode
{
VLCPlayListInsert = 1,
VLCPlayListInsertAndGo = 9,
......@@ -52,7 +52,7 @@ library AXVLC
VLCPlayListAppend = 4,
VLCPlayListAppendAndGo = 12,
VLCPlayListCheckInsert = 16
};
} eVLCPlaylistMode;
// playlist target position
const int VLCPlayListEnd = -666;
......@@ -67,6 +67,8 @@ library AXVLC
const int DISPID_MRL = 106;
const int DISPID_AutoPlay = 107;
const int DISPID_AutoLoop = 108;
const int DISPID_StartTime = 109;
const int DISPID_BaseURL = 110;
[
odl,
......@@ -297,6 +299,54 @@ library AXVLC
HRESULT height([out, retval] int* height);
};
[
odl,
uuid(15179CD8-CC12-4242-A58E-E412217FF343),
helpstring("VLC Configuration options"),
dual,
oleautomation
]
interface IVLCConfiguration : IDispatch
{
[id(DISPID_AutoLoop), propget, helpstring("Returns/sets a value that determines whether the playlist is looped")]
HRESULT AutoLoop([out, retval] VARIANT_BOOL* autoloop);
[id(DISPID_AutoLoop), propput, helpstring("Returns/sets a value that determines whether the playlist is looped")]
HRESULT AutoLoop([in] VARIANT_BOOL autoloop);
[id(DISPID_AutoPlay), propget, helpstring("Returns/sets a value that determines whether the playlist is played on startup")]
HRESULT AutoPlay([out, retval] VARIANT_BOOL* autoplay);
[id(DISPID_AutoPlay), propput, helpstring("Returns/Sets a value that determines whether the playlist is played on startup")]
HRESULT AutoPlay([in] VARIANT_BOOL autoplay);
[id(DISPID_BaseURL), propget, helpstring("Returns/sets the base URL for relative paths")]
HRESULT BaseURL([out, retval] BSTR* url);
[id(DISPID_BaseURL), propput, helpstring("Returns/sets the base URL for relative paths")]
HRESULT BaseURL([in] BSTR url);
[id(DISPID_StartTime), propget, helpstring("Returns/sets playback start time of URL.")]
HRESULT StartTime([out, retval] int* seconds);
[id(DISPID_StartTime), propput, helpstring("Returns/sets playback start time of URL.")]
HRESULT StartTime([in] int seconds);
[id(DISPID_MRL), propget, helpstring("Returns/sets the default MRL in playlist")]
HRESULT MRL([out, retval] BSTR* mrl);
[id(DISPID_MRL), propput, helpstring("Returns/sets the default MRL in playlist")]
HRESULT MRL([in] BSTR mrl);
[propget, helpstring("Returns VLC Version.")]
HRESULT VersionInfo([out, retval] BSTR* version);
[id(DISPID_Visible), propget, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
HRESULT Visible([out, retval] VARIANT_BOOL* visible);
[id(DISPID_Visible), propput, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
HRESULT Visible([in] VARIANT_BOOL visible);
[id(DISPID_Volume), propget, helpstring("Returns/sets default audio volume.")]
HRESULT Volume([out, retval] int* volume);
[id(DISPID_Volume), propput, helpstring("Returns/sets default audio volume.")]
HRESULT Volume([in] int volume);
};
[
odl,
uuid(2D719729-5333-406C-BF12-8DE787FD65E3),
......@@ -304,7 +354,7 @@ library AXVLC
dual,
oleautomation
]
interface IVLCControl2 : IDispatch
interface IVLCControl2 : IVLCConfiguration
{
[propget, helpstring("Returns the audio object.")]
HRESULT audio([out, retval] IVLCAudio** obj);
......
No preview for this file type
......@@ -17,6 +17,7 @@ DEFINE_GUID(IID_IVLCAudio, 0x9e0bd17b, 0x2d3c, 0x4656, 0xb9,0x4d, 0x03,0x08,0x4f
DEFINE_GUID(IID_IVLCInput, 0x49e0dbd1, 0x9440, 0x466c, 0x9c,0x97, 0x95,0xc6,0x71,0x90,0xc6,0x03);
DEFINE_GUID(IID_IVLCPlaylist, 0x54613049, 0x40bf, 0x4035, 0x9e,0x70, 0x0a,0x93,0x12,0xc0,0x18,0x8d);
DEFINE_GUID(IID_IVLCVideo, 0x0aaedf0b, 0xd333, 0x4b27, 0xa0,0xc6, 0xbb,0xf3,0x14,0x13,0xa4,0x2e);
DEFINE_GUID(IID_IVLCConfiguration, 0x15179cd8, 0xcc12, 0x4242, 0xa5,0x8e, 0xe4,0x12,0x21,0x7f,0xf3,0x43);
DEFINE_GUID(IID_IVLCControl2, 0x2d719729, 0x5333, 0x406c, 0xbf,0x12, 0x8d,0xe7,0x87,0xfd,0x65,0xe3);
DEFINE_GUID(CLSID_VLCPlugin, 0xe23fe9c6, 0x778e, 0x49d4, 0xb5,0x37, 0x38,0xfc,0xde,0x48,0x87,0xd8);
DEFINE_GUID(CLSID_VLCPlugin2, 0x9be31822, 0xfdad, 0x461b, 0xad,0x51, 0xbe,0x1d,0x1c,0x15,0x99,0x21);
......
......@@ -46,7 +46,7 @@ typedef interface IVLCControl2 IVLCControl2;
typedef interface DVLCEvents DVLCEvents;
#endif
enum VLCPlaylistMode {
typedef enum VLCPlaylistMode {
VLCPlayListInsert = 1,
VLCPlayListInsertAndGo = 9,
VLCPlayListReplace = 2,
......@@ -54,8 +54,7 @@ enum VLCPlaylistMode {
VLCPlayListAppend = 4,
VLCPlayListAppendAndGo = 12,
VLCPlayListCheckInsert = 16
};
} eVLCPlaylistMode;
#define VLCPlayListEnd (-666)
#define DISPID_Visible (100)
......@@ -76,6 +75,10 @@ enum VLCPlaylistMode {
#define DISPID_AutoLoop (108)
#define DISPID_StartTime (109)
#define DISPID_BaseURL (110)
/*****************************************************************************
* IVLCControl interface
*/
......@@ -1569,6 +1572,333 @@ void __RPC_STUB IVLCVideo_get_height_Stub(
#endif /* __IVLCVideo_INTERFACE_DEFINED__ */
#ifndef __IVLCConfiguration_FWD_DEFINED__
#define __IVLCConfiguration_FWD_DEFINED__
typedef interface IVLCConfiguration IVLCConfiguration;
#endif
/*****************************************************************************
* IVLCConfiguration interface
*/
#ifndef __IVLCConfiguration_INTERFACE_DEFINED__
#define __IVLCConfiguration_INTERFACE_DEFINED__
DEFINE_GUID(IID_IVLCConfiguration, 0x15179cd8, 0xcc12, 0x4242, 0xa5,0x8e, 0xe4,0x12,0x21,0x7f,0xf3,0x43);
#if defined(__cplusplus) && !defined(CINTERFACE)
interface IVLCConfiguration : public IDispatch
{
virtual HRESULT STDMETHODCALLTYPE get_AutoLoop(
VARIANT_BOOL* autoloop) = 0;
virtual HRESULT STDMETHODCALLTYPE put_AutoLoop(
VARIANT_BOOL autoloop) = 0;
virtual HRESULT STDMETHODCALLTYPE get_AutoPlay(
VARIANT_BOOL* autoplay) = 0;
virtual HRESULT STDMETHODCALLTYPE put_AutoPlay(
VARIANT_BOOL autoplay) = 0;
virtual HRESULT STDMETHODCALLTYPE get_BaseURL(
BSTR* url) = 0;
virtual HRESULT STDMETHODCALLTYPE put_BaseURL(
BSTR url) = 0;
virtual HRESULT STDMETHODCALLTYPE get_StartTime(
int* seconds) = 0;
virtual HRESULT STDMETHODCALLTYPE put_StartTime(
int seconds) = 0;
virtual HRESULT STDMETHODCALLTYPE get_MRL(
BSTR* mrl) = 0;
virtual HRESULT STDMETHODCALLTYPE put_MRL(
BSTR mrl) = 0;
virtual HRESULT STDMETHODCALLTYPE get_VersionInfo(
BSTR* version) = 0;
virtual HRESULT STDMETHODCALLTYPE get_Visible(
VARIANT_BOOL* visible) = 0;
virtual HRESULT STDMETHODCALLTYPE put_Visible(
VARIANT_BOOL visible) = 0;
virtual HRESULT STDMETHODCALLTYPE get_Volume(
int* volume) = 0;
virtual HRESULT STDMETHODCALLTYPE put_Volume(
int volume) = 0;
};
#else
typedef struct IVLCConfigurationVtbl {
BEGIN_INTERFACE
/*** IUnknown methods ***/
HRESULT (STDMETHODCALLTYPE *QueryInterface)(
IVLCConfiguration* This,
REFIID riid,
void** ppvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(
IVLCConfiguration* This);
ULONG (STDMETHODCALLTYPE *Release)(
IVLCConfiguration* This);
/*** IDispatch methods ***/
HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
IVLCConfiguration* This,
UINT* pctinfo);
HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
IVLCConfiguration* This,
UINT iTInfo,
LCID lcid,
ITypeInfo** ppTInfo);
HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
IVLCConfiguration* This,
REFIID riid,
LPOLESTR* rgszNames,
UINT cNames,
LCID lcid,
DISPID* rgDispId);
HRESULT (STDMETHODCALLTYPE *Invoke)(
IVLCConfiguration* This,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS* pDispParams,
VARIANT* pVarResult,
EXCEPINFO* pExcepInfo,
UINT* puArgErr);
/*** IVLCConfiguration methods ***/
HRESULT (STDMETHODCALLTYPE *get_AutoLoop)(
IVLCConfiguration* This,
VARIANT_BOOL* autoloop);
HRESULT (STDMETHODCALLTYPE *put_AutoLoop)(
IVLCConfiguration* This,
VARIANT_BOOL autoloop);
HRESULT (STDMETHODCALLTYPE *get_AutoPlay)(
IVLCConfiguration* This,
VARIANT_BOOL* autoplay);
HRESULT (STDMETHODCALLTYPE *put_AutoPlay)(
IVLCConfiguration* This,
VARIANT_BOOL autoplay);
HRESULT (STDMETHODCALLTYPE *get_BaseURL)(
IVLCConfiguration* This,
BSTR* url);
HRESULT (STDMETHODCALLTYPE *put_BaseURL)(
IVLCConfiguration* This,
BSTR url);
HRESULT (STDMETHODCALLTYPE *get_StartTime)(
IVLCConfiguration* This,
int* seconds);
HRESULT (STDMETHODCALLTYPE *put_StartTime)(
IVLCConfiguration* This,
int seconds);
HRESULT (STDMETHODCALLTYPE *get_MRL)(
IVLCConfiguration* This,
BSTR* mrl);
HRESULT (STDMETHODCALLTYPE *put_MRL)(
IVLCConfiguration* This,
BSTR mrl);
HRESULT (STDMETHODCALLTYPE *get_VersionInfo)(
IVLCConfiguration* This,
BSTR* version);
HRESULT (STDMETHODCALLTYPE *get_Visible)(
IVLCConfiguration* This,
VARIANT_BOOL* visible);
HRESULT (STDMETHODCALLTYPE *put_Visible)(
IVLCConfiguration* This,
VARIANT_BOOL visible);
HRESULT (STDMETHODCALLTYPE *get_Volume)(
IVLCConfiguration* This,
int* volume);
HRESULT (STDMETHODCALLTYPE *put_Volume)(
IVLCConfiguration* This,
int volume);
END_INTERFACE
} IVLCConfigurationVtbl;
interface IVLCConfiguration {
const IVLCConfigurationVtbl* lpVtbl;
};
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IVLCConfiguration_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IVLCConfiguration_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IVLCConfiguration_Release(p) (p)->lpVtbl->Release(p)
/*** IDispatch methods ***/
#define IVLCConfiguration_GetTypeInfoCount(p,a) (p)->lpVtbl->GetTypeInfoCount(p,a)
#define IVLCConfiguration_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
#define IVLCConfiguration_GetIDsOfNames(p,a,b,c,d,e) (p)->lpVtbl->GetIDsOfNames(p,a,b,c,d,e)
#define IVLCConfiguration_Invoke(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Invoke(p,a,b,c,d,e,f,g,h)
/*** IVLCConfiguration methods ***/
#define IVLCConfiguration_get_AutoLoop(p,a) (p)->lpVtbl->get_AutoLoop(p,a)
#define IVLCConfiguration_put_AutoLoop(p,a) (p)->lpVtbl->put_AutoLoop(p,a)
#define IVLCConfiguration_get_AutoPlay(p,a) (p)->lpVtbl->get_AutoPlay(p,a)
#define IVLCConfiguration_put_AutoPlay(p,a) (p)->lpVtbl->put_AutoPlay(p,a)
#define IVLCConfiguration_get_BaseURL(p,a) (p)->lpVtbl->get_BaseURL(p,a)
#define IVLCConfiguration_put_BaseURL(p,a) (p)->lpVtbl->put_BaseURL(p,a)
#define IVLCConfiguration_get_StartTime(p,a) (p)->lpVtbl->get_StartTime(p,a)
#define IVLCConfiguration_put_StartTime(p,a) (p)->lpVtbl->put_StartTime(p,a)
#define IVLCConfiguration_get_MRL(p,a) (p)->lpVtbl->get_MRL(p,a)
#define IVLCConfiguration_put_MRL(p,a) (p)->lpVtbl->put_MRL(p,a)
#define IVLCConfiguration_get_VersionInfo(p,a) (p)->lpVtbl->get_VersionInfo(p,a)
#define IVLCConfiguration_get_Visible(p,a) (p)->lpVtbl->get_Visible(p,a)
#define IVLCConfiguration_put_Visible(p,a) (p)->lpVtbl->put_Visible(p,a)
#define IVLCConfiguration_get_Volume(p,a) (p)->lpVtbl->get_Volume(p,a)
#define IVLCConfiguration_put_Volume(p,a) (p)->lpVtbl->put_Volume(p,a)
#endif
#endif
HRESULT CALLBACK IVLCConfiguration_get_AutoLoop_Proxy(
IVLCConfiguration* This,
VARIANT_BOOL* autoloop);
void __RPC_STUB IVLCConfiguration_get_AutoLoop_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_put_AutoLoop_Proxy(
IVLCConfiguration* This,
VARIANT_BOOL autoloop);
void __RPC_STUB IVLCConfiguration_put_AutoLoop_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_get_AutoPlay_Proxy(
IVLCConfiguration* This,
VARIANT_BOOL* autoplay);
void __RPC_STUB IVLCConfiguration_get_AutoPlay_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_put_AutoPlay_Proxy(
IVLCConfiguration* This,
VARIANT_BOOL autoplay);
void __RPC_STUB IVLCConfiguration_put_AutoPlay_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_get_BaseURL_Proxy(
IVLCConfiguration* This,
BSTR* url);
void __RPC_STUB IVLCConfiguration_get_BaseURL_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_put_BaseURL_Proxy(
IVLCConfiguration* This,
BSTR url);
void __RPC_STUB IVLCConfiguration_put_BaseURL_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_get_StartTime_Proxy(
IVLCConfiguration* This,
int* seconds);
void __RPC_STUB IVLCConfiguration_get_StartTime_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_put_StartTime_Proxy(
IVLCConfiguration* This,
int seconds);
void __RPC_STUB IVLCConfiguration_put_StartTime_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_get_MRL_Proxy(
IVLCConfiguration* This,
BSTR* mrl);
void __RPC_STUB IVLCConfiguration_get_MRL_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_put_MRL_Proxy(
IVLCConfiguration* This,
BSTR mrl);
void __RPC_STUB IVLCConfiguration_put_MRL_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_get_VersionInfo_Proxy(
IVLCConfiguration* This,
BSTR* version);
void __RPC_STUB IVLCConfiguration_get_VersionInfo_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_get_Visible_Proxy(
IVLCConfiguration* This,
VARIANT_BOOL* visible);
void __RPC_STUB IVLCConfiguration_get_Visible_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_put_Visible_Proxy(
IVLCConfiguration* This,
VARIANT_BOOL visible);
void __RPC_STUB IVLCConfiguration_put_Visible_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_get_Volume_Proxy(
IVLCConfiguration* This,
int* volume);
void __RPC_STUB IVLCConfiguration_get_Volume_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCConfiguration_put_Volume_Proxy(
IVLCConfiguration* This,
int volume);
void __RPC_STUB IVLCConfiguration_put_Volume_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
#endif /* __IVLCConfiguration_INTERFACE_DEFINED__ */
/*****************************************************************************
* IVLCControl2 interface
*/
......@@ -1577,7 +1907,7 @@ void __RPC_STUB IVLCVideo_get_height_Stub(
DEFINE_GUID(IID_IVLCControl2, 0x2d719729, 0x5333, 0x406c, 0xbf,0x12, 0x8d,0xe7,0x87,0xfd,0x65,0xe3);
#if defined(__cplusplus) && !defined(CINTERFACE)
interface IVLCControl2 : public IDispatch
interface IVLCControl2 : public IVLCConfiguration
{
virtual HRESULT STDMETHODCALLTYPE get_audio(
IVLCAudio** obj) = 0;
......@@ -1638,6 +1968,67 @@ typedef struct IVLCControl2Vtbl {
EXCEPINFO* pExcepInfo,
UINT* puArgErr);
/*** IVLCConfiguration methods ***/
HRESULT (STDMETHODCALLTYPE *get_AutoLoop)(
IVLCControl2* This,
VARIANT_BOOL* autoloop);
HRESULT (STDMETHODCALLTYPE *put_AutoLoop)(
IVLCControl2* This,
VARIANT_BOOL autoloop);
HRESULT (STDMETHODCALLTYPE *get_AutoPlay)(
IVLCControl2* This,
VARIANT_BOOL* autoplay);
HRESULT (STDMETHODCALLTYPE *put_AutoPlay)(
IVLCControl2* This,
VARIANT_BOOL autoplay);
HRESULT (STDMETHODCALLTYPE *get_BaseURL)(
IVLCControl2* This,
BSTR* url);
HRESULT (STDMETHODCALLTYPE *put_BaseURL)(
IVLCControl2* This,
BSTR url);
HRESULT (STDMETHODCALLTYPE *get_StartTime)(
IVLCControl2* This,
int* seconds);
HRESULT (STDMETHODCALLTYPE *put_StartTime)(
IVLCControl2* This,
int seconds);
HRESULT (STDMETHODCALLTYPE *get_MRL)(
IVLCControl2* This,
BSTR* mrl);
HRESULT (STDMETHODCALLTYPE *put_MRL)(
IVLCControl2* This,
BSTR mrl);
HRESULT (STDMETHODCALLTYPE *get_VersionInfo)(
IVLCControl2* This,
BSTR* version);
HRESULT (STDMETHODCALLTYPE *get_Visible)(
IVLCControl2* This,
VARIANT_BOOL* visible);
HRESULT (STDMETHODCALLTYPE *put_Visible)(
IVLCControl2* This,
VARIANT_BOOL visible);
HRESULT (STDMETHODCALLTYPE *get_Volume)(
IVLCControl2* This,
int* volume);
HRESULT (STDMETHODCALLTYPE *put_Volume)(
IVLCControl2* This,
int volume);
/*** IVLCControl2 methods ***/
HRESULT (STDMETHODCALLTYPE *get_audio)(
IVLCControl2* This,
......@@ -1671,6 +2062,22 @@ interface IVLCControl2 {
#define IVLCControl2_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
#define IVLCControl2_GetIDsOfNames(p,a,b,c,d,e) (p)->lpVtbl->GetIDsOfNames(p,a,b,c,d,e)
#define IVLCControl2_Invoke(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Invoke(p,a,b,c,d,e,f,g,h)
/*** IVLCConfiguration methods ***/
#define IVLCControl2_get_AutoLoop(p,a) (p)->lpVtbl->get_AutoLoop(p,a)
#define IVLCControl2_put_AutoLoop(p,a) (p)->lpVtbl->put_AutoLoop(p,a)
#define IVLCControl2_get_AutoPlay(p,a) (p)->lpVtbl->get_AutoPlay(p,a)
#define IVLCControl2_put_AutoPlay(p,a) (p)->lpVtbl->put_AutoPlay(p,a)
#define IVLCControl2_get_BaseURL(p,a) (p)->lpVtbl->get_BaseURL(p,a)
#define IVLCControl2_put_BaseURL(p,a) (p)->lpVtbl->put_BaseURL(p,a)
#define IVLCControl2_get_StartTime(p,a) (p)->lpVtbl->get_StartTime(p,a)
#define IVLCControl2_put_StartTime(p,a) (p)->lpVtbl->put_StartTime(p,a)
#define IVLCControl2_get_MRL(p,a) (p)->lpVtbl->get_MRL(p,a)
#define IVLCControl2_put_MRL(p,a) (p)->lpVtbl->put_MRL(p,a)
#define IVLCControl2_get_VersionInfo(p,a) (p)->lpVtbl->get_VersionInfo(p,a)
#define IVLCControl2_get_Visible(p,a) (p)->lpVtbl->get_Visible(p,a)
#define IVLCControl2_put_Visible(p,a) (p)->lpVtbl->put_Visible(p,a)
#define IVLCControl2_get_Volume(p,a) (p)->lpVtbl->get_Volume(p,a)
#define IVLCControl2_put_Volume(p,a) (p)->lpVtbl->put_Volume(p,a)
/*** IVLCControl2 methods ***/
#define IVLCControl2_get_audio(p,a) (p)->lpVtbl->get_audio(p,a)
#define IVLCControl2_get_input(p,a) (p)->lpVtbl->get_input(p,a)
......
......@@ -384,6 +384,7 @@ STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
return 0;
DWORD dwRegisterClassObject;
DWORD dwRegisterClassObject2;
if( FAILED(CoRegisterClassObject(CLSID_VLCPlugin, classProc,
CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &dwRegisterClassObject)) )
......@@ -395,6 +396,10 @@ STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
ACTIVEOBJECT_WEAK, &dwRegisterActiveObject)) )
return 0;
if( FAILED(RegisterActiveObject(classProc, CLSID_VLCPlugin2,
ACTIVEOBJECT_WEAK, &dwRegisterActiveObject2)) )
return 0;
classProc->Release();
/*
......@@ -405,7 +410,7 @@ STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
while( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
{
if( msg.message == WM_QUIT )
break; // Leave the PeekMessage while() loop
break; // break out PeekMessage loop
/*if(TranslateAccelerator(ghwndApp, ghAccel, &msg))
continue;*/
......@@ -415,7 +420,7 @@ STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
}
if(msg.message == WM_QUIT)
break; // Leave the for() loop
break; // break out main loop
WaitMessage();
}
......@@ -423,8 +428,11 @@ STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
if( SUCCEEDED(RevokeActiveObject(dwRegisterActiveObject, NULL)) )
CoRevokeClassObject(dwRegisterClassObject);
if( SUCCEEDED(RevokeActiveObject(dwRegisterActiveObject2, NULL)) )
CoRevokeClassObject(dwRegisterClassObject2);
// Reached on WM_QUIT message
CoUninitialize();
OleUninitialize();
return ((int) msg.wParam);
};
......
......@@ -171,7 +171,14 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
V_VT(&value) = VT_I4;
if( S_OK == pPropBag->Read(OLESTR("starttime"), &value, pErrorLog) )
{
_p_instance->setTime(V_I4(&value));
_p_instance->setStartTime(V_I4(&value));
VariantClear(&value);
}
V_VT(&value) = VT_BSTR;
if( S_OK == pPropBag->Read(OLESTR("baseurl"), &value, pErrorLog) )
{
_p_instance->setBaseURL(V_BSTR(&value));
VariantClear(&value);
}
......@@ -221,10 +228,16 @@ STDMETHODIMP VLCPersistPropertyBag::Save(LPPROPERTYBAG pPropBag, BOOL fClearDirt
VariantClear(&value);
V_VT(&value) = VT_I4;
V_I4(&value) = _p_instance->getTime();
V_I4(&value) = _p_instance->getStartTime();
pPropBag->Write(OLESTR("StartTime"), &value);
VariantClear(&value);
V_VT(&value) = VT_BSTR;
V_BSTR(&value) = SysAllocStringLen(_p_instance->getBaseURL(),
SysStringLen(_p_instance->getBaseURL()));
pPropBag->Write(OLESTR("BaseURL"), &value);
VariantClear(&value);
if( fClearDirty )
_p_instance->setDirty(FALSE);
......
......@@ -223,6 +223,7 @@ STDMETHODIMP VLCPluginClass::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, vo
if( NULL != plugin )
{
HRESULT hr = plugin->QueryInterface(riid, ppv);
// the following will destroy the object if QueryInterface() failed
plugin->Release();
return hr;
}
......@@ -472,9 +473,10 @@ HRESULT VLCPlugin::onInit(void)
if( NULL == _p_libvlc )
{
// initialize persistable properties
_bstr_mrl = NULL;
_b_autoplay = TRUE;
_b_autoloop = FALSE;
_bstr_baseurl = NULL;
_bstr_mrl = NULL;
_b_visible = TRUE;
_b_mute = FALSE;
_i_volume = 50;
......@@ -493,12 +495,11 @@ HRESULT VLCPlugin::onInit(void)
HRESULT VLCPlugin::onLoad(void)
{
if( SysStringLen(_bstr_mrl) > 0 )
if( SysStringLen(_bstr_baseurl) == 0 )
{
/*
** try to combine MRL with client site moniker, which for Internet Explorer
** is the URL of the page the plugin is embedded into. Hence, if the MRL
** is a relative URL, we should end up with an absolute URL
** try to retreive the base URL using the client site moniker, which for Internet Explorer
** is the URL of the page the plugin is embedded into.
*/
LPOLECLIENTSITE pClientSite;
if( SUCCEEDED(vlcOleObject->GetClientSite(&pClientSite)) && (NULL != pClientSite) )
......@@ -518,26 +519,13 @@ HRESULT VLCPlugin::onLoad(void)
*/
if( UrlIsW(base_url, URLIS_URL) )
{
DWORD len = INTERNET_MAX_URL_LENGTH;
LPOLESTR abs_url = (LPOLESTR)CoTaskMemAlloc(sizeof(OLECHAR)*len);
if( NULL != abs_url )
{
if( SUCCEEDED(UrlCombineW(base_url, _bstr_mrl, abs_url, &len,
URL_ESCAPE_UNSAFE|URL_PLUGGABLE_PROTOCOL)) )
{
SysFreeString(_bstr_mrl);
_bstr_mrl = SysAllocStringLen(abs_url, len);
}
CoTaskMemFree(abs_url);
}
/* copy base URL */
_bstr_mrl = SysAllocString(base_url);
}
CoTaskMemFree(base_url);
}
pContMoniker->Release();
}
pBC->Release();
}
pClientSite->Release();
}
}
setDirty(FALSE);
......@@ -639,21 +627,42 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
return E_FAIL;
}
char *psz_mrl = CStrFromBSTR(CP_UTF8, _bstr_mrl);
if( NULL != psz_mrl )
if( SysStringLen(_bstr_mrl) > 0 )
{
const char *options[1];
int i_options = 0;
char timeBuffer[32];
if( _i_time )
char *psz_mrl = NULL;
DWORD len = INTERNET_MAX_URL_LENGTH;
LPOLESTR abs_url = (LPOLESTR)CoTaskMemAlloc(sizeof(OLECHAR)*len);
if( NULL != abs_url )
{
snprintf(timeBuffer, sizeof(timeBuffer), ":start-time=%d", _i_time);
options[i_options++] = timeBuffer;
/*
** if the MRL a relative URL, we should end up with an absolute URL
*/
if( SUCCEEDED(UrlCombineW(_bstr_baseurl, _bstr_mrl, abs_url, &len,
URL_ESCAPE_UNSAFE|URL_PLUGGABLE_PROTOCOL)) )
{
psz_mrl = CStrFromBSTR(CP_UTF8, abs_url);
}