]> git.sesse.net Git - vlc/blob - activex/vlccontrol.h
mkv.cpp: implement working support for the new SimpleBlock (only when libmatroska...
[vlc] / activex / vlccontrol.h
1 /*****************************************************************************
2  * vlccontrol.h: ActiveX control for VLC
3  *****************************************************************************
4  * Copyright (C) 2005 the VideoLAN team
5  *
6  * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22
23 #ifndef _VLCCONTROL_H_
24 #define _VLCCONTROL_H_
25
26 #include <oaidl.h>
27 #include "axvlc_idl.h"
28
29 class VLCControl : public IVLCControl
30 {
31     
32 public:
33
34     VLCControl(VLCPlugin *p_instance) :  _p_instance(p_instance), _p_typeinfo(NULL) {};
35     virtual ~VLCControl();
36
37     // IUnknown methods
38     STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
39     {
40         if( (NULL != ppv)
41          && (IID_IUnknown == riid)
42          && (IID_IDispatch == riid)
43          && (IID_IVLCControl == riid) ) {
44             AddRef();
45             *ppv = reinterpret_cast<LPVOID>(this);
46             return NOERROR;
47         }
48         return _p_instance->pUnkOuter->QueryInterface(riid, ppv);
49     };
50
51     STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); };
52     STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); };
53
54     // IDispatch methods
55     STDMETHODIMP GetTypeInfoCount(UINT*);
56     STDMETHODIMP GetTypeInfo(UINT, LCID, LPTYPEINFO*);
57     STDMETHODIMP GetIDsOfNames(REFIID,LPOLESTR*,UINT,LCID,DISPID*);
58     STDMETHODIMP Invoke(DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
59
60     // IVLCControl methods
61     STDMETHODIMP play(void);
62     STDMETHODIMP get_Visible(VARIANT_BOOL *visible);
63     STDMETHODIMP put_Visible(VARIANT_BOOL visible);
64     STDMETHODIMP pause(void);
65     STDMETHODIMP stop(void);
66     STDMETHODIMP get_Playing(VARIANT_BOOL *isPlaying);
67     STDMETHODIMP get_Position(float *position);
68     STDMETHODIMP put_Position(float position);
69     STDMETHODIMP get_Time(int *seconds);
70     STDMETHODIMP put_Time(int seconds);
71     STDMETHODIMP shuttle(int seconds);
72     STDMETHODIMP fullscreen();
73     STDMETHODIMP get_Length(int *seconds);
74     STDMETHODIMP playFaster(void);
75     STDMETHODIMP playSlower(void);
76     STDMETHODIMP get_Volume(int *volume);
77     STDMETHODIMP put_Volume(int volume);
78     STDMETHODIMP toggleMute(void);
79     STDMETHODIMP setVariable( BSTR name, VARIANT value);
80     STDMETHODIMP getVariable( BSTR name, VARIANT *value);
81     STDMETHODIMP addTarget( BSTR uri, VARIANT options, enum VLCPlaylistMode mode, int position);
82     STDMETHODIMP get_PlaylistIndex(int *index);
83     STDMETHODIMP get_PlaylistCount(int *count);
84     STDMETHODIMP playlistNext(void);
85     STDMETHODIMP playlistPrev(void);
86     STDMETHODIMP playlistClear(void);
87     STDMETHODIMP get_VersionInfo(BSTR *version);
88     STDMETHODIMP get_MRL(BSTR *mrl);
89     STDMETHODIMP put_MRL(BSTR mrl);
90     STDMETHODIMP get_AutoLoop(VARIANT_BOOL *autoloop);
91     STDMETHODIMP put_AutoLoop(VARIANT_BOOL autoloop);
92     STDMETHODIMP get_AutoPlay(VARIANT_BOOL *autoplay);
93     STDMETHODIMP put_AutoPlay(VARIANT_BOOL autoplay);
94  
95 private:
96
97     HRESULT      getTypeInfo();
98
99     VLCPlugin *_p_instance;
100     ITypeInfo *_p_typeinfo;
101
102 };
103  
104 #endif
105