Commit 6572aa70 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

win32: Fix npapi build

parent 84662783
...@@ -287,7 +287,7 @@ LRESULT VLCControlsWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -287,7 +287,7 @@ LRESULT VLCControlsWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case ID_FS_PLAY_PAUSE:{ case ID_FS_PLAY_PAUSE:{
if( VP() ){ if( VP() ){
if( IsPlaying() ) if( IsPlaying() )
VP()->pause(); VP()->mlp().pause();
else else
VP()->play(); VP()->play();
} }
...@@ -295,7 +295,7 @@ LRESULT VLCControlsWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -295,7 +295,7 @@ LRESULT VLCControlsWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
case ID_FS_MUTE:{ case ID_FS_MUTE:{
if( VP() ){ if( VP() ){
VP()->set_mute( IsDlgButtonChecked(hWnd(), ID_FS_MUTE) != FALSE ); VP()->get_mp().setMute( IsDlgButtonChecked(hWnd(), ID_FS_MUTE) != FALSE );
SyncVolumeSliderWithVLCVolume(); SyncVolumeSliderWithVLCVolume();
} }
break; break;
...@@ -473,15 +473,14 @@ void VLCControlsWnd::NeedHideControls() ...@@ -473,15 +473,14 @@ void VLCControlsWnd::NeedHideControls()
void VLCControlsWnd::SyncVideoPosScrollPosWithVideoPos() void VLCControlsWnd::SyncVideoPosScrollPosWithVideoPos()
{ {
if( VP() ){ if( VP() ){
libvlc_time_t pos = VP()->get_time(); SetVideoPosScrollPosByVideoPos( VP()->get_mp().position() );
SetVideoPosScrollPosByVideoPos(pos);
} }
} }
void VLCControlsWnd::SetVideoPosScrollRangeByVideoLen() void VLCControlsWnd::SetVideoPosScrollRangeByVideoLen()
{ {
if( VP() ){ if( VP() ){
libvlc_time_t MaxLen = VP()->get_length(); libvlc_time_t MaxLen = VP()->get_mp().length();
VideoPosShiftBits = 0; VideoPosShiftBits = 0;
while(MaxLen>0xffff){ while(MaxLen>0xffff){
MaxLen >>= 1; MaxLen >>= 1;
...@@ -500,7 +499,7 @@ void VLCControlsWnd::SetVideoPos(float Pos) //0-start, 1-end ...@@ -500,7 +499,7 @@ void VLCControlsWnd::SetVideoPos(float Pos) //0-start, 1-end
{ {
if( VP() ){ if( VP() ){
vlc_player& vp = *VP(); vlc_player& vp = *VP();
vp.set_time( static_cast<libvlc_time_t>( vp.get_length()*Pos ) ); vp.get_mp().setPosition( Pos );
SyncVideoPosScrollPosWithVideoPos(); SyncVideoPosScrollPosWithVideoPos();
} }
} }
...@@ -509,12 +508,12 @@ void VLCControlsWnd::SyncVolumeSliderWithVLCVolume() ...@@ -509,12 +508,12 @@ void VLCControlsWnd::SyncVolumeSliderWithVLCVolume()
{ {
if( VP() ){ if( VP() ){
vlc_player& vp = *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); const LRESULT SliderPos = SendMessage(hVolumeSlider, (UINT) TBM_GETPOS, 0, 0);
if((UINT)SliderPos!=vol) if((UINT)SliderPos!=vol)
SendMessage(hVolumeSlider, (UINT) TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 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); int MuteButtonState = SendMessage(hMuteButton, (UINT) BM_GETCHECK, 0, 0);
if((muted&&(BST_UNCHECKED==MuteButtonState))||(!muted&&(BST_CHECKED==MuteButtonState))){ if((muted&&(BST_UNCHECKED==MuteButtonState))||(!muted&&(BST_CHECKED==MuteButtonState))){
SendMessage(hMuteButton, BM_SETCHECK, (WPARAM)(muted?BST_CHECKED:BST_UNCHECKED), 0); SendMessage(hMuteButton, BM_SETCHECK, (WPARAM)(muted?BST_CHECKED:BST_UNCHECKED), 0);
...@@ -534,9 +533,9 @@ void VLCControlsWnd::SetVLCVolumeBySliderPos(int CurPos) ...@@ -534,9 +533,9 @@ void VLCControlsWnd::SetVLCVolumeBySliderPos(int CurPos)
{ {
if( VP() ){ if( VP() ){
vlc_player& vp = *VP(); vlc_player& vp = *VP();
vp.set_volume(CurPos); vp.get_mp().setVolume( CurPos );
if(0==CurPos){ if(0==CurPos){
vp.set_mute( IsDlgButtonChecked( hWnd(), ID_FS_MUTE) != FALSE ); vp.get_mp().setMute( IsDlgButtonChecked( hWnd(), ID_FS_MUTE) != FALSE );
} }
SyncVolumeSliderWithVLCVolume(); SyncVolumeSliderWithVLCVolume();
} }
......
...@@ -114,7 +114,7 @@ private: ...@@ -114,7 +114,7 @@ private:
bool IsPlaying() bool IsPlaying()
{ {
if( VP() ) if( VP() )
return VP()->is_playing(); return VP()->mlp().isPlaying();
return false; return false;
} }
......
...@@ -301,10 +301,10 @@ static bool video_expose_handler(GtkWidget *widget, GdkEvent *event, gpointer us ...@@ -301,10 +301,10 @@ static bool video_expose_handler(GtkWidget *widget, GdkEvent *event, gpointer us
static gboolean do_time_slider_handler(gpointer user_data) static gboolean do_time_slider_handler(gpointer user_data)
{ {
VlcPluginGtk *plugin = (VlcPluginGtk *) user_data; VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
libvlc_media_player_t *md = plugin->getMD(); auto md = plugin->getMD();
if (md) { if (md) {
gdouble value = gtk_range_get_value(GTK_RANGE(plugin->time_slider)); 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; plugin->time_slider_timeout_id = 0;
...@@ -326,10 +326,10 @@ static bool time_slider_handler(GtkRange *range, GtkScrollType scroll, gdouble v ...@@ -326,10 +326,10 @@ static bool time_slider_handler(GtkRange *range, GtkScrollType scroll, gdouble v
static gboolean do_vol_slider_handler(gpointer user_data) static gboolean do_vol_slider_handler(gpointer user_data)
{ {
VlcPluginGtk *plugin = (VlcPluginGtk *) user_data; VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
libvlc_media_player_t *md = plugin->getMD(); auto md = plugin->getMD();
if (md) { if (md) {
gdouble value = gtk_range_get_value(GTK_RANGE(plugin->vol_slider)); 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; plugin->vol_slider_timeout_id = 0;
......
...@@ -182,8 +182,7 @@ bool VlcPluginWin::create_windows() ...@@ -182,8 +182,7 @@ bool VlcPluginWin::create_windows()
_WindowsManager.CreateWindows(drawable); _WindowsManager.CreateWindows(drawable);
if( get_player().is_open() ) _WindowsManager.LibVlcAttach(&player());
_WindowsManager.LibVlcAttach(&get_player());
return true; return true;
} }
...@@ -218,7 +217,7 @@ bool VlcPluginWin::destroy_windows() ...@@ -218,7 +217,7 @@ bool VlcPluginWin::destroy_windows()
void VlcPluginWin::on_media_player_new() void VlcPluginWin::on_media_player_new()
{ {
_WindowsManager.LibVlcAttach(&get_player()); _WindowsManager.LibVlcAttach(&player());
} }
void VlcPluginWin::on_media_player_release() void VlcPluginWin::on_media_player_release()
......
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