interface IVLCAudio;\r
interface IVLCInput;\r
interface IVLCLog;\r
+ interface IVLCMarquee;\r
interface IVLCMessage;\r
interface IVLCMessageIterator;\r
interface IVLCMessages;\r
HRESULT description([in] long nameID, [out, retval] BSTR* name);\r
};\r
\r
+ [\r
+ odl,\r
+ uuid(8D076AD6-9B6F-4150-A0FD-5D7E8C8CB02C),\r
+ helpstring("VLC Marquee Filter"),\r
+ dual,\r
+ oleautomation\r
+ ]\r
+ interface IVLCMarquee : IDispatch\r
+ {\r
+ [helpstring("enable Marquee Filter.")]\r
+ HRESULT enable();\r
+\r
+ [helpstring("disable Marquee Filter.")]\r
+ HRESULT disable();\r
+\r
+ [helpstring("set text to Marquee Filter.")]\r
+ HRESULT text([in] BSTR text);\r
+\r
+ [helpstring("change text color.")]\r
+ HRESULT color ([in] long val);\r
+ [helpstring("change text opacity.")]\r
+ HRESULT opacity ([in] long val);\r
+ [helpstring("change text position.")]\r
+ HRESULT position ([in] long val);\r
+ [helpstring("change refresh time.")]\r
+ HRESULT refresh ([in] long val);\r
+ [helpstring("change text size.")]\r
+ HRESULT size ([in] long val);\r
+ [helpstring("change timeout.")]\r
+ HRESULT timeout ([in] long val);\r
+ [helpstring("change text abcissa.")]\r
+ HRESULT x ([in] long val);\r
+ [helpstring("change text ordinate.")]\r
+ HRESULT y ([in] long val);\r
+ };\r
+\r
[\r
odl,\r
uuid(0AAEDF0B-D333-4B27-A0C6-BBF31413A42E),\r
\r
[helpstring("toggle teletext transparent state.")]\r
HRESULT toggleTeletext();\r
+\r
+ [propget, helpstring("Returns the marquee object.")]\r
+ HRESULT marquee([out, retval] IVLCMarquee** obj);\r
};\r
\r
[\r
EMIT_EXCEPTION_BRIDGE( VLCAudio )
EMIT_EXCEPTION_BRIDGE( VLCInput )
+EMIT_EXCEPTION_BRIDGE( VLCMarquee )
EMIT_EXCEPTION_BRIDGE( VLCMessageIterator )
EMIT_EXCEPTION_BRIDGE( VLCMessages )
EMIT_EXCEPTION_BRIDGE( VLCLog )
/*******************************************************************************/
+VLCMarquee::~VLCMarquee()
+{
+ if( _p_typeinfo )
+ _p_typeinfo->Release();
+};
+
+HRESULT VLCMarquee::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_IVLCMarquee, &_p_typeinfo);
+ if( FAILED(hr) )
+ {
+ _p_typeinfo = NULL;
+ }
+ p_typelib->Release();
+ }
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::GetTypeInfoCount(UINT* pctInfo)
+{
+ if( NULL == pctInfo )
+ return E_INVALIDARG;
+
+ if( SUCCEEDED(loadTypeInfo()) )
+ *pctInfo = 1;
+ else
+ *pctInfo = 0;
+
+ return NOERROR;
+};
+
+STDMETHODIMP VLCMarquee::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 VLCMarquee::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 VLCMarquee::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 VLCMarquee::enable()
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Enabled, true, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::disable()
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Enabled, false, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::color(long val)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Color, val, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::opacity(long val)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Opacity, val, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::position(long val)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Position, val, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::refresh(long val)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Refresh, val, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::size(long val)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Size, val, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::text(BSTR text)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ char *psz_text = CStrFromBSTR(CP_UTF8, text);
+ libvlc_video_set_marquee_option_as_string(p_md, libvlc_marquee_Text, psz_text, &ex);
+ hr = exception_bridge(&ex);
+ CoTaskMemFree(psz_text);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::timeout(long val)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Timeout, val, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::x(long val)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_X, val, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+STDMETHODIMP VLCMarquee::y(long val)
+{
+ libvlc_media_player_t *p_md;
+ HRESULT hr = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(hr) )
+ {
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ libvlc_video_set_marquee_option_as_int(p_md, libvlc_marquee_Y, val, &ex);
+ hr = exception_bridge(&ex);
+ }
+ return hr;
+};
+
+/*******************************************************************************/
+
/* STL forward iterator used by VLCEnumIterator class to implement IEnumVARIANT */
class VLCMessageSTLIterator
VLCVideo::~VLCVideo()
{
+ delete _p_vlcmarquee;
if( _p_typeinfo )
_p_typeinfo->Release();
};
return hr;
};
+STDMETHODIMP VLCVideo::get_marquee(IVLCMarquee** obj)
+{
+ if( NULL == obj )
+ return E_POINTER;
+
+ *obj = _p_vlcmarquee;
+ if( NULL != _p_vlcmarquee )
+ {
+ _p_vlcmarquee->AddRef();
+ return NOERROR;
+ }
+ return E_OUTOFMEMORY;
+};
+
/*******************************************************************************/
VLCControl2::VLCControl2(VLCPlugin *p_instance) :
VLCMessages* _p_vlcmessages;
};
+class VLCMarquee : public IVLCMarquee
+{
+public:
+ VLCMarquee(VLCPlugin *p_instance) :
+ _p_instance(p_instance), _p_typeinfo(NULL) {};
+ virtual ~VLCMarquee();
+
+ // IUnknown methods
+ STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+ {
+ if( NULL == ppv )
+ return E_POINTER;
+ if( (IID_IUnknown == riid)
+ || (IID_IDispatch == riid)
+ || (IID_IVLCMarquee == riid) )
+ {
+ AddRef();
+ *ppv = reinterpret_cast<LPVOID>(this);
+ return NOERROR;
+ }
+ // behaves as a standalone object
+ return E_NOINTERFACE;
+ };
+
+ 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*);
+
+ // IVLCMarquee methods
+ STDMETHODIMP enable();
+ STDMETHODIMP disable();
+ STDMETHODIMP text(BSTR);
+ STDMETHODIMP color(long);
+ STDMETHODIMP opacity(long);
+ STDMETHODIMP position(long);
+ STDMETHODIMP refresh(long);
+ STDMETHODIMP size(long);
+ STDMETHODIMP timeout(long);
+ STDMETHODIMP x(long);
+ STDMETHODIMP y(long);
+
+protected:
+ HRESULT loadTypeInfo();
+ HRESULT exception_bridge(libvlc_exception_t *ex);
+
+private:
+ VLCPlugin* _p_instance;
+ ITypeInfo* _p_typeinfo;
+
+};
+
class VLCPlaylistItems : public IVLCPlaylistItems
{
public:
{
public:
VLCVideo(VLCPlugin *p_instance) :
- _p_instance(p_instance), _p_typeinfo(NULL) {};
+ _p_instance(p_instance),
+ _p_typeinfo(NULL),
+ _p_vlcmarquee(NULL)
+ {
+ _p_vlcmarquee = new VLCMarquee(p_instance);
+ };
virtual ~VLCVideo();
// IUnknown methods
STDMETHODIMP put_crop(BSTR);
STDMETHODIMP get_teletext(long*);
STDMETHODIMP put_teletext(long);
+ STDMETHODIMP get_marquee(IVLCMarquee**);
STDMETHODIMP deinterlaceDisable();
STDMETHODIMP deinterlaceEnable(BSTR);
STDMETHODIMP takeSnapshot(LPPICTUREDISP*);
private:
VLCPlugin* _p_instance;
ITypeInfo* _p_typeinfo;
+ VLCMarquee* _p_vlcmarquee;
};