[vlc-commits] ActiveX: switch VLCAudio to vlc_player
Sergey Radionov
git at videolan.org
Wed Jun 6 22:37:21 CEST 2012
npapi-vlc | branch: master | Sergey Radionov <RSATom at gmail.com> | Mon Mar 19 09:36:12 2012 +0700| [ed71aaa6ef758a840084f958e545fa84b91df62d] | committer: Jean-Baptiste Kempf
ActiveX: switch VLCAudio to vlc_player
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=ed71aaa6ef758a840084f958e545fa84b91df62d
---
activex/vlccontrol2.cpp | 94 +++++++++++++++--------------------------------
1 file changed, 30 insertions(+), 64 deletions(-)
diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index 701dfed..a7d5db6 100644
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -93,20 +93,16 @@ STDMETHODIMP VLCAudio::get_mute(VARIANT_BOOL* mute)
if( NULL == mute )
return E_POINTER;
- libvlc_media_player_t *p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- *mute = varbool( libvlc_audio_get_mute(p_md) );
- return hr;
+ *mute = varbool( Instance()->get_player().is_muted() );
+
+ return S_OK;
};
STDMETHODIMP VLCAudio::put_mute(VARIANT_BOOL mute)
{
- libvlc_media_player_t *p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- libvlc_audio_set_mute(p_md, VARIANT_FALSE != mute);
- return hr;
+ Instance()->get_player().set_mute( VARIANT_FALSE != mute );
+
+ return S_OK;
};
STDMETHODIMP VLCAudio::get_volume(long* volume)
@@ -114,22 +110,16 @@ STDMETHODIMP VLCAudio::get_volume(long* volume)
if( NULL == volume )
return E_POINTER;
- libvlc_media_player_t *p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- *volume = libvlc_audio_get_volume(p_md);
- return hr;
+ *volume = Instance()->get_player().get_volume();
+
+ return S_OK;
};
STDMETHODIMP VLCAudio::put_volume(long volume)
{
- libvlc_media_player_t *p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- {
- libvlc_audio_set_volume(p_md, volume);
- }
- return hr;
+ Instance()->get_player().set_volume( volume );
+
+ return S_OK;
};
STDMETHODIMP VLCAudio::get_track(long* track)
@@ -137,24 +127,16 @@ STDMETHODIMP VLCAudio::get_track(long* track)
if( NULL == track )
return E_POINTER;
- libvlc_media_player_t* p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- {
- *track = libvlc_audio_get_track(p_md);
- }
- return hr;
+ *track = Instance()->get_player().get_track();
+
+ return S_OK;
};
STDMETHODIMP VLCAudio::put_track(long track)
{
- libvlc_media_player_t *p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- {
- libvlc_audio_set_track(p_md, track);
- }
- return hr;
+ Instance()->get_player().set_track(track);
+
+ return S_OK;
};
STDMETHODIMP VLCAudio::get_count(long* trackNumber)
@@ -162,16 +144,10 @@ STDMETHODIMP VLCAudio::get_count(long* trackNumber)
if( NULL == trackNumber )
return E_POINTER;
- libvlc_media_player_t* p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- {
- // get the number of audio track available and return it
- *trackNumber = libvlc_audio_get_track_count(p_md);
- }
- return hr;
-};
+ *trackNumber = Instance()->get_player().track_count();
+ return S_OK;
+};
STDMETHODIMP VLCAudio::description(long trackID, BSTR* name)
{
@@ -226,33 +202,23 @@ STDMETHODIMP VLCAudio::get_channel(long *channel)
if( NULL == channel )
return E_POINTER;
- libvlc_media_player_t *p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- {
- *channel = libvlc_audio_get_channel(p_md);
- }
- return hr;
+ *channel = Instance()->get_player().get_channel();
+
+ return S_OK;
};
STDMETHODIMP VLCAudio::put_channel(long channel)
{
- libvlc_media_player_t *p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- {
- libvlc_audio_set_channel(p_md, channel);
- }
- return hr;
+ Instance()->get_player().set_channel(channel);
+
+ return S_OK;
};
STDMETHODIMP VLCAudio::toggleMute()
{
- libvlc_media_player_t *p_md;
- HRESULT hr = getMD(&p_md);
- if( SUCCEEDED(hr) )
- libvlc_audio_toggle_mute(p_md);
- return hr;
+ Instance()->get_player().toggle_mute();
+
+ return S_OK;
};
/****************************************************************************/
More information about the vlc-commits
mailing list