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,255 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: CPPVideoControl.cpp
|
||||
//
|
||||
// Desc: Implementation of WinMain
|
||||
// for the Windows XP MSVidCtl C++ sample
|
||||
//
|
||||
// Copyright (c) 2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Note: Proxy/Stub Information
|
||||
// To build a separate proxy/stub DLL,
|
||||
// run nmake -f CPPVideoControlps.mk in the project directory.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
#include <commctrl.h>
|
||||
|
||||
#include "CPPVideoControl.h"
|
||||
#include "CPPVideoControl_i.c"
|
||||
#include "CompositeControl.h"
|
||||
|
||||
// Constants
|
||||
const DWORD dwTimeOut = 5000; // time for EXE to be idle before shutting down
|
||||
const DWORD dwPause = 2000; // time to wait for threads to finish up
|
||||
|
||||
// Local prototypes
|
||||
BOOL CheckVersion(void);
|
||||
|
||||
|
||||
// Passed to CreateThread to monitor the shutdown event
|
||||
static DWORD WINAPI MonitorProc(void* pv)
|
||||
{
|
||||
CExeModule* p = (CExeModule*)pv;
|
||||
p->MonitorShutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
LONG CExeModule::Unlock()
|
||||
{
|
||||
LONG lock = CComModule::Unlock();
|
||||
if (lock == 0)
|
||||
{
|
||||
bActivity = true;
|
||||
SetEvent(hEventShutdown); // tell monitor that we transitioned to zero
|
||||
}
|
||||
return lock;
|
||||
}
|
||||
|
||||
//Monitors the shutdown event
|
||||
void CExeModule::MonitorShutdown()
|
||||
{
|
||||
DWORD dwWait=0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
WaitForSingleObject(hEventShutdown, INFINITE);
|
||||
|
||||
do
|
||||
{
|
||||
bActivity = false;
|
||||
dwWait = WaitForSingleObject(hEventShutdown, dwTimeOut);
|
||||
|
||||
} while (dwWait == WAIT_OBJECT_0);
|
||||
|
||||
// timed out
|
||||
if (!bActivity && m_nLockCnt == 0) // if no activity let's really quit
|
||||
{
|
||||
#if _WIN32_WINNT >= 0x0400 && defined(_ATL_FREE_THREADED)
|
||||
CoSuspendClassObjects();
|
||||
if (!bActivity && m_nLockCnt == 0)
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(hEventShutdown);
|
||||
PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
|
||||
}
|
||||
|
||||
bool CExeModule::StartMonitor()
|
||||
{
|
||||
hEventShutdown = CreateEvent(NULL, false, false, NULL);
|
||||
if (hEventShutdown == NULL)
|
||||
return false;
|
||||
|
||||
DWORD dwThreadID;
|
||||
HANDLE h = CreateThread(NULL, 0, MonitorProc, this, 0, &dwThreadID);
|
||||
return (h != NULL);
|
||||
}
|
||||
|
||||
CExeModule _Module;
|
||||
|
||||
BEGIN_OBJECT_MAP(ObjectMap)
|
||||
OBJECT_ENTRY(CLSID_CompositeControl, CCompositeControl)
|
||||
END_OBJECT_MAP()
|
||||
|
||||
|
||||
LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2)
|
||||
{
|
||||
while (p1 != NULL && *p1 != NULL)
|
||||
{
|
||||
LPCTSTR p = p2;
|
||||
while (p != NULL && *p != NULL)
|
||||
{
|
||||
if (*p1 == *p)
|
||||
return CharNext(p1);
|
||||
p = CharNext(p);
|
||||
}
|
||||
p1 = CharNext(p1);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
extern "C" int WINAPI _tWinMain(HINSTANCE hInstance,
|
||||
HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int /*nShowCmd*/)
|
||||
{
|
||||
// This sample requires Windows XP. If running on a downlevel system,
|
||||
// exit gracefully.
|
||||
if (!CheckVersion())
|
||||
return FALSE;
|
||||
|
||||
lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
|
||||
|
||||
#if _WIN32_WINNT >= 0x0400 && defined(_ATL_FREE_THREADED)
|
||||
HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
#else
|
||||
HRESULT hRes = CoInitialize(NULL);
|
||||
#endif
|
||||
|
||||
_ASSERTE(SUCCEEDED(hRes));
|
||||
_Module.Init(ObjectMap, hInstance, &LIBID_CPPVIDEOCONTROLLib);
|
||||
_Module.dwThreadID = GetCurrentThreadId();
|
||||
TCHAR szTokens[] = _T("-/");
|
||||
|
||||
int nRet = 0;
|
||||
BOOL bRun = TRUE;
|
||||
LPCTSTR lpszToken = FindOneOf(lpCmdLine, szTokens);
|
||||
while (lpszToken != NULL)
|
||||
{
|
||||
if (lstrcmpi(lpszToken, _T("UnregServer"))==0)
|
||||
{
|
||||
_Module.UpdateRegistryFromResource(IDR_CPPVideoControl, FALSE);
|
||||
nRet = _Module.UnregisterServer(TRUE);
|
||||
bRun = FALSE;
|
||||
break;
|
||||
}
|
||||
if (lstrcmpi(lpszToken, _T("RegServer"))==0)
|
||||
{
|
||||
_Module.UpdateRegistryFromResource(IDR_CPPVideoControl, TRUE);
|
||||
nRet = _Module.RegisterServer(TRUE);
|
||||
bRun = FALSE;
|
||||
break;
|
||||
}
|
||||
lpszToken = FindOneOf(lpszToken, szTokens);
|
||||
}
|
||||
|
||||
if (bRun)
|
||||
{
|
||||
_Module.StartMonitor();
|
||||
#if _WIN32_WINNT >= 0x0400 && defined(_ATL_FREE_THREADED)
|
||||
hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,
|
||||
REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED);
|
||||
_ASSERTE(SUCCEEDED(hRes));
|
||||
hRes = CoResumeClassObjects();
|
||||
#else
|
||||
hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,
|
||||
REGCLS_MULTIPLEUSE);
|
||||
#endif
|
||||
_ASSERTE(SUCCEEDED(hRes));
|
||||
|
||||
//Create the window and have our composite control (with msvidctl) appear
|
||||
AtlAxWinInit();
|
||||
InitCommonControls();
|
||||
|
||||
HWND hWnd = ::CreateWindow(TEXT("AtlAxWin"),
|
||||
TEXT("CPPVideoControl.CompositeControl"),
|
||||
NULL,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, // x,y
|
||||
300, 350, // width, height
|
||||
NULL, NULL, // parent, menu
|
||||
::GetModuleHandle(NULL),
|
||||
NULL);
|
||||
_ASSERTE(hWnd != NULL);
|
||||
hWnd = hWnd; // Prevent C4189 (variable initialized but not used)
|
||||
|
||||
MSG msg;
|
||||
while (GetMessage(&msg, 0, 0, 0))
|
||||
{
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
_Module.RevokeClassObjects();
|
||||
Sleep(dwPause); //wait for any threads to finish
|
||||
}
|
||||
|
||||
_Module.Term();
|
||||
CoUninitialize();
|
||||
return nRet;
|
||||
}
|
||||
|
||||
//
|
||||
// called on a WM_CLOSE & WM_SYSCOMMAND (SC_CLOSE) message. If appropriate, save settings
|
||||
// and then destroy the window
|
||||
//
|
||||
LRESULT CCompositeControl::OnExit(WORD /*wNotifyCode*/, WORD /* wID */, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
{
|
||||
SAFE_RELEASE(m_pATSCTuningSpace);
|
||||
SAFE_RELEASE(m_pTuningSpaceContainer);
|
||||
SAFE_RELEASE(m_pATSCLocator);
|
||||
SAFE_RELEASE(m_pMSVidCtl);
|
||||
|
||||
DestroyWindow();
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// the user clicks on the system menu
|
||||
//
|
||||
LRESULT CCompositeControl::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
bHandled = FALSE; // always do default processing
|
||||
|
||||
if (wParam == SC_CLOSE)
|
||||
OnExit(NULL, NULL, NULL, bHandled);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
BOOL CheckVersion( void )
|
||||
{
|
||||
OSVERSIONINFO osverinfo={0};
|
||||
osverinfo.dwOSVersionInfoSize = sizeof(osverinfo);
|
||||
|
||||
if(GetVersionEx(&osverinfo)) {
|
||||
|
||||
// Windows XP's major version is 5 and its' minor version is 1.
|
||||
if((osverinfo.dwMajorVersion > 5) ||
|
||||
( (osverinfo.dwMajorVersion == 5) && (osverinfo.dwMinorVersion >= 1) )) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
MessageBox(NULL,
|
||||
TEXT("This application requires the Microsoft Video Control,\r\n")
|
||||
TEXT("which is present only on Windows XP.\r\n\r\n")
|
||||
TEXT("This sample will now exit."),
|
||||
TEXT("Microsoft Video Control is required"), MB_OK);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -0,0 +1,348 @@
|
||||
# Microsoft Developer Studio Project File - Name="CPPVideoControl" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=CPPVideoControl - 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 "CPPVideoControl.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 "CPPVideoControl.mak" CFG="CPPVideoControl - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "CPPVideoControl - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "CPPVideoControl - Win32 Unicode Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "CPPVideoControl - Win32 Release MinSize" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "CPPVideoControl - Win32 Release MinDependency" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "CPPVideoControl - Win32 Unicode Release MinSize" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "CPPVideoControl - Win32 Unicode Release MinDependency" (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)" == "CPPVideoControl - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# 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 /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W4 /Gm /ZI /Od /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D WINVER=0x501 /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 atl.lib strmiids.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"D:\nt\public\sdk\lib\i386"
|
||||
# Begin Custom Build - Performing registration
|
||||
OutDir=.\Debug
|
||||
TargetPath=.\Debug\CPPVideoControl.exe
|
||||
InputPath=.\Debug\CPPVideoControl.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(TargetPath)" /RegServer
|
||||
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
|
||||
echo Server registration done!
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "CPPVideoControl - Win32 Unicode Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "DebugU"
|
||||
# PROP BASE Intermediate_Dir "DebugU"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "DebugU"
|
||||
# PROP Intermediate_Dir "DebugU"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /ZI /Od /D "_DEBUG" /D "_UNICODE" /D "WIN32" /D "_WINDOWS" /D WINVER=0x501 /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 atl.lib strmiids.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"D:\nt\public\sdk\lib\i386"
|
||||
# Begin Custom Build - Performing registration
|
||||
OutDir=.\DebugU
|
||||
TargetPath=.\DebugU\CPPVideoControl.exe
|
||||
InputPath=.\DebugU\CPPVideoControl.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
if "%OS%"=="" goto NOTNT
|
||||
if not "%OS%"=="Windows_NT" goto NOTNT
|
||||
"$(TargetPath)" /RegServer
|
||||
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
|
||||
echo Server registration done!
|
||||
goto end
|
||||
:NOTNT
|
||||
echo Warning : Cannot register Unicode EXE on Windows 95
|
||||
:end
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "CPPVideoControl - Win32 Release MinSize"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ReleaseMinSize"
|
||||
# PROP BASE Intermediate_Dir "ReleaseMinSize"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "ReleaseMinSize"
|
||||
# PROP Intermediate_Dir "ReleaseMinSize"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /O1 /D "NDEBUG" /D "_MBCS" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /D "WIN32" /D "_WINDOWS" /D WINVER=0x501 /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 atl.lib strmiids.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"D:\nt\public\sdk\lib\i386"
|
||||
# Begin Custom Build - Performing registration
|
||||
OutDir=.\ReleaseMinSize
|
||||
TargetPath=.\ReleaseMinSize\CPPVideoControl.exe
|
||||
InputPath=.\ReleaseMinSize\CPPVideoControl.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(TargetPath)" /RegServer
|
||||
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
|
||||
echo Server registration done!
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "CPPVideoControl - Win32 Release MinDependency"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ReleaseMinDependency"
|
||||
# PROP BASE Intermediate_Dir "ReleaseMinDependency"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "ReleaseMinDependency"
|
||||
# PROP Intermediate_Dir "ReleaseMinDependency"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /O1 /D "NDEBUG" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /D "WIN32" /D "_WINDOWS" /D WINVER=0x501 /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 atl.lib strmiids.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"D:\nt\public\sdk\lib\i386"
|
||||
# Begin Custom Build - Performing registration
|
||||
OutDir=.\ReleaseMinDependency
|
||||
TargetPath=.\ReleaseMinDependency\CPPVideoControl.exe
|
||||
InputPath=.\ReleaseMinDependency\CPPVideoControl.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(TargetPath)" /RegServer
|
||||
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
|
||||
echo Server registration done!
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "CPPVideoControl - Win32 Unicode Release MinSize"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ReleaseUMinSize"
|
||||
# PROP BASE Intermediate_Dir "ReleaseUMinSize"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "ReleaseUMinSize"
|
||||
# PROP Intermediate_Dir "ReleaseUMinSize"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /O1 /D "NDEBUG" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /D "WIN32" /D "_WINDOWS" /D WINVER=0x501 /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 atl.lib strmiids.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"D:\nt\public\sdk\lib\i386"
|
||||
# Begin Custom Build - Performing registration
|
||||
OutDir=.\ReleaseUMinSize
|
||||
TargetPath=.\ReleaseUMinSize\CPPVideoControl.exe
|
||||
InputPath=.\ReleaseUMinSize\CPPVideoControl.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
if "%OS%"=="" goto NOTNT
|
||||
if not "%OS%"=="Windows_NT" goto NOTNT
|
||||
"$(TargetPath)" /RegServer
|
||||
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
|
||||
echo Server registration done!
|
||||
goto end
|
||||
:NOTNT
|
||||
echo Warning : Cannot register Unicode EXE on Windows 95
|
||||
:end
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "CPPVideoControl - Win32 Unicode Release MinDependency"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ReleaseUMinDependency"
|
||||
# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "ReleaseUMinDependency"
|
||||
# PROP Intermediate_Dir "ReleaseUMinDependency"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /O1 /D "NDEBUG" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /D WINVER=0x501 /D "WIN32" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 atl.lib strmiids.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"D:\nt\public\sdk\lib\i386"
|
||||
# Begin Custom Build - Performing registration
|
||||
OutDir=.\ReleaseUMinDependency
|
||||
TargetPath=.\ReleaseUMinDependency\CPPVideoControl.exe
|
||||
InputPath=.\ReleaseUMinDependency\CPPVideoControl.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
if "%OS%"=="" goto NOTNT
|
||||
if not "%OS%"=="Windows_NT" goto NOTNT
|
||||
"$(TargetPath)" /RegServer
|
||||
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
|
||||
echo Server registration done!
|
||||
goto end
|
||||
:NOTNT
|
||||
echo Warning : Cannot register Unicode EXE on Windows 95
|
||||
:end
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "CPPVideoControl - Win32 Debug"
|
||||
# Name "CPPVideoControl - Win32 Unicode Debug"
|
||||
# Name "CPPVideoControl - Win32 Release MinSize"
|
||||
# Name "CPPVideoControl - Win32 Release MinDependency"
|
||||
# Name "CPPVideoControl - Win32 Unicode Release MinSize"
|
||||
# Name "CPPVideoControl - Win32 Unicode Release MinDependency"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CompositeControl.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CPPVideoControl.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CPPVideoControl.idl
|
||||
# ADD MTL /tlb ".\CPPVideoControl.tlb" /h "CPPVideoControl.h" /iid "CPPVideoControl_i.c" /Oicf
|
||||
# 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=.\CompositeControl.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CPPVideoControl.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.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=.\bda.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CompositeControl.rgs
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CPPVideoControl.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CPPVideoControl.rgs
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Section CPPVideoControl : {00000000-0000-0000-0000-800000800000}
|
||||
# 1:20:IDR_COMPOSITECONTROL:102
|
||||
# 1:20:IDB_COMPOSITECONTROL:101
|
||||
# 1:20:IDD_COMPOSITECONTROL:103
|
||||
# End Section
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "CPPVideoControl"=.\CPPVideoControl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 5.01.0164 */
|
||||
/* at Mon Jul 23 18:31:14 2001
|
||||
*/
|
||||
/* Compiler settings for D:\DXSDK\samples\Multimedia\DirectShowXP\VideoControl\CPPVideoControl\CPPVideoControl.idl:
|
||||
Oicf (OptLev=i2), 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 __CPPVideoControl_h__
|
||||
#define __CPPVideoControl_h__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __ICompositeControl_FWD_DEFINED__
|
||||
#define __ICompositeControl_FWD_DEFINED__
|
||||
typedef interface ICompositeControl ICompositeControl;
|
||||
#endif /* __ICompositeControl_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __CompositeControl_FWD_DEFINED__
|
||||
#define __CompositeControl_FWD_DEFINED__
|
||||
|
||||
#ifdef __cplusplus
|
||||
typedef class CompositeControl CompositeControl;
|
||||
#else
|
||||
typedef struct CompositeControl CompositeControl;
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CompositeControl_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "oaidl.h"
|
||||
#include "ocidl.h"
|
||||
|
||||
void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
|
||||
void __RPC_USER MIDL_user_free( void __RPC_FAR * );
|
||||
|
||||
#ifndef __ICompositeControl_INTERFACE_DEFINED__
|
||||
#define __ICompositeControl_INTERFACE_DEFINED__
|
||||
|
||||
/* interface ICompositeControl */
|
||||
/* [unique][helpstring][dual][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_ICompositeControl;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("3E119535-D5AB-4520-B0E1-495B322E2A1A")
|
||||
ICompositeControl : public IDispatch
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct ICompositeControlVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
|
||||
ICompositeControl __RPC_FAR * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
|
||||
ICompositeControl __RPC_FAR * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
|
||||
ICompositeControl __RPC_FAR * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
|
||||
ICompositeControl __RPC_FAR * This,
|
||||
/* [out] */ UINT __RPC_FAR *pctinfo);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
|
||||
ICompositeControl __RPC_FAR * This,
|
||||
/* [in] */ UINT iTInfo,
|
||||
/* [in] */ LCID lcid,
|
||||
/* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
|
||||
ICompositeControl __RPC_FAR * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
|
||||
/* [in] */ UINT cNames,
|
||||
/* [in] */ LCID lcid,
|
||||
/* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
|
||||
|
||||
/* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
|
||||
ICompositeControl __RPC_FAR * This,
|
||||
/* [in] */ DISPID dispIdMember,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [in] */ LCID lcid,
|
||||
/* [in] */ WORD wFlags,
|
||||
/* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
|
||||
/* [out] */ VARIANT __RPC_FAR *pVarResult,
|
||||
/* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
|
||||
/* [out] */ UINT __RPC_FAR *puArgErr);
|
||||
|
||||
END_INTERFACE
|
||||
} ICompositeControlVtbl;
|
||||
|
||||
interface ICompositeControl
|
||||
{
|
||||
CONST_VTBL struct ICompositeControlVtbl __RPC_FAR *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define ICompositeControl_QueryInterface(This,riid,ppvObject) \
|
||||
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
|
||||
|
||||
#define ICompositeControl_AddRef(This) \
|
||||
(This)->lpVtbl -> AddRef(This)
|
||||
|
||||
#define ICompositeControl_Release(This) \
|
||||
(This)->lpVtbl -> Release(This)
|
||||
|
||||
|
||||
#define ICompositeControl_GetTypeInfoCount(This,pctinfo) \
|
||||
(This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
|
||||
|
||||
#define ICompositeControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
|
||||
(This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
|
||||
|
||||
#define ICompositeControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
|
||||
(This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
|
||||
|
||||
#define ICompositeControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
|
||||
(This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
|
||||
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __ICompositeControl_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
|
||||
#ifndef __CPPVIDEOCONTROLLib_LIBRARY_DEFINED__
|
||||
#define __CPPVIDEOCONTROLLib_LIBRARY_DEFINED__
|
||||
|
||||
/* library CPPVIDEOCONTROLLib */
|
||||
/* [helpstring][version][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID LIBID_CPPVIDEOCONTROLLib;
|
||||
|
||||
EXTERN_C const CLSID CLSID_CompositeControl;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class DECLSPEC_UUID("CDDFD429-EDFD-4C72-AE9C-B70FE6955051")
|
||||
CompositeControl;
|
||||
#endif
|
||||
#endif /* __CPPVIDEOCONTROLLib_LIBRARY_DEFINED__ */
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: CPPVideoControl.idl
|
||||
//
|
||||
// Desc: IDL source for CPPVideoControl.dll
|
||||
// for the Windows XP MSVidCtl C++ sample
|
||||
//
|
||||
// Copyright (c) 2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// This file will be processed by the MIDL tool to
|
||||
// produce the type library (CPPVideoControl.tlb) and marshalling code.
|
||||
|
||||
import "oaidl.idl";
|
||||
import "ocidl.idl";
|
||||
#include "olectl.h"
|
||||
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(3E119535-D5AB-4520-B0E1-495B322E2A1A),
|
||||
dual,
|
||||
helpstring("ICompositeControl Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface ICompositeControl : IDispatch
|
||||
{
|
||||
};
|
||||
|
||||
[
|
||||
uuid(C03567A2-8044-40F0-8ABB-301A005F9FF1),
|
||||
version(1.0),
|
||||
helpstring("CPPVideoControl 1.0 Type Library")
|
||||
]
|
||||
library CPPVIDEOCONTROLLib
|
||||
{
|
||||
importlib("stdole32.tlb");
|
||||
importlib("stdole2.tlb");
|
||||
|
||||
[
|
||||
uuid(CDDFD429-EDFD-4C72-AE9C-B70FE6955051),
|
||||
helpstring("CompositeControl Class")
|
||||
]
|
||||
coclass CompositeControl
|
||||
{
|
||||
[default] interface ICompositeControl;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,190 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.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 ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"1 TYPELIB ""CPPVideoControl.tlb""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#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 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "This sample requires Windows XP or greater.\0"
|
||||
VALUE "CompanyName", "Microsoft Corporation\0"
|
||||
VALUE "FileDescription", "CPPVideoControl Module\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "CPPVideoControl\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OLESelfRegister", "\0"
|
||||
VALUE "OriginalFilename", "CPPVideoControl.EXE\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "CPPVideoControl Module\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REGISTRY
|
||||
//
|
||||
|
||||
IDR_CPPVideoControl REGISTRY MOVEABLE PURE "CPPVideoControl.rgs"
|
||||
IDR_COMPOSITECONTROL REGISTRY DISCARDABLE "CompositeControl.rgs"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_COMPOSITECONTROL DIALOGEX 0, 0, 191, 170
|
||||
STYLE DS_3DLOOK | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_CONTROLPARENT
|
||||
CAPTION "MS Video Control - C++ Sample"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL "",IDC_VIDEOCONTROL1,
|
||||
"{B0EDF163-910A-11D2-B632-00C04F79498E}",WS_TABSTOP,13,
|
||||
13,164,120
|
||||
PUSHBUTTON "Channel &Down",IDC_CHANNELDOWN,13,136,57,25
|
||||
PUSHBUTTON "Channel &Up",IDC_CHANNELUP,120,136,57,25
|
||||
CTEXT "0",IDC_CHANNELID,74,147,42,11,SS_SUNKEN
|
||||
CTEXT "Current:",IDC_STATIC,74,137,42,8
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog Info
|
||||
//
|
||||
|
||||
IDD_COMPOSITECONTROL DLGINIT
|
||||
BEGIN
|
||||
IDC_VIDEOCONTROL1, 0x376, 34, 0
|
||||
0x0000, 0x0000, 0x0300, 0x0000, 0x196d, 0x0000, 0x1427, 0x0000, 0x000b,
|
||||
0x0000, 0x000b, 0xffff, 0x000b, 0xffff, 0x0013, 0x0000, 0x0000,
|
||||
0
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_COMPOSITECONTROL, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 190
|
||||
BOTTOMMARGIN, 169
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON ICON DISCARDABLE "bda.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_PROJNAME "CPPVideoControl"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
1 TYPELIB "CPPVideoControl.tlb"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
HKCR
|
||||
{
|
||||
NoRemove AppID
|
||||
{
|
||||
{06751985-1ADD-416A-951E-2FEF4FAEFB2D} = s 'CPPVideoControl'
|
||||
'CPPVideoControl.EXE'
|
||||
{
|
||||
val AppID = s {06751985-1ADD-416A-951E-2FEF4FAEFB2D}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/* this file contains the actual definitions of */
|
||||
/* the IIDs and CLSIDs */
|
||||
|
||||
/* link this file in with the server and any clients */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 5.01.0164 */
|
||||
/* at Mon Jul 23 18:31:14 2001
|
||||
*/
|
||||
/* Compiler settings for D:\DXSDK\samples\Multimedia\DirectShowXP\VideoControl\CPPVideoControl\CPPVideoControl.idl:
|
||||
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
*/
|
||||
//@@MIDL_FILE_HEADING( )
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __IID_DEFINED__
|
||||
#define __IID_DEFINED__
|
||||
|
||||
typedef struct _IID
|
||||
{
|
||||
unsigned long x;
|
||||
unsigned short s1;
|
||||
unsigned short s2;
|
||||
unsigned char c[8];
|
||||
} IID;
|
||||
|
||||
#endif // __IID_DEFINED__
|
||||
|
||||
#ifndef CLSID_DEFINED
|
||||
#define CLSID_DEFINED
|
||||
typedef IID CLSID;
|
||||
#endif // CLSID_DEFINED
|
||||
|
||||
const IID IID_ICompositeControl = {0x3E119535,0xD5AB,0x4520,{0xB0,0xE1,0x49,0x5B,0x32,0x2E,0x2A,0x1A}};
|
||||
|
||||
|
||||
const IID LIBID_CPPVIDEOCONTROLLib = {0xC03567A2,0x8044,0x40F0,{0x8A,0xBB,0x30,0x1A,0x00,0x5F,0x9F,0xF1}};
|
||||
|
||||
|
||||
const CLSID CLSID_CompositeControl = {0xCDDFD429,0xEDFD,0x4C72,{0xAE,0x9C,0xB7,0x0F,0xE6,0x95,0x50,0x51}};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
/* this ALWAYS GENERATED file contains the proxy stub code */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 5.01.0164 */
|
||||
/* at Mon Jul 23 18:31:14 2001
|
||||
*/
|
||||
/* Compiler settings for D:\DXSDK\samples\Multimedia\DirectShowXP\VideoControl\CPPVideoControl\CPPVideoControl.idl:
|
||||
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
*/
|
||||
//@@MIDL_FILE_HEADING( )
|
||||
|
||||
#define USE_STUBLESS_PROXY
|
||||
|
||||
|
||||
/* verify that the <rpcproxy.h> version is high enough to compile this file*/
|
||||
#ifndef __REDQ_RPCPROXY_H_VERSION__
|
||||
#define __REQUIRED_RPCPROXY_H_VERSION__ 440
|
||||
#endif
|
||||
|
||||
|
||||
#include "rpcproxy.h"
|
||||
#ifndef __RPCPROXY_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcproxy.h>
|
||||
#endif // __RPCPROXY_H_VERSION__
|
||||
|
||||
|
||||
#include "CPPVideoControl.h"
|
||||
|
||||
#define TYPE_FORMAT_STRING_SIZE 3
|
||||
#define PROC_FORMAT_STRING_SIZE 1
|
||||
|
||||
typedef struct _MIDL_TYPE_FORMAT_STRING
|
||||
{
|
||||
short Pad;
|
||||
unsigned char Format[ TYPE_FORMAT_STRING_SIZE ];
|
||||
} MIDL_TYPE_FORMAT_STRING;
|
||||
|
||||
typedef struct _MIDL_PROC_FORMAT_STRING
|
||||
{
|
||||
short Pad;
|
||||
unsigned char Format[ PROC_FORMAT_STRING_SIZE ];
|
||||
} MIDL_PROC_FORMAT_STRING;
|
||||
|
||||
|
||||
extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
|
||||
extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
|
||||
|
||||
|
||||
/* Object interface: IUnknown, ver. 0.0,
|
||||
GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
|
||||
|
||||
|
||||
/* Object interface: IDispatch, ver. 0.0,
|
||||
GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
|
||||
|
||||
|
||||
/* Object interface: ICompositeControl, ver. 0.0,
|
||||
GUID={0x3E119535,0xD5AB,0x4520,{0xB0,0xE1,0x49,0x5B,0x32,0x2E,0x2A,0x1A}} */
|
||||
|
||||
|
||||
extern const MIDL_STUB_DESC Object_StubDesc;
|
||||
|
||||
|
||||
#pragma code_seg(".orpc")
|
||||
|
||||
static const MIDL_STUB_DESC Object_StubDesc =
|
||||
{
|
||||
0,
|
||||
NdrOleAllocate,
|
||||
NdrOleFree,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
__MIDL_TypeFormatString.Format,
|
||||
1, /* -error bounds_check flag */
|
||||
0x20000, /* Ndr library version */
|
||||
0,
|
||||
0x50100a4, /* MIDL Version 5.1.164 */
|
||||
0,
|
||||
0,
|
||||
0, /* notify & notify_flag routine table */
|
||||
1, /* Flags */
|
||||
0, /* Reserved3 */
|
||||
0, /* Reserved4 */
|
||||
0 /* Reserved5 */
|
||||
};
|
||||
|
||||
CINTERFACE_PROXY_VTABLE(7) _ICompositeControlProxyVtbl =
|
||||
{
|
||||
0,
|
||||
&IID_ICompositeControl,
|
||||
IUnknown_QueryInterface_Proxy,
|
||||
IUnknown_AddRef_Proxy,
|
||||
IUnknown_Release_Proxy ,
|
||||
0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
|
||||
0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
|
||||
0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
|
||||
0 /* IDispatch_Invoke_Proxy */
|
||||
};
|
||||
|
||||
|
||||
static const PRPC_STUB_FUNCTION ICompositeControl_table[] =
|
||||
{
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION
|
||||
};
|
||||
|
||||
CInterfaceStubVtbl _ICompositeControlStubVtbl =
|
||||
{
|
||||
&IID_ICompositeControl,
|
||||
0,
|
||||
7,
|
||||
&ICompositeControl_table[-3],
|
||||
CStdStubBuffer_DELEGATING_METHODS
|
||||
};
|
||||
|
||||
#pragma data_seg(".rdata")
|
||||
|
||||
#if !defined(__RPC_WIN32__)
|
||||
#error Invalid build platform for this stub.
|
||||
#endif
|
||||
|
||||
#if !(TARGET_IS_NT40_OR_LATER)
|
||||
#error You need a Windows NT 4.0 or later to run this stub because it uses these features:
|
||||
#error -Oif or -Oicf, more than 32 methods in the interface.
|
||||
#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
|
||||
#error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
|
||||
#endif
|
||||
|
||||
|
||||
static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
|
||||
{
|
||||
0,
|
||||
{
|
||||
|
||||
0x0
|
||||
}
|
||||
};
|
||||
|
||||
static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
|
||||
{
|
||||
0,
|
||||
{
|
||||
NdrFcShort( 0x0 ), /* 0 */
|
||||
|
||||
0x0
|
||||
}
|
||||
};
|
||||
|
||||
const CInterfaceProxyVtbl * _CPPVideoControl_ProxyVtblList[] =
|
||||
{
|
||||
( CInterfaceProxyVtbl *) &_ICompositeControlProxyVtbl,
|
||||
0
|
||||
};
|
||||
|
||||
const CInterfaceStubVtbl * _CPPVideoControl_StubVtblList[] =
|
||||
{
|
||||
( CInterfaceStubVtbl *) &_ICompositeControlStubVtbl,
|
||||
0
|
||||
};
|
||||
|
||||
PCInterfaceName const _CPPVideoControl_InterfaceNamesList[] =
|
||||
{
|
||||
"ICompositeControl",
|
||||
0
|
||||
};
|
||||
|
||||
const IID * _CPPVideoControl_BaseIIDList[] =
|
||||
{
|
||||
&IID_IDispatch,
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
#define _CPPVideoControl_CHECK_IID(n) IID_GENERIC_CHECK_IID( _CPPVideoControl, pIID, n)
|
||||
|
||||
int __stdcall _CPPVideoControl_IID_Lookup( const IID * pIID, int * pIndex )
|
||||
{
|
||||
|
||||
if(!_CPPVideoControl_CHECK_IID(0))
|
||||
{
|
||||
*pIndex = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const ExtendedProxyFileInfo CPPVideoControl_ProxyFileInfo =
|
||||
{
|
||||
(PCInterfaceProxyVtblList *) & _CPPVideoControl_ProxyVtblList,
|
||||
(PCInterfaceStubVtblList *) & _CPPVideoControl_StubVtblList,
|
||||
(const PCInterfaceName * ) & _CPPVideoControl_InterfaceNamesList,
|
||||
(const IID ** ) & _CPPVideoControl_BaseIIDList,
|
||||
& _CPPVideoControl_IID_Lookup,
|
||||
1,
|
||||
2,
|
||||
0, /* table of [async_uuid] interfaces */
|
||||
0, /* Filler1 */
|
||||
0, /* Filler2 */
|
||||
0 /* Filler3 */
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
LIBRARY "CPPVideoControlPS"
|
||||
|
||||
DESCRIPTION 'Proxy/Stub DLL'
|
||||
|
||||
EXPORTS
|
||||
DllGetClassObject @1 PRIVATE
|
||||
DllCanUnloadNow @2 PRIVATE
|
||||
GetProxyDllInfo @3 PRIVATE
|
||||
DllRegisterServer @4 PRIVATE
|
||||
DllUnregisterServer @5 PRIVATE
|
||||
@@ -0,0 +1,260 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: CompositeControl.cpp
|
||||
//
|
||||
// Desc: Implementation of the CCompositeControl
|
||||
// for the Windows XP MSVidCtl C++ sample
|
||||
//
|
||||
// Copyright (c) 2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "CPPVideoControl.h"
|
||||
#include "CompositeControl.h"
|
||||
|
||||
#include <atlbase.h>
|
||||
#include <msvidctl.h>
|
||||
#include <tuner.h>
|
||||
#include <segment.h>
|
||||
|
||||
#define DEFAULT_CHANNEL 46
|
||||
|
||||
#define STR_VIEW_FAILURE TEXT("Failed IMSVidCtl::View. You may not have ") \
|
||||
TEXT("properly installed your hardware. Your ATSC tuner card, ") \
|
||||
TEXT("MPEG-2 decoder, or video card may be incompatible with ") \
|
||||
TEXT("the MicrosoftTV Technologies architecture.")
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCompositeControl
|
||||
|
||||
LRESULT CCompositeControl::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
ITuningSpace * pTuningSpace = NULL;
|
||||
IEnumTuningSpaces * pEnumTuningSpaces = NULL;
|
||||
ITuningSpace ** pTuningSpaceArray = NULL;
|
||||
ULONG ulNumFetched = 0;
|
||||
long lCount = 0;
|
||||
ULONG i = 0;
|
||||
CComBSTR bstrATSC = L"ATSC";
|
||||
CComBSTR bstrTemp = L"";
|
||||
|
||||
// Get window handle of channel label (for later update)
|
||||
m_hwndChannelID = GetDlgItem(IDC_CHANNELID);
|
||||
|
||||
// Get the tuning space collection
|
||||
hr = CoCreateInstance(CLSID_SystemTuningSpaces, NULL,
|
||||
CLSCTX_INPROC_SERVER, IID_ITuningSpaceContainer,
|
||||
reinterpret_cast<void**>(&m_pTuningSpaceContainer));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to create system tuning space."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Get the video control object
|
||||
hr = GetDlgControl(IDC_VIDEOCONTROL1,IID_IMSVidCtl, reinterpret_cast<void **>(&m_pMSVidCtl));
|
||||
if(m_pMSVidCtl == NULL)
|
||||
{
|
||||
MessageBox(TEXT("Failed to get Video Control on main dialog!"),TEXT("Error"),MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Find the ATSC tuning space in the collection
|
||||
hr = m_pTuningSpaceContainer->get_EnumTuningSpaces(&pEnumTuningSpaces);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to get tuning space enumerator."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
hr = m_pTuningSpaceContainer->get_Count(&lCount);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to enumerate tuning spaces."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Read tuning space info into allocated array
|
||||
pTuningSpaceArray = new ITuningSpace*[lCount];
|
||||
hr = pEnumTuningSpaces->Next(lCount, pTuningSpaceArray, &ulNumFetched);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to read tuning spaces."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Find the ATSC tuning space
|
||||
for (i = 0;i < ulNumFetched; i++)
|
||||
{
|
||||
hr = pTuningSpaceArray[i]->get_UniqueName(&bstrTemp);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to read tuning space unique name."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Is this the ATSC tuning space?
|
||||
if (bstrTemp == bstrATSC)
|
||||
{
|
||||
hr = pTuningSpaceArray[i]->Clone(&pTuningSpace);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pTuningSpace == NULL)
|
||||
{
|
||||
MessageBox(TEXT("Could not find ATSC tuning space."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// QI for IATSCTuningSpace
|
||||
hr = pTuningSpace->QueryInterface(IID_IATSCTuningSpace, reinterpret_cast<void**>(&m_pATSCTuningSpace));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to QI for IATSCTuningSpace."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Create ATSC Locator
|
||||
hr = CoCreateInstance(CLSID_ATSCLocator, NULL,
|
||||
CLSCTX_INPROC_SERVER, IID_IATSCLocator,
|
||||
reinterpret_cast<void**>(&m_pATSCLocator));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to create ATSC locator."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = SetChannel(DEFAULT_CHANNEL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
// SetChannel will give a message box indicating the error
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Start viewing digital TV
|
||||
hr = m_pMSVidCtl->Run();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed IMSVidCtl::Run. You may not have properly installed your hardware. Your ATSC tuner card, MPEG-2 decoder, or video card may be incompatible with the MicrosoftTV Technologies architecture."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
SAFE_RELEASE(pTuningSpace);
|
||||
SAFE_RELEASE(pEnumTuningSpaces);
|
||||
delete pTuningSpaceArray;
|
||||
|
||||
return hr;
|
||||
};
|
||||
|
||||
|
||||
LRESULT CCompositeControl::OnClickedChanneldown(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
long lPhysicalChannel = 0;
|
||||
|
||||
// Get the current physical channel and decrement it
|
||||
hr =m_pATSCLocator->get_PhysicalChannel(&lPhysicalChannel);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to read physical channel."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
lPhysicalChannel--;
|
||||
|
||||
hr = SetChannel(lPhysicalChannel);
|
||||
return hr;
|
||||
};
|
||||
|
||||
LRESULT CCompositeControl::OnClickedChannelup(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
long lPhysicalChannel = 0;
|
||||
|
||||
// Get the current physical channel and increment it
|
||||
hr =m_pATSCLocator->get_PhysicalChannel(&lPhysicalChannel);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to read physical channel."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
lPhysicalChannel++;
|
||||
|
||||
hr = SetChannel(lPhysicalChannel);
|
||||
return hr;
|
||||
};
|
||||
|
||||
HRESULT CCompositeControl::SetChannel(long lPhysicalChannel)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
IATSCChannelTuneRequest * pATSCTuneRequest = NULL;
|
||||
ITuneRequest * pTuneRequest = NULL;
|
||||
|
||||
// Set the Physical Channel
|
||||
hr =m_pATSCLocator->put_PhysicalChannel(lPhysicalChannel);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to set physical channel."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Create an ATSC tune request
|
||||
hr = m_pATSCTuningSpace->CreateTuneRequest(&pTuneRequest);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to create tune request."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = pTuneRequest->QueryInterface(IID_IATSCChannelTuneRequest, reinterpret_cast<void**>(&pATSCTuneRequest));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to query for IATSCChannelTuneRequest."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Set the Channel and MinorChannel property on the tune request to -1
|
||||
// These properties will get set by the network provider once tuned to a ATSC channel
|
||||
hr = pATSCTuneRequest->put_Channel(-1);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to put channel property."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
hr = pATSCTuneRequest->put_MinorChannel(-1);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to put minor channel property."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
hr = pATSCTuneRequest->put_Locator(m_pATSCLocator);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(TEXT("Failed to put locator."), TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Now that the tune request is configured, pass it to the video control
|
||||
CComVariant var = pATSCTuneRequest;
|
||||
hr = m_pMSVidCtl->View(&var);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(STR_VIEW_FAILURE, TEXT("Error"), MB_OK);
|
||||
return hr;
|
||||
}
|
||||
|
||||
ShowChannelNumber(lPhysicalChannel);
|
||||
|
||||
// Release interfaces
|
||||
pATSCTuneRequest->Release();
|
||||
pTuneRequest->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CCompositeControl::ShowChannelNumber(long lChannel)
|
||||
{
|
||||
TCHAR szChannelNumber[8];
|
||||
wsprintf(szChannelNumber, TEXT("%d\0"), lChannel);
|
||||
SetDlgItemText(IDC_CHANNELID, szChannelNumber);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: CompositeControl.h
|
||||
//
|
||||
// Desc: Declaration of the CCompositeControl
|
||||
// for the Windows XP MSVidCtl C++ sample
|
||||
//
|
||||
// Copyright (c) 2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef __COMPOSITECONTROL_H_
|
||||
#define __COMPOSITECONTROL_H_
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include <atlctl.h>
|
||||
#include <msvidctl.h>
|
||||
|
||||
#pragma warning(disable:4100) /* Disable 'unused parameter' warning */
|
||||
|
||||
#define SAFE_RELEASE(x) { if (x) { (x)->Release(); x=NULL; }}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCompositeControl
|
||||
class ATL_NO_VTABLE CCompositeControl :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public IDispatchImpl<ICompositeControl, &IID_ICompositeControl, &LIBID_CPPVIDEOCONTROLLib>,
|
||||
public CComCompositeControl<CCompositeControl>,
|
||||
public IPersistStreamInitImpl<CCompositeControl>,
|
||||
public IOleControlImpl<CCompositeControl>,
|
||||
public IOleObjectImpl<CCompositeControl>,
|
||||
public IOleInPlaceActiveObjectImpl<CCompositeControl>,
|
||||
public IViewObjectExImpl<CCompositeControl>,
|
||||
public IOleInPlaceObjectWindowlessImpl<CCompositeControl>,
|
||||
public IPersistStorageImpl<CCompositeControl>,
|
||||
public ISpecifyPropertyPagesImpl<CCompositeControl>,
|
||||
public IQuickActivateImpl<CCompositeControl>,
|
||||
public IDataObjectImpl<CCompositeControl>,
|
||||
public IProvideClassInfo2Impl<&CLSID_CompositeControl, NULL, &LIBID_CPPVIDEOCONTROLLib>,
|
||||
public CComCoClass<CCompositeControl, &CLSID_CompositeControl>
|
||||
{
|
||||
public:
|
||||
CCompositeControl()
|
||||
{
|
||||
m_bWindowOnly = TRUE;
|
||||
CalcExtent(m_sizeExtent);
|
||||
|
||||
// Initialize internal data
|
||||
m_pTuningSpaceContainer = NULL;
|
||||
m_pATSCTuningSpace = NULL;
|
||||
m_pATSCLocator = NULL;
|
||||
m_pMSVidCtl = NULL;
|
||||
m_hwndChannelID = NULL;
|
||||
}
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_COMPOSITECONTROL)
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
BEGIN_COM_MAP(CCompositeControl)
|
||||
COM_INTERFACE_ENTRY(ICompositeControl)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
COM_INTERFACE_ENTRY(IViewObjectEx)
|
||||
COM_INTERFACE_ENTRY(IViewObject2)
|
||||
COM_INTERFACE_ENTRY(IViewObject)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceObject)
|
||||
COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
|
||||
COM_INTERFACE_ENTRY(IOleControl)
|
||||
COM_INTERFACE_ENTRY(IOleObject)
|
||||
COM_INTERFACE_ENTRY(IPersistStreamInit)
|
||||
COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
|
||||
COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
|
||||
COM_INTERFACE_ENTRY(IQuickActivate)
|
||||
COM_INTERFACE_ENTRY(IPersistStorage)
|
||||
COM_INTERFACE_ENTRY(IDataObject)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo2)
|
||||
END_COM_MAP()
|
||||
|
||||
BEGIN_PROP_MAP(CCompositeControl)
|
||||
PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4)
|
||||
PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4)
|
||||
END_PROP_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CCompositeControl)
|
||||
CHAIN_MSG_MAP(CComCompositeControl<CCompositeControl>)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
COMMAND_HANDLER(IDC_CHANNELDOWN, BN_CLICKED, OnClickedChanneldown)
|
||||
COMMAND_HANDLER(IDC_CHANNELUP, BN_CLICKED, OnClickedChannelup)
|
||||
COMMAND_ID_HANDLER(WM_CLOSE, OnExit)
|
||||
MESSAGE_HANDLER(WM_SYSCOMMAND, OnSysCommand)
|
||||
END_MSG_MAP()
|
||||
|
||||
// Handler prototypes:
|
||||
LRESULT OnExit(WORD /*wNotifyCode*/, WORD /* wID */, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||
// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
|
||||
|
||||
BEGIN_SINK_MAP(CCompositeControl)
|
||||
//Make sure the Event Handlers have __stdcall calling convention
|
||||
END_SINK_MAP()
|
||||
|
||||
STDMETHOD(OnAmbientPropertyChange)(DISPID dispid)
|
||||
{
|
||||
if (dispid == DISPID_AMBIENT_BACKCOLOR)
|
||||
{
|
||||
SetBackgroundColorFromAmbient();
|
||||
FireViewChange();
|
||||
}
|
||||
return IOleControlImpl<CCompositeControl>::OnAmbientPropertyChange(dispid);
|
||||
}
|
||||
|
||||
|
||||
// IViewObjectEx
|
||||
DECLARE_VIEW_STATUS(0)
|
||||
|
||||
// ICompositeControl
|
||||
public:
|
||||
|
||||
enum { IDD = IDD_COMPOSITECONTROL };
|
||||
IMSVidCtl * m_pMSVidCtl;
|
||||
ITuningSpaceContainer * m_pTuningSpaceContainer;
|
||||
IATSCTuningSpace * m_pATSCTuningSpace;
|
||||
IATSCLocator * m_pATSCLocator;
|
||||
HWND m_hwndChannelID;
|
||||
|
||||
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
LRESULT OnClickedChannelup(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||
LRESULT OnClickedChanneldown(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||
HRESULT SetChannel(long lChannel);
|
||||
void ShowChannelNumber(long lChannel);
|
||||
|
||||
};
|
||||
#endif //__COMPOSITECONTROL_H_
|
||||
@@ -0,0 +1,32 @@
|
||||
HKCR
|
||||
{
|
||||
CPPVideoControl.CompositeControl.1 = s 'CompositeControl Class'
|
||||
{
|
||||
CLSID = s '{CDDFD429-EDFD-4C72-AE9C-B70FE6955051}'
|
||||
}
|
||||
CPPVideoControl.CompositeControl = s 'CompositeControl Class'
|
||||
{
|
||||
CLSID = s '{CDDFD429-EDFD-4C72-AE9C-B70FE6955051}'
|
||||
CurVer = s 'CPPVideoControl.CompositeControl.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {CDDFD429-EDFD-4C72-AE9C-B70FE6955051} = s 'CompositeControl Class'
|
||||
{
|
||||
ProgID = s 'CPPVideoControl.CompositeControl.1'
|
||||
VersionIndependentProgID = s 'CPPVideoControl.CompositeControl'
|
||||
ForceRemove 'Programmable'
|
||||
LocalServer32 = s '%MODULE%'
|
||||
val AppID = s '{06751985-1ADD-416A-951E-2FEF4FAEFB2D}'
|
||||
ForceRemove 'Control'
|
||||
ForceRemove 'Insertable'
|
||||
ForceRemove 'ToolboxBitmap32' = s '%MODULE%, 101'
|
||||
'MiscStatus' = s '0'
|
||||
{
|
||||
'1' = s '131473'
|
||||
}
|
||||
'TypeLib' = s '{C03567A2-8044-40F0-8ABB-301A005F9FF1}'
|
||||
'Version' = s '1.0'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: stdafx.cpp
|
||||
//
|
||||
// Desc: Source file that includes just the standard includes
|
||||
// stdafx.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the precompiled type information
|
||||
//
|
||||
// Copyright (c) 2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// stdafx.cpp :
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifdef _ATL_STATIC_REGISTRY
|
||||
#include <statreg.h>
|
||||
#include <statreg.cpp>
|
||||
#endif
|
||||
|
||||
#include <atlimpl.cpp>
|
||||
#include <atlctl.cpp>
|
||||
#include <atlwin.cpp>
|
||||
@@ -0,0 +1,60 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: stdafx.h
|
||||
//
|
||||
// Desc: Include file for standard system include files
|
||||
// or project specific include files that are used frequently
|
||||
// but are changed infrequently
|
||||
//
|
||||
// Copyright (c) 2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if !defined(AFX_STDAFX_H__CC50DE5B_97DF_4014_9C89_5E079D7AA958__INCLUDED_)
|
||||
#define AFX_STDAFX_H__CC50DE5B_97DF_4014_9C89_5E079D7AA958__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define STRICT
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#endif
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
|
||||
#include <atlbase.h>
|
||||
|
||||
// Disable warning message for C4201 - use of nameless struct/union
|
||||
// Otherwise, strmif.h will generate warnings for Win32 debug builds
|
||||
#pragma warning( disable : 4201 )
|
||||
|
||||
// You may derive a class from CComModule and use it if you want to override
|
||||
// something, but do not change the name of _Module
|
||||
class CExeModule : public CComModule
|
||||
{
|
||||
public:
|
||||
LONG Unlock();
|
||||
DWORD dwThreadID;
|
||||
HANDLE hEventShutdown;
|
||||
|
||||
void MonitorShutdown();
|
||||
bool StartMonitor();
|
||||
bool bActivity;
|
||||
};
|
||||
|
||||
extern CExeModule _Module;
|
||||
|
||||
#include <atlcom.h>
|
||||
#include <atlhost.h>
|
||||
|
||||
// Disable C4701: Variable may be used without having been initialized
|
||||
// This warning is generated in atlctl.h, which is not in our control
|
||||
#pragma warning( disable : 4701 )
|
||||
|
||||
#include <atlctl.h>
|
||||
|
||||
#pragma warning( default : 4701 )
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__CC50DE5B_97DF_4014_9C89_5E079D7AA958__INCLUDED)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,38 @@
|
||||
/*********************************************************
|
||||
DllData file -- generated by MIDL compiler
|
||||
|
||||
DO NOT ALTER THIS FILE
|
||||
|
||||
This file is regenerated by MIDL on every IDL file compile.
|
||||
|
||||
To completely reconstruct this file, delete it and rerun MIDL
|
||||
on all the IDL files in this DLL, specifying this file for the
|
||||
/dlldata command line option
|
||||
|
||||
*********************************************************/
|
||||
|
||||
#define PROXY_DELEGATION
|
||||
|
||||
#include <rpcproxy.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EXTERN_PROXY_FILE( CPPVideoControl )
|
||||
|
||||
|
||||
PROXYFILE_LIST_START
|
||||
/* Start of list */
|
||||
REFERENCE_PROXY_FILE( CPPVideoControl ),
|
||||
/* End of list */
|
||||
PROXYFILE_LIST_END
|
||||
|
||||
|
||||
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
|
||||
/* end of generated dlldata file */
|
||||
@@ -0,0 +1,24 @@
|
||||
Windows XP DirectShow Sample -- C++ VideoControl
|
||||
------------------------------------------------
|
||||
|
||||
This sample demonstrates using the Microsoft Video Control to view
|
||||
ATSC digital television in a window. This is a simple ATL application
|
||||
that merely hosts the control and allows you to adjust the channel
|
||||
up or down.
|
||||
|
||||
When CPPVideoControl launches, it will look for an ATSC Network
|
||||
provider on your system. If a working tuner is found, CPPVideoControl
|
||||
builds the digital television filter graph, tunes to channel 46,
|
||||
and displays the broadcast signal. It may take several seconds to
|
||||
completely build the digital television filter graph, so please be patient.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- Windows XP operating system
|
||||
|
||||
- BDA-compatible ATSC digital tuner card, such as the Broadlogic DTA-100 receiver.
|
||||
|
||||
- MPEG-2 decoder (for example, a software DVD decoder)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by CPPVideoControl.rc
|
||||
//
|
||||
#define IDS_PROJNAME 100
|
||||
#define IDR_CPPVideoControl 101
|
||||
#define IDR_COMPOSITECONTROL 102
|
||||
#define IDD_COMPOSITECONTROL 103
|
||||
#define IDC_VIDEOCONTROL1 201
|
||||
#define IDC_CHANNELUP 202
|
||||
#define IDC_CHANNELDOWN 203
|
||||
#define IDI_ICON 204
|
||||
#define IDC_CHANNELID 205
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 205
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 206
|
||||
#define _APS_NEXT_SYMED_VALUE 104
|
||||
#endif
|
||||
#endif
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
@@ -0,0 +1,28 @@
|
||||
Windows XP DirectShow Sample -- MS Video Control
|
||||
------------------------------------------------
|
||||
|
||||
These HTML samples demonstrate using the Microsoft Video Control
|
||||
to view ATSC digital, DVB digital, or analog television in a
|
||||
Windows XP browser window.
|
||||
|
||||
NOTE: These samples require a BDA-compatible tuner card, according to
|
||||
the HTML file selected.
|
||||
|
||||
- ViewATSC.htm - Requires a BDA-compatible ATSC digital tuner card,
|
||||
such as the Broadlogic DTA-100.
|
||||
|
||||
- ViewDVB.htm - Requires a BDA-compatible DVB digital tuner card.
|
||||
|
||||
- ViewTV.htm - Requires a BDA-compatible NTSC analog tuner card.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- Windows XP (or greater) operating system
|
||||
|
||||
- BDA-compatible tuner card, as described above
|
||||
|
||||
- MPEG-2 decoder (for example, a software DVD decoder)
|
||||
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>MSVidCtl: ATSC Digital TV</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<!--
|
||||
This sample requires a ATSC digital TV tuner card that is compatible with the Microsoft TV Technologies
|
||||
driver architecture (BDA - Broadcast Driver Architecture).
|
||||
|
||||
You must also have a MPEG-2 decoder installed that is capable of decoding the resolution
|
||||
(e.g. 480p or 1080i) of the digital broadcast.
|
||||
|
||||
High definition (HDTV) broadcasts may be at a resolution greater than your video card or MPEG-2 deocoder
|
||||
are capable of operating.
|
||||
-->
|
||||
|
||||
<BODY BGCOLOR="#000001" TEXT="#FFFFFF" LINK="#FCCB7A" VLINK="#551A8B" ALINK="#EE0000">
|
||||
|
||||
<CENTER>
|
||||
|
||||
<P>
|
||||
<INPUT id=startbutton type=button value="Power On">
|
||||
<INPUT id=stopbutton type=button value="Power Off">
|
||||
</P>
|
||||
|
||||
<OBJECT ID="MSVidCtl" CLASSID="CLSID:B0EDF163-910A-11D2-B632-00C04F79498E"></OBJECT>
|
||||
|
||||
</CENTER>
|
||||
|
||||
|
||||
<P ALIGN="center">
|
||||
<BR>
|
||||
<B>Channel: </B> <INPUT TYPE="text" id=currentchannel maxlength=3 SIZE=3>
|
||||
<B>Minor Chanel: </B> <INPUT TYPE="text" id=currentminorchannel maxlength=3 SIZE=3>
|
||||
<INPUT id=enter type=button value="Enter">
|
||||
<br>
|
||||
<INPUT id=chanup type=button value="Channel Up">
|
||||
<INPUT id=chandown type=button value="Channel Down">
|
||||
<BR>
|
||||
</P>
|
||||
<CENTER>
|
||||
|
||||
<P id=dl>xxx</P>
|
||||
|
||||
<SCRIPT language=vbscript>
|
||||
option explicit
|
||||
|
||||
dim tscontainer 'tuning space collection
|
||||
dim ts 'ATSC tuning space
|
||||
dim tr 'ATSC tune request
|
||||
dim locator 'ATSC Locator
|
||||
|
||||
sub window_onload
|
||||
|
||||
MSVidCtl.MaintainAspectRatio = True
|
||||
MSVidCtl.Width = 640
|
||||
MSVidCtl.Height = 480
|
||||
|
||||
set tscontainer = createobject("BDATuner.SystemTuningSpaces")
|
||||
|
||||
'Get the tuning space with the word "ATSC" in its name.
|
||||
'This tuning space works with North American ATSC terrestrial broadcast
|
||||
'For other types of digital broadcast, you may need to create your own tuning space
|
||||
set ts = tscontainer("ATSC")
|
||||
|
||||
set tr = ts.CreateTuneRequest
|
||||
|
||||
'By default we will start on channel 46
|
||||
'The physical channel property on the locator sets the 'actual' physical channel
|
||||
'The Microsoft TV Technology Network Provider will fill in the channel and minor channel, if available
|
||||
set locator = CreateObject("BDATuner.ATSCLocator")
|
||||
locator.PhysicalChannel = 46
|
||||
tr.locator = locator
|
||||
tr.MinorChannel = -1
|
||||
tr.Channel = -1
|
||||
|
||||
'Pass the tune request to the View() method and then build the graph
|
||||
MSVidCtl.View tr
|
||||
MSVidCtl.Run
|
||||
|
||||
dl.innertext = MSVidCtl.InputActive.Tune.Channel
|
||||
currentchannel.value = MSVidCtl.InputActive.Tune.Locator.PhysicalChannel
|
||||
currentminorchannel.value = MSVidCtl.InputActive.Tune.MinorChannel
|
||||
end sub
|
||||
|
||||
sub startbutton_onclick
|
||||
'This starts the graph and begins displaying audio and video
|
||||
MSVidCtl.Run
|
||||
end sub
|
||||
|
||||
sub stopbutton_onclick
|
||||
'This stops the graph, but does not destroy it
|
||||
MSVidCtl.Stop
|
||||
end sub
|
||||
|
||||
sub chanup_onclick
|
||||
'Tune to the next channel up
|
||||
locator.PhysicalChannel = locator.PhysicalChannel+1
|
||||
tr.Locator = locator
|
||||
tr.Channel = -1
|
||||
tr.MinorChannel = -1
|
||||
MSVidCtl.View tr
|
||||
|
||||
dl.innertext = MSVidCtl.InputActive.Tune.Channel
|
||||
currentchannel.value = MSVidCtl.InputActive.Tune.Locator.PhysicalChannel
|
||||
currentminorchannel.value = MSVidCtl.InputActive.Tune.MinorChannel
|
||||
end sub
|
||||
|
||||
sub chandown_onclick
|
||||
'Tune to the next channel up
|
||||
locator.PhysicalChannel = locator.PhysicalChannel-1
|
||||
tr.Locator = locator
|
||||
tr.Channel = -1
|
||||
tr.MinorChannel = -1
|
||||
MSVidCtl.View tr
|
||||
|
||||
dl.innertext = MSVidCtl.InputActive.Tune.Channel
|
||||
currentchannel.value = MSVidCtl.InputActive.Tune.Locator.PhysicalChannel
|
||||
currentminorchannel.value = MSVidCtl.InputActive.Tune.MinorChannel
|
||||
end sub
|
||||
|
||||
sub enter_onclick
|
||||
'Tune to the channel the user entered in the textbox
|
||||
'We allow the user to change to different virtual channels (minor channels)
|
||||
locator.PhysicalChannel = currentchannel.value
|
||||
tr.locator = locator
|
||||
tr.Channel = -1
|
||||
tr.MinorChannel = currentminorchannel.value
|
||||
MSVidCtl.View tr
|
||||
|
||||
dl.innertext = MSVidCtl.InputActive.Tune.Channel
|
||||
currentchannel.value = MSVidCtl.InputActive.Tune.Locator.PhysicalChannel
|
||||
currentminorchannel.value = MSVidCtl.InputActive.Tune.MinorChannel
|
||||
end sub
|
||||
|
||||
</Script>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,149 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>MSVidCtl: DVB Digital TV</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<!--
|
||||
This sample requires a DVB digital TV tuner card that is compatible with the Microsoft TV Technologies
|
||||
driver architecture (BDA - Broadcast Driver Architecture).
|
||||
|
||||
You must also have a MPEG-2 decoder installed that is capable of decoding the resolution
|
||||
(e.g. 480p or 1080i) of the digital broadcast.
|
||||
|
||||
High definition (HDTV) broadcasts may be at a resolution greater than your video card or MPEG-2 deocoder
|
||||
are capable of operating.
|
||||
-->
|
||||
|
||||
<BODY BGCOLOR="#000001" TEXT="#FFFFFF" LINK="#FCCB7A" VLINK="#551A8B" ALINK="#EE0000">
|
||||
|
||||
<CENTER>
|
||||
<P>
|
||||
<INPUT id=startbutton type=button value="Power On">
|
||||
<INPUT id=stopbutton type=button value="Power Off">
|
||||
</P>
|
||||
|
||||
<OBJECT ID="MSVidCtl" CLASSID="CLSID:B0EDF163-910A-11D2-B632-00C04F79498E"></OBJECT>
|
||||
|
||||
</CENTER>
|
||||
|
||||
<P>
|
||||
<INPUT id=chanup type=button value="Up">
|
||||
<INPUT id=chandown type=button value="Down">
|
||||
<B>Channel: </B> <INPUT TYPE="text" id=currentchannel maxlength=3 SIZE=3>
|
||||
<INPUT id=enter type=button value="Enter">
|
||||
</P>
|
||||
<P id=dl>xxx</P>
|
||||
|
||||
<SCRIPT language=vbscript>
|
||||
option explicit
|
||||
|
||||
Dim tuner
|
||||
Dim tscontainer
|
||||
Dim ts
|
||||
Dim local_ts
|
||||
Dim tr
|
||||
Dim locator
|
||||
|
||||
sub window_onload
|
||||
'Create a DVB Tuning Space
|
||||
'The tuning space contains the system information for the broadcast service
|
||||
'See the documentation on IDVBTuningSpace and DVBTuningSpace Object in MSDN or SDK for more info
|
||||
'The tuning space created below is based on the settings for Echostar Dish Network in the USA
|
||||
set tscontainer = CreateObject("BDATuner.SystemTuningSpaces")
|
||||
set ts = CreateObject("BDATuner.DVBSTuningSpace")
|
||||
set locator = CreateObject("BDATuner.DVBSLocator")
|
||||
|
||||
'Check if the tuning space already exists
|
||||
For Each local_ts In tscontainer
|
||||
If local_ts.UniqueName = "MYDVB" Then
|
||||
Set ts = local_ts
|
||||
End If
|
||||
Next
|
||||
|
||||
'The tuning space doesn't already exist, create it
|
||||
If Not (ts.UniqueName = "MYDVB") Then
|
||||
MsgBox "adding"
|
||||
ts.UniqueName = "MYDVB"
|
||||
ts.FriendlyName = "MYDVB Tuning Space"
|
||||
ts.SystemType = 2 'DVB_Satellite
|
||||
ts.NetworkType = "{FA4B375A-45B4-4D45-8440-263957B11623}"
|
||||
ts.LowOscillator = 11250000
|
||||
ts.HighOscillator = -1
|
||||
ts.LNBSwitch = -1
|
||||
|
||||
locator.CarrierFrequency = 12384000
|
||||
locator.InnerFEC = 1 'BDA_FEC_VITERBI
|
||||
locator.InnerFECRate = 3 'BDA_BCC_RATE_3_4
|
||||
locator.Modulation = 20 'BDA_MOD_QPSK
|
||||
locator.SignalPolarisation = 1 'BDA_POLARISATION_LINEAR_H
|
||||
locator.SymbolRate = 20000
|
||||
locator.Elevation = 5
|
||||
ts.DefaultLocator = locator
|
||||
tscontainer.Add ts
|
||||
End If
|
||||
|
||||
|
||||
Set ts = tscontainer("MYDVB")
|
||||
Set tr = ts.CreateTuneRequest
|
||||
|
||||
'Set the DVBTuneRequest Properties Here:
|
||||
'tr.ONID = -1
|
||||
tr.SID = 101
|
||||
|
||||
'Display some information
|
||||
|
||||
|
||||
'Uncomment the lines below if you need to have the DVB-S Locator property for the tune request set.
|
||||
'set locator = createobject("BDATuner.DVBSLocator")
|
||||
'locator.CarrierFrequency = -1
|
||||
'locator.InnerFEC = -1
|
||||
'locator.InnerFECRate = -1
|
||||
'locator.Modulation = -1
|
||||
'locator.OuterFEC = -1
|
||||
'locator.OuterFECRate = -1
|
||||
'locator.SymbolRate = -1
|
||||
'locator.Azimuth = -1
|
||||
'locator.Elevation = -1
|
||||
'locator.Elevation = -1
|
||||
'locator.OrbitalPosition = -1
|
||||
'locator.SignalPolarisation = -1
|
||||
'locator.WestPosition = -1
|
||||
'tr.locator = locator
|
||||
|
||||
|
||||
MSVidCtl.Width = 800
|
||||
MSVidCtl.Height = 600
|
||||
MSVidCtl.View tr
|
||||
dl.innertext = tr.SID
|
||||
end sub
|
||||
|
||||
sub startbutton_onclick
|
||||
|
||||
MSVidCtl.Run
|
||||
end sub
|
||||
|
||||
sub stopbutton_onclick
|
||||
MSVidCtl.Stop
|
||||
end sub
|
||||
|
||||
sub chanup_onclick
|
||||
MsgBox "Nobody Home."
|
||||
end sub
|
||||
|
||||
sub chandown_onclick
|
||||
MsgBox "Nobody Home."
|
||||
end sub
|
||||
|
||||
sub enter_onclick
|
||||
'Tune to the channel the user entered in the textbox
|
||||
'We allow the user to change to different virtual channels (minor channels)
|
||||
tr.SID = currentchannel.value
|
||||
MSVidCtl.View tr
|
||||
|
||||
dl.innertext = tr.SID
|
||||
currentchannel.value = tr.SID
|
||||
end sub
|
||||
</Script>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,139 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>MSVidCtl: NTSC Analog TV</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<!--
|
||||
This sample requires an analog TV tuner card compatible with the Windows Driver Model.
|
||||
-->
|
||||
|
||||
<BODY BGCOLOR="#000001" TEXT="#FFFFFF" LINK="#FCCB7A" VLINK="#551A8B" ALINK="#EE0000">
|
||||
<CENTER>
|
||||
|
||||
<P>
|
||||
<INPUT id=startbutton type=button value="Power On">
|
||||
<INPUT id=stopbutton type=button value="Power Off">
|
||||
</P>
|
||||
|
||||
<OBJECT ID="MSVidCtl" CLASSID="CLSID:B0EDF163-910A-11D2-B632-00C04F79498E"></OBJECT>
|
||||
|
||||
</CENTER>
|
||||
|
||||
<P align="center">
|
||||
<BR>
|
||||
<B>Channel: </B>
|
||||
<INPUT TYPE="text" id=currentchannel maxlength=3 SIZE=3>
|
||||
<INPUT id=enter type=button value="Enter">
|
||||
<BR>
|
||||
<INPUT id=chanup type=button value="Channel Up">
|
||||
<INPUT id=chandown type=button value="Channel Down">
|
||||
<BR>
|
||||
</P>
|
||||
|
||||
<P id=dl>X</P>
|
||||
|
||||
<SCRIPT language=vbscript>
|
||||
option explicit
|
||||
|
||||
dim tscontainer 'tuning space collection
|
||||
dim ts 'Analog TV tuning space
|
||||
dim tr 'Analog TV tune request
|
||||
|
||||
|
||||
sub window_onload
|
||||
MSVidCtl.Width = 800
|
||||
MSVidCtl.Height = 600
|
||||
|
||||
set tscontainer = CreateObject("BDATuner.SystemTuningSpaces")
|
||||
|
||||
'Get the tuning space with the word "Cable" in its name.
|
||||
'This tuning space works with North American NTSC Cable
|
||||
'You can use the tuning space "Antenna" if you are using NTSC terrestrial analog broadcast
|
||||
'For other types of analog broadcast, you will need to create your own tuning space
|
||||
set ts = tscontainer("Cable")
|
||||
|
||||
set tr = ts.CreateTuneRequest
|
||||
|
||||
'By default we will start on channel 5
|
||||
tr.Channel = 5
|
||||
|
||||
'Pass the tune request to the View() method and then build the graph
|
||||
MSVidCtl.View tr
|
||||
MSVidCtl.Run
|
||||
|
||||
'This will alpha blend the image mstv.jpg over the video
|
||||
dim pict
|
||||
dim alpha
|
||||
dim tempvidrend
|
||||
dim myrect
|
||||
|
||||
dim CurrentPath
|
||||
CurrentPath = location.href
|
||||
CurrentPath = Replace(CurrentPath,"%20"," ")
|
||||
CurrentPath = Replace(CurrentPath,"/","\")
|
||||
CurrentPath = Mid(CurrentPath,6,InstrRev(CurrentPath,"\")-6)
|
||||
if Mid(CurrentPath, 5, 1) = ":" then CurrentPath = Mid(CurrentPath, 4, Len(CurrentPath)-3)
|
||||
|
||||
dim fileLoc
|
||||
fileLoc = CurrentPath & "\mstv.jpg"
|
||||
set pict = LoadPicture(fileLoc)
|
||||
|
||||
alpha = 35
|
||||
set tempvidrend = MSVidCtl.VideoRendererActive
|
||||
tempvidrend.MixerBitmapOpacity = alpha
|
||||
set myrect = tempvidrend.MixerBitmapPositionRect
|
||||
myrect.Top = 20
|
||||
myrect.Left = 20
|
||||
myrect.Width = 50
|
||||
myrect.Height = 20
|
||||
tempvidrend.MixerBitmapPositionRect = myrect
|
||||
tempvidrend.MixerBitmap = pict
|
||||
|
||||
'Display the channel information
|
||||
dl.innertext = MSVidCtl.InputActive.Tune.Channel
|
||||
currentchannel.value = MSVidCtl.InputActive.Tune.Channel
|
||||
end sub
|
||||
|
||||
sub startbutton_onclick
|
||||
'This starts the graph and begins displaying audio and video
|
||||
MSVidCtl.Run
|
||||
end sub
|
||||
|
||||
|
||||
sub stopbutton_onclick
|
||||
'This stops the graph, but does not destroy it
|
||||
MSVidCtl.Stop
|
||||
end sub
|
||||
|
||||
sub chanup_onclick
|
||||
'Tune to the next channel up
|
||||
tr.Channel = tr.Channel + 1
|
||||
MSVidCtl.View tr
|
||||
|
||||
dl.innertext = MSVidCtl.InputActive.Tune.Channel
|
||||
currentchannel.value = MSVidCtl.InputActive.Tune.Channel
|
||||
end sub
|
||||
|
||||
|
||||
sub chandown_onclick
|
||||
'Tune to the next channel down
|
||||
tr.Channel = tr.Channel - 1
|
||||
MSVidCtl.View tr
|
||||
|
||||
dl.innertext = MSVidCtl.InputActive.Tune.Channel
|
||||
currentchannel.value = MSVidCtl.InputActive.Tune.Channel
|
||||
end sub
|
||||
|
||||
sub enter_onclick
|
||||
'Tune to the channel the user entered in the textbox
|
||||
tr.channel = currentchannel.value
|
||||
MSVidCtl.View tr
|
||||
|
||||
dl.innertext = MSVidCtl.InputActive.Tune.Channel
|
||||
currentchannel.value = MSVidCtl.InputActive.Tune.Channel
|
||||
end sub
|
||||
|
||||
</Script>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "CPPVideoControl"=.\CPP\CPPVideoControl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
Attribute VB_Name = "Globals"
|
||||
'*******************************************************************************
|
||||
'* This is a part of the Microsoft Platform SDK Code Samples.
|
||||
'* Copyright (C) 1999-2001 Microsoft Corporation.
|
||||
'* All rights reserved.
|
||||
'* This source code is only intended as a supplement to
|
||||
'* Microsoft Development Tools and/or SDK documentation.
|
||||
'*******************************************************************************
|
||||
|
||||
'Microsoft Video Control - Sample Visual Basic Application
|
||||
Option Explicit
|
||||
|
||||
Public Const NTSC_GUID As String = "{8A674B4D-1F63-11D3-B64C-00C04F79498E}"
|
||||
Public Const ATSC_GUID As String = "{A2E30750-6C3D-11D3-B653-00C04F79498E}"
|
||||
Public Const DVBS_GUID As String = "{B64016F3-C9A2-4066-96F0-BD9563314726}"
|
||||
Public Const CC_GUID As String = "{7F9CB14D-48E4-43B6-9346-1AEBC39C64D3}"
|
||||
Public Const DATASVC_GUID As String = "{334125C0-77E5-11D3-B653-00C04F79498E}"
|
||||
|
||||
Sub Main()
|
||||
frmMain.Show
|
||||
End Sub
|
||||
|
||||
'Use this for error reporting
|
||||
Public Function CheckError(ErrorMsg As String)
|
||||
Dim Msg As Variant
|
||||
If Err.Number <> 0 Then
|
||||
Msg = ErrorMsg & vbCrLf & vbCrLf & "The error returned was:" & vbCrLf & Hex(Err.Number) & ": " & Err.Description
|
||||
MsgBox Msg, , "Error"
|
||||
End If
|
||||
'Reset the error so we don't get the same message over and over
|
||||
Err.Number = 0
|
||||
End Function
|
||||
@@ -0,0 +1,46 @@
|
||||
Type=Exe
|
||||
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\..\WINNT\System32\stdole2.tlb#OLE Automation
|
||||
Reference=*\G{9B085638-018E-11D3-9D8E-00C04F72D980}#1.0#0#..\..\..\..\..\..\..\WINNT\System32\msvidctl.dll\2#Microsoft Tuner 1.0 Type Library
|
||||
Reference=*\G{B0EDF154-910A-11D2-B632-00C04F79498E}#1.0#0#..\..\..\..\..\..\..\WINNT\System32\msvidctl.dll#MS Video Control 1.0 Type Library
|
||||
Reference=*\G{00025E01-0000-0000-C000-000000000046}#5.0#0#..\..\..\..\..\..\..\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll#Microsoft DAO 3.6 Object Library
|
||||
Form=main.frm
|
||||
Module=Globals; Globals.bas
|
||||
Object={B0EDF154-910A-11D2-B632-00C04F79498E}#1.0#0; msvidctl.dll
|
||||
IconForm="frmMain"
|
||||
Startup="frmMain"
|
||||
HelpFile=""
|
||||
Title="VBVideoControl"
|
||||
ExeName32="VBVideoControl.exe"
|
||||
Path32="..\..\..\..\..\..\.."
|
||||
Command32=""
|
||||
Name="VBVideoControl"
|
||||
HelpContextID="0"
|
||||
CompatibleMode="0"
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
RevisionVer=0
|
||||
AutoIncrementVer=0
|
||||
ServerSupportFiles=0
|
||||
VersionComments="SDK Visual Basic Sample"
|
||||
VersionCompanyName="Microsoft Corporation"
|
||||
VersionFileDescription="Microsoft Video Control VB Sample"
|
||||
VersionLegalCopyright="Copyright 2001 Microsoft Corporation"
|
||||
CompilationType=0
|
||||
OptimizationType=0
|
||||
FavorPentiumPro(tm)=-1
|
||||
CodeViewDebugInfo=0
|
||||
NoAliasing=0
|
||||
BoundsCheck=0
|
||||
OverflowCheck=0
|
||||
FlPointCheck=0
|
||||
FDIVCheck=0
|
||||
UnroundedFP=0
|
||||
StartMode=0
|
||||
Unattended=0
|
||||
Retained=0
|
||||
ThreadPerObject=0
|
||||
MaxNumberOfThreads=1
|
||||
DebugStartupOption=0
|
||||
|
||||
[MS Transaction Server]
|
||||
AutoRefresh=1
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,931 @@
|
||||
VERSION 5.00
|
||||
Object = "{B0EDF154-910A-11D2-B632-00C04F79498E}#1.0#0"; "msvidctl.dll"
|
||||
Begin VB.Form frmMain
|
||||
BorderStyle = 3 'Fixed Dialog
|
||||
Caption = "Microsoft Video Control - VB Sample Application"
|
||||
ClientHeight = 4875
|
||||
ClientLeft = 2130
|
||||
ClientTop = 2730
|
||||
ClientWidth = 9135
|
||||
Icon = "main.frx":0000
|
||||
LinkTopic = "Form1"
|
||||
LockControls = -1 'True
|
||||
MaxButton = 0 'False
|
||||
MinButton = 0 'False
|
||||
ScaleHeight = 325
|
||||
ScaleMode = 3 'Pixel
|
||||
ScaleWidth = 609
|
||||
ShowInTaskbar = 0 'False
|
||||
Begin VB.TextBox txtChannel
|
||||
Height = 375
|
||||
Left = 1200
|
||||
TabIndex = 25
|
||||
Top = 2160
|
||||
Visible = 0 'False
|
||||
Width = 615
|
||||
End
|
||||
Begin VB.TextBox txtSID
|
||||
Height = 375
|
||||
Left = 1200
|
||||
TabIndex = 23
|
||||
Top = 1680
|
||||
Visible = 0 'False
|
||||
Width = 615
|
||||
End
|
||||
Begin VB.CommandButton cmdInfo
|
||||
Caption = "Info"
|
||||
Height = 495
|
||||
Left = 1200
|
||||
TabIndex = 22
|
||||
ToolTipText = "Display tuner information and FPS count"
|
||||
Top = 1080
|
||||
Visible = 0 'False
|
||||
Width = 855
|
||||
End
|
||||
Begin VB.CommandButton cmdEnterDVB
|
||||
Caption = "Enter"
|
||||
Height = 495
|
||||
Left = 120
|
||||
TabIndex = 20
|
||||
ToolTipText = "Enter DVB Channel"
|
||||
Top = 1800
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdViewNext
|
||||
Caption = "Next Tuner"
|
||||
Height = 495
|
||||
Left = 120
|
||||
TabIndex = 19
|
||||
ToolTipText = "Select the next tuner in the list"
|
||||
Top = 1080
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdCaptureOff
|
||||
Caption = "Hide Capture"
|
||||
Height = 495
|
||||
Left = 7305
|
||||
TabIndex = 18
|
||||
ToolTipText = "Click to hide the captured frame window"
|
||||
Top = 3960
|
||||
Visible = 0 'False
|
||||
Width = 1695
|
||||
End
|
||||
Begin VB.CommandButton cmdSeekUpDigital
|
||||
Caption = "Ch. Up"
|
||||
Height = 495
|
||||
Left = 1200
|
||||
TabIndex = 17
|
||||
ToolTipText = "ATSC Physical Channel Up"
|
||||
Top = 3600
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdVolumeDown
|
||||
Caption = "Vol. Down"
|
||||
Height = 495
|
||||
Left = 2280
|
||||
TabIndex = 16
|
||||
ToolTipText = "Click to decrease volume"
|
||||
Top = 4200
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdSeekDownDigital
|
||||
Caption = "Ch. Down"
|
||||
Height = 495
|
||||
Left = 1200
|
||||
TabIndex = 15
|
||||
ToolTipText = "ATSC Physical Channel Down"
|
||||
Top = 4200
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdCapture
|
||||
Caption = "Capture Video Frame"
|
||||
Height = 495
|
||||
Left = 4200
|
||||
TabIndex = 14
|
||||
ToolTipText = "Click to capture a frame of video"
|
||||
Top = 3960
|
||||
Visible = 0 'False
|
||||
Width = 1815
|
||||
End
|
||||
Begin VB.CommandButton cmdEnterAnalog
|
||||
Caption = "Enter"
|
||||
Height = 495
|
||||
Left = 120
|
||||
TabIndex = 13
|
||||
ToolTipText = "Enter NTSC Channel"
|
||||
Top = 2400
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdEnterATSC
|
||||
Caption = "Enter"
|
||||
Height = 495
|
||||
Left = 120
|
||||
TabIndex = 12
|
||||
ToolTipText = "Enter ATSC Channel"
|
||||
Top = 3000
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdVolumeUp
|
||||
Caption = "Vol. Up"
|
||||
Height = 495
|
||||
Left = 2280
|
||||
TabIndex = 11
|
||||
ToolTipText = "Click to increase volume"
|
||||
Top = 3600
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.TextBox txtMinorChannel
|
||||
Height = 375
|
||||
Left = 1200
|
||||
TabIndex = 8
|
||||
Top = 3120
|
||||
Visible = 0 'False
|
||||
Width = 615
|
||||
End
|
||||
Begin VB.TextBox txtPhysicalChannel
|
||||
Height = 375
|
||||
Left = 1200
|
||||
TabIndex = 6
|
||||
Top = 2640
|
||||
Visible = 0 'False
|
||||
Width = 615
|
||||
End
|
||||
Begin VB.CommandButton cmdSeekDownAnalog
|
||||
Caption = "Ch. Down"
|
||||
Height = 495
|
||||
Left = 120
|
||||
TabIndex = 5
|
||||
ToolTipText = "NTSC Channel Down"
|
||||
Top = 4200
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdSeekUpAnalog
|
||||
Caption = "Ch. Up"
|
||||
Height = 495
|
||||
Left = 120
|
||||
TabIndex = 4
|
||||
ToolTipText = "NTSC Channel Up"
|
||||
Top = 3600
|
||||
Visible = 0 'False
|
||||
Width = 975
|
||||
End
|
||||
Begin VB.CommandButton cmdPowerOff
|
||||
Caption = "Power Off"
|
||||
Height = 495
|
||||
Left = 2760
|
||||
TabIndex = 3
|
||||
ToolTipText = "Done with playback of selected source"
|
||||
Top = 1680
|
||||
Visible = 0 'False
|
||||
Width = 1095
|
||||
End
|
||||
Begin VB.CommandButton cmdPowerOn
|
||||
Caption = "Power On"
|
||||
Height = 495
|
||||
Left = 2760
|
||||
TabIndex = 2
|
||||
ToolTipText = "Start playing selected source (please be patient)"
|
||||
Top = 1080
|
||||
Width = 1095
|
||||
End
|
||||
Begin VB.ComboBox cbSource
|
||||
Height = 315
|
||||
Left = 120
|
||||
TabIndex = 0
|
||||
Text = "Combo1"
|
||||
ToolTipText = "Choose one of the tuners from the combo box and press Power On. Note that building the graph may take up to 10 seconds."
|
||||
Top = 480
|
||||
Width = 3975
|
||||
End
|
||||
Begin VB.Label lblChannel
|
||||
Caption = "Channel"
|
||||
Height = 255
|
||||
Left = 1920
|
||||
TabIndex = 26
|
||||
Top = 2220
|
||||
Visible = 0 'False
|
||||
Width = 735
|
||||
End
|
||||
Begin VB.Label lblSID
|
||||
Caption = "SID"
|
||||
Height = 255
|
||||
Left = 1920
|
||||
TabIndex = 24
|
||||
Top = 1740
|
||||
Visible = 0 'False
|
||||
Width = 495
|
||||
End
|
||||
Begin VB.Label lblInfo
|
||||
Height = 375
|
||||
Left = 4200
|
||||
TabIndex = 21
|
||||
Top = 4440
|
||||
Visible = 0 'False
|
||||
Width = 3735
|
||||
End
|
||||
Begin MSVidCtlLibCtl.MSVidCtl VidControl
|
||||
Height = 3600
|
||||
Left = 4200
|
||||
TabIndex = 10
|
||||
ToolTipText = "Microsoft Video Control window"
|
||||
Top = 240
|
||||
Width = 4800
|
||||
_cx = 42672403
|
||||
_cy = 42670286
|
||||
AutoSize = 0 'False
|
||||
Enabled = -1 'True
|
||||
Object.TabStop = -1 'True
|
||||
BackColor = 0
|
||||
End
|
||||
Begin VB.Label lblMinorChannel
|
||||
Caption = "Minor Channel"
|
||||
Height = 255
|
||||
Left = 1920
|
||||
TabIndex = 9
|
||||
Top = 3180
|
||||
Visible = 0 'False
|
||||
Width = 1455
|
||||
End
|
||||
Begin VB.Label lblPhysicalChannel
|
||||
Caption = "Physical Channel"
|
||||
Height = 255
|
||||
Left = 1920
|
||||
TabIndex = 7
|
||||
Top = 2700
|
||||
Visible = 0 'False
|
||||
Width = 1335
|
||||
End
|
||||
Begin VB.Label lblSourceInUse
|
||||
Caption = "Playback Source"
|
||||
Height = 255
|
||||
Left = 120
|
||||
TabIndex = 1
|
||||
Top = 120
|
||||
Visible = 0 'False
|
||||
Width = 3975
|
||||
End
|
||||
End
|
||||
Attribute VB_Name = "frmMain"
|
||||
Attribute VB_GlobalNameSpace = False
|
||||
Attribute VB_Creatable = False
|
||||
Attribute VB_PredeclaredId = True
|
||||
Attribute VB_Exposed = False
|
||||
'*******************************************************************************
|
||||
'* This is a part of the Microsoft Platform SDK Code Samples.
|
||||
'* Copyright (C) 1999-2001 Microsoft Corporation.
|
||||
'* All rights reserved.
|
||||
'* This source code is only intended as a supplement to
|
||||
'* Microsoft Development Tools and/or SDK documentation.
|
||||
'*******************************************************************************
|
||||
|
||||
'Microsoft Video Control - Sample Visual Basic Application
|
||||
Option Explicit
|
||||
Dim TVPlayer As MSVidAnalogTunerDevice
|
||||
Dim ATSCTune As IATSCChannelTuneRequest
|
||||
Dim AnalogTune As IChannelTuneRequest
|
||||
Dim DVBTune As IDVBTuneRequest
|
||||
Dim AnalogTV As AnalogTVTuningSpace
|
||||
Dim ATSCTV As New ATSCTuningSpace
|
||||
Dim DVBSTV As New DVBSTuningSpace
|
||||
Dim ATSCLoc As New ATSCLocator
|
||||
|
||||
|
||||
Sub Form_Load()
|
||||
cbSource.AddItem ("NTSC Analog TV")
|
||||
cbSource.AddItem ("NTSC Analog TV w/CC")
|
||||
cbSource.AddItem ("ATSC Digital Antenna TV")
|
||||
cbSource.AddItem ("ATSC Digital Antenna TV w/CC & Mixing Mode")
|
||||
cbSource.AddItem ("DVB-S Digital TV")
|
||||
cbSource.AddItem ("DVB-S Digital TV w/CC & Mixing Mode")
|
||||
cbSource.Text = "Choose a playback source and click Power On"
|
||||
End Sub
|
||||
|
||||
Sub cmdPowerOn_click()
|
||||
'This function builds the correct graph depending on the user-selected broadcast type
|
||||
On Error GoTo ON_ERROR
|
||||
Dim TuningSpaceContainer As SystemTuningSpaces
|
||||
Set TuningSpaceContainer = CreateObject("BDATuner.SystemTuningSpaces")
|
||||
Dim TuningSpaceCollection As ITuningSpaces
|
||||
Dim TS As ITuningSpace
|
||||
Dim FeaturesColl As New MSVidFeatures
|
||||
Dim FeaturesAvailableColl As MSVidFeatures
|
||||
Dim Feature As IMSVidFeature
|
||||
Dim counter As Integer
|
||||
|
||||
VidControl.MaintainAspectRatio = True
|
||||
VidControl.AutoSize = False
|
||||
|
||||
'NTSC Analog TV playback init
|
||||
If cbSource.Text = "NTSC Analog TV" Then
|
||||
'Find all of the AnalogTV tuning spaces
|
||||
Set TuningSpaceCollection = TuningSpaceContainer.TuningSpacesForCLSID(NTSC_GUID)
|
||||
If TuningSpaceCollection.Count = 0 Then
|
||||
MsgBox ("Couldn't find an NTSC Tuning Space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Pick the tuning space named Cable
|
||||
For Each TS In TuningSpaceCollection
|
||||
If TS.UniqueName = "Cable" Then
|
||||
Set AnalogTV = TS
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not (AnalogTV.UniqueName = "Cable") Then
|
||||
MsgBox ("Couldn't find the cable TV tuning space on your system. Re-install this tuning space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Create an AnalogTV tune request and view it
|
||||
Set AnalogTune = AnalogTV.CreateTuneRequest
|
||||
AnalogTune.Channel = 5
|
||||
VidControl.View AnalogTune
|
||||
CheckError "There was a problem with passing the analog TV tune request to the MSVidCtl.View() method."
|
||||
|
||||
'Set FeaturesActive to nothing to disable CC (if it is on)
|
||||
Set FeaturesColl = New MSVidFeatures
|
||||
Set FeaturesColl = Nothing
|
||||
VidControl.FeaturesActive = FeaturesColl
|
||||
CheckError "There was a problem with setting the FeaturesActive collection to NULL."
|
||||
|
||||
VidControl.Run
|
||||
CheckError "There was a problem running the graph. Check that your TV tuner card and video card are properly installed."
|
||||
If (VidControl.State = STATE_UNBUILT) Then
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
txtChannel.Text = VidControl.InputActive.Tune.Channel
|
||||
Call MakeAnalogTVToolsVisible
|
||||
|
||||
'NTSC Analog TV playback init w/CC
|
||||
ElseIf cbSource.Text = "NTSC Analog TV w/CC" Then
|
||||
'Find all of the AnalogTV tuning spaces
|
||||
Set TuningSpaceCollection = TuningSpaceContainer.TuningSpacesForCLSID(NTSC_GUID)
|
||||
If TuningSpaceCollection.Count = 0 Then
|
||||
MsgBox ("Couldn't find an NTSC Tuning Space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Pick the tuning space named Cable
|
||||
For Each TS In TuningSpaceCollection
|
||||
If TS.UniqueName = "Cable" Then
|
||||
Set AnalogTV = TS
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not (AnalogTV.UniqueName = "Cable") Then
|
||||
MsgBox ("Couldn't find the cable TV tuning space on your system. Please reinstall this tuning space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Create an AnalogTV tune request and view it
|
||||
Set AnalogTune = AnalogTV.CreateTuneRequest
|
||||
AnalogTune.Channel = 5
|
||||
VidControl.View AnalogTune
|
||||
CheckError "There was a problem with passing the analog TV tune request to the MSVidCtl.View() method."
|
||||
|
||||
'Enable CC
|
||||
Set FeaturesAvailableColl = VidControl.FeaturesAvailable
|
||||
CheckError "There was a problem getting the FeaturesAvailable collection."
|
||||
|
||||
For Each Feature In FeaturesAvailableColl
|
||||
If Feature.ClassID = CC_GUID Then
|
||||
Dim CCObj As MSVidClosedCaptioning
|
||||
Set CCObj = Feature
|
||||
CCObj.Enable = True
|
||||
FeaturesColl.Add Feature
|
||||
CheckError "There was a problem adding a feature to the collection."
|
||||
ElseIf Feature.ClassID = DATASVC_GUID Then
|
||||
FeaturesColl.Add Feature
|
||||
CheckError "There was a problem adding a feature to the collection."
|
||||
End If
|
||||
Next
|
||||
|
||||
VidControl.FeaturesActive = FeaturesColl
|
||||
CheckError "There was a problem with setting the FeaturesActive collection."
|
||||
|
||||
VidControl.Run
|
||||
CheckError "There was a problem running the graph. Check that your TV tuner card and video card are properly installed."
|
||||
If (VidControl.State = STATE_UNBUILT) Then
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
txtChannel.Text = VidControl.InputActive.Tune.Channel
|
||||
Call MakeAnalogTVToolsVisible
|
||||
|
||||
'Digital TV playback init
|
||||
ElseIf cbSource.Text = "ATSC Digital Antenna TV" Then
|
||||
'Find the all of ATSC tuning spaces
|
||||
Set TuningSpaceCollection = TuningSpaceContainer.TuningSpacesForCLSID(ATSC_GUID)
|
||||
If TuningSpaceCollection.Count = 0 Then
|
||||
MsgBox ("Couldn't find an ATSC Tuning Space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Pick the tuning space named ATSC
|
||||
For Each TS In TuningSpaceCollection
|
||||
If TS.UniqueName = "ATSC" Then
|
||||
Set ATSCTV = TS
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not (ATSCTV.UniqueName = "ATSC") Then
|
||||
MsgBox ("Couldn't find the ATSC TV tuning space on your system. Please reinstall this tuning space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Create a ATSC tune request and view it
|
||||
Set ATSCTune = ATSCTV.CreateTuneRequest
|
||||
ATSCLoc.PhysicalChannel = 46
|
||||
ATSCTune.Channel = -1
|
||||
ATSCTune.MinorChannel = -1
|
||||
ATSCTune.Locator = ATSCLoc
|
||||
|
||||
'Set FeaturesActive to nothing to disable CC (if it is on)
|
||||
Set FeaturesColl = New MSVidFeatures
|
||||
'Set FeaturesColl = Nothing
|
||||
VidControl.FeaturesActive = FeaturesColl
|
||||
CheckError "There was a problem with setting the FeaturesActive collection to NULL."
|
||||
VidControl.View ATSCTune
|
||||
CheckError "There was a problem with passing the ATSC tune request to the MSVidCtl.View() method."
|
||||
VidControl.Build
|
||||
CheckError "Build"
|
||||
VidControl.Run
|
||||
CheckError "There was a problem running the graph. Check that your TV tuner card and video card are properly installed."
|
||||
If (VidControl.State = STATE_UNBUILT) Then
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
txtPhysicalChannel.Text = VidControl.InputActive.Tune.Locator.PhysicalChannel
|
||||
txtMinorChannel.Text = VidControl.InputActive.Tune.MinorChannel
|
||||
Call MakeDigitalTVToolsVisible
|
||||
'Hide these two buttons, as we can't mix in this mode
|
||||
cmdCapture.Visible = False
|
||||
cmdCaptureOff.Visible = False
|
||||
|
||||
'Digital TV w/CC playback init
|
||||
ElseIf cbSource.Text = "ATSC Digital Antenna TV w/CC & Mixing Mode" Then
|
||||
'Find the all of ATSC tuning spaces
|
||||
Set TuningSpaceCollection = TuningSpaceContainer.TuningSpacesForCLSID(ATSC_GUID)
|
||||
If TuningSpaceCollection.Count = 0 Then
|
||||
MsgBox ("Couldn't find an ATSC Tuning Space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Pick the tuning space named ATSC
|
||||
For Each TS In TuningSpaceCollection
|
||||
If TS.UniqueName = "ATSC" Then
|
||||
Set ATSCTV = TS
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not (ATSCTV.UniqueName = "ATSC") Then
|
||||
MsgBox ("Couldn't find the ATSC TV tuning space on your system. Please reinstall this tuning space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Create a ATSC tune request and view it
|
||||
Set ATSCTune = ATSCTV.CreateTuneRequest
|
||||
ATSCLoc.PhysicalChannel = 46
|
||||
ATSCTune.Channel = -1
|
||||
ATSCTune.MinorChannel = -1
|
||||
ATSCTune.Locator = ATSCLoc
|
||||
VidControl.View ATSCTune
|
||||
CheckError "There was a problem with passing the ATSC tune request to the MSVidCtl.View() method."
|
||||
|
||||
'Enable CC (and mixing mode)
|
||||
Set FeaturesAvailableColl = VidControl.FeaturesAvailable
|
||||
CheckError "There was a problem getting the FeaturesAvailable collection."
|
||||
|
||||
For Each Feature In FeaturesAvailableColl
|
||||
If Feature.ClassID = CC_GUID Then
|
||||
FeaturesColl.Add Feature
|
||||
CheckError "There was a problem adding a feature to the collection."
|
||||
End If
|
||||
Next
|
||||
|
||||
VidControl.FeaturesActive = FeaturesColl
|
||||
CheckError "There was a problem with putting the FeaturesActive collection."
|
||||
|
||||
VidControl.Run
|
||||
CheckError "There was a problem running the graph. Check that your TV tuner card and video card are properly installed."
|
||||
If (VidControl.State = STATE_UNBUILT) Then
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
txtPhysicalChannel.Text = VidControl.InputActive.Tune.Locator.PhysicalChannel
|
||||
txtMinorChannel.Text = VidControl.InputActive.Tune.MinorChannel
|
||||
Call MakeDigitalTVToolsVisible
|
||||
|
||||
'Digital DVB-S TV playback init
|
||||
ElseIf cbSource.Text = "DVB-S Digital TV" Then
|
||||
'Find all of the DVB-S tuning spaces
|
||||
Set TuningSpaceCollection = TuningSpaceContainer.TuningSpacesForCLSID(DVBS_GUID)
|
||||
If TuningSpaceCollection.Count = 0 Then
|
||||
MsgBox ("Couldn't find a DVB Tuning Space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Pick any DVB-S tuning space we find
|
||||
For Each TS In TuningSpaceCollection
|
||||
If TS.UniqueName = "MYDVB" Then
|
||||
Set DVBSTV = TS
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If (IsNull(DVBSTV)) Then
|
||||
'If there is no tuning space exit
|
||||
MsgBox ("No MYDVB tuning space found. Please run the ViewDVB.htm file first")
|
||||
Call cmdPowerOff_click
|
||||
End If
|
||||
'Create a DVB tune request and view it
|
||||
Set DVBTune = DVBSTV.CreateTuneRequest
|
||||
CheckError "There was a problem creating a DVB-S tune request."
|
||||
DVBTune.SID = 101
|
||||
|
||||
'Set FeaturesActive to nothing to disable CC (if it is on)
|
||||
Set FeaturesColl = New MSVidFeatures
|
||||
Set FeaturesColl = Nothing
|
||||
VidControl.FeaturesActive = FeaturesColl
|
||||
CheckError "There was a problem with setting the FeaturesActive collection to NULL."
|
||||
VidControl.View DVBTune
|
||||
CheckError "There was a problem with passing the DVB tune request to the MSVidCtl.View() method."
|
||||
VidControl.Run
|
||||
CheckError "There was a problem running the graph. Check that your TV tuner card and video card are properly installed."
|
||||
If (VidControl.State = STATE_UNBUILT) Then
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Call MakeDigitalTVToolsVisible
|
||||
txtSID.Visible = True
|
||||
lblSID.Visible = True
|
||||
cmdEnterDVB.Visible = True
|
||||
'Hide these buttons, as they aren't used for DVB
|
||||
cmdCapture.Visible = False
|
||||
cmdCaptureOff.Visible = False
|
||||
txtPhysicalChannel.Visible = False
|
||||
txtMinorChannel.Visible = False
|
||||
lblPhysicalChannel.Visible = False
|
||||
lblMinorChannel.Visible = False
|
||||
txtChannel.Visible = False
|
||||
cmdEnterATSC.Visible = False
|
||||
cmdSeekUpDigital.Visible = False
|
||||
cmdSeekDownDigital.Visible = False
|
||||
|
||||
'Digital DVB-S TV w/CC playback init
|
||||
ElseIf cbSource.Text = "DVB-S Digital TV w/CC & Mixing Mode" Then
|
||||
'Find all of the DVB-S tuning spaces
|
||||
Set TuningSpaceCollection = TuningSpaceContainer.TuningSpacesForCLSID(DVBS_GUID)
|
||||
If TuningSpaceCollection.Count = 0 Then
|
||||
MsgBox ("Couldn't find a DVB Tuning Space.")
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Pick any DVB-S tuning space we find
|
||||
For Each TS In TuningSpaceCollection
|
||||
If Not (TS Is Nothing) Then
|
||||
Set DVBSTV = TS
|
||||
End If
|
||||
Next
|
||||
|
||||
'Create a DVB tune request and view it
|
||||
Set DVBTune = DVBSTV.CreateTuneRequest
|
||||
CheckError "There was a problem creating the DVB-S tune request."
|
||||
DVBTune.SID = 101
|
||||
VidControl.View DVBTune
|
||||
CheckError "There was a problem with passing the DVB tune request to the MSVidCtl.View() method."
|
||||
|
||||
'Enable CC (and mixing mode)
|
||||
Set FeaturesAvailableColl = VidControl.FeaturesAvailable
|
||||
CheckError "There was a problem getting the FeaturesAvailable collection."
|
||||
|
||||
For Each Feature In FeaturesAvailableColl
|
||||
If Feature.ClassID = CC_GUID Then
|
||||
FeaturesColl.Add Feature
|
||||
CheckError "There was a problem adding a feature to the collection."
|
||||
End If
|
||||
Next
|
||||
|
||||
VidControl.FeaturesActive = FeaturesColl
|
||||
CheckError "There was a problem with putting the FeaturesActive collection."
|
||||
|
||||
VidControl.Run
|
||||
CheckError "There was a problem running the graph. Check that your TV tuner card and video card are properly installed."
|
||||
If (VidControl.State = STATE_UNBUILT) Then
|
||||
Call cmdPowerOff_click
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Call MakeDigitalTVToolsVisible
|
||||
txtSID.Visible = True
|
||||
lblSID.Visible = True
|
||||
cmdEnterDVB.Visible = True
|
||||
'Hide the objects that aren't needed for DVB
|
||||
txtPhysicalChannel.Visible = False
|
||||
txtMinorChannel.Visible = False
|
||||
lblPhysicalChannel.Visible = False
|
||||
lblMinorChannel.Visible = False
|
||||
txtChannel.Visible = False
|
||||
cmdEnterATSC.Visible = False
|
||||
cmdSeekUpDigital.Visible = False
|
||||
cmdSeekDownDigital.Visible = False
|
||||
|
||||
'User didn't pick a playback type
|
||||
Else
|
||||
MsgBox "You have chosen a playback type that is not implemented. Please try again."
|
||||
End If
|
||||
|
||||
Exit Sub
|
||||
|
||||
ON_ERROR:
|
||||
Call ProcessGeneralErorr
|
||||
End Sub
|
||||
|
||||
Sub ProcessGeneralErorr()
|
||||
On Error Resume Next
|
||||
VidControl.Stop
|
||||
VidControl.Decompose
|
||||
ATSCTune = Null
|
||||
AnalogTune = Null
|
||||
DVBTune = Null
|
||||
AnalogTV = Null
|
||||
ATSCTV = Null
|
||||
DVBSTV = Null
|
||||
ATSCLoc = Null
|
||||
CheckError "General error - graph cannot run"
|
||||
End Sub
|
||||
|
||||
'User is done with this playback
|
||||
Sub cmdPowerOff_click()
|
||||
On Error Resume Next
|
||||
Call HideTools
|
||||
VidControl.Stop
|
||||
VidControl.Decompose
|
||||
|
||||
CheckError "There was a problem tearing down the graph."
|
||||
End Sub
|
||||
|
||||
Sub MakeAnalogTVToolsVisible()
|
||||
'Make the appropriate analog TV controls visible
|
||||
cmdPowerOff.Visible = True
|
||||
cmdCapture.Visible = True
|
||||
cmdCaptureOff.Visible = True
|
||||
cmdEnterAnalog.Visible = True
|
||||
lblChannel.Visible = True
|
||||
txtChannel.Visible = True
|
||||
lblSourceInUse.Caption = cbSource.Text
|
||||
lblSourceInUse.Visible = True
|
||||
cbSource.Visible = False
|
||||
txtChannel.Text = AnalogTune.Channel
|
||||
cmdVolumeUp.Visible = True
|
||||
cmdVolumeDown.Visible = True
|
||||
cmdSeekUpAnalog.Visible = True
|
||||
cmdSeekDownAnalog.Visible = True
|
||||
cmdViewNext.Visible = True
|
||||
cmdInfo.Visible = True
|
||||
End Sub
|
||||
|
||||
Sub MakeDigitalTVToolsVisible()
|
||||
'Make the appropriate TV controls visible
|
||||
cmdPowerOff.Visible = True
|
||||
cmdCapture.Visible = True
|
||||
cmdCaptureOff.Visible = True
|
||||
cmdSeekUpDigital.Visible = True
|
||||
cmdSeekDownDigital.Visible = True
|
||||
cmdEnterATSC.Visible = True
|
||||
lblSourceInUse.Caption = cbSource.Text
|
||||
cbSource.Visible = False
|
||||
lblSourceInUse.Visible = True
|
||||
lblMinorChannel.Visible = True
|
||||
txtMinorChannel.Visible = True
|
||||
lblPhysicalChannel.Visible = True
|
||||
txtPhysicalChannel.Visible = True
|
||||
cmdVolumeUp.Visible = True
|
||||
cmdVolumeDown.Visible = True
|
||||
cmdViewNext.Visible = True
|
||||
cmdInfo.Visible = True
|
||||
End Sub
|
||||
|
||||
'Hide all the controls we don't need to see
|
||||
Sub HideTools()
|
||||
cmdPowerOff.Visible = False
|
||||
cmdCapture.Visible = False
|
||||
cmdCaptureOff.Visible = False
|
||||
cmdSeekUpAnalog.Visible = False
|
||||
cmdSeekDownAnalog.Visible = False
|
||||
cmdSeekUpDigital.Visible = False
|
||||
cmdSeekDownDigital.Visible = False
|
||||
cmdEnterATSC.Visible = False
|
||||
cmdEnterAnalog.Visible = False
|
||||
lblChannel.Visible = False
|
||||
txtChannel.Visible = False
|
||||
cbSource.Visible = True
|
||||
lblSourceInUse.Visible = False
|
||||
lblMinorChannel.Visible = False
|
||||
txtMinorChannel.Visible = False
|
||||
lblPhysicalChannel.Visible = False
|
||||
txtPhysicalChannel.Visible = False
|
||||
cmdVolumeUp.Visible = False
|
||||
cmdVolumeDown.Visible = False
|
||||
cmdViewNext.Visible = False
|
||||
txtSID.Visible = False
|
||||
cmdEnterDVB.Visible = False
|
||||
lblSID.Visible = False
|
||||
lblInfo.Visible = False
|
||||
cmdInfo.Visible = False
|
||||
End Sub
|
||||
|
||||
'User presses Enter button to change a DVB-S channel
|
||||
Private Sub cmdEnterDVB_Click()
|
||||
On Error Resume Next
|
||||
DVBTune.SID = txtSID.Text
|
||||
VidControl.View DVBTune
|
||||
CheckError "There was a problem with passing the DVB tune request to the MSVidCtl.View() method."
|
||||
End Sub
|
||||
|
||||
'User presses Enter button to change a ATSC channel
|
||||
Private Sub cmdEnterATSC_Click()
|
||||
On Error Resume Next
|
||||
ATSCLoc.PhysicalChannel = txtPhysicalChannel.Text
|
||||
ATSCTune.Locator = ATSCLoc
|
||||
ATSCTune.MinorChannel = txtMinorChannel.Text
|
||||
ATSCTune.Channel = -1
|
||||
VidControl.View ATSCTune
|
||||
CheckError "There was a problem with passing the ATSC tune request to the MSVidCtl.View() method."
|
||||
|
||||
txtPhysicalChannel.Text = VidControl.InputActive.Tune.Locator.PhysicalChannel
|
||||
txtMinorChannel.Text = VidControl.InputActive.Tune.MinorChannel
|
||||
End Sub
|
||||
|
||||
'User presses Enter button to change a NTSC channel
|
||||
Private Sub cmdEnterAnalog_Click()
|
||||
On Error Resume Next
|
||||
AnalogTune.Channel = txtChannel.Text
|
||||
VidControl.View AnalogTune
|
||||
CheckError "There was a problem with passing the analog TV tune request to the MSVidCtl.View() method."
|
||||
|
||||
txtChannel.Text = VidControl.InputActive.Tune.Channel
|
||||
End Sub
|
||||
|
||||
'Change volume
|
||||
Private Sub cmdVolumeUp_Click()
|
||||
On Error Resume Next
|
||||
If (VidControl.AudioRendererActive.Volume < 0) Then
|
||||
VidControl.AudioRendererActive.Volume = VidControl.AudioRendererActive.Volume + 1000
|
||||
CheckError "There was a problem with changing the volume."
|
||||
'Else
|
||||
' MsgBox "Volume is set to maximum."
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Change volume
|
||||
Private Sub cmdVolumeDown_Click()
|
||||
On Error Resume Next
|
||||
If (VidControl.AudioRendererActive.Volume > -10000) Then
|
||||
VidControl.AudioRendererActive.Volume = VidControl.AudioRendererActive.Volume - 1000
|
||||
CheckError "There was a problem with changing the volume."
|
||||
'Else
|
||||
' MsgBox "Volume is set to minimum."
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Channel change up for ATSC
|
||||
Private Sub cmdSeekUpDigital_Click()
|
||||
On Error Resume Next
|
||||
ATSCLoc.PhysicalChannel = ATSCLoc.PhysicalChannel + 1
|
||||
ATSCTune.Locator = ATSCLoc
|
||||
ATSCTune.MinorChannel = -1
|
||||
ATSCTune.Channel = -1
|
||||
VidControl.View ATSCTune
|
||||
CheckError "There was a problem with passing the ATSC tune request to the MSVidCtl.View() method."
|
||||
|
||||
txtPhysicalChannel.Text = VidControl.InputActive.Tune.Locator.PhysicalChannel
|
||||
txtMinorChannel.Text = VidControl.InputActive.Tune.MinorChannel
|
||||
End Sub
|
||||
|
||||
'Channel change down for ATSC
|
||||
Private Sub cmdSeekDownDigital_Click()
|
||||
On Error Resume Next
|
||||
ATSCLoc.PhysicalChannel = ATSCLoc.PhysicalChannel - 1
|
||||
ATSCTune.Locator = ATSCLoc
|
||||
ATSCTune.MinorChannel = -1
|
||||
ATSCTune.Channel = -1
|
||||
VidControl.View ATSCTune
|
||||
CheckError "There was a problem with passing the ATSC tune request to the MSVidCtl.View() method."
|
||||
|
||||
txtPhysicalChannel.Text = VidControl.InputActive.Tune.Locator.PhysicalChannel
|
||||
txtMinorChannel.Text = VidControl.InputActive.Tune.MinorChannel
|
||||
End Sub
|
||||
|
||||
'Channel change up for NTSC
|
||||
Private Sub cmdSeekUpAnalog_Click()
|
||||
On Error Resume Next
|
||||
AnalogTune.Channel = AnalogTune.Channel + 1
|
||||
VidControl.View AnalogTune
|
||||
CheckError "There was a problem with passing the ATSC tune request to the MSVidCtl.View() method."
|
||||
|
||||
txtChannel.Text = VidControl.InputActive.Tune.Channel
|
||||
End Sub
|
||||
|
||||
'Channel change down for NTSC
|
||||
Private Sub cmdSeekDownAnalog_Click()
|
||||
On Error Resume Next
|
||||
AnalogTune.Channel = AnalogTune.Channel - 1
|
||||
VidControl.View AnalogTune
|
||||
CheckError "There was a problem with passing the ATSC tune request to the MSVidCtl.View() method."
|
||||
|
||||
txtChannel.Text = VidControl.InputActive.Tune.Channel
|
||||
End Sub
|
||||
|
||||
'Capture current video frame and alpha blend over video
|
||||
Private Sub cmdCapture_Click()
|
||||
On Error Resume Next
|
||||
Dim Alpha As Integer
|
||||
Dim TempVidRend As MSVidVideoRenderer
|
||||
Dim MyRect As IMSVidRect
|
||||
Dim Pict As IPictureDisp
|
||||
|
||||
'The amount of opacity for the image over video is 75% visible
|
||||
Alpha = 75
|
||||
|
||||
'Get the current video renderer
|
||||
Set TempVidRend = VidControl.VideoRendererActive
|
||||
CheckError "Failed to retrieve the current video renderer."
|
||||
|
||||
'Capture the frame of video
|
||||
Set Pict = TempVidRend.Capture
|
||||
CheckError "Failed to capture the video frame."
|
||||
|
||||
'Set the properties for the image and then display it
|
||||
TempVidRend.MixerBitmap = Pict
|
||||
TempVidRend.MixerBitmapOpacity = Alpha
|
||||
Set MyRect = TempVidRend.MixerBitmapPositionRect
|
||||
MyRect.Top = 10
|
||||
MyRect.Left = 10
|
||||
MyRect.Height = (VidControl.Height) / 4
|
||||
MyRect.Width = (VidControl.Width) / 4
|
||||
TempVidRend.MixerBitmapPositionRect = MyRect
|
||||
CheckError "Failed to display the frame capture. Your video card may not be compatible with the WindowsXP Video Mixing Renderer."
|
||||
End Sub
|
||||
|
||||
'Remove the alpha blended image
|
||||
Private Sub cmdCaptureOff_Click()
|
||||
On Error Resume Next
|
||||
Dim TempVidRend As MSVidVideoRenderer
|
||||
Set TempVidRend = VidControl.VideoRendererActive
|
||||
CheckError "Failed to retrieve the current video renderer."
|
||||
TempVidRend.MixerBitmap = Nothing
|
||||
CheckError "Failed to disable MixerBitmap."
|
||||
End Sub
|
||||
|
||||
Private Sub cmdViewNext_Click()
|
||||
'Try the next tuner device
|
||||
On Error Resume Next
|
||||
VidControl.Stop
|
||||
If VidControl.InputActive.TuningSpace.CLSID = NTSC_GUID Then
|
||||
VidControl.ViewNext AnalogTune
|
||||
CheckError "Failed to ViewNext for NTSC."
|
||||
ElseIf VidControl.InputActive.TuningSpace.CLSID = ATSC_GUID Then
|
||||
VidControl.ViewNext ATSCTune
|
||||
CheckError "Failed to ViewNext for ATSC."
|
||||
ElseIf VidControl.InputActive.TuningSpace.CLSID = DVBS_GUID Then
|
||||
VidControl.ViewNext DVBTune
|
||||
CheckError "Failed to ViewNext for DVB."
|
||||
Else
|
||||
MsgBox "There is not a tuning space to match the current InputActive."
|
||||
End If
|
||||
VidControl.Run
|
||||
CheckError "Unable to run after changing InputActive."
|
||||
End Sub
|
||||
|
||||
Private Sub cmdInfo_Click()
|
||||
'Display Input Name and FPS
|
||||
lblInfo.Visible = True
|
||||
lblInfo.Caption = "Device Name: " & VidControl.InputActive.Name & " FPS: " & (VidControl.VideoRendererActive.FramesPerSecond / 100)
|
||||
End Sub
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,34 @@
|
||||
Windows XP DirectShow Sample -- Visual Basic Video Control
|
||||
-----------------------------------------------------------
|
||||
|
||||
This sample demonstrates using the Microsoft Video Control to view
|
||||
digital television in a window.
|
||||
|
||||
When VBVideoControl launches, it presents you with a list of network
|
||||
providers. Choose a network provider that is available in your area
|
||||
(such as ATSC Digital Antenna TV) and click the Power On button.
|
||||
VBVideoControl will attempt to build a filter graph with the
|
||||
selected network provider.
|
||||
|
||||
If successful, it will update the Visual Basic form to display
|
||||
additional buttons, which you may use to change channels, adjust volume,
|
||||
display device information, and select tuners. You may click Power Off
|
||||
to clear the form and select another tuner.
|
||||
|
||||
NOTE: It may take several seconds to completely build the digital
|
||||
television filter graph, so please be patient.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- Windows XP (or greater) operating system
|
||||
|
||||
- BDA-compatible digital tuner card, such as the Broadlogic DTA-100 receiver.
|
||||
|
||||
- If you select ATSC digital TV, you will need an ATSC digital tuner card.
|
||||
- If you select DVB digital TV, you will need a DVB digital tuner card.
|
||||
- If you select NTSC Analog TV, you will need an NTSC Analog tuner card.
|
||||
|
||||
- MPEG-2 decoder (for example, a software DVD decoder)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
Windows XP Video Control Samples
|
||||
--------------------------------
|
||||
|
||||
These samples demonstrate using the Microsoft Video Control to view
|
||||
digital television in a window. There are Video Control examples provided
|
||||
for Visual C++, Visual Basic, and HTML.
|
||||
|
||||
|
||||
NOTE: These samples require a compatible TV tuner card, such as
|
||||
the Broadlogic DTA-100 receiver. The C++ Video Control sample requires
|
||||
a BDA-compatible ATSC Digital Tuner card. The HTML and Visual Basic samples
|
||||
require either an ATSC Digital, DVB Digital, or Analog tuner card,
|
||||
depending on the HTML file or tuning feature selected.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- Windows XP operating system
|
||||
|
||||
- BDA-compatible digital tuner card, such as the Broadlogic DTA-100 receiver.
|
||||
|
||||
- If you select ATSC digital TV, you will need an ATSC digital tuner card.
|
||||
- If you select DVB digital TV, you will need a DVB digital tuner card.
|
||||
- If you select NTSC Analog TV, you will need an NTSC Analog tuner card.
|
||||
|
||||
- MPEG-2 decoder (for example, a software DVD decoder)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
NOTE: The DirectShow_WinXP samples do not yet build properly for UNICODE.
|
||||
---------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user