Commit 3d4fc828 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Remove version guards

Since we're now targetting 4.0+
parent 26d0573a
...@@ -794,11 +794,7 @@ HRESULT VLCPlugin::onInPlaceDeactivate(void) ...@@ -794,11 +794,7 @@ HRESULT VLCPlugin::onInPlaceDeactivate(void)
{ {
if( m_player.mlp().isPlaying() ) if( m_player.mlp().isPlaying() )
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
m_player.mlp().stopAsync(); m_player.mlp().stopAsync();
#else
m_player.mlp().stop();
#endif
} }
_WindowsManager.DestroyWindows(); _WindowsManager.DestroyWindows();
...@@ -861,11 +857,7 @@ void VLCPlugin::setTime(int seconds) ...@@ -861,11 +857,7 @@ void VLCPlugin::setTime(int seconds)
if( seconds != _i_time ) if( seconds != _i_time )
{ {
setStartTime(_i_time); setStartTime(_i_time);
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
m_player.get_mp().setTime( _i_time, true ); m_player.get_mp().setTime( _i_time, true );
#else
m_player.get_mp().setTime( _i_time );
#endif
} }
} }
...@@ -1351,7 +1343,6 @@ void VLCPlugin::fireOnMediaPlayerVoutEvent(int count) ...@@ -1351,7 +1343,6 @@ void VLCPlugin::fireOnMediaPlayerVoutEvent(int count)
vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerVoutEvent, &params); vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerVoutEvent, &params);
} }
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 2, 0)
void VLCPlugin::fireOnMediaPlayerMutedEvent() void VLCPlugin::fireOnMediaPlayerMutedEvent()
{ {
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
...@@ -1376,9 +1367,7 @@ void VLCPlugin::fireOnMediaPlayerAudioVolumeEvent(float volume) ...@@ -1376,9 +1367,7 @@ void VLCPlugin::fireOnMediaPlayerAudioVolumeEvent(float volume)
params.cNamedArgs = 0; params.cNamedArgs = 0;
vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerAudioVolumeEvent, &params); vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerAudioVolumeEvent, &params);
} }
#endif
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
void VLCPlugin::fireOnMediaPlayerChapterChangedEvent(int chapter) void VLCPlugin::fireOnMediaPlayerChapterChangedEvent(int chapter)
{ {
DISPPARAMS params; DISPPARAMS params;
...@@ -1391,7 +1380,6 @@ void VLCPlugin::fireOnMediaPlayerChapterChangedEvent(int chapter) ...@@ -1391,7 +1380,6 @@ void VLCPlugin::fireOnMediaPlayerChapterChangedEvent(int chapter)
params.cNamedArgs = 0; params.cNamedArgs = 0;
vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerChapterChangedEvent, &params); vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerChapterChangedEvent, &params);
} }
#endif
/* */ /* */
...@@ -1457,15 +1445,12 @@ void VLCPlugin::player_register_events() ...@@ -1457,15 +1445,12 @@ void VLCPlugin::player_register_events()
em.onLengthChanged( [this]( int64_t length ) { em.onLengthChanged( [this]( int64_t length ) {
fireOnMediaPlayerLengthChangedEvent( length ); fireOnMediaPlayerLengthChangedEvent( length );
}); });
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
em.onChapterChanged( [this]( int chapter ) { em.onChapterChanged( [this]( int chapter ) {
fireOnMediaPlayerChapterChangedEvent( chapter ); fireOnMediaPlayerChapterChangedEvent( chapter );
}); });
#endif
em.onVout( [this]( int count ) { em.onVout( [this]( int count ) {
fireOnMediaPlayerVoutEvent( count ); fireOnMediaPlayerVoutEvent( count );
}); });
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 2, 0)
em.onMuted( [this] { em.onMuted( [this] {
fireOnMediaPlayerMutedEvent(); fireOnMediaPlayerMutedEvent();
}); });
...@@ -1475,7 +1460,6 @@ void VLCPlugin::player_register_events() ...@@ -1475,7 +1460,6 @@ void VLCPlugin::player_register_events()
em.onAudioVolume( [this]( float volume ) { em.onAudioVolume( [this]( float volume ) {
fireOnMediaPlayerAudioVolumeEvent( volume ); fireOnMediaPlayerAudioVolumeEvent( volume );
}); });
#endif
} }
#undef B #undef B
...@@ -264,16 +264,12 @@ public: ...@@ -264,16 +264,12 @@ public:
void fireOnMediaPlayerMediaChangedEvent(); void fireOnMediaPlayerMediaChangedEvent();
void fireOnMediaPlayerTitleChangedEvent(int title); void fireOnMediaPlayerTitleChangedEvent(int title);
void fireOnMediaPlayerLengthChangedEvent(long length); void fireOnMediaPlayerLengthChangedEvent(long length);
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
void fireOnMediaPlayerChapterChangedEvent(int chapter); void fireOnMediaPlayerChapterChangedEvent(int chapter);
#endif
void fireOnMediaPlayerVoutEvent(int count); void fireOnMediaPlayerVoutEvent(int count);
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 2, 0)
void fireOnMediaPlayerMutedEvent(); void fireOnMediaPlayerMutedEvent();
void fireOnMediaPlayerUnmutedEvent(); void fireOnMediaPlayerUnmutedEvent();
void fireOnMediaPlayerAudioVolumeEvent(float volume); void fireOnMediaPlayerAudioVolumeEvent(float volume);
#endif
void fireClickEvent(); void fireClickEvent();
void fireDblClickEvent(); void fireDblClickEvent();
......
...@@ -562,12 +562,8 @@ STDMETHODIMP VLCAudio::toggleMute() ...@@ -562,12 +562,8 @@ STDMETHODIMP VLCAudio::toggleMute()
STDMETHODIMP VLCDeinterlace::disable() STDMETHODIMP VLCDeinterlace::disable()
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
_plug->get_player().get_mp().setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Disabled, _plug->get_player().get_mp().setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Disabled,
std::string() ); std::string() );
#else
_plug->get_player().get_mp().setDeinterlace( "" );
#endif
return S_OK; return S_OK;
} }
...@@ -576,12 +572,8 @@ STDMETHODIMP VLCDeinterlace::enable(BSTR mode) ...@@ -576,12 +572,8 @@ STDMETHODIMP VLCDeinterlace::enable(BSTR mode)
char *psz_mode = CStrFromBSTR(CP_UTF8, mode); char *psz_mode = CStrFromBSTR(CP_UTF8, mode);
if ( psz_mode == nullptr ) if ( psz_mode == nullptr )
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
_plug->get_player().get_mp().setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Enabled, _plug->get_player().get_mp().setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Enabled,
psz_mode ); psz_mode );
#else
_plug->get_player().get_mp().setDeinterlace( psz_mode );
#endif
CoTaskMemFree(psz_mode); CoTaskMemFree(psz_mode);
return S_OK; return S_OK;
} }
...@@ -734,11 +726,7 @@ STDMETHODIMP VLCInput::get_position(double* position) ...@@ -734,11 +726,7 @@ STDMETHODIMP VLCInput::get_position(double* position)
STDMETHODIMP VLCInput::put_position(double position) STDMETHODIMP VLCInput::put_position(double position)
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
_plug->get_player().get_mp().setPosition( static_cast<float>(position), true ); _plug->get_player().get_mp().setPosition( static_cast<float>(position), true );
#else
_plug->get_player().get_mp().setPosition( static_cast<float>(position) );
#endif
return S_OK; return S_OK;
} }
...@@ -755,11 +743,7 @@ STDMETHODIMP VLCInput::get_time(double* time) ...@@ -755,11 +743,7 @@ STDMETHODIMP VLCInput::get_time(double* time)
STDMETHODIMP VLCInput::put_time(double time) STDMETHODIMP VLCInput::put_time(double time)
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
_plug->get_player().get_mp().setTime(static_cast<libvlc_time_t>(time), true); _plug->get_player().get_mp().setTime(static_cast<libvlc_time_t>(time), true);
#else
_plug->get_player().get_mp().setTime(static_cast<libvlc_time_t>(time));
#endif
return S_OK; return S_OK;
} }
...@@ -887,15 +871,7 @@ STDMETHODIMP VLCMarquee::get_text(BSTR *val) ...@@ -887,15 +871,7 @@ STDMETHODIMP VLCMarquee::get_text(BSTR *val)
{ {
if( NULL == val ) if( NULL == val )
return E_POINTER; return E_POINTER;
#if LIBVLC_VERSION_INT < LIBVLC_VERSION(4, 0, 0, 0)
auto str = _plug->get_player().get_mp().marqueeString( libvlc_marquee_Text );
if( !str.empty() )
*val = BSTRFromCStr( CP_UTF8, str.c_str() );
return S_OK;
#else
return E_INVALIDARG; return E_INVALIDARG;
#endif
} }
STDMETHODIMP VLCMarquee::put_text(BSTR val) STDMETHODIMP VLCMarquee::put_text(BSTR val)
...@@ -1083,11 +1059,7 @@ STDMETHODIMP VLCPlaylist::togglePause() ...@@ -1083,11 +1059,7 @@ STDMETHODIMP VLCPlaylist::togglePause()
STDMETHODIMP VLCPlaylist::stop() STDMETHODIMP VLCPlaylist::stop()
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
_plug->get_player().mlp().stopAsync(); _plug->get_player().mlp().stopAsync();
#else
_plug->get_player().mlp().stop();
#endif
return S_OK; return S_OK;
} }
...@@ -1570,15 +1542,11 @@ STDMETHODIMP VLCVideo::toggleFullscreen() ...@@ -1570,15 +1542,11 @@ STDMETHODIMP VLCVideo::toggleFullscreen()
STDMETHODIMP VLCVideo::toggleTeletext() STDMETHODIMP VLCVideo::toggleTeletext()
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
if( _plug->get_player().get_mp().teletext() == 0 ) if( _plug->get_player().get_mp().teletext() == 0 )
_plug->get_player().get_mp().setTeletext( 100 ); _plug->get_player().get_mp().setTeletext( 100 );
else else
_plug->get_player().get_mp().setTeletext( 0 ); _plug->get_player().get_mp().setTeletext( 0 );
return S_OK; return S_OK;
#else
_plug->get_player().get_mp().toggleTeletext();
#endif
} }
STDMETHODIMP VLCVideo::get_track(long* track) STDMETHODIMP VLCVideo::get_track(long* track)
......
...@@ -111,7 +111,6 @@ int vlc_player::preparse_item_sync(unsigned int idx, int options, unsigned int t ...@@ -111,7 +111,6 @@ int vlc_player::preparse_item_sync(unsigned int idx, int options, unsigned int t
return -1; return -1;
auto em = media->eventManager(); auto em = media->eventManager();
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
# if defined(_WIN32) # if defined(_WIN32)
HANDLE barrier = CreateEvent(nullptr, true, false, nullptr); HANDLE barrier = CreateEvent(nullptr, true, false, nullptr);
if ( barrier == nullptr ) if ( barrier == nullptr )
...@@ -152,13 +151,6 @@ int vlc_player::preparse_item_sync(unsigned int idx, int options, unsigned int t ...@@ -152,13 +151,6 @@ int vlc_player::preparse_item_sync(unsigned int idx, int options, unsigned int t
retval = future.get(); retval = future.get();
event->unregister(); event->unregister();
# endif # endif
#else
media->parse();
if ( media->isParsed() )
retval = 4; /* int( VLC::Media::ParsedStatus::Done ); */
else
retval = 2; /* int( VLC::Media::ParsedStatus::Failed ); */
#endif
return retval; return retval;
} }
......
...@@ -426,7 +426,6 @@ void VLCControlsWnd::RegisterToVLCEvents() ...@@ -426,7 +426,6 @@ void VLCControlsWnd::RegisterToVLCEvents()
PostMessage(hVideoPosScroll, (UINT) PBM_SETPOS, (WPARAM)0, 0); PostMessage(hVideoPosScroll, (UINT) PBM_SETPOS, (WPARAM)0, 0);
}); });
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 2, 0)
VP()->get_mp().eventManager().onAudioVolume([this](float vol) { VP()->get_mp().eventManager().onAudioVolume([this](float vol) {
UpdateVolumeSlider( roundf(vol * 100) ); UpdateVolumeSlider( roundf(vol * 100) );
}); });
...@@ -438,7 +437,6 @@ void VLCControlsWnd::RegisterToVLCEvents() ...@@ -438,7 +437,6 @@ void VLCControlsWnd::RegisterToVLCEvents()
VP()->get_mp().eventManager().onUnmuted([this] { VP()->get_mp().eventManager().onUnmuted([this] {
UpdateMuteButton(false); UpdateMuteButton(false);
}); });
#endif
} }
void VLCControlsWnd::NeedShowControls() void VLCControlsWnd::NeedShowControls()
...@@ -460,11 +458,7 @@ void VLCControlsWnd::NeedHideControls() ...@@ -460,11 +458,7 @@ void VLCControlsWnd::NeedHideControls()
void VLCControlsWnd::SetVideoPos(float Pos) //0-start, 1-end void VLCControlsWnd::SetVideoPos(float Pos) //0-start, 1-end
{ {
if( VP() ){ if( VP() ){
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
VP()->get_mp().setPosition( Pos, true ); VP()->get_mp().setPosition( Pos, true );
#else
VP()->get_mp().setPosition( Pos );
#endif
if( VP()->get_mp().length() > 0 ) if( VP()->get_mp().length() > 0 )
PostMessage(hVideoPosScroll, (UINT)PBM_SETPOS, (WPARAM) (Pos * 1000), 0); PostMessage(hVideoPosScroll, (UINT)PBM_SETPOS, (WPARAM) (Pos * 1000), 0);
......
...@@ -536,11 +536,7 @@ LibvlcInputNPObject::setProperty(int index, const NPVariant &value) ...@@ -536,11 +536,7 @@ LibvlcInputNPObject::setProperty(int index, const NPVariant &value)
return INVOKERESULT_INVALID_VALUE; return INVOKERESULT_INVALID_VALUE;
} }
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.setPosition( v, true ); mp.setPosition( v, true );
#else
mp.setPosition( v );
#endif
return INVOKERESULT_NO_ERROR; return INVOKERESULT_NO_ERROR;
} }
case ID_input_time: case ID_input_time:
...@@ -550,11 +546,7 @@ LibvlcInputNPObject::setProperty(int index, const NPVariant &value) ...@@ -550,11 +546,7 @@ LibvlcInputNPObject::setProperty(int index, const NPVariant &value)
return INVOKERESULT_INVALID_VALUE; return INVOKERESULT_INVALID_VALUE;
} }
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.setTime( v, true ); mp.setTime( v, true );
#else
mp.setTime( v );
#endif
return INVOKERESULT_NO_ERROR; return INVOKERESULT_NO_ERROR;
} }
case ID_input_rate: case ID_input_rate:
...@@ -1011,11 +1003,7 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args, ...@@ -1011,11 +1003,7 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args,
case ID_playlist_stop: case ID_playlist_stop:
if( argCount == 0 ) if( argCount == 0 )
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
p_plugin->player().mlp().stopAsync(); p_plugin->player().mlp().stopAsync();
#else
p_plugin->player().mlp().stop();
#endif
return INVOKERESULT_NO_ERROR; return INVOKERESULT_NO_ERROR;
} }
return INVOKERESULT_NO_SUCH_METHOD; return INVOKERESULT_NO_SUCH_METHOD;
...@@ -1588,14 +1576,10 @@ LibvlcVideoNPObject::invoke(int index, const NPVariant *args, ...@@ -1588,14 +1576,10 @@ LibvlcVideoNPObject::invoke(int index, const NPVariant *args,
{ {
if( argCount == 0 ) if( argCount == 0 )
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
if ( p_plugin->getMD().teletext() == 0 ) if ( p_plugin->getMD().teletext() == 0 )
p_plugin->getMD().setTeletext( 100 ); p_plugin->getMD().setTeletext( 100 );
else else
p_plugin->getMD().setTeletext( 0 ); p_plugin->getMD().setTeletext( 0 );
#else
p_plugin->getMD().toggleTeletext();
#endif
return INVOKERESULT_NO_ERROR; return INVOKERESULT_NO_ERROR;
} }
return INVOKERESULT_NO_SUCH_METHOD; return INVOKERESULT_NO_SUCH_METHOD;
...@@ -1694,11 +1678,6 @@ LibvlcMarqueeNPObject::getProperty(int index, npapi::OutVariant& result) ...@@ -1694,11 +1678,6 @@ LibvlcMarqueeNPObject::getProperty(int index, npapi::OutVariant& result)
result = position_bynumber( mp.marqueeInt( libvlc_marquee_Position ) ); result = position_bynumber( mp.marqueeInt( libvlc_marquee_Position ) );
return INVOKERESULT_NO_ERROR; return INVOKERESULT_NO_ERROR;
#if LIBVLC_VERSION_INT < LIBVLC_VERSION(4, 0, 0, 0)
case ID_marquee_text:
result = mp.marqueeString( libvlc_marquee_Text );
return INVOKERESULT_NO_ERROR;
#endif
} }
return INVOKERESULT_GENERIC_ERROR; return INVOKERESULT_GENERIC_ERROR;
} }
...@@ -1995,12 +1974,8 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args, ...@@ -1995,12 +1974,8 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args,
switch( index ) switch( index )
{ {
case ID_deint_disable: case ID_deint_disable:
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Disabled, mp.setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Disabled,
std::string() ); std::string() );
#else
mp.setDeinterlace( std::string() );
#endif
break; break;
case ID_deint_enable: case ID_deint_enable:
...@@ -2011,11 +1986,7 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args, ...@@ -2011,11 +1986,7 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args,
if ( !v.is<const char*>() ) if ( !v.is<const char*>() )
return INVOKERESULT_INVALID_VALUE; return INVOKERESULT_INVALID_VALUE;
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Enabled, v ); mp.setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Enabled, v );
#else
mp.setDeinterlace( v );
#endif
break; break;
} }
default: default:
......
...@@ -373,16 +373,12 @@ static struct vlcevents_t { ...@@ -373,16 +373,12 @@ static struct vlcevents_t {
{ "MediaPlayerSeekableChanged", libvlc_MediaPlayerSeekableChanged }, { "MediaPlayerSeekableChanged", libvlc_MediaPlayerSeekableChanged },
{ "MediaPlayerPausableChanged", libvlc_MediaPlayerPausableChanged }, { "MediaPlayerPausableChanged", libvlc_MediaPlayerPausableChanged },
{ "MediaPlayerTitleChanged", libvlc_MediaPlayerTitleChanged }, { "MediaPlayerTitleChanged", libvlc_MediaPlayerTitleChanged },
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
{ "MediaPlayerChapterChanged", libvlc_MediaPlayerChapterChanged }, { "MediaPlayerChapterChanged", libvlc_MediaPlayerChapterChanged },
#endif
{ "MediaPlayerLengthChanged", libvlc_MediaPlayerLengthChanged }, { "MediaPlayerLengthChanged", libvlc_MediaPlayerLengthChanged },
{ "MediaPlayerVout", libvlc_MediaPlayerVout }, { "MediaPlayerVout", libvlc_MediaPlayerVout },
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 2, 0)
{ "MediaPlayerMuted", libvlc_MediaPlayerMuted }, { "MediaPlayerMuted", libvlc_MediaPlayerMuted },
{ "MediaPlayerUnmuted", libvlc_MediaPlayerUnmuted }, { "MediaPlayerUnmuted", libvlc_MediaPlayerUnmuted },
{ "MediaPlayerAudioVolume", libvlc_MediaPlayerAudioVolume }, { "MediaPlayerAudioVolume", libvlc_MediaPlayerAudioVolume },
#endif
}; };
void VlcPluginBase::subscribe(const char* eventName, npapi::Variant listener) void VlcPluginBase::subscribe(const char* eventName, npapi::Variant listener)
...@@ -447,18 +443,15 @@ void VlcPluginBase::subscribe(const char* eventName, npapi::Variant listener) ...@@ -447,18 +443,15 @@ void VlcPluginBase::subscribe(const char* eventName, npapi::Variant listener)
case libvlc_MediaPlayerTitleChanged: case libvlc_MediaPlayerTitleChanged:
e = player().get_mp().eventManager().onTitleChanged( std::move( closure ) ); e = player().get_mp().eventManager().onTitleChanged( std::move( closure ) );
break; break;
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
case libvlc_MediaPlayerChapterChanged: case libvlc_MediaPlayerChapterChanged:
e = player().get_mp().eventManager().onChapterChanged( std::move( closure ) ); e = player().get_mp().eventManager().onChapterChanged( std::move( closure ) );
break; break;
#endif
case libvlc_MediaPlayerLengthChanged: case libvlc_MediaPlayerLengthChanged:
e = player().get_mp().eventManager().onLengthChanged( std::move( closure ) ); e = player().get_mp().eventManager().onLengthChanged( std::move( closure ) );
break; break;
case libvlc_MediaPlayerVout: case libvlc_MediaPlayerVout:
e = player().get_mp().eventManager().onVout( std::move( closure ) ); e = player().get_mp().eventManager().onVout( std::move( closure ) );
break; break;
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 2, 0)
case libvlc_MediaPlayerMuted: case libvlc_MediaPlayerMuted:
e = player().get_mp().eventManager().onMuted( std::move( closure ) ); e = player().get_mp().eventManager().onMuted( std::move( closure ) );
break; break;
...@@ -468,7 +461,6 @@ void VlcPluginBase::subscribe(const char* eventName, npapi::Variant listener) ...@@ -468,7 +461,6 @@ void VlcPluginBase::subscribe(const char* eventName, npapi::Variant listener)
case libvlc_MediaPlayerAudioVolume: case libvlc_MediaPlayerAudioVolume:
e = player().get_mp().eventManager().onAudioVolume( std::move( closure ) ); e = player().get_mp().eventManager().onAudioVolume( std::move( closure ) );
break; break;
#endif
default: default:
break; break;
} }
...@@ -665,11 +657,7 @@ void VlcPluginBase::control_handler(vlc_toolbar_clicked_t clicked) ...@@ -665,11 +657,7 @@ void VlcPluginBase::control_handler(vlc_toolbar_clicked_t clicked)
case clicked_Stop: case clicked_Stop:
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
player().get_mp().stopAsync(); player().get_mp().stopAsync();
#else
player().get_mp().stop();
#endif
} }
break; break;
......
...@@ -326,11 +326,7 @@ gboolean VlcPluginGtk::update_time_slider(gpointer user_data) ...@@ -326,11 +326,7 @@ gboolean VlcPluginGtk::update_time_slider(gpointer user_data)
static bool time_slider_handler(GtkRange*, GtkScrollType, gdouble value, gpointer user_data) static bool time_slider_handler(GtkRange*, GtkScrollType, gdouble value, gpointer user_data)
{ {
VlcPluginGtk *plugin = (VlcPluginGtk *) user_data; VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
plugin->getMD().setPosition( value / 100.0, true ); plugin->getMD().setPosition( value / 100.0, true );
#else
plugin->getMD().setPosition( value / 100.0 );
#endif
return false; return false;
} }
......
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