]> git.sesse.net Git - vlc/commitdiff
- activex: added configuration interface
authorDamien Fouilleul <damienf@videolan.org>
Fri, 22 Sep 2006 17:44:45 +0000 (17:44 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Fri, 22 Sep 2006 17:44:45 +0000 (17:44 +0000)
13 files changed:
activex/Makefile.am
activex/axvlc.idl
activex/axvlc.tlb
activex/axvlc_idl.c
activex/axvlc_idl.h
activex/main.cpp
activex/persistpropbag.cpp
activex/plugin.cpp
activex/plugin.h
activex/vlcconfiguration.cpp [new file with mode: 0755]
activex/vlcconfiguration.h [new file with mode: 0755]
activex/vlccontrol2.cpp
activex/vlccontrol2.h

index bd98a95ac2a1ae3785999e65bb93fe45afa6bf52..e833132262fccf98823aeb32659e2f4612a6a78b 100644 (file)
@@ -38,6 +38,8 @@ SOURCES_activex = \
     viewobject.h \
     vlccontrol.cpp \
     vlccontrol.h \
+    vlcconfiguration.cpp \
+    vlcconfiguration.h \
     vlccontrol2.cpp \
     vlccontrol2.h \
     plugin.cpp \
index 50f7662cbeab49d70267bcd0b62d381c831907e5..05ab4c1533e1b1f380ae17fd8d9e7ffc5c4acbf3 100644 (file)
@@ -43,7 +43,7 @@ library AXVLC
 \r
     importlib("stdole2.tlb");\r
 \r
-    enum VLCPlaylistMode\r
+    typedef [public] enum VLCPlaylistMode\r
     {\r
         VLCPlayListInsert       =  1,\r
         VLCPlayListInsertAndGo  =  9,\r
@@ -52,7 +52,7 @@ library AXVLC
         VLCPlayListAppend       =  4,\r
         VLCPlayListAppendAndGo  = 12,\r
         VLCPlayListCheckInsert  = 16\r
-    };\r
+    } eVLCPlaylistMode;\r
 \r
     // playlist target position\r
     const int VLCPlayListEnd    = -666;\r
@@ -67,6 +67,8 @@ library AXVLC
     const int DISPID_MRL        = 106;\r
     const int DISPID_AutoPlay   = 107;\r
     const int DISPID_AutoLoop   = 108;\r
+    const int DISPID_StartTime  = 109;\r
+    const int DISPID_BaseURL    = 110;\r
 \r
     [\r
       odl,\r
@@ -297,6 +299,54 @@ library AXVLC
         HRESULT height([out, retval] int* height);\r
     };\r
 \r
+    [\r
+      odl,\r
+      uuid(15179CD8-CC12-4242-A58E-E412217FF343),\r
+      helpstring("VLC Configuration options"),\r
+      dual,\r
+      oleautomation\r
+    ]\r
+    interface IVLCConfiguration : IDispatch\r
+    {\r
+        [id(DISPID_AutoLoop), propget, helpstring("Returns/sets a value that determines whether the playlist is looped")]\r
+        HRESULT AutoLoop([out, retval] VARIANT_BOOL* autoloop);\r
+        [id(DISPID_AutoLoop), propput, helpstring("Returns/sets a value that determines whether the playlist is looped")]\r
+        HRESULT AutoLoop([in] VARIANT_BOOL autoloop);\r
+\r
+        [id(DISPID_AutoPlay), propget, helpstring("Returns/sets a value that determines whether the playlist is played on startup")]\r
+        HRESULT AutoPlay([out, retval] VARIANT_BOOL* autoplay);\r
+        [id(DISPID_AutoPlay), propput, helpstring("Returns/Sets a value that determines whether the playlist is played on startup")]\r
+        HRESULT AutoPlay([in] VARIANT_BOOL autoplay);\r
+\r
+        [id(DISPID_BaseURL), propget, helpstring("Returns/sets the base URL for relative paths")]\r
+        HRESULT BaseURL([out, retval] BSTR* url);\r
+        [id(DISPID_BaseURL), propput, helpstring("Returns/sets the base URL for relative paths")]\r
+        HRESULT BaseURL([in] BSTR url);\r
+\r
+        [id(DISPID_StartTime), propget, helpstring("Returns/sets playback start time of URL.")]\r
+        HRESULT StartTime([out, retval] int* seconds);\r
+        [id(DISPID_StartTime), propput, helpstring("Returns/sets playback start time of URL.")]\r
+        HRESULT StartTime([in] int seconds);\r
+\r
+        [id(DISPID_MRL), propget, helpstring("Returns/sets the default MRL in playlist")]\r
+        HRESULT MRL([out, retval] BSTR* mrl);\r
+        [id(DISPID_MRL), propput, helpstring("Returns/sets the default MRL in playlist")]\r
+        HRESULT MRL([in] BSTR mrl);\r
+\r
+        [propget, helpstring("Returns VLC Version.")]\r
+        HRESULT VersionInfo([out, retval] BSTR* version);\r
+\r
+        [id(DISPID_Visible), propget, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]\r
+        HRESULT Visible([out, retval] VARIANT_BOOL* visible);\r
+        [id(DISPID_Visible), propput, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]\r
+        HRESULT Visible([in] VARIANT_BOOL visible);\r
+\r
+        [id(DISPID_Volume), propget, helpstring("Returns/sets default audio volume.")]\r
+        HRESULT Volume([out, retval] int* volume);\r
+        [id(DISPID_Volume), propput, helpstring("Returns/sets default audio volume.")]\r
+        HRESULT Volume([in] int volume);\r
+    };\r
+\r
     [\r
       odl,\r
       uuid(2D719729-5333-406C-BF12-8DE787FD65E3),\r
@@ -304,7 +354,7 @@ library AXVLC
       dual,\r
       oleautomation\r
     ]\r
-    interface IVLCControl2 : IDispatch\r
+    interface IVLCControl2 : IVLCConfiguration\r
     {\r
         [propget, helpstring("Returns the audio object.")]\r
         HRESULT audio([out, retval] IVLCAudio** obj);\r
index 3ca03b7c8a937a0fcf3d7c145018c4d82df8de48..9a2868fbecad3c464d98376a05fc6af8be530685 100644 (file)
Binary files a/activex/axvlc.tlb and b/activex/axvlc.tlb differ
index b2cba3e9c679e58c51e6bf2bbab4e33d04e5ca21..502aa47d88a54a641983186cfe10db2c76673b0d 100644 (file)
@@ -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);
index 07ccc65b5f9811c27a1428c45e4fb7354b0724c7..d83300ee0393534d1918c4c6eefe84d4eacf48ea 100644 (file)
@@ -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)
index bd4c0c3877f220e24796be67707a301a0e07be7e..53df72424a54d0fe62f93ede8f7fa4fa9f773374 100644 (file)
@@ -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);
 };
 
index 5592991bc4190d9797db3f0ebcd79d75d33974b6..6d3a529833b3dd985bffb7e0862af0917c117070 100644 (file)
@@ -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);
 
index 22914c322450b04cc4cbf6db8a61573c102daefb..9a96662d7e31cc3b3ec62e68b944b9d1dd6104f8 100644 (file)
@@ -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);
+                }
+                else
+                {
+                    psz_mrl = CStrFromBSTR(CP_UTF8, _bstr_mrl);
+                }
+                CoTaskMemFree(abs_url);
+            }
+            if( NULL != psz_mrl )
+            {
+                const char *options[1];
+                int i_options = 0;
+
+                char timeBuffer[32];
+                if( _i_time )
+                {
+                    snprintf(timeBuffer, sizeof(timeBuffer), ":start-time=%d", _i_time);
+                    options[i_options++] = timeBuffer;
+                }
+                // add default target to playlist
+                libvlc_playlist_add_extended(_p_libvlc, psz_mrl, NULL, i_options, options, NULL);
+                CoTaskMemFree(psz_mrl);
             }
