[vlc-devel] [PATCH 04/12] ActiveX: attach to vlc_player events
Sergey Radionov
rsatom at gmail.com
Sat Apr 21 18:07:45 CEST 2012
---
activex/plugin.cpp | 19 ++++++++++++++++++-
activex/plugin.h | 1 +
activex/vlccontrol.cpp | 7 ++-----
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/activex/plugin.cpp b/activex/plugin.cpp
index 02d9735..9a8fc65 100644
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -753,7 +753,6 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG, HWND hwndParent, LPCRECT lprcPosRect
if( get_autoplay() )
{
vlc_player::play(0);
- fireOnPlayEvent();
}
}
@@ -1243,6 +1242,24 @@ void VLCPlugin::set_player_window()
_WindowsManager.LibVlcAttach(vlc_player::get_mp());
}
+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;
+ }
+}
+
void VLCPlugin::player_register_events()
{
libvlc_event_manager_t *eventManager = NULL;
diff --git a/activex/plugin.h b/activex/plugin.h
index 6d503ba..e1ed102 100644
--- a/activex/plugin.h
+++ b/activex/plugin.h
@@ -328,6 +328,7 @@ public:
}
protected:
+ void on_player_action(vlc_player_action_e);
virtual ~VLCPlugin();
diff --git a/activex/vlccontrol.cpp b/activex/vlccontrol.cpp
index 7145f4a..fa0c09c 100644
--- a/activex/vlccontrol.cpp
+++ b/activex/vlccontrol.cpp
@@ -125,7 +125,6 @@ STDMETHODIMP VLCControl::put_Visible(VARIANT_BOOL isVisible)
STDMETHODIMP VLCControl::play(void)
{
_p_instance->playlist_play();
- _p_instance->fireOnPlayEvent();
return S_OK;
};
@@ -135,8 +134,7 @@ STDMETHODIMP VLCControl::pause(void)
HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_media_player_pause(p_md);
- _p_instance->fireOnPauseEvent();
+ _p_instance->playlist_pause();
}
return result;
};
@@ -147,8 +145,7 @@ STDMETHODIMP VLCControl::stop(void)
HRESULT result = _p_instance->getMD(&p_md);
if( SUCCEEDED(result) )
{
- libvlc_media_player_stop(p_md);
- _p_instance->fireOnStopEvent();
+ _p_instance->playlist_stop();
}
return result;
};
--
1.7.7.1.msysgit.0
More information about the vlc-devel
mailing list