]> git.sesse.net Git - vlc/blobdiff - activex/vlccontrol.h
I forgot this part in the previous commit.
[vlc] / activex / vlccontrol.h
index f262b631599d1b750d40831e9f2bf166aa966a34..fa19b31fac53c8fffaa162fec1231de5fc39e906 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vlccontrol.h: ActiveX control for VLC
  *****************************************************************************
- * Copyright (C) 2005 VideoLAN (Centrale Réseaux) and its contributors
+ * Copyright (C) 2005 the VideoLAN team
  *
  * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
  *
  *
  * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifndef _VLCCONTROL_H_
 #define _VLCCONTROL_H_
 
-#include <oaidl.h>
 #include "axvlc_idl.h"
 
 class VLCControl : public IVLCControl
 {
-    
 public:
 
     VLCControl(VLCPlugin *p_instance) :  _p_instance(p_instance), _p_typeinfo(NULL) {};
@@ -37,19 +35,21 @@ public:
     // IUnknown methods
     STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
     {
-        if( (NULL != ppv)
-         && (IID_IUnknown == riid)
-         && (IID_IDispatch == riid)
-         && (IID_IVLCControl == riid) ) {
+        if( NULL == ppv )
+          return E_POINTER;
+        if( (IID_IUnknown == riid)
+         || (IID_IDispatch == riid)
+         || (IID_IVLCControl == riid) )
+        {
             AddRef();
-            *ppv = dynamic_cast<LPVOID>(this);
+            *ppv = reinterpret_cast<LPVOID>(this);
             return NOERROR;
         }
-        return _p_instance->QueryInterface(riid, ppv);
+        return _p_instance->pUnkOuter->QueryInterface(riid, ppv);
     };
 
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); };
 
     // IDispatch methods
     STDMETHODIMP GetTypeInfoCount(UINT*);
@@ -64,7 +64,6 @@ public:
     STDMETHODIMP pause(void);
     STDMETHODIMP stop(void);
     STDMETHODIMP get_Playing(VARIANT_BOOL *isPlaying);
-    STDMETHODIMP put_Playing(VARIANT_BOOL isPlaying);
     STDMETHODIMP get_Position(float *position);
     STDMETHODIMP put_Position(float position);
     STDMETHODIMP get_Time(int *seconds);
@@ -86,15 +85,22 @@ public:
     STDMETHODIMP playlistPrev(void);
     STDMETHODIMP playlistClear(void);
     STDMETHODIMP get_VersionInfo(BSTR *version);
+    STDMETHODIMP get_MRL(BSTR *mrl);
+    STDMETHODIMP put_MRL(BSTR mrl);
+    STDMETHODIMP get_AutoLoop(VARIANT_BOOL *autoloop);
+    STDMETHODIMP put_AutoLoop(VARIANT_BOOL autoloop);
+    STDMETHODIMP get_AutoPlay(VARIANT_BOOL *autoplay);
+    STDMETHODIMP put_AutoPlay(VARIANT_BOOL autoplay);
+
+    static HRESULT CreateTargetOptions(int codePage, VARIANT *options, char ***cOptions, int *cOptionCount);
+    static void FreeTargetOptions(char **cOptions, int cOptionCount);
+
 private:
 
     HRESULT      getTypeInfo();
 
     VLCPlugin *_p_instance;
     ITypeInfo *_p_typeinfo;
-
 };
-#endif
 
+#endif