- return E_POINTER;
-
- libvlc_instance_t* p_libvlc;
- HRESULT hr = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(hr) )
- {
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
- if( ! libvlc_exception_raised(&ex) )
- {
- *hasVout = libvlc_media_instance_has_vout(p_md, &ex) ? VARIANT_TRUE : VARIANT_FALSE;
- libvlc_media_instance_release(p_md);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- }
- _p_instance->setErrorInfo(IID_IVLCInput, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return hr;
-};
-
-/*******************************************************************************/
-
-VLCLog::~VLCLog()
-{
- delete _p_vlcmessages;
- if( _p_log )
- libvlc_log_close(_p_log, NULL);
-
- if( _p_typeinfo )
- _p_typeinfo->Release();
-};
-
-HRESULT VLCLog::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_IVLCLog, &_p_typeinfo);
- if( FAILED(hr) )
- {
- _p_typeinfo = NULL;
- }
- p_typelib->Release();
- }
- }
- return hr;
-};
-
-STDMETHODIMP VLCLog::GetTypeInfoCount(UINT* pctInfo)
-{
- if( NULL == pctInfo )
- return E_INVALIDARG;
-
- if( SUCCEEDED(loadTypeInfo()) )
- *pctInfo = 1;
- else
- *pctInfo = 0;
-
- return NOERROR;
-};
-
-STDMETHODIMP VLCLog::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 VLCLog::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 VLCLog::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 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 = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(hr) )
- {
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- *level = libvlc_get_log_verbosity(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCLog, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- }
- return hr;
- }
- else
- {
- /* log is not enabled, return -1 */
- *level = -1;
- return NOERROR;
- }
-};
-
-STDMETHODIMP VLCLog::put_verbosity(long verbosity)
-{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_instance_t* p_libvlc;
- HRESULT hr = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(hr) )
- {
- if( verbosity >= 0 )
- {
- if( ! _p_log )
- {
- _p_log = libvlc_log_open(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCLog, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- }
- libvlc_set_log_verbosity(p_libvlc, (unsigned)verbosity, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCLog, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- }
- else if( _p_log )
- {
- /* close log when verbosity is set to -1 */
- libvlc_log_close(_p_log, &ex);
- _p_log = NULL;
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCLog, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- }
- }
- return hr;
-};
-
-/*******************************************************************************/
-
-/* 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;
-};
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-VLCMessages::~VLCMessages()
-{
- if( _p_typeinfo )
- _p_typeinfo->Release();
-};
-
-HRESULT VLCMessages::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_IVLCMessages, &_p_typeinfo);
- if( FAILED(hr) )
- {
- _p_typeinfo = NULL;
- }
- p_typelib->Release();
- }
- }
- return hr;
-};
-
-STDMETHODIMP VLCMessages::GetTypeInfoCount(UINT* pctInfo)
-{
- if( NULL == pctInfo )
- return E_INVALIDARG;
-
- if( SUCCEEDED(loadTypeInfo()) )
- *pctInfo = 1;
- else
- *pctInfo = 0;
-
- return NOERROR;
-};
-
-STDMETHODIMP VLCMessages::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 VLCMessages::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 VLCMessages::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 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_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_log_clear(p_log, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCMessages, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- }
- return NOERROR;
-};
-
-STDMETHODIMP VLCMessages::get_count(long* count)
-{
- if( NULL == count )
- return E_POINTER;
-
- libvlc_log_t *p_log = _p_vlclog->_p_log;
- if( p_log )
- {
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- *count = libvlc_log_count(p_log, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCMessages, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- }
- else
- *count = 0;
- return S_OK;
-};
-
-STDMETHODIMP VLCMessages::iterator(IVLCMessageIterator** iter)
-{
- if( NULL == iter )
- return E_POINTER;
-
- *iter = new VLCMessageIterator(_p_instance, _p_vlclog);
-
- return *iter ? S_OK : E_OUTOFMEMORY;
-};
-
-/*******************************************************************************/
-
-VLCMessageIterator::VLCMessageIterator(VLCPlugin *p_instance, VLCLog* p_vlclog ) :
- _p_instance(p_instance),
- _p_typeinfo(NULL),
- _refcount(1),
- _p_vlclog(p_vlclog)
-{
- if( p_vlclog->_p_log )
- {
- _p_iter = libvlc_log_get_iterator(p_vlclog->_p_log, NULL);
- }
- else
- _p_iter = NULL;
-};
-
-VLCMessageIterator::~VLCMessageIterator()
-{
- if( _p_iter )
- libvlc_log_iterator_free(_p_iter, NULL);
-
- if( _p_typeinfo )
- _p_typeinfo->Release();
-};
-
-HRESULT VLCMessageIterator::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_IVLCMessageIterator, &_p_typeinfo);
- if( FAILED(hr) )
- {
- _p_typeinfo = NULL;
- }
- p_typelib->Release();
- }
- }
- return hr;
-};
-
-STDMETHODIMP VLCMessageIterator::GetTypeInfoCount(UINT* pctInfo)
-{
- if( NULL == pctInfo )
- return E_INVALIDARG;
-
- if( SUCCEEDED(loadTypeInfo()) )
- *pctInfo = 1;
- else
- *pctInfo = 0;
-
- return NOERROR;
-};
-
-STDMETHODIMP VLCMessageIterator::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 VLCMessageIterator::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 VLCMessageIterator::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 VLCMessageIterator::get_hasNext(VARIANT_BOOL* hasNext)
-{
- if( NULL == hasNext )
- return E_POINTER;
-
- if( _p_iter && _p_vlclog->_p_log )
- {
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- *hasNext = libvlc_log_iterator_has_next(_p_iter, &ex) ? VARIANT_TRUE : VARIANT_FALSE;
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCMessageIterator, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- }
- else
- {
- *hasNext = VARIANT_FALSE;
- }
- return S_OK;
-};
-
-STDMETHODIMP VLCMessageIterator::next(IVLCMessage** message)
-{
- 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);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCMessageIterator, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- *message = new VLCMessage(_p_instance, buffer);
- return *message ? NOERROR : E_OUTOFMEMORY;
- }
- return E_FAIL;
-};
-
-/*******************************************************************************/
-
-VLCMessage::~VLCMessage()
-{
- if( _p_typeinfo )
- _p_typeinfo->Release();
-};
-
-HRESULT VLCMessage::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_IVLCMessage, &_p_typeinfo);
- if( FAILED(hr) )
- {
- _p_typeinfo = NULL;
- }
- p_typelib->Release();
- }
- }
- return hr;
-};
-
-STDMETHODIMP VLCMessage::GetTypeInfoCount(UINT* pctInfo)
-{
- if( NULL == pctInfo )
- return E_INVALIDARG;
-
- if( SUCCEEDED(loadTypeInfo()) )
- *pctInfo = 1;
- else
- *pctInfo = 0;
-
- return NOERROR;
-};
-
-STDMETHODIMP VLCMessage::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 VLCMessage::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 VLCMessage::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;
-};
-
-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;
-};
-
-/*******************************************************************************/
-
-VLCPlaylistItems::~VLCPlaylistItems()
-{
- if( _p_typeinfo )
- _p_typeinfo->Release();
-};
-
-HRESULT VLCPlaylistItems::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_IVLCPlaylistItems, &_p_typeinfo);
- if( FAILED(hr) )
- {
- _p_typeinfo = NULL;
- }
- p_typelib->Release();
- }
- }
- return hr;
-};
-
-STDMETHODIMP VLCPlaylistItems::GetTypeInfoCount(UINT* pctInfo)
-{
- if( NULL == pctInfo )
- return E_INVALIDARG;
-
- if( SUCCEEDED(loadTypeInfo()) )
- *pctInfo = 1;
- else
- *pctInfo = 0;
-
- return NOERROR;
-};
-
-STDMETHODIMP VLCPlaylistItems::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 VLCPlaylistItems::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 VLCPlaylistItems::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 VLCPlaylistItems::get_count(long* count)
-{
- if( NULL == count )
- return E_POINTER;
-
- libvlc_instance_t* p_libvlc;
- HRESULT hr = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(hr) )
- {
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- *count = libvlc_playlist_items_count(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCPlaylistItems,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;