-            // add default target to playlist
-            libvlc_playlist_add_extended(_p_libvlc, psz_mrl, NULL, i_options, options, NULL);
-            CoTaskMemFree(psz_mrl);
         }
     }
     *pp_libvlc = _p_libvlc;
@@ -917,7 +926,7 @@ void VLCPlugin::setTime(int seconds)
 
     if( seconds != _i_time )
     {
-        _i_time = seconds;
+        setStartTime(_i_time);
         if( isRunning() )
         {
             libvlc_input_t *p_input = libvlc_playlist_get_input(_p_libvlc, NULL);
@@ -927,7 +936,6 @@ void VLCPlugin::setTime(int seconds)
                 libvlc_input_free(p_input);
             }
         }
-        setDirty(TRUE);
     }
 };
 
index 94a4abe64d3b66dacf61b8b5217e054cc6de5b7b..9f1547f3ed84d7f40876d4641798cab8c53f0672 100644 (file)
@@ -120,9 +120,24 @@ public:
     BOOL getVisible(void) { return _b_visible; };
     BOOL isVisible(void) { return _b_visible || (! _b_usermode); };
 
+    inline void setStartTime(int time)
+    {
+        _i_time = time;
+        setDirty(TRUE);
+    };
+    inline int getStartTime(void) { return _i_time; };
+
     void setTime(int time);
     int  getTime(void) { return _i_time; };
 
