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

Remove vlc_player::on_player_action

Now there is no reason for plugins to inherit vlc_player
parent d97efe9f
...@@ -1246,24 +1246,6 @@ void VLCPlugin::set_player_window() ...@@ -1246,24 +1246,6 @@ void VLCPlugin::set_player_window()
_WindowsManager.LibVlcAttach( &get_player() ); _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[] = { static vlcplugin_event_t vlcevents[] = {
{ libvlc_MediaPlayerMediaChanged, handle_input_state_event }, { libvlc_MediaPlayerMediaChanged, handle_input_state_event },
{ libvlc_MediaPlayerNothingSpecial, handle_input_state_event }, { libvlc_MediaPlayerNothingSpecial, handle_input_state_event },
......
...@@ -260,6 +260,7 @@ public: ...@@ -260,6 +260,7 @@ public:
*/ */
void freezeEvents(BOOL freeze); void freezeEvents(BOOL freeze);
void firePropChangedEvent(DISPID dispid); void firePropChangedEvent(DISPID dispid);
//FIXME: I'm fairly convinced this 3 events are useless.
void fireOnPlayEvent(void); void fireOnPlayEvent(void);
void fireOnPauseEvent(void); void fireOnPauseEvent(void);
void fireOnStopEvent(void); void fireOnStopEvent(void);
...@@ -340,8 +341,6 @@ public: ...@@ -340,8 +341,6 @@ public:
} }
protected: protected:
void on_player_action(vlc_player_action_e);
virtual ~VLCPlugin(); virtual ~VLCPlugin();
private: private:
......
...@@ -108,43 +108,33 @@ void vlc_player::play() ...@@ -108,43 +108,33 @@ void vlc_player::play()
else if( -1 == current_item() ) { else if( -1 == current_item() ) {
play(0); play(0);
} }
else { else
_ml_p.play(); _ml_p.play();
on_player_action(pa_play);
}
} }
bool vlc_player::play(unsigned int idx) bool vlc_player::play(unsigned int idx)
{ {
if( _ml_p.playItemAtIndex( idx ) ) { return _ml_p.playItemAtIndex( idx );
on_player_action(pa_play);
return true;
}
return false;
} }
void vlc_player::pause() void vlc_player::pause()
{ {
_mp.setPause( true ); _mp.setPause( true );
on_player_action(pa_pause);
} }
void vlc_player::togglePause() void vlc_player::togglePause()
{ {
_ml_p.pause(); _ml_p.pause();
on_player_action(pa_pause);
} }
void vlc_player::stop() void vlc_player::stop()
{ {
libvlc_media_list_player_stop(_ml_p); libvlc_media_list_player_stop(_ml_p);
on_player_action(pa_stop);
} }
bool vlc_player::next() bool vlc_player::next()
{ {
if( _ml_p.next() ) { if( _ml_p.next() ) {
on_player_action(pa_next);
return true; return true;
} }
return false; return false;
...@@ -152,11 +142,7 @@ bool vlc_player::next() ...@@ -152,11 +142,7 @@ bool vlc_player::next()
bool vlc_player::prev() bool vlc_player::prev()
{ {
if( _ml_p.previous() ) { return _ml_p.previous();
on_player_action(pa_prev);
return true;
}
return false;
} }
float vlc_player::get_rate() float vlc_player::get_rate()
......
...@@ -93,9 +93,6 @@ public: ...@@ -93,9 +93,6 @@ public:
VLC::MediaPlayer& get_mp() VLC::MediaPlayer& get_mp()
{ return _mp; } { return _mp; }
protected:
virtual void on_player_action( vlc_player_action_e ){}
private: private:
VLC::Instance _libvlc_instance; VLC::Instance _libvlc_instance;
VLC::MediaPlayer _mp; VLC::MediaPlayer _mp;
......
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