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)
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();
}
......
......@@ -114,7 +114,7 @@ private:
bool IsPlaying()
{
if( VP() )
return VP()->is_playing();
return VP()->mlp().isPlaying();
return false;
}
......
......@@ -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;
......
......@@ -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()
......
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