+    void setBaseURL(BSTR url)
+    {
+        SysFreeString(_bstr_baseurl);
+        _bstr_baseurl = SysAllocStringLen(url, SysStringLen(url));
+        setDirty(TRUE);
+    };
+    const BSTR getBaseURL(void) { return _bstr_baseurl; };
+
     // control size in HIMETRIC
     inline void setExtent(const SIZEL& extent)
     {
@@ -240,6 +255,7 @@ private:
     RECT _posRect;
 
     // persistable properties
+    BSTR _bstr_baseurl;
     BSTR _bstr_mrl;
     BOOL _b_autoplay;
     BOOL _b_autoloop;
diff --git a/activex/vlcconfiguration.cpp b/activex/vlcconfiguration.cpp
new file mode 100755 (executable)
index 0000000..f9235f3
--- /dev/null
@@ -0,0 +1,235 @@
+/*****************************************************************************
+ * VLCConfiguration.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 the VideoLAN team
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "vlcconfiguration.h"
+
+#include "utils.h"
+
+using namespace std;
+
+VLCConfiguration::~VLCConfiguration()
+{
+    if( _p_typeinfo )
+        _p_typeinfo->Release();
+};
+
+HRESULT VLCConfiguration::loadTypeInfo(void)
+{
+    HRESULT hr = NOERROR;
+    if( NULL == _p_typeinfo )
+    {
+        ITypeLib *p_typelib;
+
+        hr = _p_instance->getTypeLib(LOCALE_USER_DEFAULT, &p_typelib);
+        if( SUCCEEDED(hr) )
+        {
+            hr = p_typelib->GetTypeInfoOfGuid(IID_IVLCConfiguration, &_p_typeinfo);
+            if( FAILED(hr) )
+            {
+                _p_typeinfo = NULL;
+            }
+            p_typelib->Release();
+        }
+    }
+    return hr;
+};
+
+STDMETHODIMP VLCConfiguration::GetTypeInfoCount(UINT* pctInfo)
+{
+    if( NULL == pctInfo )
+        return E_INVALIDARG;
+
+    if( SUCCEEDED(loadTypeInfo()) )
+        *pctInfo = 1;
+    else
+        *pctInfo = 0;
+
+    return NOERROR;
+};
+
+STDMETHODIMP VLCConfiguration::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
+{
+    if( NULL == ppTInfo )
+        return E_INVALIDARG;
+
+    if( SUCCEEDED(loadTypeInfo()) )
+    {
+        _p_typeinfo->AddRef();
+        *ppTInfo = _p_typeinfo;
+        return NOERROR;
+    }
+    *ppTInfo = NULL;
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCConfiguration::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, 
+        UINT cNames, LCID lcid, DISPID* rgDispID)
+{
+    if( SUCCEEDED(loadTypeInfo()) )
+    {
+        return DispGetIDsOfNames(_p_typeinfo, rgszNames, cNames, rgDispID);
+    }
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCConfiguration::Invoke(DISPID dispIdMember, REFIID riid,
+        LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
+        VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
+{
+    if( SUCCEEDED(loadTypeInfo()) )
+    {
+        return DispInvoke(this, _p_typeinfo, dispIdMember, wFlags, pDispParams,
+                pVarResult, pExcepInfo, puArgErr);
+    }
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCConfiguration::get_AutoLoop(VARIANT_BOOL *autoloop)
+{
+    if( NULL == autoloop )
+        return E_POINTER;
+
+    *autoloop = _p_instance->getAutoLoop() ? VARIANT_TRUE: VARIANT_FALSE;
+    return S_OK;
+};
+
+STDMETHODIMP VLCConfiguration::put_AutoLoop(VARIANT_BOOL autoloop)
+{
+    _p_instance->setAutoLoop((VARIANT_FALSE != autoloop) ? TRUE: FALSE);
+    return S_OK;
+};
+
+STDMETHODIMP VLCConfiguration::get_AutoPlay(VARIANT_BOOL *autoplay)
+{
+    if( NULL == autoplay )
+        return E_POINTER;
+
+    *autoplay = _p_instance->getAutoPlay() ? VARIANT_TRUE: VARIANT_FALSE;
+    return S_OK;
+};
+
+STDMETHODIMP VLCConfiguration::put_AutoPlay(VARIANT_BOOL autoplay)
+{
+    _p_instance->setAutoPlay((VARIANT_FALSE != autoplay) ? TRUE: FALSE);
+    return S_OK;
+};
+
+STDMETHODIMP VLCConfiguration::get_BaseURL(BSTR *url)
+{
+    if( NULL == url )
+        return E_POINTER;
+
+    *url = SysAllocStringLen(_p_instance->getBaseURL(),
+                SysStringLen(_p_instance->getBaseURL()));
+    return NOERROR;
+};
+
+STDMETHODIMP VLCConfiguration::put_BaseURL(BSTR mrl)
+{
+    _p_instance->setBaseURL(mrl);
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCConfiguration::get_MRL(BSTR *mrl)
+{
+    if( NULL == mrl )
+        return E_POINTER;
+
+    *mrl = SysAllocStringLen(_p_instance->getMRL(),
+                SysStringLen(_p_instance->getMRL()));
+    return NOERROR;
+};
+
+STDMETHODIMP VLCConfiguration::put_MRL(BSTR mrl)
+{
+    _p_instance->setMRL(mrl);
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCConfiguration::get_StartTime(int *seconds)
+{
+    if( NULL == seconds )
+        return E_POINTER;
+
+    *seconds = _p_instance->getStartTime();
+
+    return S_OK;
+};
+     
+STDMETHODIMP VLCConfiguration::put_StartTime(int seconds)
+{
+    _p_instance->setStartTime(seconds);
+
+    return NOERROR;
+};
+        
+STDMETHODIMP VLCConfiguration::get_VersionInfo(BSTR *version)
+{
+    if( NULL == version )
+        return E_POINTER;
+
+    const char *versionStr = VLC_Version();
+    if( NULL != versionStr )
+    {
+        *version = BSTRFromCStr(_p_instance->getCodePage(), versionStr);
+        
+        return NULL == *version ? E_OUTOFMEMORY : NOERROR;
+    }
+    *version = NULL;
+    return E_FAIL;
+};
+STDMETHODIMP VLCConfiguration::get_Visible(VARIANT_BOOL *isVisible)
+{
+    if( NULL == isVisible )
+        return E_POINTER;
+
+    *isVisible = _p_instance->getVisible() ? VARIANT_TRUE : VARIANT_FALSE;
+
+    return NOERROR;
+};
+        
+STDMETHODIMP VLCConfiguration::put_Visible(VARIANT_BOOL isVisible)
+{
+    _p_instance->setVisible(isVisible != VARIANT_FALSE);
+
+    return NOERROR;
+};
+
+STDMETHODIMP VLCConfiguration::get_Volume(int *volume)
+{
+    if( NULL == volume )
+        return E_POINTER;
+
+    *volume  = _p_instance->getVolume();
+    return NOERROR;
+};
+        
+STDMETHODIMP VLCConfiguration::put_Volume(int volume)
+{
+    _p_instance->setVolume(volume);
+    return NOERROR;
+};
+
diff --git a/activex/vlcconfiguration.h b/activex/vlcconfiguration.h
new file mode 100755 (executable)
index 0000000..de1c6cb
--- /dev/null
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * VLCConfiguration.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 the VideoLAN team
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef _VLCCONFIGURATION_H_
+#define _VLCCONFIGURATION_H_
+
+#include "axvlc_idl.h"
+
+class VLCConfiguration : public IVLCConfiguration
+{
+public:
+
+    VLCConfiguration(VLCPlugin *p_instance) :  _p_instance(p_instance), _p_typeinfo(NULL) {};
+    virtual ~VLCConfiguration();
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( NULL == ppv )
+          return E_POINTER;
+        if( (IID_IUnknown == riid)
+         || (IID_IDispatch == riid)
+         || (IID_IVLCConfiguration == riid) )
+        {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->pUnkOuter->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); };
+
+    // IDispatch methods
+    STDMETHODIMP GetTypeInfoCount(UINT*);
+    STDMETHODIMP GetTypeInfo(UINT, LCID, LPTYPEINFO*);
+    STDMETHODIMP GetIDsOfNames(REFIID,LPOLESTR*,UINT,LCID,DISPID*);
+    STDMETHODIMP Invoke(DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
+
+    /* IVLCConfiguration methods */
+    STDMETHODIMP get_AutoLoop(VARIANT_BOOL *autoloop);
+    STDMETHODIMP put_AutoLoop(VARIANT_BOOL autoloop);
+    STDMETHODIMP get_AutoPlay(VARIANT_BOOL *autoplay);
+    STDMETHODIMP put_AutoPlay(VARIANT_BOOL autoplay);
+    STDMETHODIMP get_BaseURL(BSTR *url);
+    STDMETHODIMP put_BaseURL(BSTR url);
+    STDMETHODIMP get_MRL(BSTR *mrl);
+    STDMETHODIMP put_MRL(BSTR mrl);
+    STDMETHODIMP get_StartTime(int *seconds);
+    STDMETHODIMP put_StartTime(int seconds);
+    STDMETHODIMP get_VersionInfo(BSTR *version);
+    STDMETHODIMP get_Visible(VARIANT_BOOL *visible);
+    STDMETHODIMP put_Visible(VARIANT_BOOL visible);
+    STDMETHODIMP get_Volume(int *volume);
+    STDMETHODIMP put_Volume(int volume);
+
+protected:
+    virtual HRESULT loadTypeInfo();
+
+private:
+    VLCPlugin*      _p_instance;
+    ITypeInfo*      _p_typeinfo;
+
+};
+#endif
+
index 1007775cd1b875f4c93076d71ff902587075ddd8..ce57ef5c86ca8c9977c77f9f1f53e7a543f09431 100755 (executable)
@@ -148,6 +148,8 @@ STDMETHODIMP VLCAudio::put_mute(VARIANT_BOOL mute)
     return hr;
 };
 
