diff options
author | kinddragon <kinddragon@users.sourceforge.net> | 2010-04-20 06:17:50 +0400 |
---|---|---|
committer | kinddragon <kinddragon@users.sourceforge.net> | 2010-04-20 06:17:50 +0400 |
commit | 4f8e4a60a362334579435db89e08f00e78a5de48 (patch) | |
tree | 8aa488487d0984467be5789c0ed6bd226c8d9cbb /src/apps/mplayerc/FGManager.cpp | |
parent | 3c584d0200f48d4b29f783bec509a756f3579ff3 (diff) |
long sequences of "if" replaced by "switch" for better performance and simplifying debugging
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1802 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/FGManager.cpp')
-rw-r--r-- | src/apps/mplayerc/FGManager.cpp | 82 |
1 files changed, 47 insertions, 35 deletions
diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index 340e5af8b..7f6f6afc2 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -2518,41 +2518,53 @@ CFGManagerPlayer::CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) // Renderers
- if(s.iDSVideoRendererType == VIDRNDT_DS_OLDRENDERER)
- m_transform.AddTail(DNew CFGFilterRegistry(CLSID_VideoRenderer, m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_OVERLAYMIXER)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_OverlayMixer, L"Overlay Mixer", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_VMR7WINDOWED)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_VideoMixingRenderer, L"Video Mixing Render 7 (Windowed)", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_VMR9WINDOWED)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_VideoMixingRenderer9, L"Video Mixing Render 9 (Windowed)", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_VMR7RENDERLESS)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_VMR7AllocatorPresenter, L"Video Mixing Render 7 (Renderless)", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_VMR9RENDERLESS)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_VMR9AllocatorPresenter, L"Video Mixing Render 9 (Renderless)", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_EVR)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_EnhancedVideoRenderer, L"Enhanced Video Renderer", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_EVR_CUSTOM)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_EVRAllocatorPresenter, L"Enhanced Video Renderer (custom presenter)", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_DXR)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_DXRAllocatorPresenter, L"Haali's Video Renderer", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_MADVR)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_madVRAllocatorPresenter, L"madVR Renderer", m_vrmerit));
-// m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_madVR, L"Madshi Video Renderer", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_SYNC)
- m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_SyncAllocatorPresenter, L"Sync Renderer", m_vrmerit));
- else if(s.iDSVideoRendererType == VIDRNDT_DS_NULL_COMP)
- {
- pFGF = DNew CFGFilterInternal<CNullVideoRenderer>(L"Null Video Renderer (Any)", MERIT64_ABOVE_DSHOW+2);
- pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_NULL);
- m_transform.AddTail(pFGF);
- }
- else if(s.iDSVideoRendererType == VIDRNDT_DS_NULL_UNCOMP)
- {
- pFGF = DNew CFGFilterInternal<CNullUVideoRenderer>(L"Null Video Renderer (Uncompressed)", MERIT64_ABOVE_DSHOW+2);
- pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_NULL);
- m_transform.AddTail(pFGF);
- }
+ switch(s.iDSVideoRendererType)
+ {
+ case VIDRNDT_DS_OLDRENDERER:
+ m_transform.AddTail(DNew CFGFilterRegistry(CLSID_VideoRenderer, m_vrmerit));
+ break;
+ case VIDRNDT_DS_OVERLAYMIXER:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_OverlayMixer, L"Overlay Mixer", m_vrmerit));
+ break;
+ case VIDRNDT_DS_VMR7WINDOWED:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_VideoMixingRenderer, L"Video Mixing Render 7 (Windowed)", m_vrmerit));
+ break;
+ case VIDRNDT_DS_VMR9WINDOWED:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_VideoMixingRenderer9, L"Video Mixing Render 9 (Windowed)", m_vrmerit));
+ break;
+ case VIDRNDT_DS_VMR7RENDERLESS:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_VMR7AllocatorPresenter, L"Video Mixing Render 7 (Renderless)", m_vrmerit));
+ break;
+ case VIDRNDT_DS_VMR9RENDERLESS:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_VMR9AllocatorPresenter, L"Video Mixing Render 9 (Renderless)", m_vrmerit));
+ break;
+ case VIDRNDT_DS_EVR:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_EnhancedVideoRenderer, L"Enhanced Video Renderer", m_vrmerit));
+ break;
+ case VIDRNDT_DS_EVR_CUSTOM:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_EVRAllocatorPresenter, L"Enhanced Video Renderer (custom presenter)", m_vrmerit));
+ break;
+ case VIDRNDT_DS_DXR:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_DXRAllocatorPresenter, L"Haali's Video Renderer", m_vrmerit));
+ break;
+ case VIDRNDT_DS_MADVR:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_madVRAllocatorPresenter, L"madVR Renderer", m_vrmerit));
+ //m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_madVR, L"Madshi Video Renderer", m_vrmerit));
+ break;
+ case VIDRNDT_DS_SYNC:
+ m_transform.AddTail(DNew CFGFilterVideoRenderer(m_hWnd, CLSID_SyncAllocatorPresenter, L"Sync Renderer", m_vrmerit));
+ break;
+ case VIDRNDT_DS_NULL_COMP:
+ pFGF = DNew CFGFilterInternal<CNullVideoRenderer>(L"Null Video Renderer (Any)", MERIT64_ABOVE_DSHOW+2);
+ pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_NULL);
+ m_transform.AddTail(pFGF);
+ break;
+ case VIDRNDT_DS_NULL_UNCOMP:
+ pFGF = DNew CFGFilterInternal<CNullUVideoRenderer>(L"Null Video Renderer (Uncompressed)", MERIT64_ABOVE_DSHOW+2);
+ pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_NULL);
+ m_transform.AddTail(pFGF);
+ break;
+ }
CString SelAudioRender = s.SelectedAudioRender();
if(SelAudioRender == AUDRNDT_NULL_COMP)
|