Commit 04022490 authored by Sergey Radionov's avatar Sergey Radionov Committed by Jean-Baptiste Kempf

common/win32_fullscreen: Attaching to libvlc events moved to VLCWindowsManager

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4d5793c0
This diff is collapsed.
...@@ -38,19 +38,19 @@ public: ...@@ -38,19 +38,19 @@ public:
static VLCHolderWnd* CreateHolderWindow(HWND hParentWnd, VLCWindowsManager* WM); static VLCHolderWnd* CreateHolderWindow(HWND hParentWnd, VLCWindowsManager* WM);
void DestroyWindow(); void DestroyWindow();
libvlc_media_player_t* getMD() const {return _p_md;} void LibVlcAttach();
void LibVlcAttach(libvlc_media_player_t* p_md);
void LibVlcDetach(); void LibVlcDetach();
//libvlc events arrives from separate thread
void OnLibVlcEvent(const libvlc_event_t* event);
private: private:
static LPCTSTR getClassName(void) { return TEXT("VLC ActiveX Window Holder Class"); }; static LPCTSTR getClassName(void) { return TEXT("VLC ActiveX Window Holder Class"); };
static LRESULT CALLBACK VLCHolderClassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK VLCHolderClassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam);
HHOOK _hMouseHook; HHOOK _hMouseHook;
static void OnLibVlcEvent(const libvlc_event_t* event, void *param); libvlc_media_player_t* getMD() const;
void DetachFromLibVlcEventSystem();
private: private:
static HINSTANCE _hinstance; static HINSTANCE _hinstance;
...@@ -59,8 +59,7 @@ private: ...@@ -59,8 +59,7 @@ private:
private: private:
VLCHolderWnd(HWND hWnd, VLCWindowsManager* WM) VLCHolderWnd(HWND hWnd, VLCWindowsManager* WM)
: _hMouseHook(NULL), _hWnd(hWnd) : _hMouseHook(NULL), _hWnd(hWnd)
, _WindowsManager(WM), _p_md(0) , _WindowsManager(WM){};
, _LibVlcESAttached(false){};
public: public:
HWND getHWND() const {return _hWnd;} HWND getHWND() const {return _hWnd;}
...@@ -68,8 +67,6 @@ public: ...@@ -68,8 +67,6 @@ public:
private: private:
HWND _hWnd; HWND _hWnd;
VLCWindowsManager* _WindowsManager; VLCWindowsManager* _WindowsManager;
libvlc_media_player_t* _p_md;
bool _LibVlcESAttached;
}; };
/////////////////////// ///////////////////////
...@@ -120,9 +117,6 @@ private: ...@@ -120,9 +117,6 @@ private:
} }
private: private:
void RegisterEvents();
void UnRegisterEvents();
void SetVideoPosScrollRangeByVideoLen(); void SetVideoPosScrollRangeByVideoLen();
void SyncVideoPosScrollPosWithVideoPos(); void SyncVideoPosScrollPosWithVideoPos();
void SetVideoPos(float Pos); //0-start, 1-end void SetVideoPos(float Pos); //0-start, 1-end
...@@ -132,6 +126,8 @@ private: ...@@ -132,6 +126,8 @@ private:
public: public:
void NeedShowControls(); void NeedShowControls();
//libvlc events arrives from separate thread
void OnLibVlcEvent(const libvlc_event_t* event);
private: private:
void NeedHideControls(); void NeedHideControls();
...@@ -163,10 +159,8 @@ private: ...@@ -163,10 +159,8 @@ private:
private: private:
void SetVideoPosScrollPosByVideoPos(libvlc_time_t CurPos); void SetVideoPosScrollPosByVideoPos(libvlc_time_t CurPos);
static bool handle_position_changed_event_enabled; void handle_position_changed_event(const libvlc_event_t* event);
static void handle_position_changed_event(const libvlc_event_t* event, void *param); void handle_input_state_event(const libvlc_event_t* event);
//static void handle_time_changed_event(const libvlc_event_t* event, void *param);
static void handle_input_state_event(const libvlc_event_t* event, void *param);
public: public:
HWND getHWND() const {return _hWnd;} HWND getHWND() const {return _hWnd;}
...@@ -200,7 +194,7 @@ public: ...@@ -200,7 +194,7 @@ public:
HMODULE getHModule() const {return _hModule;}; HMODULE getHModule() const {return _hModule;};
VLCHolderWnd* getHolderWnd() const {return _HolderWnd;} VLCHolderWnd* getHolderWnd() const {return _HolderWnd;}
VLCFullScreenWnd* getFullScreenWnd() const {return _FSWnd;} VLCFullScreenWnd* getFullScreenWnd() const {return _FSWnd;}
libvlc_media_player_t* getMD() const {return _HolderWnd?_HolderWnd->getMD():0;} libvlc_media_player_t* getMD() const {return _p_md;}
public: public:
void setNewMessageFlag(bool Yes) void setNewMessageFlag(bool Yes)
...@@ -210,10 +204,18 @@ public: ...@@ -210,10 +204,18 @@ public:
public: public:
void OnMouseEvent(UINT uMouseMsg); void OnMouseEvent(UINT uMouseMsg);
private:
void VlcEvents(bool Attach);
//libvlc events arrives from separate thread
static void OnLibVlcEvent_proxy(const libvlc_event_t* event, void *param);
void OnLibVlcEvent(const libvlc_event_t* event);
private: private:
HMODULE _hModule; HMODULE _hModule;
HWND _hWindowedParentWnd; HWND _hWindowedParentWnd;
libvlc_media_player_t* _p_md;
VLCHolderWnd* _HolderWnd; VLCHolderWnd* _HolderWnd;
VLCFullScreenWnd* _FSWnd; VLCFullScreenWnd* _FSWnd;
......
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