[vlc-commits] Remove vlc_player::on_player_action
Hugo Beauzée-Luyssen
git at videolan.org
Tue Apr 21 10:15:49 CEST 2015
npapi-vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 23 18:25:47 2015 +0100| [abd4e591338f92fe84b10e747dd92147ddfa9b85] | committer: Hugo Beauzée-Luyssen
Remove vlc_player::on_player_action
Now there is no reason for plugins to inherit vlc_player
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=abd4e591338f92fe84b10e747dd92147ddfa9b85
---
activex/plugin.cpp | 18 ------------------
activex/plugin.h | 3 +--
common/vlc_player.cpp | 20 +++-----------------
common/vlc_player.h | 3 ---
4 files changed, 4 insertions(+), 40 deletions(-)
diff --git a/activex/plugin.cpp b/activex/plugin.cpp
index 83c5ad2..ff28649 100644
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -1246,24 +1246,6 @@ void VLCPlugin::set_player_window()
_WindowsManager.LibVlcAttach( &get_player() );
}
-void VLCPlugin::on_player_action(vlc_player_action_e pa)
-{
- switch(pa){
- case pa_play:
- fireOnPlayEvent();
- break;
- case pa_pause:
- fireOnPauseEvent();
- break;
- case pa_stop:
- fireOnStopEvent();
- break;
- case pa_next:
- case pa_prev:
- break;
- }
-}
-
static vlcplugin_event_t vlcevents[] = {
{ libvlc_MediaPlayerMediaChanged, handle_input_state_event },
{ libvlc_MediaPlayerNothingSpecial, handle_input_state_event },
diff --git a/activex/plugin.h b/activex/plugin.h
index 5d34b3f..a1849d8 100644
--- a/activex/plugin.h
+++ b/activex/plugin.h
@@ -260,6 +260,7 @@ public:
*/
void freezeEvents(BOOL freeze);
void firePropChangedEvent(DISPID dispid);
+ //FIXME: I'm fairly convinced this 3 events are useless.
void fireOnPlayEvent(void);
void fireOnPauseEvent(void);
void fireOnStopEvent(void);
@@ -340,8 +341,6 @@ public:
}
protected:
- void on_player_action(vlc_player_action_e);
-
virtual ~VLCPlugin();
private:
diff --git a/common/vlc_player.cpp b/common/vlc_player.cpp
index b69d4d8..b3d002e 100644
--- a/common/vlc_player.cpp
+++ b/common/vlc_player.cpp
@@ -108,43 +108,33 @@ void vlc_player::play()
else if( -1 == current_item() ) {
play(0);
}
- else {
+ else
_ml_p.play();
- on_player_action(pa_play);
- }
}
bool vlc_player::play(unsigned int idx)
{
- if( _ml_p.playItemAtIndex( idx ) ) {
- on_player_action(pa_play);
- return true;
- }
- return false;
+ return _ml_p.playItemAtIndex( idx );
}
void vlc_player::pause()
{
_mp.setPause( true );
- on_player_action(pa_pause);
}
void vlc_player::togglePause()
{
_ml_p.pause();
- on_player_action(pa_pause);
}
void vlc_player::stop()
{
libvlc_media_list_player_stop(_ml_p);
- on_player_action(pa_stop);
}
bool vlc_player::next()
{
if( _ml_p.next() ) {
- on_player_action(pa_next);
return true;
}
return false;
@@ -152,11 +142,7 @@ bool vlc_player::next()
bool vlc_player::prev()
{
- if( _ml_p.previous() ) {
- on_player_action(pa_prev);
- return true;
- }
- return false;
+ return _ml_p.previous();
}
float vlc_player::get_rate()
diff --git a/common/vlc_player.h b/common/vlc_player.h
index 2dcd86d..b405bce 100644
--- a/common/vlc_player.h
+++ b/common/vlc_player.h
@@ -93,9 +93,6 @@ public:
VLC::MediaPlayer& get_mp()
{ return _mp; }
-protected:
- virtual void on_player_action( vlc_player_action_e ){}
-
private:
VLC::Instance _libvlc_instance;
VLC::MediaPlayer _mp;
More information about the vlc-commits
mailing list