/*****************************************************************************
* vlccontrol.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>
* Jean-Paul Saman <jpsaman@videolan.org>
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "plugin.h"
*isVisible = _p_instance->getVisible() ? VARIANT_TRUE : VARIANT_FALSE;
- return NOERROR;
+ return S_OK;
};
STDMETHODIMP VLCControl::put_Visible(VARIANT_BOOL isVisible)
{
_p_instance->setVisible(isVisible != VARIANT_FALSE);
- return NOERROR;
+ return S_OK;
};
STDMETHODIMP VLCControl::play(void)
{
- libvlc_instance_t* p_libvlc;
- HRESULT result = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(result) )
- {
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_playlist_play(p_libvlc, -1, 0, NULL, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- _p_instance->fireOnPlayEvent();
- return NOERROR;
- }
- return result;
+ _p_instance->playlist_play();
+ _p_instance->fireOnPlayEvent();
+ return S_OK;
};
STDMETHODIMP VLCControl::pause(void)
{
- libvlc_instance_t* p_libvlc;
- HRESULT result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t* p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_playlist_pause(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
+ libvlc_media_player_pause(p_md);
_p_instance->fireOnPauseEvent();
- return NOERROR;
}
return result;
};
STDMETHODIMP VLCControl::stop(void)
{
- libvlc_instance_t* p_libvlc;
- HRESULT result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_playlist_stop(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
+ libvlc_media_player_stop(p_md);
+ _p_instance->fireOnStopEvent();
}
- _p_instance->fireOnStopEvent();
return result;
};
if( NULL == isPlaying )
return E_POINTER;
- HRESULT result = NOERROR;
- if( _p_instance->isRunning() )
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(result) )
{
- libvlc_instance_t *p_libvlc;
- result = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(result) )
- {
- if( libvlc_playlist_isplaying(p_libvlc, NULL) )
- *isPlaying = VARIANT_TRUE;
- else
- *isPlaying = VARIANT_FALSE;
- return NOERROR;
- }
- }
- *isPlaying = VARIANT_FALSE;
+ *isPlaying = libvlc_media_player_is_playing(p_md) ?
+ VARIANT_TRUE : VARIANT_FALSE;
+ } else *isPlaying = VARIANT_FALSE;
return result;
};
return E_POINTER;
*position = 0.0f;
- libvlc_instance_t* p_libvlc;
- HRESULT result = E_UNEXPECTED;
- result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_media_player_t *p_md;
- p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
- if( !libvlc_exception_raised(&ex) )
- {
- *position = libvlc_media_player_get_position(p_md, &ex);
- libvlc_media_player_release(p_md);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- }
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
+ *position = libvlc_media_player_get_position(p_md);
}
return result;
};
STDMETHODIMP VLCControl::put_Position(float position)
{
- HRESULT result = E_UNEXPECTED;
- libvlc_instance_t* p_libvlc;
- result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_media_player_t *p_md;
- p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
- if( ! libvlc_exception_raised(&ex) )
- {
- libvlc_media_player_set_position(p_md, position, &ex);
- libvlc_media_player_release(p_md);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- }
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
+ libvlc_media_player_set_position(p_md, position);
}
return result;
};
return E_POINTER;
*seconds = 0;
- libvlc_instance_t* p_libvlc;
- HRESULT result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_media_player_t *p_md;
- p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
- if( ! libvlc_exception_raised(&ex) )
- {
- *seconds = libvlc_media_player_get_time(p_md, &ex);
- libvlc_media_player_release(p_md);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- }
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
+ *seconds = libvlc_media_player_get_time(p_md);
}
return result;
};
{
/* setTime function of the plugin sets the time. */
_p_instance->setTime(seconds);
- return NOERROR;
+ return S_OK;
};
STDMETHODIMP VLCControl::shuttle(int seconds)
{
- libvlc_instance_t* p_libvlc;
- HRESULT result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_media_player_t *p_md;
- p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
- if( ! libvlc_exception_raised(&ex) )
- {
- if( seconds < 0 ) seconds = 0;
- libvlc_media_player_set_time(p_md, (int64_t)seconds, &ex);
- libvlc_media_player_release(p_md);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- }
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
+ if( seconds < 0 ) seconds = 0;
+ libvlc_media_player_set_time(p_md, (int64_t)seconds);
}
return result;
STDMETHODIMP VLCControl::fullscreen(void)
{
- HRESULT result = E_UNEXPECTED;
- if( _p_instance->isRunning() )
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
+ if( SUCCEEDED(result) )
{
- libvlc_instance_t *p_libvlc;
- result = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(result) )
+ if( libvlc_media_player_is_playing(p_md) )
{
- if( libvlc_playlist_isplaying(p_libvlc, NULL) )
- {
- libvlc_media_player_t *p_md =
- libvlc_playlist_get_media_player(p_libvlc, NULL);
- if( p_md )
- {
- libvlc_toggle_fullscreen(p_md, NULL);
- libvlc_media_player_release(p_md);
- }
- }
+ libvlc_toggle_fullscreen(p_md);
}
}
return result;
return E_POINTER;
*seconds = 0;
- libvlc_instance_t* p_libvlc;
- HRESULT result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_media_player_t *p_md;
- p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
- if( ! libvlc_exception_raised(&ex) )
- {
- *seconds = (double)libvlc_media_player_get_length(p_md, &ex);
- libvlc_media_player_release(p_md);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- }
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
+ *seconds = (double)libvlc_media_player_get_length(p_md);
}
return result;
{
int32_t rate = 2;
- HRESULT result = E_UNEXPECTED;
- if( !_p_instance->isRunning() )
- return result;
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
- libvlc_instance_t* p_libvlc;
- result = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_media_player_t *p_md;
- p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
- if( ! libvlc_exception_raised(&ex) )
- {
- libvlc_media_player_set_rate(p_md, rate, &ex);
- libvlc_media_player_release(p_md);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- }
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
+ libvlc_media_player_set_rate(p_md, rate);
}
return result;
};
{
float rate = 0.5;
- HRESULT result = E_UNEXPECTED;
- if( !_p_instance->isRunning() )
- return result;
-
- libvlc_instance_t* p_libvlc;
- result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_media_player_t *p_md;
- p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
- if( ! libvlc_exception_raised(&ex) )
- {
- libvlc_media_player_set_rate(p_md, rate, &ex);
- libvlc_media_player_release(p_md);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- }
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
+ libvlc_media_player_set_rate(p_md, rate);
}
return result;
};
return E_POINTER;
*volume = _p_instance->getVolume();
- return NOERROR;
+ return S_OK;
};
STDMETHODIMP VLCControl::put_Volume(int volume)
{
_p_instance->setVolume(volume);
- return NOERROR;
+ return S_OK;
};
STDMETHODIMP VLCControl::toggleMute(void)
{
- libvlc_instance_t* p_libvlc;
- HRESULT result = _p_instance->getVLC(&p_libvlc);
+ libvlc_media_player_t *p_md;
+ HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
- {
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_audio_toggle_mute(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
- }
+ libvlc_audio_toggle_mute(p_md);
return result;
};
STDMETHODIMP VLCControl::setVariable(BSTR name, VARIANT value)
{
- return E_INVALIDARG;
-#if 0
- if( 0 == SysStringLen(name) )
- return E_INVALIDARG;
-
- libvlc_instance_t *p_libvlc;
- HRESULT hr = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(hr) )
+ libvlc_instance_t* p_libvlc;
+ HRESULT result = _p_instance->getVLC(&p_libvlc);
+ if( SUCCEEDED(result) )
{
- int codePage = _p_instance->getCodePage();
- char *psz_varname = CStrFromBSTR(codePage, name);
- if( NULL == psz_varname )
- return E_OUTOFMEMORY;
-
- int i_type;
- vlc_value_t val;
-
- if( VLC_SUCCESS == VLC_VariableType(i_vlc, psz_varname, &i_type) )
- {
- VARIANT arg;
- VariantInit(&arg);
-
- switch( i_type )
- {
- case VLC_VAR_BOOL:
- hr = VariantChangeType(&arg, &value, 0, VT_BOOL);
- if( SUCCEEDED(hr) )
- val.b_bool = (VARIANT_TRUE == V_BOOL(&arg)) ? true : false;
- break;
-
- case VLC_VAR_INTEGER:
- case VLC_VAR_HOTKEY:
- hr = VariantChangeType(&arg, &value, 0, VT_I4);
- if( SUCCEEDED(hr) )
- val.i_int = V_I4(&arg);
- break;
-
- case VLC_VAR_FLOAT:
- hr = VariantChangeType(&arg, &value, 0, VT_R4);
- if( SUCCEEDED(hr) )
- val.f_float = V_R4(&arg);
- break;
-
- case VLC_VAR_STRING:
- case VLC_VAR_MODULE:
- case VLC_VAR_FILE:
- case VLC_VAR_DIRECTORY:
- case VLC_VAR_VARIABLE:
- hr = VariantChangeType(&arg, &value, 0, VT_BSTR);
- if( SUCCEEDED(hr) )
- {
- i_type = VLC_VAR_STRING;
- val.psz_string = CStrFromBSTR(codePage, V_BSTR(&arg));
- VariantClear(&arg);
- }
- break;
-
- case VLC_VAR_TIME:
- // use a double value to represent time (base is expressed in seconds)
- hr = VariantChangeType(&arg, &value, 0, VT_R8);
- if( SUCCEEDED(hr) )
- val.i_time = (signed __int64)(V_R8(&arg)*1000000.0);
- break;
-
- default:
- hr = DISP_E_TYPEMISMATCH;
- }
- }
- else {
- // no defined type, use type in VARIANT
- hr = NO_ERROR;
- switch( V_VT(&value) )
- {
- case VT_BOOL:
- val.b_bool = (VARIANT_TRUE == V_BOOL(&value)) ? true : false;
- i_type = VLC_VAR_BOOL;
- break;
- case VT_I4:
- val.i_int = V_I4(&value);
- i_type = VLC_VAR_INTEGER;
- break;
- case VT_R4:
- val.f_float = V_R4(&value);
- i_type = VLC_VAR_FLOAT;
- break;
- case VT_BSTR:
- val.psz_string = CStrFromBSTR(codePage, V_BSTR(&value));
- i_type = VLC_VAR_STRING;
- break;
- case VT_R8:
- // use a double value to represent time (base is expressed in seconds)
- val.i_time = (signed __int64)(V_R8(&value)*1000000.0);
- i_type = VLC_VAR_TIME;
- break;
- default:
- hr = DISP_E_TYPEMISMATCH;
- }
- }
- if( SUCCEEDED(hr) )
- {
- hr = (VLC_SUCCESS == VLC_VariableSet(i_vlc, psz_varname, val)) ? NOERROR : E_FAIL;
-
- if( (VLC_VAR_STRING == i_type) && (NULL != val.psz_string) )
- CoTaskMemFree(val.psz_string);
- }
- CoTaskMemFree(psz_varname);
+ _p_instance->setErrorInfo(IID_IVLCControl,
+ "setVariable() is an unsafe interface to use. "
+ "It has been removed because of security implications." );
}
- return hr;
-#endif
+ return E_FAIL;
};
-STDMETHODIMP VLCControl::getVariable( BSTR name, VARIANT *value)
+STDMETHODIMP VLCControl::getVariable(BSTR name, VARIANT *value)
{
- return E_INVALIDARG;
-#if 0
- if( NULL == value )
- return E_POINTER;
-
- VariantInit(value);
-
- if( 0 == SysStringLen(name) )
- return E_INVALIDARG;
-
- libvlc_instance_t *p_libvlc;
- HRESULT hr = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(hr) )
+ libvlc_instance_t* p_libvlc;
+ HRESULT result = _p_instance->getVLC(&p_libvlc);
+ if( SUCCEEDED(result) )
{
- UINT codePage = _p_instance->getCodePage();
- char *psz_varname = CStrFromBSTR(codePage, name);
- if( NULL == psz_varname )
- return E_OUTOFMEMORY;
-
- hr = E_INVALIDARG;
-
- vlc_value_t val;
- int i_type;
-
- if( (VLC_SUCCESS == VLC_VariableGet(i_vlc, psz_varname, &val))
- && (VLC_SUCCESS == VLC_VariableType(i_vlc, psz_varname, &i_type)) )
- {
- hr = NOERROR;
- switch( i_type )
- {
- case VLC_VAR_BOOL:
- V_VT(value) = VT_BOOL;
- V_BOOL(value) = val.b_bool ? VARIANT_TRUE : VARIANT_FALSE;
- break;
-
- case VLC_VAR_INTEGER:
- case VLC_VAR_HOTKEY:
- V_VT(value) = VT_I4;
- V_I4(value) = val.i_int;
- break;
-
- case VLC_VAR_FLOAT:
- V_VT(value) = VT_R4;
- V_R4(value) = val.f_float;
- break;
-
- case VLC_VAR_STRING:
- case VLC_VAR_MODULE:
- case VLC_VAR_FILE:
- case VLC_VAR_DIRECTORY:
- case VLC_VAR_VARIABLE:
- V_VT(value) = VT_BSTR;
- V_BSTR(value) = BSTRFromCStr(codePage, val.psz_string);
- if( NULL != val.psz_string)
- free(val.psz_string);
- break;
-
- case VLC_VAR_TIME:
- // use a double value to represent time (base is expressed in seconds)
- V_VT(value) = VT_R8;
- V_R8(value) = ((double)val.i_time)/1000000.0;
- break;
-
- default:
- hr = DISP_E_TYPEMISMATCH;
- }
- }
- CoTaskMemFree(psz_varname);
- return hr;
+ _p_instance->setErrorInfo(IID_IVLCControl,
+ "getVariable() is an unsafe interface to use. "
+ "It has been removed because of security implications." );
}
- return hr;
-#endif
+ return E_FAIL;
};
void VLCControl::FreeTargetOptions(char **cOptions, int cOptionCount)
if( FAILED(CreateTargetOptions(CP_UTF8, &options, &cOptions, &cOptionsCount)) )
return E_INVALIDARG;
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- position = libvlc_playlist_add_extended(p_libvlc, cUri, cUri,
- cOptionsCount,
- const_cast<const char**>(cOptions),
- &ex);
+ position = _p_instance->playlist_add_extended_untrusted(cUri,
+ cOptionsCount, const_cast<const char**>(cOptions));
FreeTargetOptions(cOptions, cOptionsCount);
CoTaskMemFree(cUri);
- if( libvlc_exception_raised(&ex) )
+ if( position >= 0 )
+ {
+ if( mode & VLCPlayListAppendAndGo )
+ _p_instance->fireOnPlayEvent();
+ }
+ else
{
- _p_instance->setErrorInfo(IID_IVLCPlaylist,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
-
if( mode & VLCPlayListAppendAndGo )
_p_instance->fireOnStopEvent();
- return E_FAIL;
}
-
- if( mode & VLCPlayListAppendAndGo )
- _p_instance->fireOnPlayEvent();
- return NOERROR;
}
return hr;
};
STDMETHODIMP VLCControl::get_PlaylistIndex(int *index)
{
- return E_INVALIDARG;
-#if 0
if( NULL == index )
return E_POINTER;
+ *index = 0;
libvlc_instance_t *p_libvlc;
HRESULT result = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(result) )
{
- *index = VLC_PlaylistIndex(i_vlc);
- return NOERROR;
+ *index = _p_instance->playlist_get_current_index();
}
- *index = 0;
return result;
-#endif
};
STDMETHODIMP VLCControl::get_PlaylistCount(int *count)
if( NULL == count )
return E_POINTER;
- *count = 0;
- libvlc_instance_t* p_libvlc;
- HRESULT result = _p_instance->getVLC(&p_libvlc);
- if( SUCCEEDED(result) )
- {
- 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_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
- }
- return result;
+ *count = _p_instance->playlist_count();
+ return S_OK;
};
STDMETHODIMP VLCControl::playlistNext(void)
HRESULT result = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_playlist_next(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
+ _p_instance->playlist_next();
}
return result;
};
HRESULT result = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_playlist_prev(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
+ _p_instance->playlist_prev();
}
return result;
};
HRESULT result = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(result) )
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
-
- libvlc_playlist_clear(p_libvlc, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCControl,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
+ _p_instance->playlist_clear();
}
return result;
};
*mrl = SysAllocStringLen(_p_instance->getMRL(),
SysStringLen(_p_instance->getMRL()));
- return NOERROR;
+ return S_OK;
};
STDMETHODIMP VLCControl::put_MRL(BSTR mrl)