[vlc-commits] win32: Fix npapi build
Hugo Beauzée-Luyssen
git at videolan.org
Tue Apr 21 10:15:52 CEST 2015
npapi-vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Mar 24 16:45:04 2015 +0100| [6572aa706d6af445aaf67a17de60bd3bffa92285] | committer: Hugo Beauzée-Luyssen
win32: Fix npapi build
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=6572aa706d6af445aaf67a17de60bd3bffa92285
---
common/win32_fullscreen.cpp | 19 +++++++++----------
common/win32_fullscreen.h | 2 +-
npapi/vlcplugin_gtk.cpp | 8 ++++----
npapi/vlcplugin_win.cpp | 5 ++---
4 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp
index 4958f98..811066c 100644
--- a/common/win32_fullscreen.cpp
+++ b/common/win32_fullscreen.cpp
@@ -287,7 +287,7 @@ LRESULT VLCControlsWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case ID_FS_PLAY_PAUSE:{
if( VP() ){
if( IsPlaying() )
- VP()->pause();
+ VP()->mlp().pause();
else
VP()->play();
}
@@ -295,7 +295,7 @@ LRESULT VLCControlsWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
case ID_FS_MUTE:{
if( VP() ){
- VP()->set_mute( IsDlgButtonChecked(hWnd(), ID_FS_MUTE) != FALSE );
+ VP()->get_mp().setMute( IsDlgButtonChecked(hWnd(), ID_FS_MUTE) != FALSE );
SyncVolumeSliderWithVLCVolume();
}
break;
@@ -473,15 +473,14 @@ void VLCControlsWnd::NeedHideControls()
void VLCControlsWnd::SyncVideoPosScrollPosWithVideoPos()
{
if( VP() ){
- libvlc_time_t pos = VP()->get_time();
- SetVideoPosScrollPosByVideoPos(pos);
+ SetVideoPosScrollPosByVideoPos( VP()->get_mp().position() );
}
}
void VLCControlsWnd::SetVideoPosScrollRangeByVideoLen()
{
if( VP() ){
- libvlc_time_t MaxLen = VP()->get_length();
+ libvlc_time_t MaxLen = VP()->get_mp().length();
VideoPosShiftBits = 0;
while(MaxLen>0xffff){
MaxLen >>= 1;
@@ -500,7 +499,7 @@ void VLCControlsWnd::SetVideoPos(float Pos) //0-start, 1-end
{
if( VP() ){
vlc_player& vp = *VP();
- vp.set_time( static_cast<libvlc_time_t>( vp.get_length()*Pos ) );
+ vp.get_mp().setPosition( Pos );
SyncVideoPosScrollPosWithVideoPos();
}
}
@@ -509,12 +508,12 @@ void VLCControlsWnd::SyncVolumeSliderWithVLCVolume()
{
if( VP() ){
vlc_player& vp = *VP();
- unsigned int vol = vp.get_volume();
+ unsigned int vol = vp.get_mp().volume();
const LRESULT SliderPos = SendMessage(hVolumeSlider, (UINT) TBM_GETPOS, 0, 0);
if((UINT)SliderPos!=vol)
SendMessage(hVolumeSlider, (UINT) TBM_SETPOS, (WPARAM) TRUE, (LPARAM) vol);
- bool muted = vp.is_muted();
+ bool muted = vp.get_mp().mute();
int MuteButtonState = SendMessage(hMuteButton, (UINT) BM_GETCHECK, 0, 0);
if((muted&&(BST_UNCHECKED==MuteButtonState))||(!muted&&(BST_CHECKED==MuteButtonState))){
SendMessage(hMuteButton, BM_SETCHECK, (WPARAM)(muted?BST_CHECKED:BST_UNCHECKED), 0);
@@ -534,9 +533,9 @@ void VLCControlsWnd::SetVLCVolumeBySliderPos(int CurPos)
{
if( VP() ){
vlc_player& vp = *VP();
- vp.set_volume(CurPos);
+ vp.get_mp().setVolume( CurPos );
if(0==CurPos){
- vp.set_mute( IsDlgButtonChecked( hWnd(), ID_FS_MUTE) != FALSE );
+ vp.get_mp().setMute( IsDlgButtonChecked( hWnd(), ID_FS_MUTE) != FALSE );
}
SyncVolumeSliderWithVLCVolume();
}
diff --git a/common/win32_fullscreen.h b/common/win32_fullscreen.h
index 34096de..8c8fc7f 100644
--- a/common/win32_fullscreen.h
+++ b/common/win32_fullscreen.h
@@ -114,7 +114,7 @@ private:
bool IsPlaying()
{
if( VP() )
- return VP()->is_playing();
+ return VP()->mlp().isPlaying();
return false;
}
diff --git a/npapi/vlcplugin_gtk.cpp b/npapi/vlcplugin_gtk.cpp
index 744a75d..fa8dd23 100644
--- a/npapi/vlcplugin_gtk.cpp
+++ b/npapi/vlcplugin_gtk.cpp
@@ -301,10 +301,10 @@ static bool video_expose_handler(GtkWidget *widget, GdkEvent *event, gpointer us
static gboolean do_time_slider_handler(gpointer user_data)
{
VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
- libvlc_media_player_t *md = plugin->getMD();
+ auto md = plugin->getMD();
if (md) {
gdouble value = gtk_range_get_value(GTK_RANGE(plugin->time_slider));
- libvlc_media_player_set_position(md, value/100.0);
+ md.setPosition( value / 100.0 );
}
plugin->time_slider_timeout_id = 0;
@@ -326,10 +326,10 @@ static bool time_slider_handler(GtkRange *range, GtkScrollType scroll, gdouble v
static gboolean do_vol_slider_handler(gpointer user_data)
{
VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
- libvlc_media_player_t *md = plugin->getMD();
+ auto md = plugin->getMD();
if (md) {
gdouble value = gtk_range_get_value(GTK_RANGE(plugin->vol_slider));
- libvlc_audio_set_volume(md, value);
+ md.setVolume( value );
}
plugin->vol_slider_timeout_id = 0;
diff --git a/npapi/vlcplugin_win.cpp b/npapi/vlcplugin_win.cpp
index 57f4cee..d18aea9 100644
--- a/npapi/vlcplugin_win.cpp
+++ b/npapi/vlcplugin_win.cpp
@@ -182,8 +182,7 @@ bool VlcPluginWin::create_windows()
_WindowsManager.CreateWindows(drawable);
- if( get_player().is_open() )
- _WindowsManager.LibVlcAttach(&get_player());
+ _WindowsManager.LibVlcAttach(&player());
return true;
}
@@ -218,7 +217,7 @@ bool VlcPluginWin::destroy_windows()
void VlcPluginWin::on_media_player_new()
{
- _WindowsManager.LibVlcAttach(&get_player());
+ _WindowsManager.LibVlcAttach(&player());
}
void VlcPluginWin::on_media_player_release()
More information about the vlc-commits
mailing list