+#include <iostream>
+
 STDMETHODIMP VLCAudio::get_volume(int* volume)
 {
     if( NULL == volume )
@@ -161,6 +163,7 @@ STDMETHODIMP VLCAudio::get_volume(int* volume)
         libvlc_exception_init(&ex);
 
         *volume = libvlc_audio_get_volume(p_libvlc, &ex);
+        cerr << "volume is " << *volume;
         if( libvlc_exception_raised(&ex) )
         {
             libvlc_exception_clear(&ex);
@@ -1100,6 +1103,7 @@ STDMETHODIMP VLCVideo::get_height(int* height)
 /*******************************************************************************/
 
 VLCControl2::VLCControl2(VLCPlugin *p_instance) :
+    VLCConfiguration(p_instance),
     _p_instance(p_instance),
     _p_typeinfo(NULL),
     _p_vlcaudio(NULL),
index 2e3e60d22238ab07c907ce3092a44b12eab5e9ce..b07b4aa91410ac677eb3b0d7ee4d95f67b83922f 100755 (executable)
@@ -24,6 +24,7 @@
 #define _VLCCONTROL2_H_
 
 #include "axvlc_idl.h"
+#include "vlcconfiguration.h"
 
 class VLCAudio : public IVLCAudio
 {
@@ -65,11 +66,12 @@ public:
     STDMETHODIMP put_volume(int);
     STDMETHODIMP toggleMute();
  
-private:
-    HRESULT     loadTypeInfo();
+protected:
+    virtual HRESULT loadTypeInfo();
 
-    VLCPlugin*  _p_instance;
-    ITypeInfo*  _p_typeinfo;
+private:
+    VLCPlugin*      _p_instance;
+    ITypeInfo*      _p_typeinfo;
 
 };
  
@@ -118,12 +120,13 @@ public:
     STDMETHODIMP put_rate(float);
     STDMETHODIMP get_fps(float*);
     STDMETHODIMP get_hasVout(VARIANT_BOOL*);
-     
-private:
-    HRESULT     loadTypeInfo();
+    
+protected:
+    virtual HRESULT loadTypeInfo();
 
-    VLCPlugin*  _p_instance;
-    ITypeInfo*  _p_typeinfo;
+private:
+    VLCPlugin*      _p_instance;
+    ITypeInfo*      _p_typeinfo;
 
 };
  
@@ -173,10 +176,10 @@ public:
     STDMETHODIMP clear();
     STDMETHODIMP removeItem(int);
  
-private:
-
-    HRESULT     loadTypeInfo();
+protected:
+    virtual HRESULT loadTypeInfo();
 
+private:
     VLCPlugin*  _p_instance;
     ITypeInfo*  _p_typeinfo;
 
@@ -221,16 +224,16 @@ public:
     STDMETHODIMP get_width(int*);
     STDMETHODIMP get_height(int*);
  
-private:
+protected:
+    virtual HRESULT loadTypeInfo();
 
-    HRESULT     loadTypeInfo();
-
-    VLCPlugin*  _p_instance;
-    ITypeInfo*  _p_typeinfo;
+private:
+    VLCPlugin*      _p_instance;
+    ITypeInfo*      _p_typeinfo;
 
 };
  
-class VLCControl2 : public IVLCControl2
+class VLCControl2 : public VLCConfiguration
 {
     
 public:
@@ -245,6 +248,7 @@ public:
           return E_POINTER;
         if( (IID_IUnknown == riid)
          || (IID_IDispatch == riid)
+         || (IID_IVLCConfiguration == riid)
          || (IID_IVLCControl2 == riid) )
         {
             AddRef();
@@ -268,11 +272,11 @@ public:
     STDMETHODIMP get_input(IVLCInput**);
     STDMETHODIMP get_playlist(IVLCPlaylist**);
     STDMETHODIMP get_video(IVLCVideo**);
-private:
 
-    HRESULT         loadTypeInfo();
+protected:
+    virtual HRESULT loadTypeInfo();
 
+private:
     VLCPlugin*      _p_instance;
     ITypeInfo*      _p_typeinfo;