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
committerUnderground78 <underground78@users.sourceforge.net>2014-06-03 23:44:06 +0400
commitdf78d4f94c9052e75f03c8a6c3e33d1d4f97a8fb (patch)
tree13237e7bdc0dc28b58d29b4f869e4fc07e9a34c7 /common
parent3ff3dfb49712b9db21f3171fc845f16981863d35 (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.h11
3 files changed, 31 insertions, 4 deletions
diff --git a/common/DSUtilLite/BaseTrayIcon.cpp b/common/DSUtilLite/BaseTrayIcon.cpp
index 73d3d41c..46b4e0be 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 e04e469f..d298ed43 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 e153f081..d9782292 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,
@@ -185,3 +189,10 @@ interface ILAVFSettings : public IUnknown
// Get the duration (in ms) of analysis for network streams (to find the streams and codec parameters)
STDMETHOD_(DWORD, GetNetworkStreamAnalysisDuration)() = 0;
};
+
+[uuid("77C1027F-BF53-458F-82CE-9DD88A2C300B")]
+interface ILAVFSettingsMPCHCCustom : public IUnknown
+{
+ // Set a custom callback function to handle the property page
+ STDMETHOD(SetPropertyPageCallback)(HRESULT (*fpPropPageCallback)(IBaseFilter* pFilter)) = 0;
+};