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()
_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 },
......
......@@ -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:
......
......@@ -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()
......
......@@ -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;
......
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