Initial commit: ROW Client source code
Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: Mapper.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - an MFC based C++ filter mapper application.
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Mapper.h"
|
||||
#include "MapperDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapperApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMapperApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CMapperApp)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapperApp construction
|
||||
|
||||
CMapperApp::CMapperApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CMapperApp object
|
||||
|
||||
CMapperApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapperApp initialization
|
||||
|
||||
BOOL CMapperApp::InitInstance()
|
||||
{
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
#ifdef _AFXDLL
|
||||
// In MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete because
|
||||
// their functionality is incorporated into Microsoft's 32-bit operating systems.
|
||||
#if (_MSC_VER <= 1200)
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#endif
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
CMapperDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
int nResponse = (int) dlg.DoModal();
|
||||
if (nResponse == IDOK)
|
||||
{
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with OK
|
||||
}
|
||||
else if (nResponse == IDCANCEL)
|
||||
{
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with Cancel
|
||||
}
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
return FALSE;
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
# Microsoft Developer Studio Project File - Name="Mapper" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=Mapper - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Mapper.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Mapper.mak" CFG="Mapper - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Mapper - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "Mapper - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Mapper - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 strmiids.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "Mapper - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\BaseClasses" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 strmiids.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Mapper - Win32 Release"
|
||||
# Name "Mapper - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mapper.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mapper.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MapperDlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mapper.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MapperDlg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\types.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\Mapper.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\Mapper.rc2
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Mapper"=.\Mapper.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: Mapper.h
|
||||
//
|
||||
// Desc: DirectShow sample code - an MFC based C++ filter mapper application.
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
// Mapper.h : main header file for the MAPPER application
|
||||
//
|
||||
|
||||
#if !defined(AFX_MAPPER_H__8F990BFF_27ED_4CE2_AF97_7C2E416356FB__INCLUDED_)
|
||||
#define AFX_MAPPER_H__8F990BFF_27ED_4CE2_AF97_7C2E416356FB__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapperApp:
|
||||
// See Mapper.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CMapperApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CMapperApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMapperApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CMapperApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAPPER_H__8F990BFF_27ED_4CE2_AF97_7C2E416356FB__INCLUDED_)
|
||||
@@ -0,0 +1,240 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on Mapper.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=Mapper - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to Mapper - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "Mapper - Win32 Release" && "$(CFG)" != "Mapper - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Mapper.mak" CFG="Mapper - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Mapper - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "Mapper - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "Mapper - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\Mapper.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Mapper.obj"
|
||||
-@erase "$(INTDIR)\Mapper.pch"
|
||||
-@erase "$(INTDIR)\Mapper.res"
|
||||
-@erase "$(INTDIR)\MapperDlg.obj"
|
||||
-@erase "$(INTDIR)\StdAfx.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\Mapper.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\Mapper.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Mapper.res" /d "NDEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\Mapper.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=strmiids.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\Mapper.pdb" /machine:I386 /out:"$(OUTDIR)\Mapper.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Mapper.obj" \
|
||||
"$(INTDIR)\MapperDlg.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"$(INTDIR)\Mapper.res"
|
||||
|
||||
"$(OUTDIR)\Mapper.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "Mapper - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\Mapper.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Mapper.obj"
|
||||
-@erase "$(INTDIR)\Mapper.pch"
|
||||
-@erase "$(INTDIR)\Mapper.res"
|
||||
-@erase "$(INTDIR)\MapperDlg.obj"
|
||||
-@erase "$(INTDIR)\StdAfx.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\Mapper.exe"
|
||||
-@erase "$(OUTDIR)\Mapper.ilk"
|
||||
-@erase "$(OUTDIR)\Mapper.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\Mapper.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Mapper.res" /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\Mapper.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=strmiids.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\Mapper.pdb" /debug /machine:I386 /out:"$(OUTDIR)\Mapper.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Mapper.obj" \
|
||||
"$(INTDIR)\MapperDlg.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"$(INTDIR)\Mapper.res"
|
||||
|
||||
"$(OUTDIR)\Mapper.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("Mapper.dep")
|
||||
!INCLUDE "Mapper.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "Mapper.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "Mapper - Win32 Release" || "$(CFG)" == "Mapper - Win32 Debug"
|
||||
SOURCE=.\Mapper.cpp
|
||||
|
||||
"$(INTDIR)\Mapper.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\Mapper.pch"
|
||||
|
||||
|
||||
SOURCE=.\Mapper.rc
|
||||
|
||||
"$(INTDIR)\Mapper.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\MapperDlg.cpp
|
||||
|
||||
"$(INTDIR)\MapperDlg.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\Mapper.pch"
|
||||
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
|
||||
!IF "$(CFG)" == "Mapper - Win32 Release"
|
||||
|
||||
CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\Mapper.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\Mapper.pch" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "Mapper - Win32 Debug"
|
||||
|
||||
CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\Mapper.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\Mapper.pch" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
266
Library/dxx8/samples/Multimedia/DirectShow/Misc/Mapper/Mapper.rc
Normal file
266
Library/dxx8/samples/Multimedia/DirectShow/Misc/Mapper/Mapper.rc
Normal file
@@ -0,0 +1,266 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\Mapper.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\Mapper.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 250, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About FilterMapper"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||
CTEXT "DirectShow Filter Mapper Sample",IDC_STATIC,40,10,146,8,
|
||||
SS_NOPREFIX
|
||||
CTEXT "Copyright (c) 2000-2001 Microsoft Corporation",
|
||||
IDC_STATIC,40,34,146,8
|
||||
DEFPUSHBUTTON "OK",IDOK,193,7,50,14,WS_GROUP
|
||||
CTEXT "Version 8.1",IDC_STATIC,40,22,146,8,SS_NOPREFIX
|
||||
END
|
||||
|
||||
IDD_MAPPER_DIALOG DIALOGEX 0, 0, 436, 345
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE |
|
||||
WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "DirectShow Filter Mapper Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&Search",IDC_BUTTON_SEARCH,22,20,78,23
|
||||
PUSHBUTTON "&Clear",IDC_BUTTON_CLEAR,118,20,78,23
|
||||
COMBOBOX IDC_COMBO_MERIT,297,18,122,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO_INPUT_CATEGORY,84,63,122,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO_OUTPUT_CATEGORY,297,63,122,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Use exact match?",IDC_CHECK_EXACT_MATCH,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,243,35,86,10
|
||||
LISTBOX IDC_LIST_INPUT_MAJOR,12,89,93,36,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_INPUT_MINOR,113,89,93,36,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_INPUT_MAJOR2,12,138,93,36,LBS_NOINTEGRALHEIGHT |
|
||||
WS_DISABLED | WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_INPUT_MINOR2,113,138,93,36,LBS_NOINTEGRALHEIGHT |
|
||||
WS_DISABLED | WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_OUTPUT_MAJOR,224,89,93,36,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_OUTPUT_MINOR,326,89,93,36,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_OUTPUT_MAJOR2,224,138,93,36,
|
||||
LBS_NOINTEGRALHEIGHT | WS_DISABLED | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LISTBOX IDC_LIST_OUTPUT_MINOR2,326,138,93,36,
|
||||
LBS_NOINTEGRALHEIGHT | WS_DISABLED | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
CONTROL "Has at least one input pin?",IDC_CHECK_INPUT_PIN,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,12,178,126,10
|
||||
CONTROL "Has at least one output pin?",IDC_CHECK_OUTPUT_PIN,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,178,104,10
|
||||
CONTROL "Renders its output?",IDC_CHECK_RENDERER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,341,178,78,10
|
||||
GROUPBOX "Filters Matching Query : 0",IDC_STATIC_NUMFILTERS,7,194,
|
||||
419,144,BS_CENTER
|
||||
LISTBOX IDC_LIST_FILTERS,12,214,407,118,LBS_SORT |
|
||||
LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_HSCROLL | WS_TABSTOP
|
||||
GROUPBOX "Filter Input",IDC_STATIC,7,52,206,139,BS_LEFT
|
||||
CTEXT "Input pin category :",IDC_STATIC,13,65,68,8
|
||||
CTEXT "Input Media Type",IDC_STATIC,12,78,93,8
|
||||
CTEXT "Media Subtype",IDC_STATIC,113,78,93,8
|
||||
CTEXT "Secondary Media Type",IDC_STATIC,12,127,93,8
|
||||
CTEXT "Secondary Subtype",IDC_STATIC,113,127,93,8
|
||||
GROUPBOX "Filter Output",IDC_STATIC,220,52,206,139,BS_LEFT
|
||||
CTEXT "Output pin category : ",IDC_STATIC,226,65,67,8
|
||||
CTEXT "Output Media Type",IDC_STATIC,224,78,93,8
|
||||
CTEXT "Media Subtype",IDC_STATIC,326,78,93,8
|
||||
CTEXT "Secondary Media Type",IDC_STATIC,224,127,93,8
|
||||
CTEXT "Secondary Subtype",IDC_STATIC,326,127,93,8
|
||||
GROUPBOX "Global options",IDC_STATIC,219,6,206,44
|
||||
RTEXT "Minimum merit : ",IDC_STATIC,226,19,67,11,
|
||||
SS_CENTERIMAGE
|
||||
GROUPBOX "Select your filter query parameters and click Search.",
|
||||
IDC_STATIC,7,6,206,43
|
||||
LTEXT "Filter Name",IDC_STATIC,13,204,109,8
|
||||
LTEXT "Filter Merit",IDC_STATIC,153,204,74,8
|
||||
LTEXT "Server Filename",IDC_STATIC,243,204,109,8
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 8,1,0,0
|
||||
PRODUCTVERSION 8,1,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "Mapper MFC Application\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "Mapper\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2000-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "Mapper.EXE\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 243
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 48
|
||||
END
|
||||
|
||||
IDD_MAPPER_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 432
|
||||
TOPMARGIN, 6
|
||||
BOTTOMMARGIN, 338
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_ABOUTBOX "&About FilterMapper..."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#include "res\Mapper.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,867 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: MapperDlg.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - an MFC based C++ filter mapper application.
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
// MapperDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Mapper.h"
|
||||
#include "MapperDlg.h"
|
||||
|
||||
#include "types.h"
|
||||
#include "wxdebug.h"
|
||||
#include "fil_data.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
// ID for unpublished filter data helper method
|
||||
const IID IID_IAMFilterData = {0x97f7c4d4,0x547b,0x4a5f,{0x83,0x32,0x53,0x64,0x30,0xad,0x2e,0x4d}};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAboutDlg)
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAboutDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
//{{AFX_MSG(CAboutDlg)
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAboutDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAboutDlg)
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapperDlg dialog
|
||||
|
||||
CMapperDlg::CMapperDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CMapperDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CMapperDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||
}
|
||||
|
||||
void CMapperDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CMapperDlg)
|
||||
DDX_Control(pDX, IDC_BUTTON_SEARCH, m_bSearch);
|
||||
DDX_Control(pDX, IDC_BUTTON_CLEAR, m_bClear);
|
||||
DDX_Control(pDX, IDC_STATIC_NUMFILTERS, m_StrNumFilters);
|
||||
DDX_Control(pDX, IDC_CHECK_RENDERER, m_bIsRenderer);
|
||||
DDX_Control(pDX, IDC_CHECK_OUTPUT_PIN, m_bAtLeastOneOutputPin);
|
||||
DDX_Control(pDX, IDC_CHECK_INPUT_PIN, m_bAtLeastOneInputPin);
|
||||
DDX_Control(pDX, IDC_CHECK_EXACT_MATCH, m_bExactMatch);
|
||||
DDX_Control(pDX, IDC_LIST_OUTPUT_MINOR2, m_ListOutputMinor2);
|
||||
DDX_Control(pDX, IDC_LIST_OUTPUT_MINOR, m_ListOutputMinor);
|
||||
DDX_Control(pDX, IDC_LIST_OUTPUT_MAJOR2, m_ListOutputMajor2);
|
||||
DDX_Control(pDX, IDC_LIST_OUTPUT_MAJOR, m_ListOutputMajor);
|
||||
DDX_Control(pDX, IDC_LIST_INPUT_MINOR2, m_ListInputMinor2);
|
||||
DDX_Control(pDX, IDC_LIST_INPUT_MINOR, m_ListInputMinor);
|
||||
DDX_Control(pDX, IDC_LIST_INPUT_MAJOR2, m_ListInputMajor2);
|
||||
DDX_Control(pDX, IDC_LIST_INPUT_MAJOR, m_ListInputMajor);
|
||||
DDX_Control(pDX, IDC_COMBO_MERIT, m_ComboMerit);
|
||||
DDX_Control(pDX, IDC_COMBO_OUTPUT_CATEGORY, m_ComboOutputCat);
|
||||
DDX_Control(pDX, IDC_COMBO_INPUT_CATEGORY, m_ComboInputCat);
|
||||
DDX_Control(pDX, IDC_LIST_FILTERS, m_ListFilters);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMapperDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CMapperDlg)
|
||||
ON_WM_SYSCOMMAND()
|
||||
ON_WM_PAINT()
|
||||
ON_WM_QUERYDRAGICON()
|
||||
ON_WM_CLOSE()
|
||||
ON_WM_DESTROY()
|
||||
ON_BN_CLICKED(IDC_BUTTON_SEARCH, OnButtonSearch)
|
||||
ON_LBN_SELCHANGE(IDC_LIST_INPUT_MAJOR, OnSelchangeListInputMajor)
|
||||
ON_LBN_SELCHANGE(IDC_LIST_OUTPUT_MAJOR, OnSelchangeListOutputMajor)
|
||||
ON_LBN_SELCHANGE(IDC_LIST_INPUT_MAJOR2, OnSelchangeListInputMajor2)
|
||||
ON_LBN_SELCHANGE(IDC_LIST_OUTPUT_MAJOR2, OnSelchangeListOutputMajor2)
|
||||
ON_BN_CLICKED(IDC_BUTTON_CLEAR, OnButtonClear)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapperDlg message handlers
|
||||
|
||||
void CMapperDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
|
||||
{
|
||||
CAboutDlg dlgAbout;
|
||||
dlgAbout.DoModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnSysCommand(nID, lParam);
|
||||
}
|
||||
}
|
||||
|
||||
// If you add a minimize button to your dialog, you will need the code below
|
||||
// to draw the icon. For MFC applications using the document/view model,
|
||||
// this is automatically done for you by the framework.
|
||||
|
||||
void CMapperDlg::OnPaint()
|
||||
{
|
||||
if (IsIconic())
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
|
||||
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
|
||||
|
||||
// Center icon in client rectangle
|
||||
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||||
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
int x = (rect.Width() - cxIcon + 1) / 2;
|
||||
int y = (rect.Height() - cyIcon + 1) / 2;
|
||||
|
||||
// Draw the icon
|
||||
dc.DrawIcon(x, y, m_hIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnPaint();
|
||||
}
|
||||
}
|
||||
|
||||
// The system calls this to obtain the cursor to display while the user drags
|
||||
// the minimized window.
|
||||
HCURSOR CMapperDlg::OnQueryDragIcon()
|
||||
{
|
||||
return (HCURSOR) m_hIcon;
|
||||
}
|
||||
|
||||
|
||||
BOOL CMapperDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// Add "About..." menu item to system menu.
|
||||
|
||||
// IDM_ABOUTBOX must be in the system command range.
|
||||
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
|
||||
ASSERT(IDM_ABOUTBOX < 0xF000);
|
||||
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != NULL)
|
||||
{
|
||||
CString strAboutMenu;
|
||||
strAboutMenu.LoadString(IDS_ABOUTBOX);
|
||||
if (!strAboutMenu.IsEmpty())
|
||||
{
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the icon for this dialog. The framework does this automatically
|
||||
// when the application's main window is not a dialog
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DirectShow initialization code
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
// Create the filter mapper that will be used for all queries
|
||||
HRESULT hr = CoCreateInstance(CLSID_FilterMapper2,
|
||||
NULL, CLSCTX_INPROC, IID_IFilterMapper2,
|
||||
(void **) &m_pMapper);
|
||||
ASSERT(SUCCEEDED(hr));
|
||||
if (FAILED(hr))
|
||||
return FALSE;
|
||||
|
||||
// Initialize some application settings
|
||||
InitializeTooltips();
|
||||
SetDefaults();
|
||||
|
||||
// Customize list box tab stops for good formatting
|
||||
int nTabStops[2]={140,230};
|
||||
m_ListFilters.SetTabStops(2, nTabStops);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
}
|
||||
|
||||
BOOL CMapperDlg::InitializeTooltips()
|
||||
{
|
||||
int rc;
|
||||
|
||||
// Create the tooltip control
|
||||
m_pToolTip = new CToolTipCtrl;
|
||||
if(!m_pToolTip->Create(this))
|
||||
{
|
||||
TRACE(TEXT("Unable To create ToolTip\n"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Set some tooltip defaults
|
||||
m_pToolTip->SetMaxTipWidth(250);
|
||||
m_pToolTip->SetDelayTime(TTDT_AUTOPOP, 10000); /* 10s */
|
||||
m_pToolTip->SetDelayTime(TTDT_INITIAL, 2000); /* 2s */
|
||||
|
||||
// Add tooltip strings for the relevant controls
|
||||
rc = m_pToolTip->AddTool(&m_bExactMatch, TTSTR_EXACT_MATCH);
|
||||
rc = m_pToolTip->AddTool(&m_bAtLeastOneInputPin, TTSTR_ALOIP);
|
||||
rc = m_pToolTip->AddTool(&m_bAtLeastOneOutputPin, TTSTR_ALOOP);
|
||||
rc = m_pToolTip->AddTool(&m_bIsRenderer, TTSTR_IS_RENDERER);
|
||||
rc = m_pToolTip->AddTool(&m_bClear, TTSTR_CLEAR);
|
||||
rc = m_pToolTip->AddTool(&m_bSearch, TTSTR_SEARCH);
|
||||
rc = m_pToolTip->AddTool(&m_ListFilters, TTSTR_FILTERS);
|
||||
rc = m_pToolTip->AddTool(&m_ComboMerit, TTSTR_MERIT);
|
||||
rc = m_pToolTip->AddTool(&m_ComboInputCat, TTSTR_PIN_CAT);
|
||||
rc = m_pToolTip->AddTool(&m_ComboOutputCat, TTSTR_PIN_CAT);
|
||||
rc = m_pToolTip->AddTool(&m_ListInputMajor, TTSTR_TYPE);
|
||||
rc = m_pToolTip->AddTool(&m_ListInputMajor2, TTSTR_TYPE);
|
||||
rc = m_pToolTip->AddTool(&m_ListOutputMajor, TTSTR_TYPE);
|
||||
rc = m_pToolTip->AddTool(&m_ListOutputMajor2, TTSTR_TYPE);
|
||||
rc = m_pToolTip->AddTool(&m_ListInputMinor, TTSTR_SUBTYPE);
|
||||
rc = m_pToolTip->AddTool(&m_ListInputMinor2, TTSTR_SUBTYPE);
|
||||
rc = m_pToolTip->AddTool(&m_ListOutputMinor, TTSTR_SUBTYPE);
|
||||
rc = m_pToolTip->AddTool(&m_ListOutputMinor2, TTSTR_SUBTYPE);
|
||||
|
||||
// Activate the tooltip control
|
||||
m_pToolTip->Activate(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CMapperDlg::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
// Let the tooltip process the message, if appropriate
|
||||
if (m_pToolTip)
|
||||
m_pToolTip->RelayEvent(pMsg);
|
||||
|
||||
return CDialog::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
void CMapperDlg::SetDefaults()
|
||||
{
|
||||
int i;
|
||||
|
||||
// The app allows you to specify up to two major/minor type pairs
|
||||
FillMajorTypes(m_ListInputMajor);
|
||||
FillMajorTypes(m_ListInputMajor2);
|
||||
FillMajorTypes(m_ListOutputMajor);
|
||||
FillMajorTypes(m_ListOutputMajor2);
|
||||
|
||||
// Initialize subtype list boxes
|
||||
m_ListInputMinor.ResetContent();
|
||||
m_ListInputMinor2.ResetContent();
|
||||
m_ListOutputMinor.ResetContent();
|
||||
m_ListOutputMinor2.ResetContent();
|
||||
|
||||
// Set checkboxes to preferred default values
|
||||
m_bAtLeastOneInputPin.SetCheck(1);
|
||||
m_bAtLeastOneOutputPin.SetCheck(1);
|
||||
|
||||
// Initialize merit box
|
||||
m_ComboMerit.ResetContent();
|
||||
for (i=0; i < NUM_MERIT_TYPES; i++)
|
||||
{
|
||||
m_ComboMerit.InsertString(i, merittypes[i].szName);
|
||||
m_ComboMerit.SetItemData(i, merittypes[i].dwMerit);
|
||||
}
|
||||
m_ComboMerit.SetCurSel(4); // "Normal" merit
|
||||
|
||||
// Initialize pin categories
|
||||
m_ComboInputCat.ResetContent();
|
||||
m_ComboOutputCat.ResetContent();
|
||||
m_ComboInputCat.AddString(TEXT("<Don't care>\0"));
|
||||
m_ComboOutputCat.AddString(TEXT("<Don't care>\0"));
|
||||
|
||||
// Fill pin category lists
|
||||
for (i=1; i < NUM_PIN_TYPES; i++)
|
||||
{
|
||||
m_ComboInputCat.InsertString(i, pintypes[i].szName);
|
||||
m_ComboInputCat.SetItemDataPtr(i, (void *) pintypes[i].pGUID);
|
||||
m_ComboOutputCat.InsertString(i, pintypes[i].szName);
|
||||
m_ComboOutputCat.SetItemDataPtr(i, (void *) pintypes[i].pGUID);
|
||||
}
|
||||
m_ComboInputCat.SetCurSel(0);
|
||||
m_ComboOutputCat.SetCurSel(0);
|
||||
|
||||
// Clear filter list
|
||||
m_ListFilters.ResetContent();
|
||||
m_StrNumFilters.SetWindowText(TEXT("Filters Matching Query : 0"));
|
||||
|
||||
// Select the first item in each type list
|
||||
FillSubType(m_ListInputMajor, m_ListInputMinor);
|
||||
FillSubType(m_ListInputMajor2, m_ListInputMinor2);
|
||||
FillSubType(m_ListOutputMajor, m_ListOutputMinor);
|
||||
FillSubType(m_ListOutputMajor2, m_ListOutputMinor2);
|
||||
|
||||
// Disable the second type/subtype listboxes until the user selects
|
||||
// something other than "don't care" for the first type/subtype pair.
|
||||
OnSelchangeListInputMajor();
|
||||
OnSelchangeListOutputMajor();
|
||||
}
|
||||
|
||||
void CMapperDlg::OnButtonClear()
|
||||
{
|
||||
// Clear all values and reset dialog
|
||||
SetDefaults();
|
||||
}
|
||||
|
||||
void CMapperDlg::OnClose()
|
||||
{
|
||||
// Disable and destroy the tooltip control
|
||||
if (m_pToolTip)
|
||||
{
|
||||
m_pToolTip->Activate(FALSE);
|
||||
delete m_pToolTip;
|
||||
m_pToolTip = 0;
|
||||
}
|
||||
|
||||
// Release FilterMapper interface
|
||||
SAFE_RELEASE(m_pMapper);
|
||||
|
||||
// Release COM
|
||||
CoUninitialize();
|
||||
|
||||
CDialog::OnClose();
|
||||
}
|
||||
|
||||
void CMapperDlg::OnDestroy()
|
||||
{
|
||||
// Disable and destroy the tooltip control
|
||||
if (m_pToolTip)
|
||||
{
|
||||
delete m_pToolTip;
|
||||
m_pToolTip = 0;
|
||||
}
|
||||
|
||||
// Release FilterMapper interface
|
||||
SAFE_RELEASE(m_pMapper);
|
||||
|
||||
CDialog::OnDestroy();
|
||||
}
|
||||
|
||||
void CMapperDlg::FillMajorTypes(CListBox& m_List)
|
||||
{
|
||||
m_List.ResetContent();
|
||||
|
||||
// Fill the specified list box with major type name/GUID
|
||||
for (int i=0; i < NUM_MAJOR_TYPES; i++)
|
||||
{
|
||||
m_List.InsertString(i, majortypes[i].szName);
|
||||
m_List.SetItemDataPtr(i, (void *) majortypes[i].pGUID);
|
||||
}
|
||||
|
||||
m_List.SetCurSel(0);
|
||||
}
|
||||
|
||||
void CMapperDlg::FillSubType(CListBox& m_List, CListBox& m_ListMinor)
|
||||
{
|
||||
const GUIDINFO *pSubtype;
|
||||
int nSelection = m_List.GetCurSel();
|
||||
int nMajorType;
|
||||
|
||||
// First clear the subtype list
|
||||
m_ListMinor.ResetContent();
|
||||
|
||||
// If the "don't care" item was selected, clear and exit
|
||||
if (nSelection == 0)
|
||||
{
|
||||
m_ListMinor.AddString(TEXT("<No subtypes>\0"));
|
||||
m_ListMinor.SetCurSel(0);
|
||||
return;
|
||||
}
|
||||
else
|
||||
nMajorType = nSelection - 1;
|
||||
|
||||
// Determine how to fill the minor type list, based on the
|
||||
// currently selected major type.
|
||||
pSubtype = pSubTypes[nMajorType];
|
||||
|
||||
// If there's no associated subtype, just add a default
|
||||
if (!pSubtype)
|
||||
{
|
||||
m_ListMinor.AddString(TEXT("<No subtypes>\0"));
|
||||
m_ListMinor.SetCurSel(0);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set a default item for "don't care"
|
||||
m_ListMinor.AddString(TEXT("<Don't care>\0"));
|
||||
|
||||
int i=0;
|
||||
|
||||
// Fill the subtype list box. Enter N item data to the N+1 list slot.
|
||||
while (pSubtype[i].pGUID != NULL)
|
||||
{
|
||||
m_ListMinor.AddString(pSubtype[i].szName);
|
||||
m_ListMinor.SetItemDataPtr(i+1, (void *) pSubtype[i].pGUID);
|
||||
i++;
|
||||
}
|
||||
|
||||
m_ListMinor.SetCurSel(0);
|
||||
}
|
||||
}
|
||||
|
||||
void CMapperDlg::OnSelchangeListInputMajor()
|
||||
{
|
||||
// User has selected a new major type, so refill the subtype list box
|
||||
FillSubType(m_ListInputMajor, m_ListInputMinor);
|
||||
|
||||
// Since the second type/subtype pair is irrelevant if the first
|
||||
// is a don't care, disable the second set if appropriate.
|
||||
EnableSecondTypePair(m_ListInputMajor, m_ListInputMajor2, m_ListInputMinor2);
|
||||
}
|
||||
|
||||
void CMapperDlg::OnSelchangeListInputMajor2()
|
||||
{
|
||||
// User has selected a new major type, so refill the subtype list box
|
||||
FillSubType(m_ListInputMajor2, m_ListInputMinor2);
|
||||
}
|
||||
|
||||
void CMapperDlg::OnSelchangeListOutputMajor()
|
||||
{
|
||||
// User has selected a new major type, so refill the subtype list box
|
||||
FillSubType(m_ListOutputMajor, m_ListOutputMinor);
|
||||
|
||||
// Since the second type/subtype pair is irrelevant if the first
|
||||
// is a don't care, disable the second set if appropriate.
|
||||
EnableSecondTypePair(m_ListOutputMajor, m_ListOutputMajor2, m_ListOutputMinor2);
|
||||
}
|
||||
|
||||
void CMapperDlg::OnSelchangeListOutputMajor2()
|
||||
{
|
||||
// User has selected a new major type, so refill the subtype list box
|
||||
FillSubType(m_ListOutputMajor2, m_ListOutputMinor2);
|
||||
}
|
||||
|
||||
void CMapperDlg::EnableSecondTypePair(CListBox& m_ListMajor,
|
||||
CListBox& m_ListMajor2, CListBox& m_ListMinor2)
|
||||
{
|
||||
// If there is no selection in the first major type listbox,
|
||||
// clear and disable the second major/minor type listboxes.
|
||||
if (m_ListMajor.GetCurSel() == 0)
|
||||
{
|
||||
m_ListMajor2.SetCurSel(0);
|
||||
FillSubType(m_ListMajor2, m_ListMinor2);
|
||||
|
||||
m_ListMajor2.EnableWindow(FALSE);
|
||||
m_ListMinor2.EnableWindow(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ListMajor2.EnableWindow(TRUE);
|
||||
m_ListMinor2.EnableWindow(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void FillTypeArray(CListBox& m_ListMajor, CListBox& m_ListMinor,
|
||||
GUID *atypes, int nIndex, DWORD *pdwPairs)
|
||||
{
|
||||
int nMajorSel = m_ListMajor.GetCurSel();
|
||||
int nMinorSel = m_ListMinor.GetCurSel();
|
||||
|
||||
// If no selection ("don't care"), just exit without modifying the array
|
||||
if (nMajorSel <= 0)
|
||||
return;
|
||||
|
||||
// Get GUID for major type
|
||||
const GUID *p1 = (const GUID *)m_ListMajor.GetItemDataPtr(nMajorSel);
|
||||
|
||||
// Since the FilterMapper interface requires GUIDs (instead of GUID *),
|
||||
// copy the specified GUID data into its array slot.
|
||||
memcpy(&atypes[nIndex], p1, sizeof(GUID));
|
||||
|
||||
// Increment number of type/subtype pairs
|
||||
(*pdwPairs)++;
|
||||
|
||||
// If no selection ("don't care"), or uninitialized (returning -1),
|
||||
// just exit without modifying the array
|
||||
if (nMinorSel <= 0)
|
||||
return;
|
||||
|
||||
// Get GUID for subtype
|
||||
const GUID *p2 = (const GUID *)m_ListMinor.GetItemDataPtr(nMinorSel);
|
||||
|
||||
if (p2)
|
||||
memcpy(&atypes[nIndex+1], p2, sizeof(GUID));
|
||||
}
|
||||
|
||||
IEnumMoniker *CMapperDlg::GetFilterEnumerator(void)
|
||||
{
|
||||
// First set up the boolean values
|
||||
BOOL bExactMatch = m_bExactMatch.GetCheck();
|
||||
BOOL bAtLeastOneInputPin = m_bAtLeastOneInputPin.GetCheck();
|
||||
BOOL bAtLeastOneOutputPin = m_bAtLeastOneOutputPin.GetCheck();
|
||||
BOOL bIsRenderer = m_bIsRenderer.GetCheck();
|
||||
|
||||
// Merit
|
||||
DWORD dwMerit = (DWORD) m_ComboMerit.GetItemData(m_ComboMerit.GetCurSel());
|
||||
|
||||
// Pin categories
|
||||
const GUID *pInCat = (const GUID *)
|
||||
m_ComboInputCat.GetItemDataPtr(m_ComboInputCat.GetCurSel());
|
||||
const GUID *pOutCat = (const GUID *)
|
||||
m_ComboOutputCat.GetItemDataPtr(m_ComboOutputCat.GetCurSel());
|
||||
|
||||
// Major type/subtype pairs
|
||||
DWORD dwInputTypes=0, dwOutputTypes=0;
|
||||
GUID arrayInput[4], arrayOutput[4];
|
||||
|
||||
// Initialize GUID type/subtype arrays
|
||||
for (int i=0; i<4; i++)
|
||||
{
|
||||
arrayInput[i] = GUID_NULL;
|
||||
arrayOutput[i] = GUID_NULL;
|
||||
}
|
||||
|
||||
// Fill each of the four GUID arrays (input/output, major/minor).
|
||||
// If the first call doesn't set anything (primary), don't bother to
|
||||
// read the secondary value, since it would be invalid anyway due to
|
||||
// its position within the array (2) but with a count of only 1.
|
||||
FillTypeArray(m_ListInputMajor, m_ListInputMinor, arrayInput, 0, &dwInputTypes);
|
||||
if (dwInputTypes)
|
||||
FillTypeArray(m_ListInputMajor2, m_ListInputMinor2, arrayInput, 2, &dwInputTypes);
|
||||
|
||||
FillTypeArray(m_ListOutputMajor, m_ListOutputMinor, arrayOutput, 0, &dwOutputTypes);
|
||||
if (dwOutputTypes)
|
||||
FillTypeArray(m_ListOutputMajor2, m_ListOutputMinor2, arrayOutput, 2, &dwOutputTypes);
|
||||
|
||||
// Enumerate all filters that match the specified criteria
|
||||
IEnumMoniker *pEnum;
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
hr = m_pMapper->EnumMatchingFilters(
|
||||
&pEnum,
|
||||
0, // Reserved
|
||||
bExactMatch, // Use exact match?
|
||||
dwMerit, // Minimum merit
|
||||
bAtLeastOneInputPin,
|
||||
dwInputTypes, // Number of major type/subtype pairs for input
|
||||
arrayInput, // Array of major type/subtype pairs for input
|
||||
NULL, // Input medium
|
||||
pInCat, // Input pin category
|
||||
bIsRenderer, // Must be a renderer?
|
||||
bAtLeastOneOutputPin,
|
||||
dwOutputTypes, // Number of major type/subtype pairs for output
|
||||
arrayOutput, // Array of major type/subtype pairs for output
|
||||
NULL, // Output medium
|
||||
pOutCat); // Output pin category
|
||||
|
||||
if (FAILED(hr))
|
||||
return 0;
|
||||
else
|
||||
return pEnum;
|
||||
}
|
||||
|
||||
int CMapperDlg::GetFilenameByCLSID(REFCLSID clsid, TCHAR *szFile)
|
||||
{
|
||||
HRESULT hr;
|
||||
LPOLESTR strCLSID;
|
||||
int rc=0;
|
||||
|
||||
// Convert binary CLSID to a readable version
|
||||
hr = StringFromCLSID(clsid, &strCLSID);
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
TCHAR szKey[512];
|
||||
CString strQuery(strCLSID);
|
||||
|
||||
// Create key name for reading filename from registry
|
||||
wsprintf(szKey, TEXT("Software\\Classes\\CLSID\\%s\\InprocServer32\0"),
|
||||
strQuery);
|
||||
|
||||
// Free memory associated with strCLSID (allocated in StringFromCLSID)
|
||||
CoTaskMemFree(strCLSID);
|
||||
|
||||
HKEY hkeyFilter=0;
|
||||
DWORD dwSize=MAX_PATH;
|
||||
BYTE szFilename[MAX_PATH];
|
||||
|
||||
// Open the CLSID key that contains information about the filter
|
||||
rc = RegOpenKey(HKEY_LOCAL_MACHINE, szKey, &hkeyFilter);
|
||||
if (rc == ERROR_SUCCESS)
|
||||
{
|
||||
rc = RegQueryValueEx(hkeyFilter, NULL, // Read (Default) value
|
||||
NULL, NULL, szFilename, &dwSize);
|
||||
|
||||
if (rc == ERROR_SUCCESS)
|
||||
wsprintf(szFile, TEXT("%s"), szFilename);
|
||||
|
||||
RegCloseKey(hkeyFilter);
|
||||
}
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Read merit and version information
|
||||
HRESULT CMapperDlg::GetMerit(IPropertyBag *pPropBag, DWORD *pdwMerit)
|
||||
{
|
||||
HRESULT hr;
|
||||
IAMFilterData *pData=0;
|
||||
|
||||
*pdwMerit = 0;
|
||||
|
||||
VARIANT varFilData={0};
|
||||
varFilData.vt = VT_UI1 | VT_ARRAY;
|
||||
varFilData.parray = 0; // docs say to zero this
|
||||
|
||||
BYTE *pbFilterData = 0; // 0 if not read
|
||||
DWORD dwcbFilterDAta = 0; // 0 if not read
|
||||
|
||||
// Read compressed filter data from the property bag with a variant
|
||||
hr = pPropBag->Read(L"FilterData", &varFilData, 0);
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
ASSERT(varFilData.vt == (VT_UI1 | VT_ARRAY));
|
||||
dwcbFilterDAta = varFilData.parray->rgsabound[0].cElements;
|
||||
|
||||
// Access the filter data
|
||||
HRESULT hrTmp = SafeArrayAccessData(varFilData.parray, (void **)&pbFilterData);
|
||||
ASSERT(hrTmp == S_OK);
|
||||
ASSERT(pbFilterData);
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT(dwcbFilterDAta == 0 && pbFilterData == 0);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Get the IAMFilterData interface for parsing the filter data
|
||||
hr = m_pMapper->QueryInterface(IID_IAMFilterData, (void **)&pData);
|
||||
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
BYTE *pb=0;
|
||||
|
||||
// Use a helper method to parse the binary filter data. Pass in
|
||||
// the pointer to the filter data, its size, and a buffer to fill with
|
||||
// the resulting data. The "pb" buffer is allocated with CoTaskMemAlloc,
|
||||
// so it must be correspondingly freed by the caller.
|
||||
hr = pData->ParseFilterData(pbFilterData, dwcbFilterDAta, &pb);
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
REGFILTER2 *pFil = ((REGFILTER2 **)pb)[0];
|
||||
|
||||
if(pbFilterData)
|
||||
{
|
||||
HRESULT hrTmp = SafeArrayUnaccessData(varFilData.parray);
|
||||
ASSERT(hrTmp == S_OK);
|
||||
|
||||
hrTmp = VariantClear(&varFilData);
|
||||
ASSERT(hrTmp == S_OK);
|
||||
}
|
||||
|
||||
// Assign the merit value from the REGFILTER2 structure
|
||||
if (pFil)
|
||||
*pdwMerit = pFil->dwMerit;
|
||||
|
||||
// Free the memory allocated by ParseFilterData
|
||||
if (pb)
|
||||
CoTaskMemFree(pb);
|
||||
}
|
||||
|
||||
// Release the IAMFilterData interface
|
||||
pData->Release();
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CMapperDlg::AddMerit(TCHAR *szInfo, DWORD dwMerit)
|
||||
{
|
||||
TCHAR szMerit[32];
|
||||
|
||||
switch (dwMerit)
|
||||
{
|
||||
case MERIT_NORMAL:
|
||||
wsprintf(szMerit, TEXT("MERIT_NORMAL\0"));
|
||||
break; // Assume normal
|
||||
case MERIT_PREFERRED:
|
||||
wsprintf(szMerit, TEXT("MERIT_PREFERRED\0"));
|
||||
break;
|
||||
case MERIT_UNLIKELY:
|
||||
wsprintf(szMerit, TEXT("MERIT_UNLIKELY\0"));
|
||||
break;
|
||||
case MERIT_DO_NOT_USE:
|
||||
wsprintf(szMerit, TEXT("MERIT_DO_NOT_USE\0"));
|
||||
break;
|
||||
case MERIT_SW_COMPRESSOR:
|
||||
wsprintf(szMerit, TEXT("MERIT_SW_COMPRESSOR\0"));
|
||||
break;
|
||||
case MERIT_HW_COMPRESSOR:
|
||||
wsprintf(szMerit, TEXT("MERIT_HW_COMPRESSOR\0"));
|
||||
break;
|
||||
|
||||
default:
|
||||
wsprintf(szMerit, TEXT("0x%08x\0"), dwMerit);
|
||||
break;
|
||||
}
|
||||
|
||||
// Add new merit information to string
|
||||
_tcscat(szInfo, szMerit);
|
||||
}
|
||||
|
||||
|
||||
void CMapperDlg::AddFilter(const TCHAR *szFilterName, const GUID *pCatGuid, DWORD dwMerit)
|
||||
{
|
||||
TCHAR szInfo[300], szFilename[255];
|
||||
|
||||
// First add the friendly name of the filter
|
||||
wsprintf(szInfo, TEXT("%s\t\0"), szFilterName);
|
||||
|
||||
// Add the filter's merit value
|
||||
AddMerit(szInfo, dwMerit);
|
||||
|
||||
// Get the filter's server name from the registry
|
||||
int rc = GetFilenameByCLSID(*pCatGuid, szFilename);
|
||||
|
||||
// Add the filter's server name
|
||||
if (rc == ERROR_SUCCESS)
|
||||
{
|
||||
_tcscat(szInfo, TEXT("\t\0"));
|
||||
_tcscat(szInfo, szFilename);
|
||||
}
|
||||
|
||||
// Add the filter name and filename to the listbox
|
||||
m_ListFilters.AddString(szInfo);
|
||||
}
|
||||
|
||||
void CMapperDlg::OnButtonSearch()
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
IEnumMoniker *pEnum;
|
||||
IMoniker *pMoniker=0;
|
||||
ULONG cFetched=0;
|
||||
VARIANT varName={0};
|
||||
int nFilters=0;
|
||||
|
||||
// Clear any previous results
|
||||
m_ListFilters.ResetContent();
|
||||
|
||||
// Enumerate filters based on the current dialog box selections
|
||||
pEnum = GetFilterEnumerator();
|
||||
if (!pEnum)
|
||||
{
|
||||
m_ListFilters.AddString(TEXT("<No filters matched query>"));
|
||||
return;
|
||||
}
|
||||
hr = pEnum->Reset();
|
||||
|
||||
// Enumerate all filters that match the search criteria. The enumerator
|
||||
// that is returned from GetFilterEnumerator() will only list filters
|
||||
// that matched the user's search request.
|
||||
while((hr = pEnum->Next(1, &pMoniker, &cFetched)) == S_OK)
|
||||
{
|
||||
IPropertyBag *pPropBag;
|
||||
ASSERT(pMoniker);
|
||||
|
||||
// Associate the moniker with a file
|
||||
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
|
||||
(void **)&pPropBag);
|
||||
ASSERT(SUCCEEDED(hr));
|
||||
ASSERT(pPropBag);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
// Read filter name from property bag
|
||||
varName.vt = VT_BSTR;
|
||||
hr = pPropBag->Read(L"FriendlyName", &varName, 0);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
// Get filter name (converting BSTR name to a CString)
|
||||
CString str(varName.bstrVal);
|
||||
SysFreeString(varName.bstrVal);
|
||||
nFilters++;
|
||||
|
||||
// Read Merit value from property bag
|
||||
DWORD dwMerit;
|
||||
GetMerit(pPropBag, &dwMerit);
|
||||
|
||||
// Read filter's CLSID from property bag. This CLSID string will be
|
||||
// converted to a binary CLSID and passed to AddFilter(), which will
|
||||
// add the filter's name to the listbox and its CLSID to the listbox
|
||||
// item's DataPtr item.
|
||||
VARIANT varFilterClsid;
|
||||
varFilterClsid.vt = VT_BSTR;
|
||||
|
||||
// Read CLSID string from property bag
|
||||
hr = pPropBag->Read(L"CLSID", &varFilterClsid, 0);
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
CLSID clsidFilter;
|
||||
|
||||
// Add filter name and filename to listbox
|
||||
if(CLSIDFromString(varFilterClsid.bstrVal, &clsidFilter) == S_OK)
|
||||
{
|
||||
AddFilter(str, &clsidFilter, dwMerit);
|
||||
}
|
||||
|
||||
SysFreeString(varFilterClsid.bstrVal);
|
||||
}
|
||||
|
||||
// Clean up interfaces
|
||||
SAFE_RELEASE(pPropBag);
|
||||
SAFE_RELEASE(pMoniker);
|
||||
}
|
||||
|
||||
// Display number of filters matching query
|
||||
TCHAR szNumFilters[48];
|
||||
wsprintf(szNumFilters, TEXT("Filters Matching Query : %d"), nFilters);
|
||||
m_StrNumFilters.SetWindowText(szNumFilters);
|
||||
|
||||
// Clean up enumerator
|
||||
if (pEnum)
|
||||
pEnum->Release();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: MapperDlg.h
|
||||
//
|
||||
// Desc: DirectShow sample code - an MFC based C++ filter mapper application.
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if !defined(AFX_MAPPERDLG_H__B56EF95A_58D3_498A_B0FD_11BD1B1CADF3__INCLUDED_)
|
||||
#define AFX_MAPPERDLG_H__B56EF95A_58D3_498A_B0FD_11BD1B1CADF3__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
|
||||
#include <dshow.h>
|
||||
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
|
||||
|
||||
//
|
||||
// Tooltip strings
|
||||
//
|
||||
#define TTSTR_EXACT_MATCH TEXT("If the value of the bExactMatch parameter is TRUE, this method ")\
|
||||
TEXT("looks for filters that exactly match the values you specify for media type, pin category, ")\
|
||||
TEXT("and pin medium. If the value is FALSE, filters that register a value of NULL for any ")\
|
||||
TEXT("of these items are considered a match. (In effect, a NULL value in the registry acts as a ")\
|
||||
TEXT("wildcard.)")
|
||||
|
||||
#define TTSTR_ALOIP TEXT("Boolean value indicating whether the filter must have an input pin. ")\
|
||||
TEXT("If the value is TRUE, the filter must have at least one input pin.")
|
||||
|
||||
#define TTSTR_ALOOP TEXT("Boolean value specifying whether the filter must have an output pin. ")\
|
||||
TEXT("If TRUE, the filter must have at least one output pin.")
|
||||
|
||||
#define TTSTR_IS_RENDERER TEXT("Boolean value that specifies whether the filter must render its ")\
|
||||
TEXT("input. If TRUE, the specified filter must render input.")
|
||||
|
||||
#define TTSTR_CLEAR TEXT("Clear all selections and return them to default values.")
|
||||
|
||||
#define TTSTR_SEARCH TEXT("Search the registry for filters that match the current selections, ")\
|
||||
TEXT("using the IFilterMapper2::EnumMatchingFilters() method.")
|
||||
|
||||
#define TTSTR_FILTERS TEXT("This area displays the names and filenames of filters that match ")\
|
||||
TEXT("your query.")
|
||||
|
||||
#define TTSTR_MERIT TEXT("Minimum merit value. Each filter is registered with a merit value. ")\
|
||||
TEXT("When the filter graph manager builds a graph, it enumerates all the filters registered ")\
|
||||
TEXT("with the correct media type. Then it tries them in order of merit, from highest to lowest. ")\
|
||||
TEXT("(It uses additional criteria to choose between filters with equal merit.) It never tries ")\
|
||||
TEXT("filters with a merit value less than or equal to MERIT_DO_NOT_USE.")
|
||||
|
||||
#define TTSTR_PIN_CAT TEXT("The pin property set enables you to retrieve the category to which ")\
|
||||
TEXT("a pin belongs, if any. The category is set by the filter when it creates the pin; the ")\
|
||||
TEXT("category indicates what type of data the pin is streaming. The most commonly used ")\
|
||||
TEXT("categories are for the capture and preview pins on a capture filter. Leave as <Don't Care> ")\
|
||||
TEXT("if not needed.")
|
||||
|
||||
#define TTSTR_TYPE TEXT("Select a media type, if desired. If you specify <Don't care> for ")\
|
||||
TEXT("media type or pin category, any filter is considered a match for that parameter. ")\
|
||||
TEXT("If a pin did not register any media types, this method will not consider it a match for ")\
|
||||
TEXT("the media type.")
|
||||
|
||||
#define TTSTR_SUBTYPE TEXT("Select a corresponding media subtype, if desired. If you specify ")\
|
||||
TEXT("<Don't care> for the subtype, then the subtype is ignored (set to GUID_NULL) so that all ")\
|
||||
TEXT("subtypes are considered a match within the related type.")
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapperDlg dialog
|
||||
|
||||
class CMapperDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CMapperDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
void FillMajorTypes(CListBox& m_List);
|
||||
void FillSubType(CListBox& m_List, CListBox& m_ListMinor);
|
||||
void EnableSecondTypePair(CListBox& m_ListMajor,
|
||||
CListBox& m_ListMajor2, CListBox& m_ListMinor2);
|
||||
void SetDefaults();
|
||||
|
||||
BOOL InitializeTooltips(void);
|
||||
|
||||
IEnumMoniker *GetFilterEnumerator(void);
|
||||
|
||||
int GetFilenameByCLSID(REFCLSID clsid, TCHAR *szFile);
|
||||
|
||||
void AddFilter(const TCHAR *szFilterName, const GUID *pCatGuid, DWORD dwMerit);
|
||||
void AddMerit(TCHAR *szInfo, DWORD dwMerit);
|
||||
HRESULT GetMerit(IPropertyBag *pPropBag, DWORD *pdwMerit);
|
||||
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CMapperDlg)
|
||||
enum { IDD = IDD_MAPPER_DIALOG };
|
||||
CButton m_bSearch;
|
||||
CButton m_bClear;
|
||||
CStatic m_StrNumFilters;
|
||||
CButton m_bIsRenderer;
|
||||
CButton m_bAtLeastOneOutputPin;
|
||||
CButton m_bAtLeastOneInputPin;
|
||||
CButton m_bExactMatch;
|
||||
CListBox m_ListOutputMinor2;
|
||||
CListBox m_ListOutputMinor;
|
||||
CListBox m_ListOutputMajor2;
|
||||
CListBox m_ListOutputMajor;
|
||||
CListBox m_ListInputMinor2;
|
||||
CListBox m_ListInputMinor;
|
||||
CListBox m_ListInputMajor2;
|
||||
CListBox m_ListInputMajor;
|
||||
CComboBox m_ComboMerit;
|
||||
CComboBox m_ComboOutputCat;
|
||||
CComboBox m_ComboInputCat;
|
||||
CListBox m_ListFilters;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMapperDlg)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
|
||||
IFilterMapper2 *m_pMapper;
|
||||
CToolTipCtrl *m_pToolTip;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CMapperDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnButtonSearch();
|
||||
afx_msg void OnSelchangeListInputMajor();
|
||||
afx_msg void OnSelchangeListOutputMajor();
|
||||
afx_msg void OnSelchangeListInputMajor2();
|
||||
afx_msg void OnSelchangeListOutputMajor2();
|
||||
afx_msg void OnButtonClear();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAPPERDLG_H__B56EF95A_58D3_498A_B0FD_11BD1B1CADF3__INCLUDED_)
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// Mapper.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__00C2DF4A_9A0B_4426_A607_2B9D9DB7E00A__INCLUDED_)
|
||||
#define AFX_STDAFX_H__00C2DF4A_9A0B_4426_A607_2B9D9DB7E00A__INCLUDED_
|
||||
|
||||
#ifdef _WIN32_WINDOWS
|
||||
#undef _WIN32_WINDOWS
|
||||
#endif
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__00C2DF4A_9A0B_4426_A607_2B9D9DB7E00A__INCLUDED_)
|
||||
@@ -0,0 +1,201 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: fil_data.h
|
||||
//
|
||||
// Desc: DirectShow sample code - an MFC based C++ filter mapper application.
|
||||
//
|
||||
// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
/* File created by MIDL compiler version 5.01.0164 */
|
||||
/* at Sat Oct 23 12:28:23 1999
|
||||
*/
|
||||
/* Compiler settings for fil_data.idl:
|
||||
Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
*/
|
||||
//@@MIDL_FILE_HEADING( )
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 440
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __fil_data_h__
|
||||
#define __fil_data_h__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __IAMFilterData_FWD_DEFINED__
|
||||
#define __IAMFilterData_FWD_DEFINED__
|
||||
typedef interface IAMFilterData IAMFilterData;
|
||||
#endif /* __IAMFilterData_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "unknwn.h"
|
||||
#include "strmif.h"
|
||||
|
||||
void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
|
||||
void __RPC_USER MIDL_user_free( void __RPC_FAR * );
|
||||
|
||||
/* interface __MIDL_itf_fil_data_0000 */
|
||||
/* [local] */
|
||||
|
||||
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_fil_data_0000_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_fil_data_0000_v0_0_s_ifspec;
|
||||
|
||||
#ifndef __IAMFilterData_INTERFACE_DEFINED__
|
||||
#define __IAMFilterData_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IAMFilterData */
|
||||
/* [unique][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IAMFilterData;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("97f7c4d4-547b-4a5f-8332-536430ad2e4d")
|
||||
IAMFilterData : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE ParseFilterData(
|
||||
/* [size_is][in] */ BYTE __RPC_FAR *rgbFilterData,
|
||||
/* [in] */ ULONG cb,
|
||||
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *prgbRegFilter2) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateFilterData(
|
||||
/* [in] */ REGFILTER2 __RPC_FAR *prf2,
|
||||
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *prgbFilterData,
|
||||
/* [out] */ ULONG __RPC_FAR *pcb) = 0;
|
||||
|
||||
};
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IAMFilterDataVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
|
||||
IAMFilterData __RPC_FAR * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
|
||||
IAMFilterData __RPC_FAR * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
|
||||
IAMFilterData __RPC_FAR * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ParseFilterData )(
|
||||
IAMFilterData __RPC_FAR * This,
|
||||
/* [size_is][in] */ BYTE __RPC_FAR *rgbFilterData,
|
||||
/* [in] */ ULONG cb,
|
||||
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *prgbRegFilter2);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreateFilterData )(
|
||||
IAMFilterData __RPC_FAR * This,
|
||||
/* [in] */ REGFILTER2 __RPC_FAR *prf2,
|
||||
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *prgbFilterData,
|
||||
/* [out] */ ULONG __RPC_FAR *pcb);
|
||||
|
||||
END_INTERFACE
|
||||
} IAMFilterDataVtbl;
|
||||
|
||||
interface IAMFilterData
|
||||
{
|
||||
CONST_VTBL struct IAMFilterDataVtbl __RPC_FAR *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IAMFilterData_QueryInterface(This,riid,ppvObject) \
|
||||
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
|
||||
|
||||
#define IAMFilterData_AddRef(This) \
|
||||
(This)->lpVtbl -> AddRef(This)
|
||||
|
||||
#define IAMFilterData_Release(This) \
|
||||
(This)->lpVtbl -> Release(This)
|
||||
|
||||
|
||||
#define IAMFilterData_ParseFilterData(This,rgbFilterData,cb,prgbRegFilter2) \
|
||||
(This)->lpVtbl -> ParseFilterData(This,rgbFilterData,cb,prgbRegFilter2)
|
||||
|
||||
#define IAMFilterData_CreateFilterData(This,prf2,prgbFilterData,pcb) \
|
||||
(This)->lpVtbl -> CreateFilterData(This,prf2,prgbFilterData,pcb)
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE IAMFilterData_ParseFilterData_Proxy(
|
||||
IAMFilterData __RPC_FAR * This,
|
||||
/* [size_is][in] */ BYTE __RPC_FAR *rgbFilterData,
|
||||
/* [in] */ ULONG cb,
|
||||
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *prgbRegFilter2);
|
||||
|
||||
|
||||
void __RPC_STUB IAMFilterData_ParseFilterData_Stub(
|
||||
IRpcStubBuffer *This,
|
||||
IRpcChannelBuffer *_pRpcChannelBuffer,
|
||||
PRPC_MESSAGE _pRpcMessage,
|
||||
DWORD *_pdwStubPhase);
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE IAMFilterData_CreateFilterData_Proxy(
|
||||
IAMFilterData __RPC_FAR * This,
|
||||
/* [in] */ REGFILTER2 __RPC_FAR *prf2,
|
||||
/* [out] */ BYTE __RPC_FAR *__RPC_FAR *prgbFilterData,
|
||||
/* [out] */ ULONG __RPC_FAR *pcb);
|
||||
|
||||
|
||||
void __RPC_STUB IAMFilterData_CreateFilterData_Stub(
|
||||
IRpcStubBuffer *This,
|
||||
IRpcChannelBuffer *_pRpcChannelBuffer,
|
||||
PRPC_MESSAGE _pRpcMessage,
|
||||
DWORD *_pdwStubPhase);
|
||||
|
||||
|
||||
|
||||
#endif /* __IAMFilterData_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
DirectShow Sample -- Mapper
|
||||
---------------------------
|
||||
|
||||
This sample demonstrates using the IFilterMapper2::EnumMatchingFilters method
|
||||
to locate filters in the registry. The application's user interface contains controls
|
||||
that match the parameters of the EnumMatchingFilters method, such as minimum merit value,
|
||||
pin categories, and media types.
|
||||
|
||||
Select the search options that you want, then click the Search button to enumerate
|
||||
the filters that match those options. The list box will display the results of your
|
||||
query, including the filter's Friendly Name, Filter merit, and the filename of the
|
||||
server which contains it. Tooltips are provided to help explain the user interface
|
||||
elements.
|
||||
|
||||
Although the EnumMatchingFilters method allows you to specify the number of
|
||||
media type/subtype pairs to use in the query, the Mapper application only provides
|
||||
two sets of list boxes for input and output types. If the first media type is specified
|
||||
as a "Don't Care" condition, then the secondary media type/subtype listboxes will
|
||||
be disabled to prevent confusion. By default, the search elements are configured
|
||||
to display all filters with a merit value of Normal or higher.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// MAPPER.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,48 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by Mapper.rc
|
||||
//
|
||||
#define IDM_ABOUTBOX 0x0010
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDS_ABOUTBOX 101
|
||||
#define IDD_MAPPER_DIALOG 102
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDC_CHECK_EXACT_MATCH 1000
|
||||
#define IDC_CHECK_INPUT_PIN 1001
|
||||
#define IDC_CHECK_RENDERER 1002
|
||||
#define IDC_CHECK_OUTPUT_PIN 1003
|
||||
#define IDC_COMBO_MERIT 1004
|
||||
#define IDC_COMBO_INPUT_MAJOR 1005
|
||||
#define IDC_COMBO_INPUT_MINOR 1006
|
||||
#define IDC_COMBO_INPUT_MAJOR2 1007
|
||||
#define IDC_COMBO_INPUT_MINOR2 1008
|
||||
#define IDC_COMBO_OUTPUT_MAJOR 1009
|
||||
#define IDC_COMBO_OUTPUT_MINOR 1010
|
||||
#define IDC_COMBO_OUTPUT_MAJOR2 1011
|
||||
#define IDC_COMBO_OUTPUT_MINOR2 1012
|
||||
#define IDC_COMBO_INPUT_CATEGORY 1013
|
||||
#define IDC_COMBO_OUTPUT_CATEGORY 1014
|
||||
#define IDC_LIST_FILTERS 1015
|
||||
#define IDC_BUTTON_SEARCH 1016
|
||||
#define IDC_STATIC_MATCHING_FILTERS 1017
|
||||
#define IDC_BUTTON_CLEAR 1018
|
||||
#define IDC_LIST_INPUT_MAJOR 1019
|
||||
#define IDC_LIST_INPUT_MINOR 1020
|
||||
#define IDC_LIST_INPUT_MAJOR2 1021
|
||||
#define IDC_LIST_INPUT_MINOR2 1022
|
||||
#define IDC_LIST_OUTPUT_MAJOR 1024
|
||||
#define IDC_LIST_OUTPUT_MINOR 1025
|
||||
#define IDC_LIST_OUTPUT_MAJOR2 1026
|
||||
#define IDC_LIST_OUTPUT_MINOR2 1027
|
||||
#define IDC_STATIC_NUMFILTERS 1030
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 131
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1032
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
215
Library/dxx8/samples/Multimedia/DirectShow/Misc/Mapper/types.h
Normal file
215
Library/dxx8/samples/Multimedia/DirectShow/Misc/Mapper/types.h
Normal file
@@ -0,0 +1,215 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: Types.h
|
||||
//
|
||||
// Desc: DirectShow sample code - an MFC based C++ filter mapper application.
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Merit for pins
|
||||
//
|
||||
typedef struct _meritinfo
|
||||
{
|
||||
DWORD dwMerit;
|
||||
TCHAR szName[64];
|
||||
|
||||
} MERITINFO;
|
||||
|
||||
// Minimum merit must be specified, so there is no <Don't Care> entry
|
||||
const MERITINFO merittypes[] = {
|
||||
|
||||
MERIT_HW_COMPRESSOR, TEXT("Hardware compressor"),
|
||||
MERIT_SW_COMPRESSOR, TEXT("Software compressor"),
|
||||
MERIT_DO_NOT_USE, TEXT("Do not use"),
|
||||
MERIT_UNLIKELY, TEXT("Unlikely"),
|
||||
MERIT_NORMAL, TEXT("Normal"),
|
||||
MERIT_PREFERRED, TEXT("Preferred"),
|
||||
|
||||
};
|
||||
|
||||
#define NUM_MERIT_TYPES (sizeof(merittypes) / sizeof(merittypes[0]))
|
||||
|
||||
//
|
||||
// Media types
|
||||
//
|
||||
typedef struct _guidinfo
|
||||
{
|
||||
const GUID *pGUID;
|
||||
TCHAR szName[64];
|
||||
|
||||
} GUIDINFO;
|
||||
|
||||
const GUIDINFO pintypes[] = {
|
||||
|
||||
0 ,TEXT("<Don't care>"),
|
||||
&PIN_CATEGORY_ANALOGVIDEOIN ,TEXT("Analog video in"),
|
||||
&PIN_CATEGORY_CAPTURE ,TEXT("Capture"),
|
||||
&PIN_CATEGORY_CC ,TEXT("Closed Captioning (Line21)"),
|
||||
&PIN_CATEGORY_EDS ,TEXT("EDS (Line 21)"),
|
||||
&PIN_CATEGORY_NABTS ,TEXT("NABTS"),
|
||||
&PIN_CATEGORY_PREVIEW ,TEXT("Preview"),
|
||||
&PIN_CATEGORY_STILL ,TEXT("Still"),
|
||||
&PIN_CATEGORY_TELETEXT ,TEXT("Teletext (CC)"),
|
||||
&PIN_CATEGORY_TIMECODE ,TEXT("Timecode"),
|
||||
&PIN_CATEGORY_VBI ,TEXT("VBI"),
|
||||
&PIN_CATEGORY_VIDEOPORT ,TEXT("VideoPort (connect to Overlay Mixer)"),
|
||||
&PIN_CATEGORY_VIDEOPORT_VBI ,TEXT("VideoPort VBI"),
|
||||
|
||||
};
|
||||
|
||||
#define NUM_PIN_TYPES (sizeof(pintypes) / sizeof(pintypes[0]))
|
||||
|
||||
const GUIDINFO majortypes[] = {
|
||||
|
||||
0 ,TEXT("<Don't care>"), /* No selection */
|
||||
&MEDIATYPE_AnalogAudio ,TEXT("Analog audio"),
|
||||
&MEDIATYPE_AnalogVideo ,TEXT("Analog video"),
|
||||
&MEDIATYPE_Audio ,TEXT("Audio"),
|
||||
&MEDIATYPE_AUXLine21Data ,TEXT("Line 21 data (CC)"),
|
||||
&MEDIATYPE_File ,TEXT("File (CC)"),
|
||||
&MEDIATYPE_Interleaved ,TEXT("Interleaved (DV)"),
|
||||
&MEDIATYPE_LMRT ,TEXT("LMRT (Obsolete)"),
|
||||
&MEDIATYPE_Midi ,TEXT("MIDI"),
|
||||
&MEDIATYPE_MPEG2_PES ,TEXT("MPEG2 (DVD)"),
|
||||
&MEDIATYPE_ScriptCommand ,TEXT("ScriptCommand (CC)"),
|
||||
&MEDIATYPE_Stream ,TEXT("Byte stream (no time stamps)"),
|
||||
&MEDIATYPE_Text ,TEXT("Text"),
|
||||
&MEDIATYPE_Timecode ,TEXT("Timecode data"),
|
||||
&MEDIATYPE_URL_STREAM ,TEXT("URL_STREAM (Obsolete)"),
|
||||
&MEDIATYPE_Video ,TEXT("Video"),
|
||||
|
||||
};
|
||||
|
||||
#define NUM_MAJOR_TYPES (sizeof(majortypes) / sizeof(majortypes[0]))
|
||||
|
||||
//
|
||||
// Media subtypes
|
||||
//
|
||||
const GUIDINFO audiosubtypes[] = {
|
||||
|
||||
&MEDIASUBTYPE_PCM ,TEXT("PCM audio"),
|
||||
&MEDIASUBTYPE_MPEG1Packet ,TEXT("MPEG1 Audio Packet"),
|
||||
&MEDIASUBTYPE_MPEG1Payload ,TEXT("MPEG1 Audio Payload"),
|
||||
0, 0
|
||||
};
|
||||
|
||||
const GUIDINFO line21subtypes[] = {
|
||||
|
||||
&MEDIASUBTYPE_Line21_BytePair ,TEXT("BytePairs"),
|
||||
&MEDIASUBTYPE_Line21_GOPPacket ,TEXT("DVD GOP Packet"),
|
||||
&MEDIASUBTYPE_Line21_VBIRawData ,TEXT("VBI Raw Data"),
|
||||
0, 0
|
||||
};
|
||||
|
||||
const GUIDINFO mpeg2subtypes[] = {
|
||||
|
||||
&MEDIASUBTYPE_DVD_SUBPICTURE ,TEXT("DVD Subpicture"),
|
||||
&MEDIASUBTYPE_DVD_LPCM_AUDIO ,TEXT("DVD Audio (LPCM)"),
|
||||
&MEDIASUBTYPE_DOLBY_AC3 ,TEXT("Dolby AC3"),
|
||||
&MEDIASUBTYPE_MPEG2_AUDIO ,TEXT("MPEG-2 Audio"),
|
||||
&MEDIASUBTYPE_MPEG2_TRANSPORT ,TEXT("MPEG-2 Transport Stream"),
|
||||
&MEDIASUBTYPE_MPEG2_PROGRAM ,TEXT("MPEG-2 Program Stream"),
|
||||
0, 0
|
||||
};
|
||||
|
||||
const GUIDINFO streamsubtypes[] = {
|
||||
|
||||
&MEDIASUBTYPE_AIFF ,TEXT("AIFF"),
|
||||
&MEDIASUBTYPE_Asf ,TEXT("ASF"),
|
||||
&MEDIASUBTYPE_Avi ,TEXT("AVI"),
|
||||
&MEDIASUBTYPE_AU ,TEXT("AU"),
|
||||
&MEDIASUBTYPE_DssAudio ,TEXT("DSS Audio"),
|
||||
&MEDIASUBTYPE_DssVideo ,TEXT("DSS Video"),
|
||||
&MEDIASUBTYPE_MPEG1Audio ,TEXT("MPEG1 Audio"),
|
||||
&MEDIASUBTYPE_MPEG1System ,TEXT("MPEG1 System"),
|
||||
// &MEDIASUBTYPE_MPEG1SystemStream ,TEXT("MPEG1 System Stream"),
|
||||
&MEDIASUBTYPE_MPEG1Video ,TEXT("MPEG1 Video"),
|
||||
&MEDIASUBTYPE_MPEG1VideoCD ,TEXT("MPEG1 VideoCD"),
|
||||
&MEDIASUBTYPE_WAVE ,TEXT("Wave"),
|
||||
0, 0
|
||||
};
|
||||
|
||||
const GUIDINFO videosubtypes[] = {
|
||||
|
||||
&MEDIASUBTYPE_YVU9 ,TEXT("YVU9"),
|
||||
&MEDIASUBTYPE_Y411 ,TEXT("YUV 411"),
|
||||
&MEDIASUBTYPE_Y41P ,TEXT("Y41P"),
|
||||
&MEDIASUBTYPE_YUY2 ,TEXT("YUY2"),
|
||||
&MEDIASUBTYPE_YVYU ,TEXT("YVYU"),
|
||||
&MEDIASUBTYPE_UYVY ,TEXT("UYVY"),
|
||||
&MEDIASUBTYPE_Y211 ,TEXT("YUV 211"),
|
||||
&MEDIASUBTYPE_CLJR ,TEXT("Cirrus YUV 411"),
|
||||
&MEDIASUBTYPE_IF09 ,TEXT("Indeo YVU9"),
|
||||
&MEDIASUBTYPE_CPLA ,TEXT("Cinepak UYVY"),
|
||||
&MEDIASUBTYPE_MJPG ,TEXT("Motion JPEG"),
|
||||
&MEDIASUBTYPE_TVMJ ,TEXT("TrueVision MJPG"),
|
||||
&MEDIASUBTYPE_WAKE ,TEXT("MJPG (Wake)"),
|
||||
&MEDIASUBTYPE_CFCC ,TEXT("MJPG (CFCC)"),
|
||||
&MEDIASUBTYPE_IJPG ,TEXT("Intergraph JPEG"),
|
||||
&MEDIASUBTYPE_Plum ,TEXT("Plum MJPG"),
|
||||
&MEDIASUBTYPE_RGB1 ,TEXT("RGB1 (Palettized)"),
|
||||
&MEDIASUBTYPE_RGB4 ,TEXT("RGB4 (Palettized)"),
|
||||
&MEDIASUBTYPE_RGB8 ,TEXT("RGB8 (Palettized)"),
|
||||
&MEDIASUBTYPE_RGB565 ,TEXT("RGB565"),
|
||||
&MEDIASUBTYPE_RGB555 ,TEXT("RGB555"),
|
||||
&MEDIASUBTYPE_RGB24 ,TEXT("RGB24"),
|
||||
&MEDIASUBTYPE_RGB32 ,TEXT("RGB32"),
|
||||
&MEDIASUBTYPE_ARGB32 ,TEXT("ARGB32"),
|
||||
&MEDIASUBTYPE_Overlay ,TEXT("Overlay video (from HW)"),
|
||||
&MEDIASUBTYPE_QTMovie ,TEXT("Apple QuickTime"),
|
||||
&MEDIASUBTYPE_QTRpza ,TEXT("QuickTime RPZA"),
|
||||
&MEDIASUBTYPE_QTSmc ,TEXT("QuickTime SMC"),
|
||||
&MEDIASUBTYPE_QTRle ,TEXT("QuickTime RLE"),
|
||||
&MEDIASUBTYPE_QTJpeg ,TEXT("QuickTime JPEG"),
|
||||
&MEDIASUBTYPE_dvsd ,TEXT("Standard DV"),
|
||||
&MEDIASUBTYPE_dvhd ,TEXT("High Definition DV"),
|
||||
&MEDIASUBTYPE_dvsl ,TEXT("Long Play DV"),
|
||||
&MEDIASUBTYPE_MPEG1Packet ,TEXT("MPEG1 Video Packet"),
|
||||
&MEDIASUBTYPE_MPEG1Payload ,TEXT("MPEG1 Video Payload"),
|
||||
//&MEDIASUBTYPE_VideoPort ,TEXT("Video Port (DVD)"),
|
||||
&MEDIASUBTYPE_VPVideo ,TEXT("Video port video"),
|
||||
&MEDIASUBTYPE_VPVBI ,TEXT("Video port VBI"),
|
||||
0, 0
|
||||
};
|
||||
|
||||
const GUIDINFO analogvideosubtypes[] = {
|
||||
|
||||
&MEDIASUBTYPE_AnalogVideo_NTSC_M ,TEXT("(M) NTSC"),
|
||||
&MEDIASUBTYPE_AnalogVideo_PAL_B ,TEXT("(B) PAL"),
|
||||
&MEDIASUBTYPE_AnalogVideo_PAL_D ,TEXT("(D) PAL"),
|
||||
&MEDIASUBTYPE_AnalogVideo_PAL_G ,TEXT("(G) PAL"),
|
||||
&MEDIASUBTYPE_AnalogVideo_PAL_H ,TEXT("(H) PAL"),
|
||||
&MEDIASUBTYPE_AnalogVideo_PAL_I ,TEXT("(I) PAL"),
|
||||
&MEDIASUBTYPE_AnalogVideo_PAL_M ,TEXT("(M) PAL"),
|
||||
&MEDIASUBTYPE_AnalogVideo_PAL_N ,TEXT("(N) PAL"),
|
||||
&MEDIASUBTYPE_AnalogVideo_SECAM_B ,TEXT("(B) SECAM"),
|
||||
&MEDIASUBTYPE_AnalogVideo_SECAM_D ,TEXT("(D) SECAM"),
|
||||
&MEDIASUBTYPE_AnalogVideo_SECAM_G ,TEXT("(G) SECAM"),
|
||||
&MEDIASUBTYPE_AnalogVideo_SECAM_H ,TEXT("(H) SECAM"),
|
||||
&MEDIASUBTYPE_AnalogVideo_SECAM_K ,TEXT("(K) SECAM"),
|
||||
&MEDIASUBTYPE_AnalogVideo_SECAM_K1 ,TEXT("(K1) SECAM"),
|
||||
&MEDIASUBTYPE_AnalogVideo_SECAM_L ,TEXT("(L) SECAM"),
|
||||
0, 0
|
||||
};
|
||||
|
||||
|
||||
const GUIDINFO *pSubTypes[] = {
|
||||
|
||||
audiosubtypes, // Analog audio
|
||||
analogvideosubtypes,// Analog video
|
||||
audiosubtypes, // Audio
|
||||
line21subtypes, // Line21 data
|
||||
NULL, // File. Used by closed captions
|
||||
NULL, // Interleaved. Used by Digital Video (DV)
|
||||
NULL, // Obsolete. Do not use.
|
||||
NULL, // MIDI format
|
||||
mpeg2subtypes, // MPEG-2. Used by DVD.
|
||||
NULL, // Script command, used by closed captions
|
||||
streamsubtypes, // Byte stream with no time stamps
|
||||
NULL, // Text
|
||||
NULL, // Timecode data
|
||||
NULL, // Obsolete. Do not use.
|
||||
videosubtypes, // Video
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user