Commit 1ecd02ef authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Jean-Baptiste Kempf

activex: remove IVLCLog, IVLCMessagesIterator, IVLCMessage interface.

parent ccf4474a
......@@ -40,11 +40,8 @@ library AXVLC
interface IVLCControl;
interface IVLCAudio;
interface IVLCInput;
interface IVLCLog;
interface IVLCLogo;
interface IVLCMarquee;
interface IVLCMessage;
interface IVLCMessageIterator;
interface IVLCMessages;
interface IVLCPlaylist;
interface IVLCSubtitle;
interface IVLCVideo;
......@@ -261,90 +258,6 @@ library AXVLC
HRESULT hasVout([out, retval] VARIANT_BOOL* hasVout);
};
[
odl,
uuid(9ED00AFA-7BCD-4FFF-8D48-7DD4DB2C800D),
helpstring("VLC Log Message"),
dual,
oleautomation
]
interface IVLCMessage: IDispatch
{
[id(DISPID_VALUE), propget]
HRESULT _Value([out, retval] VARIANT* message);
[propget, helpstring("Returns message severity.")]
HRESULT severity([out, retval] long* level);
[propget, helpstring("Returns message issuer type.")]
HRESULT type([out, retval] BSTR* type);
[propget, helpstring("Returns message issuer name.")]
HRESULT name([out, retval] BSTR* name);
[propget, helpstring("Returns message header.")]
HRESULT header([out, retval] BSTR* header);
[propget, helpstring("Returns message content.")]
HRESULT message([out, retval] BSTR* message);
};
[
odl,
uuid(15179CD8-CC12-4242-A58E-E412217FF343),
helpstring("VLC Log iterator"),
dual,
oleautomation
]
interface IVLCMessageIterator : IDispatch
{
[propget, helpstring("Returns whether a message is available.")]
HRESULT hasNext([out, retval] VARIANT_BOOL* hasNext);
[helpstring("Returns next message.")]
HRESULT next([out, retval] IVLCMessage** msg);
};
[
odl,
uuid(6C5CE55D-2D6C-4AAD-8299-C62D2371F106),
helpstring("VLC Log Messages Collection."),
dual,
oleautomation
]
interface IVLCMessages : IDispatch
{
[id(DISPID_NEWENUM), propget]
HRESULT _NewEnum([out, retval] IUnknown** _NewEnum);
[helpstring("Clear all messages from log.")]
HRESULT clear();
[propget, helpstring("Returns the number of messages.")]
HRESULT count([out, retval] long* count);
[helpstring("Returns an iterator for messages in log")]
HRESULT iterator([out, retval] IVLCMessageIterator** iter);
};
[
odl,
uuid(8E3BC3D9-62E9-48FB-8A6D-993F9ABC4A0A),
helpstring("VLC Log APIs"),
dual,
oleautomation
]
interface IVLCLog : IDispatch
{
[propget, helpstring("Returns messages in log")]
HRESULT messages([out, retval] IVLCMessages** iter);
[propget, helpstring("Returns/Sets the log versbosity level.")]
HRESULT verbosity([out, retval] long* level);
[propput, helpstring("Returns/Sets the log versbosity level.")]
HRESULT verbosity([in] long level);
};
[
odl,
uuid(FD37FE32-82BC-4A25-B056-315F4DBB194D),
......@@ -661,9 +574,6 @@ library AXVLC
[propget, helpstring("Returns the audio object.")]
HRESULT input([out, retval] IVLCInput** obj);
[propget, helpstring("Returns the log object.")]
HRESULT log([out, retval] IVLCLog** obj);
[propget, helpstring("Returns the playlist object.")]
HRESULT playlist([out, retval] IVLCPlaylist** obj);
......
No preview for this file type
/*** Autogenerated by WIDL 1.1.23 from axvlc.idl - Do not edit ***/
/*** Autogenerated by WIDL 1.1.32 from axvlc.idl - Do not edit ***/
#include <rpc.h>
#include <rpcndr.h>
......@@ -14,10 +14,6 @@ DEFINE_GUID(IID_IVLCControl, 0xc2fa41d0, 0xb113, 0x476e, 0xac,0x8c, 0x9b,0xd1,0x
DEFINE_GUID(DIID_DVLCEvents, 0xdf48072f, 0x5ef8, 0x434e, 0x9b,0x40, 0xe2,0xf3,0xae,0x75,0x9b,0x5f);
DEFINE_GUID(IID_IVLCAudio, 0x9e0bd17b, 0x2d3c, 0x4656, 0xb9,0x4d, 0x03,0x08,0x4f,0x3f,0xd9,0xd4);
DEFINE_GUID(IID_IVLCInput, 0x49e0dbd1, 0x9440, 0x466c, 0x9c,0x97, 0x95,0xc6,0x71,0x90,0xc6,0x03);
DEFINE_GUID(IID_IVLCMessage, 0x9ed00afa, 0x7bcd, 0x4fff, 0x8d,0x48, 0x7d,0xd4,0xdb,0x2c,0x80,0x0d);
DEFINE_GUID(IID_IVLCMessageIterator, 0x15179cd8, 0xcc12, 0x4242, 0xa5,0x8e, 0xe4,0x12,0x21,0x7f,0xf3,0x43);
DEFINE_GUID(IID_IVLCMessages, 0x6c5ce55d, 0x2d6c, 0x4aad, 0x82,0x99, 0xc6,0x2d,0x23,0x71,0xf1,0x06);
DEFINE_GUID(IID_IVLCLog, 0x8e3bc3d9, 0x62e9, 0x48fb, 0x8a,0x6d, 0x99,0x3f,0x9a,0xbc,0x4a,0x0a);
DEFINE_GUID(IID_IVLCPlaylistItems, 0xfd37fe32, 0x82bc, 0x4a25, 0xb0,0x56, 0x31,0x5f,0x4d,0xbb,0x19,0x4d);
DEFINE_GUID(IID_IVLCPlaylist, 0x54613049, 0x40bf, 0x4035, 0x9e,0x70, 0x0a,0x93,0x12,0xc0,0x18,0x8d);
DEFINE_GUID(IID_IVLCSubtitle, 0x465e787a, 0x0556, 0x452f, 0x94,0x77, 0x95,0x4e,0x4a,0x94,0x00,0x03);
......
This diff is collapsed.
......@@ -656,14 +656,6 @@ HRESULT VLCPlugin::onClose(DWORD dwSaveOption)
{
libvlc_instance_t* p_libvlc = _p_libvlc;
IVLCLog *p_log;
if( SUCCEEDED(vlcControl2->get_log(&p_log)) )
{
// make sure the log is disabled
p_log->put_verbosity(-1);
p_log->Release();
}
_p_libvlc = NULL;
vlcDataObject->onClose();
......
/*****************************************************************************
* supporterrorinfo.cpp: ActiveX control for VLC
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* Copyright (C) 2005-2010 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
*
......@@ -32,11 +32,8 @@ STDMETHODIMP VLCSupportErrorInfo::InterfaceSupportsErrorInfo(REFIID riid)
{
if( (riid == IID_IVLCAudio)
|| (riid == IID_IVLCInput)
|| (riid == IID_IVLCLog)
|| (riid == IID_IVLCMarquee)
|| (riid == IID_IVLCMessage)
|| (riid == IID_IVLCMessageIterator)
|| (riid == IID_IVLCMessages)
|| (riid == IID_IVLCLogo)
|| (riid == IID_IVLCPlaylist)
|| (riid == IID_IVLCPlaylistItems)
|| (riid == IID_IVLCSubtitle)
......
......@@ -63,10 +63,6 @@ HRESULT VLCInterfaceBase::loadTypeInfo(REFIID riid)
BIND_INTERFACE( VLCAudio )
BIND_INTERFACE( VLCInput )
BIND_INTERFACE( VLCMessage )
BIND_INTERFACE( VLCMessages )
BIND_INTERFACE( VLCMessageIterator )
BIND_INTERFACE( VLCLog )
BIND_INTERFACE( VLCMarquee )
BIND_INTERFACE( VLCLogo )
BIND_INTERFACE( VLCPlaylistItems )
......@@ -473,80 +469,6 @@ STDMETHODIMP VLCInput::get_hasVout(VARIANT_BOOL* hasVout)
/****************************************************************************/
VLCLog::~VLCLog()
{
delete _p_vlcmessages;
if( _p_log )
libvlc_log_close(_p_log);
}
STDMETHODIMP VLCLog::get_messages(IVLCMessages** obj)
{
if( NULL == obj )
return E_POINTER;
*obj = _p_vlcmessages;
if( NULL != _p_vlcmessages )
{
_p_vlcmessages->AddRef();
return NOERROR;
}
return E_OUTOFMEMORY;
};
STDMETHODIMP VLCLog::get_verbosity(long* level)
{
if( NULL == level )
return E_POINTER;
if( _p_log )
{
libvlc_instance_t* p_libvlc;
HRESULT hr = getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
*level = libvlc_get_log_verbosity(p_libvlc);
return hr;
}
else
{
/* log is not enabled, return -1 */
*level = -1;
return NOERROR;
}
};
STDMETHODIMP VLCLog::put_verbosity(long verbosity)
{
libvlc_instance_t* p_libvlc;
HRESULT hr = getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
if( verbosity >= 0 )
{
if( ! _p_log )
{
_p_log = libvlc_log_open(p_libvlc, &ex);
hr = exception_bridge(&ex);
}
if( SUCCEEDED(hr) )
libvlc_set_log_verbosity(p_libvlc, (unsigned)verbosity);
}
else if( _p_log )
{
/* close log when verbosity is set to -1 */
libvlc_log_close(_p_log);
_p_log = NULL;
}
hr = exception_bridge(&ex);
}
return hr;
};
/****************************************************************************/
HRESULT VLCMarquee::do_put_int(unsigned idx, LONG val)
{
libvlc_media_player_t *p_md;
......@@ -650,266 +572,6 @@ STDMETHODIMP VLCMarquee::put_text(BSTR val)
/****************************************************************************/
/* STL forward iterator used by VLCEnumIterator class to implement IEnumVARIANT */
class VLCMessageSTLIterator
{
public:
VLCMessageSTLIterator(IVLCMessageIterator* iter) : iter(iter), msg(NULL)
{
// get first message
operator++();
};
VLCMessageSTLIterator(const VLCMessageSTLIterator& other)
{
iter = other.iter;
if( iter )
iter->AddRef();
msg = other.msg;
if( msg )
msg->AddRef();
};
virtual ~VLCMessageSTLIterator()
{
if( msg )
msg->Release();
if( iter )
iter->Release();
};
// we only need prefix ++ operator
VLCMessageSTLIterator& operator++()
{
VARIANT_BOOL hasNext = VARIANT_FALSE;
if( iter )
{
iter->get_hasNext(&hasNext);
if( msg )
{
msg->Release();
msg = NULL;
}
if( VARIANT_TRUE == hasNext ) {
iter->next(&msg);
}
}
return *this;
};
VARIANT operator*() const
{
VARIANT v;
VariantInit(&v);
if( msg )
{
if( SUCCEEDED(msg->QueryInterface(IID_IDispatch,
(LPVOID*)&V_DISPATCH(&v))) )
{
V_VT(&v) = VT_DISPATCH;
}
}
return v;
};
bool operator==(const VLCMessageSTLIterator& other) const
{
return msg == other.msg;
};
bool operator!=(const VLCMessageSTLIterator& other) const
{
return msg != other.msg;
};
private:
IVLCMessageIterator* iter;
IVLCMessage* msg;
};
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP VLCMessages::get__NewEnum(LPUNKNOWN* _NewEnum)
{
if( NULL == _NewEnum )
return E_POINTER;
IVLCMessageIterator* iter = NULL;
iterator(&iter);
*_NewEnum= new VLCEnumIterator<IID_IEnumVARIANT,
IEnumVARIANT,
VARIANT,
VLCMessageSTLIterator>
(VLCMessageSTLIterator(iter), VLCMessageSTLIterator(NULL));
return *_NewEnum ? S_OK : E_OUTOFMEMORY;
};
STDMETHODIMP VLCMessages::clear()
{
libvlc_log_t *p_log = _p_vlclog->_p_log;
if( p_log )
libvlc_log_clear(p_log);
return NOERROR;
};
STDMETHODIMP VLCMessages::get_count(long* count)
{
if( NULL == count )
return E_POINTER;
libvlc_log_t *p_log = _p_vlclog->_p_log;
*count = libvlc_log_count(p_log);
return S_OK;
};
STDMETHODIMP VLCMessages::iterator(IVLCMessageIterator** iter)
{
if( NULL == iter )
return E_POINTER;
*iter = new VLCMessageIterator(Instance(), _p_vlclog);
return *iter ? S_OK : E_OUTOFMEMORY;
};
/****************************************************************************/
VLCMessageIterator::VLCMessageIterator(VLCPlugin *p, VLCLog* p_vlclog ):
VLCInterface<VLCMessageIterator,IVLCMessageIterator>(p),
_refcount(1),
_p_vlclog(p_vlclog),
_p_iter(_p_vlclog && _p_vlclog->_p_log ?
libvlc_log_get_iterator(_p_vlclog->_p_log, NULL) : NULL)
{
}
STDMETHODIMP VLCMessageIterator::get_hasNext(VARIANT_BOOL* hasNext)
{
if( NULL == hasNext )
return E_POINTER;
*hasNext = (_p_iter && _p_vlclog->_p_log &&
libvlc_log_iterator_has_next(_p_iter)) ?
VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
};
STDMETHODIMP VLCMessageIterator::next(IVLCMessage** message)
{
HRESULT hr = S_OK;
if( NULL == message )
return E_POINTER;
if( _p_iter && _p_vlclog->_p_log )
{
struct libvlc_log_message_t buffer;
buffer.sizeof_msg = sizeof(buffer);
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_log_iterator_next(_p_iter, &buffer, &ex);
*message = new VLCMessage(Instance(), buffer);
if( !message )
hr = E_OUTOFMEMORY;
}
return hr;
};
/****************************************************************************/
inline const char *msgSeverity(int sev)
{
switch( sev )
{
case 0:
return "info";
case 1:
return "error";
case 2:
return "warning";
default:
return "debug";
}
};
STDMETHODIMP VLCMessage::get__Value(VARIANT* _Value)
{
if( NULL == _Value )
return E_POINTER;
char buffer[256];
snprintf(buffer, sizeof(buffer), "%s %s %s: %s",
_msg.psz_type, _msg.psz_name, msgSeverity(_msg.i_severity), _msg.psz_message);
V_VT(_Value) = VT_BSTR;
V_BSTR(_Value) = BSTRFromCStr(CP_UTF8, buffer);
return S_OK;
};
STDMETHODIMP VLCMessage::get_severity(long* level)
{
if( NULL == level )
return E_POINTER;
*level = _msg.i_severity;
return S_OK;
};
STDMETHODIMP VLCMessage::get_type(BSTR* type)
{
if( NULL == type )
return E_POINTER;
*type = BSTRFromCStr(CP_UTF8, _msg.psz_type);
return NOERROR;
};
STDMETHODIMP VLCMessage::get_name(BSTR* name)
{
if( NULL == name )
return E_POINTER;
*name = BSTRFromCStr(CP_UTF8, _msg.psz_name);
return NOERROR;
};
STDMETHODIMP VLCMessage::get_header(BSTR* header)
{
if( NULL == header )
return E_POINTER;
*header = BSTRFromCStr(CP_UTF8, _msg.psz_header);
return NOERROR;
};
STDMETHODIMP VLCMessage::get_message(BSTR* message)
{
if( NULL == message )
return E_POINTER;
*message = BSTRFromCStr(CP_UTF8, _msg.psz_message);
return NOERROR;
};
/****************************************************************************/
STDMETHODIMP VLCPlaylistItems::get_count(long* count)
{
if( NULL == count )
......@@ -1782,7 +1444,6 @@ VLCControl2::VLCControl2(VLCPlugin *p_instance) :
_p_typeinfo(NULL),
_p_vlcaudio(new VLCAudio(p_instance)),
_p_vlcinput(new VLCInput(p_instance)),
_p_vlclog(new VLCLog(p_instance)),
_p_vlcplaylist(new VLCPlaylist(p_instance)),
_p_vlcsubtitle(new VLCSubtitle(p_instance)),
_p_vlcvideo(new VLCVideo(p_instance))
......@@ -1794,7 +1455,6 @@ VLCControl2::~VLCControl2()
delete _p_vlcvideo;
delete _p_vlcsubtitle;
delete _p_vlcplaylist;
delete _p_vlclog;
delete _p_vlcinput;
delete _p_vlcaudio;
if( _p_typeinfo )
......@@ -2058,11 +1718,6 @@ STDMETHODIMP VLCControl2::get_input(IVLCInput** obj)
return object_get(obj,_p_vlcinput);
}
STDMETHODIMP VLCControl2::get_log(IVLCLog** obj)
{
return object_get(obj,_p_vlclog);
}
STDMETHODIMP VLCControl2::get_playlist(IVLCPlaylist** obj)
{
return object_get(obj,_p_vlcplaylist);
......
......@@ -2,6 +2,7 @@
* vlccontrol.h: ActiveX control for VLC
*****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* Copyright (C) 2010 M2X BV
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
* Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
......@@ -172,114 +173,6 @@ public:
STDMETHODIMP get_hasVout(VARIANT_BOOL*);
};
class VLCMessage: public VLCInterface<VLCMessage,IVLCMessage>
{
public:
VLCMessage(VLCPlugin *p, struct libvlc_log_message_t &msg):
VLCInterface<VLCMessage,IVLCMessage>(p),
_refcount(1),
_msg(msg) { }
STDMETHODIMP_(ULONG) AddRef(void)
{ return InterlockedIncrement(&_refcount); }
STDMETHODIMP_(ULONG) Release(void)
{
ULONG refcount = InterlockedDecrement(&_refcount);
if( 0 == refcount )
{
delete this;
return 0;
}
return refcount;
};
// IVLCMessage methods
STDMETHODIMP get__Value(VARIANT *);
STDMETHODIMP get_severity(long *);
STDMETHODIMP get_type(BSTR *);
STDMETHODIMP get_name(BSTR *);
STDMETHODIMP get_header(BSTR *);
STDMETHODIMP get_message(BSTR *);
private:
LONG _refcount;
struct libvlc_log_message_t _msg;
};
class VLCLog;
class VLCMessageIterator: public
VLCInterface<VLCMessageIterator,IVLCMessageIterator>
{
public:
VLCMessageIterator(VLCPlugin *p, VLCLog *p_vlclog );
~VLCMessageIterator() { if( _p_iter ) libvlc_log_iterator_free(_p_iter); }
STDMETHODIMP_(ULONG) AddRef(void)
{ return InterlockedIncrement(&_refcount); };
STDMETHODIMP_(ULONG) Release(void)
{
ULONG refcount = InterlockedDecrement(&_refcount);
if( 0 == refcount )
{
delete this;
return 0;
}
return refcount;
}
// IVLCMessageIterator methods
STDMETHODIMP get_hasNext(VARIANT_BOOL*);
STDMETHODIMP next(IVLCMessage**);
private:
LONG _refcount;
VLCLog* _p_vlclog;
libvlc_log_iterator_t* _p_iter;
};
class VLCMessages: public VLCInterface<VLCMessages,IVLCMessages>
{
public:
VLCMessages(VLCPlugin *p, VLCLog *p_vlclog):
VLCInterface<VLCMessages,IVLCMessages>(p),
_p_vlclog(p_vlclog) { }
// IVLCMessages methods
STDMETHODIMP get__NewEnum(LPUNKNOWN*);
STDMETHODIMP clear();
STDMETHODIMP get_count(long*);
STDMETHODIMP iterator(IVLCMessageIterator**);
protected:
VLCLog* _p_vlclog;
};
class VLCLog: public VLCInterface<VLCLog,IVLCLog>
{
public:
friend class VLCMessages;
friend class VLCMessageIterator;
VLCLog(VLCPlugin *p): VLCInterface<VLCLog,IVLCLog>(p), _p_log(NULL),
_p_vlcmessages(new VLCMessages(p, this)) { }
virtual ~VLCLog();
// IVLCLog methods
STDMETHODIMP get_messages(IVLCMessages**);
STDMETHODIMP get_verbosity(long *);
STDMETHODIMP put_verbosity(long);
protected:
libvlc_log_t *_p_log;
IVLCMessages *_p_vlcmessages;
};
class VLCMarquee: public VLCInterface<VLCMarquee,IVLCMarquee>
{
public:
......@@ -484,7 +377,6 @@ public:
STDMETHODIMP get_audio(IVLCAudio**);
STDMETHODIMP get_input(IVLCInput**);
STDMETHODIMP get_log(IVLCLog**);
STDMETHODIMP get_playlist(IVLCPlaylist**);
STDMETHODIMP get_subtitle(IVLCSubtitle**);
STDMETHODIMP get_video(IVLCVideo**);
......@@ -498,7 +390,6 @@ private:
IVLCAudio *_p_vlcaudio;
IVLCInput *_p_vlcinput;
IVLCLog *_p_vlclog;
IVLCPlaylist *_p_vlcplaylist;
IVLCSubtitle *_p_vlcsubtitle;
IVLCVideo *_p_vlcvideo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment