]> git.sesse.net Git - vlc/blobdiff - activex/plugin.h
Remove annoying warnings.
[vlc] / activex / plugin.h
index 227773a8aa0fcda2c8a7253f624de64a7db76cdf..456583be78274d6d268304902693272b2f199296 100644 (file)
@@ -17,7 +17,7 @@
  *
  * 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 __PLUGIN_H__
 #include <ole2.h>
 #include <olectl.h>
 
-#include <vlc/vlc.h>
+#include <vlc/libvlc.h>
 
 extern const GUID CLSID_VLCPlugin; 
+extern const GUID CLSID_VLCPlugin2; 
 extern const GUID LIBID_AXVLC; 
 extern const GUID DIID_DVLCEvents; 
 
@@ -37,7 +38,7 @@ class VLCPluginClass : public IClassFactory
 
 public:
 
-    VLCPluginClass(LONG *p_class_ref,HINSTANCE hInstance);
+    VLCPluginClass(LONG *p_class_ref, HINSTANCE hInstance, REFCLSID rclsid);
 
     /* IUnknown methods */
     STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
@@ -48,8 +49,9 @@ public:
     STDMETHODIMP CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppv);
     STDMETHODIMP LockServer(BOOL fLock);
 
+    REFCLSID getClassID(void) { return (REFCLSID)_classid; };
+
     LPCSTR getInPlaceWndClassName(void) const { return TEXT("VLC Plugin In-Place"); };
-    LPCSTR getVideoWndClassName(void) const { return TEXT("VLC Plugin Video"); };
     HINSTANCE getHInstance(void) const { return _hinstance; };
     LPPICTURE getInPlacePict(void) const
         { if( NULL != _inplace_picture) _inplace_picture->AddRef(); return _inplace_picture; };
@@ -62,8 +64,8 @@ private:
 
     LPLONG      _p_class_ref;
     HINSTANCE   _hinstance;
+    CLSID       _classid;
     ATOM        _inplace_wndclass_atom;
-    ATOM        _video_wndclass_atom;
     LPPICTURE   _inplace_picture;
 };
 
@@ -81,7 +83,7 @@ public:
 
     /* custom methods */
     HRESULT getTypeLib(LCID lcid, ITypeLib **pTL) { return LoadRegTypeLib(LIBID_AXVLC, 1, 0, lcid, pTL); };
-    REFCLSID getClassID(void) { return (REFCLSID)CLSID_VLCPlugin; };
+    REFCLSID getClassID(void) { return _p_class->getClassID(); };
     REFIID getDispEventID(void) { return (REFIID)DIID_DVLCEvents; };
 
     /*
@@ -109,8 +111,30 @@ public:
     };
     inline BOOL getAutoLoop(void) { return _b_autoloop;};
 
+    void setVolume(int volume);
+    int getVolume(void) { return _i_volume; };
+
     void setVisible(BOOL fVisible);
     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)
@@ -143,7 +167,14 @@ public:
     void setFocus(BOOL fFocus);
 
     inline UINT getCodePage(void) { return _i_codepage; };
-    inline void setCodePage(UINT cp) { _i_codepage = cp; };
+    inline void setCodePage(UINT cp)
+    {
+        // accept new codepage only if it works on this system
+        size_t mblen = WideCharToMultiByte(cp,
+                0, L"test", -1, NULL, 0, NULL, NULL);
+        if( mblen > 0 )
+            _i_codepage = cp;
+    };
 
     inline BOOL isUserMode(void) { return _b_usermode; };
     inline void setUserMode(BOOL um) { _b_usermode = um; };
@@ -151,15 +182,16 @@ public:
     inline BOOL isDirty(void) { return _b_dirty; };
     inline void setDirty(BOOL dirty) { _b_dirty = dirty; };
 
-    inline BOOL isRunning(void) { return 0 != _i_vlc; };
+    inline BOOL isRunning(void) { return NULL != _p_libvlc; };
+    HRESULT getVLCObject(int *i_vlc);
+    HRESULT getVLC(libvlc_instance_t** p_vlc);
+    void setErrorInfo(REFIID riid, const char *description);
 
     // control geometry within container
     RECT getPosRect(void) { return _posRect; }; 
     inline HWND getInPlaceWindow(void) const { return _inplacewnd; };
     BOOL isInPlaceActive(void);
 
-    inline int getVLCObject(void) const { return _i_vlc; };
-
     /*
     ** container events
     */
@@ -204,30 +236,35 @@ private:
     class VLCConnectionPointContainer *vlcConnectionPointContainer;
     class VLCObjectSafety *vlcObjectSafety;
     class VLCControl *vlcControl;
+    class VLCControl2 *vlcControl2;
     class VLCViewObject *vlcViewObject;
     class VLCDataObject *vlcDataObject;
+    class VLCSupportErrorInfo *vlcSupportErrorInfo;
 
-    // in place activated window (Clipping window)
+    // in place activated window (Plugin window)
     HWND _inplacewnd;
-    // video window (Drawing window)
-    HWND _videownd;
 
-    VLCPluginClass *_p_class;
+    VLCPluginClass_p_class;
     ULONG _i_ref;
 
-    LPPICTURE _p_pict;
+    libvlc_instance_t* _p_libvlc;
     UINT _i_codepage;
     BOOL _b_usermode;
+    RECT _posRect;
+
+    // persistable properties
+    BSTR _bstr_baseurl;
     BSTR _bstr_mrl;
     BOOL _b_autoplay;
     BOOL _b_autoloop;
     BOOL _b_visible;
     BOOL _b_mute;
-    BOOL _b_dirty;
-    int  _i_vlc;
-
+    int  _i_volume;
+    int  _i_time;
     SIZEL _extent;
-    RECT _posRect;
+    LPPICTURE _p_pict;
+    // indicates whether properties needs persisting
+    BOOL _b_dirty;
 };
 
 #endif