Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorUnderground78 <underground78@users.sourceforge.net>2013-09-28 19:30:14 +0400
committerXhmikosR <xhmikosr@gmail.com>2017-07-16 18:06:24 +0300
commit41bfa85bc620074676985ed858ecded15409fcd4 (patch)
treefd9f1ffb09009c6856ea65061a114e9afb7a4872 /common
parent6564d0f7d6cf98e0fc4a06e11935ac23fb325a91 (diff)
[MPC-HC] Tray icon: Add an optional custom callback for "show property page" events.
Diffstat (limited to 'common')
-rw-r--r--common/DSUtilLite/BaseTrayIcon.cpp22
-rw-r--r--common/DSUtilLite/BaseTrayIcon.h2
-rw-r--r--common/includes/LAVSplitterSettings.h10
3 files changed, 30 insertions, 4 deletions
diff --git a/common/DSUtilLite/BaseTrayIcon.cpp b/common/DSUtilLite/BaseTrayIcon.cpp
index 5ff69d05..77373749 100644
--- a/common/DSUtilLite/BaseTrayIcon.cpp
+++ b/common/DSUtilLite/BaseTrayIcon.cpp
@@ -184,12 +184,26 @@ HRESULT CBaseTrayIcon::CreateTrayIconData()
HRESULT CBaseTrayIcon::OpenPropPage()
{
CheckPointer(m_pFilter, E_UNEXPECTED);
+ HRESULT hr = E_UNEXPECTED;
+
m_bPropPageOpen = TRUE;
- RECT desktopRect;
- GetWindowRect(GetDesktopWindow(), &desktopRect);
- SetWindowPos(m_hWnd, 0, (desktopRect.right / 2) - PROP_WIDTH_OFFSET, (desktopRect.bottom / 2) - PROP_HEIGHT_OFFSET, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- CBaseDSPropPage::ShowPropPageDialog(m_pFilter, m_hWnd);
+ if (!m_fpCustomOpenPropPage) {
+ RECT desktopRect;
+ GetWindowRect(GetDesktopWindow(), &desktopRect);
+ SetWindowPos(m_hWnd, 0, (desktopRect.right / 2) - PROP_WIDTH_OFFSET, (desktopRect.bottom / 2) - PROP_HEIGHT_OFFSET, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ CBaseDSPropPage::ShowPropPageDialog(m_pFilter, m_hWnd);
+ hr = S_OK;
+ } else {
+ hr = m_fpCustomOpenPropPage(m_pFilter);
+ }
m_bPropPageOpen = FALSE;
+
+ return hr;
+}
+
+HRESULT CBaseTrayIcon::SetCustomOpenPropPage(HRESULT (*fpCustomOpenPropPage)(IBaseFilter* pFilter))
+{
+ m_fpCustomOpenPropPage = fpCustomOpenPropPage;
return S_OK;
}
diff --git a/common/DSUtilLite/BaseTrayIcon.h b/common/DSUtilLite/BaseTrayIcon.h
index d5a3872f..8805e1d2 100644
--- a/common/DSUtilLite/BaseTrayIcon.h
+++ b/common/DSUtilLite/BaseTrayIcon.h
@@ -28,6 +28,7 @@ public:
virtual ~CBaseTrayIcon(void);
static BOOL ProcessBlackList();
+ HRESULT SetCustomOpenPropPage(HRESULT (*fpCustomOpenPropPage)(IBaseFilter* pFilter));
protected:
virtual HRESULT CreateTrayIconData();
@@ -56,6 +57,7 @@ private:
HANDLE m_hThread = 0;
HWND m_hWnd = 0;
BOOL m_bPropPageOpen = FALSE;
+ HRESULT (*m_fpCustomOpenPropPage)(IBaseFilter* pFilter) = nullptr;
WCHAR m_wszClassName[64];
const WCHAR *m_wszName = nullptr;
diff --git a/common/includes/LAVSplitterSettings.h b/common/includes/LAVSplitterSettings.h
index 29f1164e..8b50d490 100644
--- a/common/includes/LAVSplitterSettings.h
+++ b/common/includes/LAVSplitterSettings.h
@@ -25,6 +25,10 @@
DEFINE_GUID(IID_ILAVFSettings,
0x774a919d, 0xea95, 0x4a87, 0x8a, 0x1e, 0xf4, 0x8a, 0xbe, 0x84, 0x99, 0xc7);
+// {77C1027F-BF53-458F-82CE-9DD88A2C300B}
+DEFINE_GUID(IID_ILAVFSettingsMPCHCCustom,
+0x77c1027f, 0xbf53, 0x458f, 0x82, 0xce, 0x9d, 0xd8, 0x8a, 0x2c, 0x30, 0xb);
+
typedef enum LAVSubtitleMode {
LAVSubtitleMode_NoSubs,
LAVSubtitleMode_ForcedOnly,
@@ -190,3 +194,9 @@ interface __declspec(uuid("774A919D-EA95-4A87-8A1E-F48ABE8499C7")) ILAVFSettings
// Get the maximum queue size, in number of packets
STDMETHOD_(DWORD, GetMaxQueueSize)() = 0;
};
+
+DECLARE_INTERFACE_IID_(ILAVFSettingsMPCHCCustom, IUnknown, "77C1027F-BF53-458F-82CE-9DD88A2C300B")
+{
+ // Set a custom callback function to handle the property page
+ STDMETHOD(SetPropertyPageCallback)(HRESULT (*fpPropPageCallback)(IBaseFilter* pFilter)) = 0;
+};