Commit 60ac2426 authored by Sergey Radionov's avatar Sergey Radionov Committed by Jean-Baptiste Kempf

ActiveX: switch VLCPlaylist to vlc_player

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent c0f95dd8
...@@ -538,8 +538,8 @@ STDMETHODIMP VLCPlaylist::get_itemCount(long* count) ...@@ -538,8 +538,8 @@ STDMETHODIMP VLCPlaylist::get_itemCount(long* count)
if( NULL == count ) if( NULL == count )
return E_POINTER; return E_POINTER;
*count = 0; *count = Instance()->get_player().items_count();
*count = Instance()->playlist_count();
return S_OK; return S_OK;
}; };
...@@ -548,13 +548,9 @@ STDMETHODIMP VLCPlaylist::get_isPlaying(VARIANT_BOOL* isPlaying) ...@@ -548,13 +548,9 @@ STDMETHODIMP VLCPlaylist::get_isPlaying(VARIANT_BOOL* isPlaying)
if( NULL == isPlaying ) if( NULL == isPlaying )
return E_POINTER; return E_POINTER;
libvlc_media_player_t *p_md; *isPlaying = varbool( Instance()->get_player().is_playing()!=0 );
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
*isPlaying = varbool( libvlc_media_player_is_playing(p_md) );
}
return hr;
}; };
STDMETHODIMP VLCPlaylist::add(BSTR uri, VARIANT name, VARIANT options, long* item) STDMETHODIMP VLCPlaylist::add(BSTR uri, VARIANT name, VARIANT options, long* item)
...@@ -633,65 +629,50 @@ STDMETHODIMP VLCPlaylist::add(BSTR uri, VARIANT name, VARIANT options, long* ite ...@@ -633,65 +629,50 @@ STDMETHODIMP VLCPlaylist::add(BSTR uri, VARIANT name, VARIANT options, long* ite
STDMETHODIMP VLCPlaylist::play() STDMETHODIMP VLCPlaylist::play()
{ {
Instance()->playlist_play(); Instance()->get_player().play();
return S_OK; return S_OK;
}; };
STDMETHODIMP VLCPlaylist::playItem(long item) STDMETHODIMP VLCPlaylist::playItem(long item)
{ {
Instance()->playlist_play_item(item); Instance()->get_player().play(item);
return S_OK; return S_OK;
}; };
STDMETHODIMP VLCPlaylist::togglePause() STDMETHODIMP VLCPlaylist::togglePause()
{ {
libvlc_media_player_t* p_md; Instance()->get_player().pause();
HRESULT hr = getMD(&p_md); return S_OK;
if( SUCCEEDED(hr) )
{
libvlc_media_player_pause(p_md);
}
return hr;
}; };
STDMETHODIMP VLCPlaylist::stop() STDMETHODIMP VLCPlaylist::stop()
{ {
libvlc_media_player_t *p_md; Instance()->get_player().stop();
HRESULT hr = getMD(&p_md); return S_OK;
if( SUCCEEDED(hr) )
{
libvlc_media_player_stop(p_md);
}
return hr;
}; };
STDMETHODIMP VLCPlaylist::next() STDMETHODIMP VLCPlaylist::next()
{ {
Instance()->playlist_next(); Instance()->get_player().next();
return S_OK; return S_OK;
}; };
STDMETHODIMP VLCPlaylist::prev() STDMETHODIMP VLCPlaylist::prev()
{ {
Instance()->playlist_prev(); Instance()->get_player().prev();
return S_OK; return S_OK;
}; };
STDMETHODIMP VLCPlaylist::clear() STDMETHODIMP VLCPlaylist::clear()
{ {
Instance()->playlist_clear(); Instance()->get_player().clear_items();
return S_OK; return S_OK;
}; };
STDMETHODIMP VLCPlaylist::removeItem(long item) STDMETHODIMP VLCPlaylist::removeItem(long item)
{ {
libvlc_instance_t* p_libvlc; Instance()->get_player().delete_item(item);
HRESULT hr = getVLC(&p_libvlc); return S_OK;
if( SUCCEEDED(hr) )
{
Instance()->playlist_delete_item(item);
}
return hr;
}; };
STDMETHODIMP VLCPlaylist::get_items(IVLCPlaylistItems** obj) STDMETHODIMP VLCPlaylist::get_items(IVLCPlaylistItems** obj)
......
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