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>
@@ -0,0 +1,443 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: BGMusic.cpp
|
||||
//
|
||||
// Desc: A simple playback applicaiton that plays a cyclic set of media
|
||||
// files of the same type. This is the code required to use DirectShow
|
||||
// to play compressed audio in the background of your title in a
|
||||
// seamless manner.
|
||||
//
|
||||
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <windows.h>
|
||||
#include <dshow.h>
|
||||
#include <tchar.h>
|
||||
#include <malloc.h>
|
||||
#include "resource.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Forward Declarations
|
||||
//------------------------------------------------------------------------------
|
||||
HRESULT GraphInit(void);
|
||||
HWND AppInit(HINSTANCE hInstance);
|
||||
void AppMessageLoop(void);
|
||||
void AppCleanUp(void);
|
||||
HRESULT SwapSourceFilter(void);
|
||||
void ShowCurrentFile(HWND hWnd);
|
||||
const TCHAR* DXUtil_GetDXSDKMediaPath();
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
VOID CALLBACK MyTimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Macros
|
||||
//------------------------------------------------------------------------------
|
||||
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Constants
|
||||
//------------------------------------------------------------------------------
|
||||
#define CLASSNAME TEXT("BGMusicPlayer")
|
||||
#define APPNAME TEXT("BGMusic Player")
|
||||
#define APPWIDTH 200
|
||||
#define APPHEIGHT 100
|
||||
#define MEDIA_TIMEOUT (10 * 1000) // 10 seconds, represented in milliseconds
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Global Variables
|
||||
//------------------------------------------------------------------------------
|
||||
// DirectShow Graph, Filter & Pins used
|
||||
IGraphBuilder *g_pGraphBuilder = NULL;
|
||||
IMediaControl *g_pMediaControl = NULL;
|
||||
IMediaSeeking *g_pMediaSeeking = NULL;
|
||||
IBaseFilter *g_pSourceCurrent = NULL;
|
||||
IBaseFilter *g_pSourceNext = NULL;
|
||||
TCHAR g_szCurrentFile[128];
|
||||
HWND g_hwndApp;
|
||||
|
||||
// File names & variables to track current file
|
||||
LPCTSTR pstrFiles[] =
|
||||
{
|
||||
TEXT("track1.mp3\0"),
|
||||
TEXT("track2.mp3\0"),
|
||||
TEXT("track3.mp3\0"),
|
||||
};
|
||||
|
||||
int g_iNumFiles = 3, g_iNextFile = 0;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Name: WinMain()
|
||||
// Desc: Main Entry point for the app. Calls the Initialization routines and
|
||||
// then calls the main processing loop.
|
||||
//------------------------------------------------------------------------------
|
||||
int APIENTRY WinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
// Initialize application window
|
||||
if (! AppInit(hInstance))
|
||||
return 0;
|
||||
|
||||
// Initialize DirectShow components and build initial graph
|
||||
if (SUCCEEDED (GraphInit()))
|
||||
{
|
||||
// Main Message Loop
|
||||
AppMessageLoop();
|
||||
}
|
||||
|
||||
// Clean up
|
||||
AppCleanUp();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Name: GraphInit()
|
||||
// Desc: Initialization of DirectShow components and initial graph
|
||||
//------------------------------------------------------------------------------
|
||||
HRESULT GraphInit(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
// Initialize COM
|
||||
if (FAILED (hr = CoInitialize(NULL)) )
|
||||
return hr;
|
||||
|
||||
// Create DirectShow Graph
|
||||
if (FAILED (hr = CoCreateInstance(CLSID_FilterGraph, NULL,
|
||||
CLSCTX_INPROC, IID_IGraphBuilder,
|
||||
reinterpret_cast<void **>(&g_pGraphBuilder))) )
|
||||
return hr;
|
||||
|
||||
// Get the IMediaControl Interface
|
||||
if (FAILED (g_pGraphBuilder->QueryInterface(IID_IMediaControl,
|
||||
reinterpret_cast<void **>(&g_pMediaControl))))
|
||||
return hr;
|
||||
|
||||
// Get the IMediaControl Interface
|
||||
if (FAILED (g_pGraphBuilder->QueryInterface(IID_IMediaSeeking,
|
||||
reinterpret_cast<void **>(&g_pMediaSeeking))))
|
||||
return hr;
|
||||
|
||||
// Create Source Filter for first file
|
||||
g_iNextFile = 0;
|
||||
|
||||
// Create the intial graph
|
||||
if (FAILED (SwapSourceFilter()))
|
||||
return hr;
|
||||
|
||||
// Set a timer for switching the sources
|
||||
SetTimer(g_hwndApp, 0, MEDIA_TIMEOUT, (TIMERPROC) MyTimerProc);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Name: AppInit()
|
||||
// Desc: Initialization of application window
|
||||
//------------------------------------------------------------------------------
|
||||
HWND AppInit(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
// Register the window class
|
||||
ZeroMemory(&wc, sizeof wc);
|
||||
wc.lpfnWndProc = WndProc;
|
||||
wc.hInstance = hInstance;
|
||||
wc.lpszClassName = CLASSNAME;
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_BGMUSIC));
|
||||
if(!RegisterClass(&wc))
|
||||
return 0;
|
||||
|
||||
// Create the main window without support for resizing
|
||||
g_hwndApp = CreateWindow(CLASSNAME, APPNAME,
|
||||
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU
|
||||
| WS_MINIMIZEBOX | WS_VISIBLE,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
APPWIDTH, APPHEIGHT,
|
||||
0, 0, hInstance, 0);
|
||||
|
||||
return g_hwndApp;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Name: WndProcLoop()
|
||||
// Desc: Main Message Processor for the Application
|
||||
//------------------------------------------------------------------------------
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(message)
|
||||
{
|
||||
case WM_PAINT:
|
||||
ShowCurrentFile(hWnd);
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Name: ShowCurrentFile()
|
||||
// Desc: Display the currently playing media file in the main window
|
||||
//------------------------------------------------------------------------------
|
||||
void ShowCurrentFile(HWND hWnd)
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
RECT rc;
|
||||
TCHAR szMsg[128];
|
||||
|
||||
BeginPaint(hWnd, &ps);
|
||||
HDC hdc = GetDC(hWnd);
|
||||
GetWindowRect(hWnd, &rc);
|
||||
|
||||
// Set the text color to bright green against black background
|
||||
SetTextColor(hdc, RGB(80, 255, 80));
|
||||
SetBkColor(hdc, RGB(0,0,0));
|
||||
|
||||
// Decide where to place the text (centered in window)
|
||||
int X = (rc.right - rc.left) / 2;
|
||||
int Y = (rc.bottom - rc.top) / 3;
|
||||
SetTextAlign(hdc, TA_CENTER | VTA_CENTER);
|
||||
|
||||
// Update the text string
|
||||
wsprintf(szMsg, _T("Playing %s\0"), g_szCurrentFile);
|
||||
ExtTextOut(hdc, X, Y, ETO_OPAQUE, NULL, szMsg, _tcslen(szMsg), 0);
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Name: AppMessageLoop()
|
||||
// Desc: Main Message Loop for the Application
|
||||
//------------------------------------------------------------------------------
|
||||
void AppMessageLoop(void)
|
||||
{
|
||||
MSG msg={0};
|
||||
|
||||
// Main message loop:
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (! TranslateAccelerator(msg.hwnd, NULL, &msg) )
|
||||
{
|
||||
TranslateMessage(&msg) ;
|
||||
DispatchMessage(&msg) ;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Name: AppCleanUp)
|
||||
// Desc: Clean up the application
|
||||
//------------------------------------------------------------------------------
|
||||
void AppCleanUp(void)
|
||||
{
|
||||
// Stop playback
|
||||
if (g_pMediaControl)
|
||||
g_pMediaControl->Stop();
|
||||
|
||||
// Release all remaining pointers
|
||||
SAFE_RELEASE( g_pSourceNext);
|
||||
SAFE_RELEASE( g_pSourceCurrent);
|
||||
SAFE_RELEASE( g_pMediaSeeking);
|
||||
SAFE_RELEASE( g_pMediaControl);
|
||||
SAFE_RELEASE( g_pGraphBuilder);
|
||||
|
||||
// Clean up COM
|
||||
CoUninitialize();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// MyTimerProc - Callback when the timer goes off
|
||||
//------------------------------------------------------------------------------
|
||||
VOID CALLBACK MyTimerProc(
|
||||
HWND hwnd, // handle to window
|
||||
UINT uMsg, // WM_TIMER message
|
||||
UINT idEvent, // timer identifier
|
||||
DWORD dwTime // current system time
|
||||
)
|
||||
{
|
||||
SwapSourceFilter();
|
||||
|
||||
// Update the "current file" text message
|
||||
RECT rc;
|
||||
GetWindowRect(hwnd, &rc);
|
||||
InvalidateRect(hwnd, &rc, TRUE);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Name: SwapSourceFilter()
|
||||
// Desc: This routine is used to change the source file in the current graph.
|
||||
// First the graph is stopped, then the current source filter is removed.
|
||||
// The new source filter is added, the output pin on this filter is
|
||||
// rendered, and playback is restarted.
|
||||
//
|
||||
// When this routine is called during initialization, there is no
|
||||
// currently running graph. In that case, Stop becomes a no-op. The source
|
||||
// filter is added to an empty graph. Then during the render call, all
|
||||
// necessary filters required to play this source are added to the graph.
|
||||
//
|
||||
// On subsequent calls, Stopping the graph allows filters to be removed.
|
||||
// When the old source filter is removed, all other filters are still
|
||||
// left in the graph. The new source filter is added, and then the render
|
||||
// operation reconnects the graph. Since all of the necessary filters for
|
||||
// playback are already in the graph (if the two files have the same file
|
||||
// type), these filters are reused. Existing filters in the graph are
|
||||
// always used first, if possible, during a Render operation. This avoids
|
||||
// having to create new filter instances with each change.
|
||||
//------------------------------------------------------------------------------
|
||||
HRESULT SwapSourceFilter(void)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
IPin *pPin = NULL;
|
||||
TCHAR szFilename[MAX_PATH];
|
||||
WCHAR wFileName[MAX_PATH];
|
||||
|
||||
// Determine the file to load based on DirectX Media path (from SDK)
|
||||
_tcscpy( szFilename, DXUtil_GetDXSDKMediaPath() );
|
||||
_tcscat( szFilename, pstrFiles[g_iNextFile % g_iNumFiles]);
|
||||
_tcscpy( g_szCurrentFile, pstrFiles[g_iNextFile % g_iNumFiles]);
|
||||
g_iNextFile++;
|
||||
|
||||
// Make sure that this file exists
|
||||
DWORD dwAttr = GetFileAttributes(szFilename);
|
||||
if (dwAttr == (DWORD) -1)
|
||||
return ERROR_FILE_NOT_FOUND;
|
||||
|
||||
#ifndef UNICODE
|
||||
MultiByteToWideChar(CP_ACP, 0, szFilename, -1, wFileName, MAX_PATH);
|
||||
#else
|
||||
lstrcpy(wFileName, szFilename);
|
||||
#endif
|
||||
|
||||
// OPTIMIZATION OPPORTUNITY
|
||||
// This will open the file, which is expensive. To optimize, this
|
||||
// should be done earlier, ideally as soon as we knew this was the
|
||||
// next file to ensure that the file load doesn't add to the
|
||||
// filter swapping time & cause a hiccup.
|
||||
//
|
||||
// Add the new source filter to the graph. (Graph can still be running)
|
||||
hr = g_pGraphBuilder->AddSourceFilter(wFileName, wFileName, &g_pSourceNext);
|
||||
|
||||
// Get the first output pin of the new source filter. Audio sources
|
||||
// typically have only one output pin, so for most audio cases finding
|
||||
// any output pin is sufficient.
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = g_pSourceNext->FindPin(L"Output", &pPin);
|
||||
}
|
||||
|
||||
// Stop the graph
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = g_pMediaControl->Stop();
|
||||
}
|
||||
|
||||
// Break all connections on the filters. You can do this by adding
|
||||
// and removing each filter in the graph
|
||||
if (SUCCEEDED(hr)) {
|
||||
IEnumFilters *pFilterEnum = NULL;
|
||||
|
||||
if (SUCCEEDED(hr = g_pGraphBuilder->EnumFilters(&pFilterEnum))) {
|
||||
int iFiltCount = 0;
|
||||
int iPos = 0;
|
||||
|
||||
// Need to know how many filters. If we add/remove filters during the
|
||||
// enumeration we'll invalidate the enumerator
|
||||
while (S_OK == pFilterEnum->Skip(1)) {
|
||||
iFiltCount++;
|
||||
}
|
||||
|
||||
// Allocate space, then pull out all of the
|
||||
IBaseFilter **ppFilters = reinterpret_cast<IBaseFilter **>
|
||||
(_alloca(sizeof(IBaseFilter *) * iFiltCount));
|
||||
pFilterEnum->Reset();
|
||||
|
||||
while (S_OK == pFilterEnum->Next(1, &(ppFilters[iPos++]), NULL));
|
||||
SAFE_RELEASE(pFilterEnum);
|
||||
|
||||
for (iPos = 0; iPos < iFiltCount; iPos++) {
|
||||
g_pGraphBuilder->RemoveFilter(ppFilters[iPos]);
|
||||
// Put the filter back, unless it is the old source
|
||||
if (ppFilters[iPos] != g_pSourceCurrent) {
|
||||
g_pGraphBuilder->AddFilter(ppFilters[iPos], NULL);
|
||||
}
|
||||
SAFE_RELEASE(ppFilters[iPos]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We have the new ouput pin. Render it
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = g_pGraphBuilder->Render(pPin);
|
||||
g_pSourceCurrent = g_pSourceNext;
|
||||
g_pSourceNext = NULL;
|
||||
}
|
||||
|
||||
SAFE_RELEASE(pPin);
|
||||
SAFE_RELEASE(g_pSourceNext); // In case of errors
|
||||
|
||||
// Re-seek the graph to the beginning
|
||||
if (SUCCEEDED(hr)) {
|
||||
LONGLONG llPos = 0;
|
||||
hr = g_pMediaSeeking->SetPositions(&llPos, AM_SEEKING_AbsolutePositioning,
|
||||
&llPos, AM_SEEKING_NoPositioning);
|
||||
}
|
||||
|
||||
// Start the graph
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = g_pMediaControl->Run();
|
||||
}
|
||||
|
||||
// Release the old source filter.
|
||||
SAFE_RELEASE(g_pSourceCurrent)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: DXUtil_GetDXSDKMediaPath()
|
||||
// Desc: Returns the DirectX SDK media path
|
||||
//-----------------------------------------------------------------------------
|
||||
const TCHAR* DXUtil_GetDXSDKMediaPath()
|
||||
{
|
||||
static TCHAR strNull[2] = _T("");
|
||||
static TCHAR strPath[MAX_PATH];
|
||||
DWORD dwType;
|
||||
DWORD dwSize = MAX_PATH;
|
||||
HKEY hKey;
|
||||
|
||||
// Open the appropriate registry key
|
||||
LONG lResult = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
|
||||
_T("Software\\Microsoft\\DirectX SDK"),
|
||||
0, KEY_READ, &hKey );
|
||||
if( ERROR_SUCCESS != lResult )
|
||||
return strNull;
|
||||
|
||||
lResult = RegQueryValueEx( hKey, _T("DX81SDK Samples Path"), NULL,
|
||||
&dwType, (BYTE*)strPath, &dwSize );
|
||||
RegCloseKey( hKey );
|
||||
|
||||
if( ERROR_SUCCESS != lResult )
|
||||
return strNull;
|
||||
|
||||
_tcscat( strPath, _T("\\Media\\") );
|
||||
|
||||
return strPath;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
# Microsoft Developer Studio Project File - Name="BGMusic" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=BGMusic - 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 "bgmusic.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 "bgmusic.mak" CFG="BGMusic - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "BGMusic - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "BGMusic - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "BGMusic - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib strmiids.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "BGMusic - 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 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib strmiids.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "BGMusic - Win32 Release"
|
||||
# Name "BGMusic - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\bgmusic.CPP
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\bgmusic.rc
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx.ico
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "BGMusic"=.\bgmusic.DSP - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on bgmusic.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=BGMusic - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to BGMusic - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "BGMusic - Win32 Release" && "$(CFG)" != "BGMusic - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "bgmusic.mak" CFG="BGMusic - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "BGMusic - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "BGMusic - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "BGMusic - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\bgmusic.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\bgmusic.obj"
|
||||
-@erase "$(INTDIR)\bgmusic.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\bgmusic.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\bgmusic.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\bgmusic.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib strmiids.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\bgmusic.pdb" /machine:I386 /out:"$(OUTDIR)\bgmusic.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\bgmusic.obj" \
|
||||
"$(INTDIR)\bgmusic.res"
|
||||
|
||||
"$(OUTDIR)\bgmusic.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "BGMusic - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\bgmusic.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\bgmusic.obj"
|
||||
-@erase "$(INTDIR)\bgmusic.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\bgmusic.exe"
|
||||
-@erase "$(OUTDIR)\bgmusic.ilk"
|
||||
-@erase "$(OUTDIR)\bgmusic.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\bgmusic.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\bgmusic.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib strmiids.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\bgmusic.pdb" /debug /machine:I386 /out:"$(OUTDIR)\bgmusic.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\bgmusic.obj" \
|
||||
"$(INTDIR)\bgmusic.res"
|
||||
|
||||
"$(OUTDIR)\bgmusic.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("bgmusic.dep")
|
||||
!INCLUDE "bgmusic.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "bgmusic.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "BGMusic - Win32 Release" || "$(CFG)" == "BGMusic - Win32 Debug"
|
||||
SOURCE=.\bgmusic.CPP
|
||||
|
||||
"$(INTDIR)\bgmusic.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\bgmusic.rc
|
||||
|
||||
"$(INTDIR)\bgmusic.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
// Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "resource.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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_BGMUSIC ICON DISCARDABLE "directx.ico"
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resrc1.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""resource.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\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 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "BGMusic Applicatoin\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "BGMusic\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2000-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "BGMusic.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,13 @@
|
||||
DirectShow Sample -- BGMusic
|
||||
----------------------------
|
||||
|
||||
This sample shows how to swap source filters in a filter graph. It will
|
||||
cycle through three MP3 files, displaying the name of each file as it is played.
|
||||
The MP3 files used by this sample are located in the Media directory of the
|
||||
DirectX SDK ( <sdk root>\samples\Multimedia\Media ).
|
||||
|
||||
When the application begins, it renders the first audio file in the sequence
|
||||
and sets a timer. Whenever the timer fires, the application removes the current
|
||||
source filter and replaces it with a source filter for the next file.
|
||||
Since the files are all of the same type, there is no need to rebuild the
|
||||
entire graph.
|
||||
@@ -0,0 +1,14 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: Resource.h
|
||||
//
|
||||
// Desc: Header file for DirectShow Background music player
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Resource constants
|
||||
//-----------------------------------------------------------------------------
|
||||
#define IDI_BGMUSIC 10000
|
||||
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="Cutscene" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=Cutscene - 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 "Cutscene.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 "Cutscene.mak" CFG="Cutscene - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Cutscene - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "Cutscene - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Cutscene - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# 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 strmiids.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 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "Cutscene - 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 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# 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 strmiids.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 /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Cutscene - Win32 Release"
|
||||
# Name "Cutscene - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cutscene.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\main.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cutscene.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"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Cutscene"=.\Cutscene.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on Cutscene.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=Cutscene - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to Cutscene - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "Cutscene - Win32 Release" && "$(CFG)" != "Cutscene - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Cutscene.mak" CFG="Cutscene - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Cutscene - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "Cutscene - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "Cutscene - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\Cutscene.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cutscene.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\Cutscene.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\Cutscene.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\Cutscene.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=strmiids.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 /incremental:no /pdb:"$(OUTDIR)\Cutscene.pdb" /machine:I386 /out:"$(OUTDIR)\Cutscene.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cutscene.obj" \
|
||||
"$(INTDIR)\main.obj"
|
||||
|
||||
"$(OUTDIR)\Cutscene.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "Cutscene - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\Cutscene.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cutscene.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\Cutscene.exe"
|
||||
-@erase "$(OUTDIR)\Cutscene.ilk"
|
||||
-@erase "$(OUTDIR)\Cutscene.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\Cutscene.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\Cutscene.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=strmiids.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 /incremental:yes /pdb:"$(OUTDIR)\Cutscene.pdb" /debug /machine:I386 /out:"$(OUTDIR)\Cutscene.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cutscene.obj" \
|
||||
"$(INTDIR)\main.obj"
|
||||
|
||||
"$(OUTDIR)\Cutscene.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("Cutscene.dep")
|
||||
!INCLUDE "Cutscene.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "Cutscene.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "Cutscene - Win32 Release" || "$(CFG)" == "Cutscene - Win32 Debug"
|
||||
SOURCE=.\cutscene.cpp
|
||||
|
||||
"$(INTDIR)\cutscene.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\main.cpp
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,350 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: CutScene.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - simple interactive movie player. Plays
|
||||
// a movie or game cutscene in fullscreen mode. Supports simple user
|
||||
// input to enable ESC, spacebar, or ENTER to quit.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include <dshow.h>
|
||||
#include <stdio.h>
|
||||
#include <atlbase.h>
|
||||
|
||||
#include "cutscene.h"
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
#define KEYBOARD_SAMPLE_FREQ 100 // Sample user input on an interval
|
||||
#define CUTSCENE_NAME TEXT("Cutscene Player Sample")
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
static IGraphBuilder *pGB = NULL;
|
||||
static IMediaControl *pMC = NULL;
|
||||
static IVideoWindow *pVW = NULL;
|
||||
static IMediaEvent *pME = NULL;
|
||||
|
||||
static HWND g_hwndMain=0;
|
||||
static BOOL g_bContinue=TRUE, g_bUserInterruptedPlayback=FALSE;
|
||||
|
||||
|
||||
//
|
||||
// Function prototypes
|
||||
//
|
||||
static HRESULT PlayMedia(LPTSTR lpszMovie, HINSTANCE hInstance);
|
||||
static HRESULT GetInterfaces(void);
|
||||
static HRESULT SetFullscreen(void);
|
||||
static BOOL CreateHiddenWindow( HINSTANCE hInstance, TCHAR *szFile );
|
||||
static LONG WINAPI WindowProc(HWND, UINT, WPARAM, LPARAM);
|
||||
static void CloseApp();
|
||||
static void CleanupInterfaces(void);
|
||||
static void Msg(TCHAR *szFormat, ...);
|
||||
|
||||
|
||||
//
|
||||
// Helper Macros (Jump-If-Failed, Log-If-Failed)
|
||||
//
|
||||
#define RELEASE(i) {if (i) i->Release(); i = NULL;}
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); goto CLEANUP;}
|
||||
|
||||
#define LIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return hr;}
|
||||
|
||||
|
||||
|
||||
HRESULT PlayCutscene(LPTSTR szMovie, HINSTANCE hInstance)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Create the main hidden window to field keyboard input
|
||||
if (!CreateHiddenWindow(hInstance, szMovie))
|
||||
return E_FAIL;
|
||||
|
||||
// Initialize COM
|
||||
if (FAILED(hr = CoInitialize(NULL)))
|
||||
return hr;
|
||||
|
||||
// Get DirectShow interfaces
|
||||
if (FAILED(hr = GetInterfaces()))
|
||||
{
|
||||
CoUninitialize();
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Play the movie / cutscene
|
||||
hr = PlayMedia(szMovie, hInstance);
|
||||
|
||||
// If the user interrupted playback and there was no other error,
|
||||
// return S_FALSE.
|
||||
if ((hr == S_OK) && g_bUserInterruptedPlayback)
|
||||
hr = S_FALSE;
|
||||
|
||||
// Release DirectShow interfaces
|
||||
CleanupInterfaces();
|
||||
CoUninitialize();
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
BOOL CreateHiddenWindow( HINSTANCE hInstance, TCHAR *szFile )
|
||||
{
|
||||
TCHAR szTitle[MAX_PATH];
|
||||
|
||||
// Set up and register window class
|
||||
WNDCLASS wc = {0};
|
||||
wc.lpfnWndProc = (WNDPROC) WindowProc;
|
||||
wc.hInstance = hInstance;
|
||||
wc.lpszClassName = CUTSCENE_NAME;
|
||||
if (!RegisterClass(&wc))
|
||||
return FALSE;
|
||||
|
||||
wsprintf(szTitle, TEXT("%s: %s"), CUTSCENE_NAME, szFile);
|
||||
|
||||
// Create a window of zero size that will serve as the sink for
|
||||
// keyboard input. If this media file has a video component, then
|
||||
// a second ActiveMovie window will be displayed in which the video
|
||||
// will be rendered. Setting keyboard focus on this application window
|
||||
// will allow the user to move the video window around the screen, make
|
||||
// it full screen, resize, center, etc. independent of the application
|
||||
// window. If the media file has only an audio component, then this will
|
||||
// be the only window created.
|
||||
g_hwndMain = CreateWindowEx(
|
||||
0, CUTSCENE_NAME, szTitle,
|
||||
0, // not visible
|
||||
0, 0, 0, 0,
|
||||
NULL, NULL, hInstance, NULL );
|
||||
|
||||
return (g_hwndMain != NULL);
|
||||
}
|
||||
|
||||
|
||||
LONG WINAPI WindowProc( HWND hWnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( message )
|
||||
{
|
||||
// Monitor keystrokes for manipulating video window
|
||||
// and program options
|
||||
case WM_KEYDOWN:
|
||||
switch( wParam )
|
||||
{
|
||||
case VK_ESCAPE:
|
||||
case VK_SPACE:
|
||||
case VK_RETURN:
|
||||
g_bUserInterruptedPlayback = TRUE;
|
||||
CloseApp();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (LONG) DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
HRESULT GetInterfaces(void)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
// Instantiate filter graph interface
|
||||
JIF(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
|
||||
IID_IGraphBuilder, (void **)&pGB));
|
||||
|
||||
// Get interfaces to control playback & screensize
|
||||
JIF(pGB->QueryInterface(IID_IMediaControl, (void **)&pMC));
|
||||
JIF(pGB->QueryInterface(IID_IVideoWindow, (void **)&pVW));
|
||||
|
||||
// Get interface to allow the app to wait for completion of playback
|
||||
JIF(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
|
||||
|
||||
return S_OK;
|
||||
|
||||
// In case of failure, the helper macro jumps here
|
||||
CLEANUP:
|
||||
CleanupInterfaces();
|
||||
return(hr);
|
||||
}
|
||||
|
||||
|
||||
void CleanupInterfaces(void)
|
||||
{
|
||||
// Release the DirectShow interfaces
|
||||
RELEASE(pGB);
|
||||
RELEASE(pMC);
|
||||
RELEASE(pVW);
|
||||
RELEASE(pME);
|
||||
|
||||
DestroyWindow(g_hwndMain);
|
||||
}
|
||||
|
||||
|
||||
void CloseApp()
|
||||
{
|
||||
// Stop playback and exit
|
||||
pMC->Stop();
|
||||
g_bContinue = FALSE;
|
||||
|
||||
PostMessage(g_hwndMain, WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
HRESULT PlayMedia(LPTSTR lpszMovie, HINSTANCE hInstance)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
WCHAR wFileName[MAX_PATH];
|
||||
BOOL bSleep=TRUE;
|
||||
|
||||
wcscpy(wFileName, T2W(lpszMovie));
|
||||
|
||||
// Allow DirectShow to create the FilterGraph for this media file
|
||||
hr = pGB->RenderFile(wFileName, NULL);
|
||||
if (FAILED(hr)) {
|
||||
Msg(TEXT("Failed(0x%08lx) in RenderFile(%s)!\r\n"), hr, lpszMovie);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Set the message drain of the video window to point to our hidden
|
||||
// application window. This allows keyboard input to be transferred
|
||||
// to our main window for processing.
|
||||
//
|
||||
// If this is an audio-only or MIDI file, then put_MessageDrain will fail.
|
||||
//
|
||||
hr = pVW->put_MessageDrain((OAHWND) g_hwndMain);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
Msg(TEXT("Failed(0x%08lx) to set message drain for %s.\r\n\r\n")
|
||||
TEXT("This sample is designed to play videos, but the file selected ")
|
||||
TEXT("has no video component."), hr, lpszMovie);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Set fullscreen
|
||||
hr = SetFullscreen();
|
||||
if (FAILED(hr)) {
|
||||
Msg(TEXT("Failed(%08lx) to set fullscreen!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Display first frame of the movie
|
||||
hr = pMC->Pause();
|
||||
if (FAILED(hr)) {
|
||||
Msg(TEXT("Failed(%08lx) in Pause()!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Start playback
|
||||
hr = pMC->Run();
|
||||
if (FAILED(hr)) {
|
||||
Msg(TEXT("Failed(%08lx) in Run()!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Update state variables
|
||||
g_bContinue = TRUE;
|
||||
|
||||
// Enter a loop of checking for events and sampling keyboard i6nput
|
||||
while (g_bContinue)
|
||||
{
|
||||
MSG msg;
|
||||
long lEventCode, lParam1, lParam2;
|
||||
|
||||
// Reset sleep flag
|
||||
bSleep = TRUE;
|
||||
|
||||
// Has there been a media event? Look for end of stream condition.
|
||||
if(E_ABORT != pME->GetEvent(&lEventCode, (LONG_PTR *) &lParam1,
|
||||
(LONG_PTR *) &lParam2, 0))
|
||||
{
|
||||
// Free the media event resources.
|
||||
hr = pME->FreeEventParams(lEventCode, lParam1, lParam2);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
Msg(TEXT("Failed(%08lx) to free event params (%s)!\r\n"),
|
||||
hr, lpszMovie);
|
||||
}
|
||||
|
||||
// Is this the end of the movie?
|
||||
if (lEventCode == EC_COMPLETE)
|
||||
{
|
||||
g_bContinue = FALSE;
|
||||
bSleep = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Give system threads time to run (and don't sample user input madly)
|
||||
if (bSleep)
|
||||
Sleep(KEYBOARD_SAMPLE_FREQ);
|
||||
|
||||
// Check and process window messages (like our keystrokes)
|
||||
while (PeekMessage (&msg, g_hwndMain, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT SetFullscreen(void)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
LONG lMode;
|
||||
static HWND hDrain=0;
|
||||
|
||||
if (!pVW)
|
||||
return S_FALSE;
|
||||
|
||||
// Read current state
|
||||
LIF(pVW->get_FullScreenMode(&lMode));
|
||||
|
||||
if (lMode == 0) /* OAFALSE */
|
||||
{
|
||||
// Save current message drain
|
||||
LIF(pVW->get_MessageDrain((OAHWND *) &hDrain));
|
||||
|
||||
// Set message drain to application main window
|
||||
LIF(pVW->put_MessageDrain((OAHWND) g_hwndMain));
|
||||
|
||||
// Switch to full-screen mode
|
||||
lMode = -1; /* OATRUE */
|
||||
LIF(pVW->put_FullScreenMode(lMode));
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
void Msg(TCHAR *szFormat, ...)
|
||||
{
|
||||
TCHAR szBuffer[512]; // Large buffer for very long filenames (like with HTTP)
|
||||
|
||||
va_list pArgs;
|
||||
va_start(pArgs, szFormat);
|
||||
_vstprintf(szBuffer, szFormat, pArgs);
|
||||
va_end(pArgs);
|
||||
|
||||
// This sample uses a simple message box to convey warning and error
|
||||
// messages. You may want to display a debug string or suppress messages
|
||||
// altogether, depending on your application.
|
||||
MessageBox(NULL, szBuffer, TEXT("PlayCutscene Error"), MB_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: CutScene.h
|
||||
//
|
||||
// Desc: DirectShow sample code - declarations for simple movie player.
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// Function prototypes
|
||||
//
|
||||
HRESULT PlayCutscene(LPTSTR lpszMovie, HINSTANCE hInstance);
|
||||
@@ -0,0 +1,107 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: Main.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - simple movie player console application.
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// This program uses the PlayCutscene() function provided in cutscene.cpp.
|
||||
// It is only necessary to provide the name of a file and the application's
|
||||
// instance handle.
|
||||
//
|
||||
// If the file was played to the end, PlayCutscene returns S_OK.
|
||||
// If the user interrupted playback, PlayCutscene returns S_FALSE.
|
||||
// Otherwise, PlayCutscene will return an HRESULT error code.
|
||||
//
|
||||
// Usage: cutscene <required file name>
|
||||
//
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cutscene.h"
|
||||
|
||||
#define USAGE \
|
||||
TEXT("Cutscene is a console application that demonstrates\r\n") \
|
||||
TEXT("playing a movie at the beginning of your game.\r\n\r\n") \
|
||||
TEXT("Please provide a valid filename on the command line.\r\n") \
|
||||
TEXT("\r\n Usage: cutscene <filename>\r\n") \
|
||||
|
||||
|
||||
//
|
||||
// Main program code
|
||||
//
|
||||
int APIENTRY
|
||||
WinMain (
|
||||
HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpszMovie,
|
||||
int nCmdShow
|
||||
)
|
||||
{
|
||||
HRESULT hr;
|
||||
TCHAR szMovieName[MAX_PATH];
|
||||
|
||||
// Prevent C4100: unreferenced formal parameter
|
||||
hPrevInstance = hPrevInstance;
|
||||
nCmdShow = nCmdShow;
|
||||
|
||||
#ifdef UNICODE
|
||||
TCHAR szCommandLine[MAX_PATH], *pstrCommandLine=NULL;
|
||||
UNREFERENCED_PARAMETER(lpszMovie);
|
||||
|
||||
// Get the UNICODE command line. This is necessary for UNICODE apps
|
||||
// because the standard WinMain only passes in an LPSTR for command line.
|
||||
lstrcpy(szCommandLine, GetCommandLine());
|
||||
pstrCommandLine = szCommandLine;
|
||||
|
||||
// Skip the first part of the command line, which is the full path
|
||||
// to the exe. If the path contains spaces, it will be contained in quotes,
|
||||
// so the leading and trailing quotes need to be removed.
|
||||
if (*pstrCommandLine == TEXT('\"'))
|
||||
{
|
||||
// Remove the leading quotes
|
||||
pstrCommandLine++;
|
||||
|
||||
// Skip characters until we reach the trailing quotes
|
||||
while (*pstrCommandLine != TEXT('\0') && *pstrCommandLine != TEXT('\"'))
|
||||
pstrCommandLine++;
|
||||
|
||||
// Strip trailing quotes from executable name
|
||||
if( *pstrCommandLine == TEXT('\"'))
|
||||
pstrCommandLine++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Executable name isn't encased in quotes, so just search for the
|
||||
// first space, which indicates the end of the executable name.
|
||||
while (*pstrCommandLine != TEXT('\0') && *pstrCommandLine != TEXT(' '))
|
||||
pstrCommandLine++;
|
||||
}
|
||||
|
||||
// Strip all leading spaces on file name
|
||||
while( *pstrCommandLine == TEXT(' '))
|
||||
pstrCommandLine++;
|
||||
|
||||
lstrcpy(szMovieName, pstrCommandLine);
|
||||
|
||||
#else
|
||||
lstrcpy(szMovieName, lpszMovie);
|
||||
#endif
|
||||
|
||||
// If no filename is specified, show an error message and exit
|
||||
if (szMovieName[0] == TEXT('\0'))
|
||||
{
|
||||
MessageBox(NULL, USAGE, TEXT("Cutscene Error"), MB_OK | MB_ICONERROR);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Play movie
|
||||
hr = PlayCutscene(szMovieName, hInstance);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
DirectShow Sample -- CutScene
|
||||
-----------------------------
|
||||
|
||||
Usage:
|
||||
|
||||
cutscene <media filename>
|
||||
|
||||
Description:
|
||||
|
||||
Cutscene is a simple fullscreen movie player sample that enables you to
|
||||
add movie playback to your application without needing to learn the
|
||||
specifics of DirectShow programming.
|
||||
|
||||
The application's WinMain() calls PlayCutscene(), a generic function that
|
||||
you can use to add easy playback of movies or cutscenes to the beginning
|
||||
of your game. All of the code needed for movie playback is contained
|
||||
within cutscene.cpp and cutscene.h and can be added to your project.
|
||||
|
||||
Cutscene creates a hidden window to handle keyboard input. A user can
|
||||
press SPACE, ENTER, or ESCAPE keys to cause the playback to end.
|
||||
When playback ends, the window is destroyed.
|
||||
|
||||
Return values:
|
||||
|
||||
If movie playback continues to the end without error,
|
||||
PlayCutscene() returns S_OK.
|
||||
|
||||
If movie playback is interrupted by the user, PlayCutscene returns S_FALSE.
|
||||
(S_FALSE is not an error and will not fail in the FAILED() macro.)
|
||||
|
||||
If there is an error, PlayCutscene returns an HRESULT error code.
|
||||
|
||||
@@ -0,0 +1,674 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: DDrawObj.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - implementation of DDrawObject class.
|
||||
//
|
||||
// Copyright (c) 1993-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include <streams.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "DDrawObj.h"
|
||||
#include "VidPlay.h"
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject constructor
|
||||
//
|
||||
CDDrawObject::CDDrawObject(HWND hWndApp)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 3, TEXT("CDDrawObject c-tor entered"))) ;
|
||||
|
||||
m_pDDObject = NULL ;
|
||||
m_pPrimary = NULL ;
|
||||
m_pBackBuff = NULL ;
|
||||
|
||||
// Default colors to be used for filling
|
||||
m_dwScrnColor = RGB(0, 0, 0) ;
|
||||
m_dwVideoKeyColor = RGB(255, 0, 255) ;
|
||||
|
||||
// Rects for the screen area and video area
|
||||
SetRect(&m_RectScrn, 0, 0, 0, 0) ;
|
||||
SetRect(&m_RectVideo, 0, 0, 0, 0) ;
|
||||
|
||||
// some flags, count, messages for buffer flipping
|
||||
m_bInExclMode = FALSE ;
|
||||
m_iCount = 0 ;
|
||||
m_bFrontBuff = TRUE ;
|
||||
m_szFrontMsg = TEXT("Front Buffer" );
|
||||
m_szBackMsg = TEXT("Back Buffer" );
|
||||
m_szDirection = TEXT("Press the 'Arrow' keys to move the ball. Hit 'Esc' to stop playback." );
|
||||
|
||||
// Create brush and pen for drawing the filled ball
|
||||
LOGBRUSH lb ;
|
||||
lb.lbStyle = BS_HATCHED ;
|
||||
lb.lbColor = RGB(0, 255, 0) ;
|
||||
lb.lbHatch = HS_CROSS ;
|
||||
m_hBrush = CreateBrushIndirect(&lb) ;
|
||||
ASSERT(NULL != m_hBrush) ;
|
||||
|
||||
m_hPen = CreatePen(PS_SOLID, 2, RGB(0, 0, 255)) ;
|
||||
ASSERT(NULL != m_hPen) ;
|
||||
|
||||
HRESULT hr=S_OK ;
|
||||
m_pOverlayCallback = (IDDrawExclModeVideoCallback *) new COverlayCallback(this, hWndApp, &hr) ;
|
||||
ASSERT(SUCCEEDED(hr)) ;
|
||||
m_bOverlayVisible = FALSE ; // don't draw color key until it's OK-ed by OverlayMixer
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject destructor
|
||||
//
|
||||
CDDrawObject::~CDDrawObject(void)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 3, TEXT("CDDrawObject d-tor entered"))) ;
|
||||
|
||||
// Let go of the overlay notification callback object now
|
||||
if (m_pOverlayCallback)
|
||||
m_pOverlayCallback->Release() ; // done with callback object now
|
||||
|
||||
// delete the pen and brush we created for drawing the ball
|
||||
if (m_hPen)
|
||||
DeleteObject(m_hPen) ;
|
||||
if (m_hBrush)
|
||||
DeleteObject(m_hBrush) ;
|
||||
|
||||
if (m_pBackBuff)
|
||||
m_pBackBuff->Release() ;
|
||||
if (m_pPrimary)
|
||||
m_pPrimary->Release() ;
|
||||
|
||||
if (m_pDDObject)
|
||||
m_pDDObject->Release() ;
|
||||
|
||||
DbgLog((LOG_TRACE, 3, TEXT("CDDrawObject d-tor exiting..."))) ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::Initialize(): Just creates a DDraw object.
|
||||
//
|
||||
BOOL CDDrawObject::Initialize(HWND hWndApp)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::Initialize() entered"))) ;
|
||||
|
||||
HRESULT hr = DirectDrawCreate(NULL, &m_pDDObject, NULL) ;
|
||||
if (FAILED(hr) || NULL == m_pDDObject)
|
||||
{
|
||||
MessageBox(hWndApp,
|
||||
TEXT("Can't create a DirectDraw object.\nPress OK to end the app."),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
#define SCRN_WIDTH 800
|
||||
#define SCRN_HEIGHT 600
|
||||
#define SCRN_BITDEPTH 8
|
||||
|
||||
//
|
||||
// CDDrawObject::StartExclusiveMode(): Gets into fullscreen exclusive mode, sets
|
||||
// display mode to 800x600x8, creates a flipping primary surface with one back
|
||||
// buffer, gets the surface size and inits some variables.
|
||||
//
|
||||
// NOTE: Please don't bother about the "#ifndef NOFLIP"s. They were there
|
||||
// for testing.
|
||||
//
|
||||
HRESULT CDDrawObject::StartExclusiveMode(HWND hWndApp)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::StartExclusiveMode() entered"))) ;
|
||||
|
||||
HRESULT hr ;
|
||||
DDSURFACEDESC ddsd ;
|
||||
DDSCAPS ddscaps ;
|
||||
|
||||
if (! Initialize(hWndApp) )
|
||||
return E_FAIL ;
|
||||
|
||||
// Get into fullscreen exclusive mode
|
||||
#ifndef NOFLIP
|
||||
hr = m_pDDObject->SetCooperativeLevel(hWndApp,
|
||||
DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(hWndApp,
|
||||
TEXT("SetCooperativeLevel() failed to go into exclusive mode"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
return hr ;
|
||||
}
|
||||
#else
|
||||
hr = m_pDDObject->SetCooperativeLevel(hWndApp, DDSCL_NORMAL) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(hWndApp,
|
||||
TEXT("SetCooperativeLevel() failed to go into normal mode"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
return hr ;
|
||||
}
|
||||
#endif // NOFLIP
|
||||
|
||||
#ifndef NOFLIP
|
||||
hr = m_pDDObject->SetDisplayMode(SCRN_WIDTH, SCRN_HEIGHT, SCRN_BITDEPTH) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("ERROR: SetDisplayMode failed (Error 0x%lx)"), hr)) ;
|
||||
MessageBox(hWndApp, TEXT("SetDisplayMode(640, 480, 8) failed"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
return hr ;
|
||||
}
|
||||
#endif // NOFLIP
|
||||
|
||||
// Create the primary surface with 1 back buffer
|
||||
ZeroMemory(&ddsd, sizeof(ddsd)) ;
|
||||
ddsd.dwSize = sizeof(ddsd) ;
|
||||
|
||||
#ifndef NOFLIP
|
||||
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT ;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
|
||||
DDSCAPS_FLIP |
|
||||
DDSCAPS_COMPLEX ;
|
||||
ddsd.dwBackBufferCount = 1 ;
|
||||
#else
|
||||
ddsd.dwFlags = DDSD_CAPS ;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE ;
|
||||
#endif // NOFLIP
|
||||
|
||||
hr = m_pDDObject->CreateSurface(&ddsd, &m_pPrimary, NULL) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
#ifndef NOFLIP
|
||||
MessageBox(hWndApp, TEXT("CreateSurface(Primary, flip(1), complex) failed"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
#else
|
||||
MessageBox(hWndApp, TEXT("CreateSurface(Primary, noflip, no backbuffer) failed"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
#endif // NOFLIP
|
||||
return hr ;
|
||||
}
|
||||
|
||||
#ifndef NOFLIP
|
||||
// Get a pointer to the back buffer
|
||||
ddscaps.dwCaps = DDSCAPS_BACKBUFFER ;
|
||||
hr = m_pPrimary->GetAttachedSurface(&ddscaps, &m_pBackBuff) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(hWndApp, TEXT("GetAttachedSurface() failed to get back buffer"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
return hr ;
|
||||
}
|
||||
#endif // NOFLIP
|
||||
|
||||
// Get the screen size and save it as a rect
|
||||
ZeroMemory(&ddsd, sizeof(ddsd)) ;
|
||||
ddsd.dwSize = sizeof(ddsd) ;
|
||||
hr = m_pPrimary->GetSurfaceDesc(&ddsd) ;
|
||||
if (! (SUCCEEDED(hr) && (ddsd.dwFlags & DDSD_WIDTH) && (ddsd.dwFlags & DDSD_HEIGHT)) )
|
||||
{
|
||||
MessageBox(hWndApp, TEXT("GetSurfaceDesc() failed to get surface width & height"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
return hr ;
|
||||
}
|
||||
|
||||
SetRect(&m_RectScrn, 0, 0, ddsd.dwWidth, ddsd.dwHeight) ;
|
||||
|
||||
// Reset some buffer drawing flags, values etc.
|
||||
m_iCount = 0 ;
|
||||
m_bFrontBuff = TRUE ;
|
||||
m_bInExclMode = TRUE ;
|
||||
|
||||
return S_OK ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::StopExclusiveMode(): Releases primary buffer, exits
|
||||
// exclusive mode, resets some variables/flags.
|
||||
//
|
||||
HRESULT CDDrawObject::StopExclusiveMode(HWND hWndApp)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::StopExclusiveMode() entered"))) ;
|
||||
|
||||
HRESULT hr ;
|
||||
|
||||
if (m_pBackBuff)
|
||||
{
|
||||
hr = m_pBackBuff->Release() ; // release back buffer
|
||||
m_pBackBuff = NULL ; // no back buffer anymore
|
||||
}
|
||||
|
||||
#ifndef NOFLIP
|
||||
if (m_pDDObject)
|
||||
{
|
||||
// Restore display to previous mode (set with SetDisplayMode())
|
||||
hr = m_pDDObject->RestoreDisplayMode();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("ERROR: RestoreDisplayMode failed (Error 0x%lx)"), hr)) ;
|
||||
MessageBox(hWndApp, TEXT("RestoreDisplayMode failed"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
}
|
||||
}
|
||||
#endif // NOFLIP
|
||||
|
||||
// Release the primary surface (and attached buffer with it)
|
||||
if (m_pPrimary)
|
||||
{
|
||||
hr = m_pPrimary->Release() ; // release primary surface
|
||||
m_pPrimary = NULL ;
|
||||
}
|
||||
|
||||
// Get out of fullscreen exclusive mode
|
||||
if (m_pDDObject)
|
||||
{
|
||||
hr = m_pDDObject->SetCooperativeLevel(hWndApp, DDSCL_NORMAL) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(hWndApp,
|
||||
TEXT("SetCooperativeLevel() failed to go back to normal mode"),
|
||||
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
|
||||
return hr ;
|
||||
}
|
||||
|
||||
m_pDDObject->Release() ; // now release the DDraw object
|
||||
m_pDDObject = NULL ; // no more DDraw object
|
||||
}
|
||||
|
||||
// Reset the color key and screen, video rects.
|
||||
m_dwVideoKeyColor = RGB(255, 0, 255) ;
|
||||
SetRect(&m_RectScrn, 0, 0, 0, 0) ;
|
||||
SetRect(&m_RectVideo, 0, 0, 0, 0) ;
|
||||
|
||||
m_bInExclMode = FALSE ;
|
||||
|
||||
return S_OK ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::DrawOnSurface(): Private method to draw stuff on back buffer
|
||||
//
|
||||
void CDDrawObject::DrawOnSurface(LPDIRECTDRAWSURFACE pSurface)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::DrawOnSurface() entered"))) ;
|
||||
|
||||
HDC hDC ;
|
||||
TCHAR achBuffer[30] ;
|
||||
|
||||
if (DD_OK == pSurface->GetDC(&hDC))
|
||||
{
|
||||
// write fonr/back to show buffer flipping
|
||||
SetBkColor(hDC, RGB(0, 0, 255)) ;
|
||||
SetTextColor(hDC, RGB(255, 255, 0)) ;
|
||||
wsprintf(achBuffer, TEXT(" %-12s: %6.6d "),
|
||||
m_bFrontBuff ? m_szFrontMsg : m_szBackMsg, m_iCount) ;
|
||||
TextOut(hDC, 20, 10, achBuffer, lstrlen(achBuffer)) ;
|
||||
|
||||
// Write the instructions
|
||||
SetBkColor(hDC, RGB(0, 0, 0)) ;
|
||||
SetTextColor(hDC, RGB(0, 255, 255)) ;
|
||||
TextOut(hDC, m_RectScrn.left + 100, m_RectScrn.bottom - 20, m_szDirection, lstrlen(m_szDirection)) ;
|
||||
|
||||
// Draw the ball on screen now
|
||||
HBRUSH hBrush = (HBRUSH) SelectObject(hDC, m_hBrush) ; // select special brush
|
||||
HPEN hPen = (HPEN) SelectObject(hDC, m_hPen) ; // select special pen
|
||||
Ellipse(hDC, m_iBallCenterX - BALL_RADIUS, m_iBallCenterY - BALL_RADIUS,
|
||||
m_iBallCenterX + BALL_RADIUS, m_iBallCenterY + BALL_RADIUS) ;
|
||||
SelectObject(hDC, hBrush) ; // restore original brush
|
||||
SelectObject(hDC, hPen) ; // restore original pen
|
||||
|
||||
pSurface->ReleaseDC(hDC) ; // done now; let go of the DC
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::ConvertColorRefToPhysColor(): Converts a COLORREF to a
|
||||
// DWORD physical color value based on current display mode.
|
||||
//
|
||||
// NOTE: This method is useful ONLY if you want to get the COLORREF from
|
||||
// OverlayMixer (rather than the physical color as a DWORD) and convert
|
||||
// it yourself. But OverlayMixer does it for you anyway; so the utility
|
||||
// of this method is quite minimal.
|
||||
//
|
||||
HRESULT CDDrawObject::ConvertColorRefToPhysColor(COLORREF rgb, DWORD *pdwPhysColor)
|
||||
{
|
||||
HRESULT hr ;
|
||||
COLORREF rgbCurr ;
|
||||
HDC hDC ;
|
||||
DDSURFACEDESC ddsd ;
|
||||
|
||||
ASSERT(rgb != CLR_INVALID) ;
|
||||
|
||||
// use GDI SetPixel to color match for us
|
||||
hr = m_pBackBuff->GetDC(&hDC) ;
|
||||
if (DD_OK != hr)
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("m_pBackBuff->GetDC() failed (Error 0x%lx)"), hr)) ;
|
||||
return hr ;
|
||||
}
|
||||
rgbCurr = GetPixel(hDC, 0, 0) ; // save current pixel value
|
||||
SetPixel(hDC, 0, 0, rgb) ; // set our value
|
||||
m_pBackBuff->ReleaseDC(hDC) ;
|
||||
|
||||
// now lock the surface so we can read back the converted color
|
||||
ZeroMemory(&ddsd, sizeof(ddsd)) ;
|
||||
ddsd.dwSize = sizeof(ddsd) ;
|
||||
while (DDERR_WASSTILLDRAWING == (hr = m_pBackBuff->Lock(NULL, &ddsd, 0, NULL))) // until unlocked...
|
||||
; // ...just wait
|
||||
|
||||
if (DD_OK == hr)
|
||||
{
|
||||
// get DWORD
|
||||
*pdwPhysColor = *(DWORD *) ddsd.lpSurface ;
|
||||
|
||||
// mask it to bpp
|
||||
if (ddsd.ddpfPixelFormat.dwRGBBitCount < 32)
|
||||
*pdwPhysColor &= (1 << ddsd.ddpfPixelFormat.dwRGBBitCount) - 1 ;
|
||||
m_pBackBuff->Unlock(NULL) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("m_pBackBuff->Lock() failed (Error 0x%lx)"), hr)) ;
|
||||
return hr ;
|
||||
}
|
||||
|
||||
// now restote the pixel to the color that was there
|
||||
hr = m_pBackBuff->GetDC(&hDC) ;
|
||||
if (DD_OK != hr)
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("m_pBackBuff->GetDC() failed (Error 0x%lx)"), hr)) ;
|
||||
return hr ;
|
||||
}
|
||||
SetPixel(hDC, 0, 0, rgbCurr) ;
|
||||
m_pBackBuff->ReleaseDC(hDC) ;
|
||||
|
||||
return S_OK ;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
//
|
||||
// CDDrawObject::SetColorKey(): Creates a DWORD physical color out COLORREF.
|
||||
//
|
||||
// NOTE: This method is useful only if you want to do the conversion. We have
|
||||
// defined an inline version in ddrawobj.h file.
|
||||
//
|
||||
HRESULT CDDrawObject::SetColorKey(COLORKEY *pColorKey)
|
||||
{
|
||||
if (NULL == pColorKey)
|
||||
return E_INVALIDARG ;
|
||||
|
||||
DWORD dwPhysColor ;
|
||||
HRESULT hr = ConvertColorRefToPhysColor(pColorKey->LowColorValue, &dwPhysColor) ;
|
||||
if (FAILED(hr))
|
||||
return hr ;
|
||||
|
||||
m_dwVideoKeyColor = dwPhysColor ;
|
||||
return S_OK ;
|
||||
}
|
||||
#endif // #if 0
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::FillSurface(): Private method to fill the back buffer with black
|
||||
// color and put the color key in teh video area.
|
||||
//
|
||||
// NOTE: Re-filling the back buffer every time is required ONLY IF the video
|
||||
// position keeps changing. Otherwise setting it once should be fine.
|
||||
//
|
||||
HRESULT CDDrawObject::FillSurface(IDirectDrawSurface *pDDSurface)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::FillSurface() entered"))) ;
|
||||
|
||||
if (NULL == pDDSurface)
|
||||
return E_INVALIDARG ;
|
||||
|
||||
// Repaint the whole specified surface
|
||||
HRESULT hr ;
|
||||
DDBLTFX ddFX ;
|
||||
ZeroMemory(&ddFX, sizeof(ddFX)) ;
|
||||
ddFX.dwSize = sizeof(ddFX) ;
|
||||
ddFX.dwFillColor = m_dwScrnColor ;
|
||||
|
||||
hr = pDDSurface->Blt(&m_RectScrn, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddFX) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("pDDSurface->Blt for screen failed (Error 0x%lx)"), hr)) ;
|
||||
DbgLog((LOG_ERROR, 0, TEXT("Destination Rect: (%ld, %ld, %ld, %ld), Color = 0x%lx"),
|
||||
m_RectScrn.left, m_RectScrn.top, m_RectScrn.right, m_RectScrn.bottom, m_dwScrnColor)) ;
|
||||
return hr ;
|
||||
}
|
||||
|
||||
// Draw color key on the video area of given surface, ONLY IF we are supposed
|
||||
// to paint color key in the video area.
|
||||
if (m_bOverlayVisible)
|
||||
{
|
||||
ddFX.dwFillColor = m_dwVideoKeyColor ;
|
||||
hr = pDDSurface->Blt(&m_RectVideo, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddFX) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("pDDSurface->Blt for video failed (Error 0x%lx)"), hr)) ;
|
||||
DbgLog((LOG_ERROR, 0, TEXT("Destination Rect: (%ld, %ld, %ld, %ld), Color = 0x%lx"),
|
||||
m_RectVideo.left, m_RectVideo.top, m_RectVideo.right, m_RectVideo.bottom,
|
||||
m_dwVideoKeyColor)) ;
|
||||
return hr ;
|
||||
}
|
||||
}
|
||||
else
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Color keying of video area skipped"))) ;
|
||||
|
||||
return S_OK ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::UpdateAndFlipSurfaces(): Prepares the back buffer and flips.
|
||||
//
|
||||
HRESULT CDDrawObject::UpdateAndFlipSurfaces(void)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::UpdateAndFlipSurfaces() entered"))) ;
|
||||
|
||||
// Draw screen and color key on the current back buffer
|
||||
HRESULT hr = FillSurface(m_pBackBuff) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
DbgLog((LOG_ERROR, 1, TEXT("UpdateAndFlipSurfaces() skipped as FillSurface() failed"), hr)) ;
|
||||
return hr ; // or return S_OK??
|
||||
}
|
||||
|
||||
IncCount() ; // increment flip count first
|
||||
m_bFrontBuff = !m_bFrontBuff ; // toggle flag
|
||||
DrawOnSurface(m_pBackBuff) ; // draw next text on the back buffer
|
||||
|
||||
// Keep trying to flip the buffers until successful
|
||||
while (1)
|
||||
{
|
||||
hr = m_pPrimary->Flip(NULL, 0) ; // flip the surfaces
|
||||
if (DD_OK == hr) // success!!
|
||||
{
|
||||
break ;
|
||||
}
|
||||
if (DDERR_SURFACELOST == hr) // surface lost; try to restore
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("DirectDraw surface was lost. Trying to restore..."))) ;
|
||||
hr = m_pPrimary->Restore() ;
|
||||
if (DD_OK != hr) // couldn't restore surface
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("IDirectDrawSurface::Restore() failed (Error 0x%lx)"), hr)) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if (DDERR_WASSTILLDRAWING != hr) // some weird error -- bail out
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("IDirectDrawSurface::Flip() failed (Error 0x%lx)"), hr)) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
return hr ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::SetVideoPosition(): Receives the video position in terms of screen
|
||||
// coordinates.
|
||||
//
|
||||
void CDDrawObject::SetVideoPosition(DWORD dwVideoLeft, DWORD dwVideoTop,
|
||||
DWORD dwVideoWidth, DWORD dwVideoHeight)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::SetVideoPosition() entered"))) ;
|
||||
|
||||
SetRect(&m_RectVideo, dwVideoLeft, dwVideoTop, dwVideoLeft + dwVideoWidth,
|
||||
dwVideoTop + dwVideoHeight) ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::SetBallPosition(): Uses the video position to initialize the ball's
|
||||
// position to the center of the video.
|
||||
//
|
||||
void CDDrawObject::SetBallPosition(DWORD dwVideoLeft, DWORD dwVideoTop,
|
||||
DWORD dwVideoWidth, DWORD dwVideoHeight)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::SetBallPosition() entered"))) ;
|
||||
|
||||
// Place the ball at the middle of video on start
|
||||
m_iBallCenterX = dwVideoLeft + dwVideoWidth / 2 ;
|
||||
m_iBallCenterY = dwVideoTop + dwVideoHeight / 2 ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CDDrawObject::MoveBallPosition(): Moves the ball L/R/U/D and keeps it within
|
||||
// the video area..
|
||||
//
|
||||
void CDDrawObject::MoveBallPosition(int iDirX, int iDirY)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("CDDrawObject::MoveBallPosition(%d, %d) entered"),
|
||||
iDirX, iDirY)) ;
|
||||
|
||||
m_iBallCenterX += iDirX ;
|
||||
m_iBallCenterY += iDirY ;
|
||||
|
||||
// Keep the ball inside the video rect
|
||||
if (m_iBallCenterX < m_RectVideo.left + BALL_RADIUS)
|
||||
m_iBallCenterX = m_RectVideo.left + BALL_RADIUS ;
|
||||
else if (m_iBallCenterX > m_RectVideo.right - BALL_RADIUS)
|
||||
m_iBallCenterX = m_RectVideo.right - BALL_RADIUS ;
|
||||
|
||||
if (m_iBallCenterY < m_RectVideo.top + BALL_RADIUS)
|
||||
m_iBallCenterY = m_RectVideo.top + BALL_RADIUS ;
|
||||
else if (m_iBallCenterY > m_RectVideo.bottom - BALL_RADIUS)
|
||||
m_iBallCenterY = m_RectVideo.bottom - BALL_RADIUS ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Overlay Callback object implementation
|
||||
//
|
||||
COverlayCallback::COverlayCallback(CDDrawObject *pDDrawObj, HWND hWndApp, HRESULT *phr) :
|
||||
CUnknown("Overlay Callback Object", NULL, phr),
|
||||
m_pDDrawObj(pDDrawObj),
|
||||
m_hWndApp(hWndApp)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("COverlayCallback::COverlayCallback() entered"))) ;
|
||||
ASSERT(m_pDDrawObj) ;
|
||||
AddRef() ; // increment ref count for itself
|
||||
}
|
||||
|
||||
|
||||
COverlayCallback::~COverlayCallback()
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("COverlayCallback::~COverlayCallback() entered"))) ;
|
||||
}
|
||||
|
||||
|
||||
HRESULT COverlayCallback::OnUpdateOverlay(BOOL bBefore,
|
||||
DWORD dwFlags,
|
||||
BOOL bOldVisible,
|
||||
const RECT *prcSrcOld,
|
||||
const RECT *prcDestOld,
|
||||
BOOL bNewVisible,
|
||||
const RECT *prcSrcNew,
|
||||
const RECT *prcDestNew)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("COverlayCallback::OnUpdateOverlay(%s, ...) entered"),
|
||||
bBefore ? "TRUE" : "FALSE")) ;
|
||||
|
||||
if (NULL == m_pDDrawObj)
|
||||
{
|
||||
DbgLog((LOG_ERROR, 1, TEXT("ERROR: NULL DDraw object pointer was specified"))) ;
|
||||
return E_POINTER ;
|
||||
}
|
||||
|
||||
if (bBefore) // overlay is going to be updated
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Just turn off color keying and return"))) ;
|
||||
m_pDDrawObj->SetOverlayState(FALSE) ; // don't paint color key in video's position
|
||||
#ifndef NOFLIP
|
||||
m_pDDrawObj->UpdateAndFlipSurfaces() ; // flip the surface so that video doesn't show anymore
|
||||
#endif // NOFLIP
|
||||
return S_OK ;
|
||||
}
|
||||
|
||||
//
|
||||
// After overlay has been updated. Turn on/off overlay color keying based on
|
||||
// flags and use new source/dest position etc.
|
||||
//
|
||||
if (dwFlags & (AM_OVERLAY_NOTIFY_VISIBLE_CHANGE |
|
||||
AM_OVERLAY_NOTIFY_SOURCE_CHANGE |
|
||||
AM_OVERLAY_NOTIFY_DEST_CHANGE)) // it's a valid flag
|
||||
m_pDDrawObj->SetOverlayState(bNewVisible) ; // paint/don't paint color key based on param
|
||||
|
||||
if (dwFlags & AM_OVERLAY_NOTIFY_VISIBLE_CHANGE) // overlay visibility state change
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT(".._NOTIFY_VISIBLE_CHANGE from %s to %s"),
|
||||
bOldVisible ? "TRUE" : "FALSE", bNewVisible ? "TRUE" : "FALSE")) ;
|
||||
}
|
||||
|
||||
if (dwFlags & AM_OVERLAY_NOTIFY_SOURCE_CHANGE) // overlay source rect change
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT(".._NOTIFY_SOURCE_CHANGE from (%ld, %ld, %ld, %ld) to (%ld, %ld, %ld, %ld)"),
|
||||
prcSrcOld->left, prcSrcOld->top, prcSrcOld->right, prcSrcOld->bottom,
|
||||
prcSrcNew->left, prcSrcNew->top, prcSrcNew->right, prcSrcNew->bottom)) ;
|
||||
}
|
||||
|
||||
if (dwFlags & AM_OVERLAY_NOTIFY_DEST_CHANGE) // overlay destination rect change
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT(".._NOTIFY_DEST_CHANGE from (%ld, %ld, %ld, %ld) to (%ld, %ld, %ld, %ld)"),
|
||||
prcDestOld->left, prcDestOld->top, prcDestOld->right, prcDestOld->bottom,
|
||||
prcDestNew->left, prcDestNew->top, prcDestNew->right, prcDestNew->bottom)) ;
|
||||
m_pDDrawObj->SetVideoPosition(prcDestNew->left, prcDestNew->top,
|
||||
RECTWIDTH(*prcDestNew), RECTHEIGHT(*prcDestNew)) ;
|
||||
}
|
||||
|
||||
return S_OK ;
|
||||
}
|
||||
|
||||
|
||||
HRESULT COverlayCallback::OnUpdateColorKey(COLORKEY const *pKey,
|
||||
DWORD dwColor)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("COverlayCallback::OnUpdateColorKey(.., 0x%lx) entered"), dwColor)) ;
|
||||
|
||||
return S_OK ;
|
||||
}
|
||||
|
||||
|
||||
HRESULT COverlayCallback::OnUpdateSize(DWORD dwWidth, DWORD dwHeight,
|
||||
DWORD dwARWidth, DWORD dwARHeight)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("COverlayCallback::OnUpdateSize(%lu, %lu, %lu, %lu) entered"),
|
||||
dwWidth, dwHeight, dwARWidth, dwARHeight)) ;
|
||||
|
||||
PostMessage(m_hWndApp, WM_SIZE_CHANGE, 0, 0) ;
|
||||
|
||||
return S_OK ;
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: DDrawObj.h
|
||||
//
|
||||
// Desc: DirectShow sample code - DDraw Object class header file.
|
||||
//
|
||||
// Copyright (c) 1993-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// #define NOFLIP 1 /* for debugging */
|
||||
|
||||
|
||||
// Define ball radius
|
||||
#define BALL_RADIUS 40
|
||||
#define BALL_STEP 4
|
||||
|
||||
//
|
||||
// Some macros
|
||||
//
|
||||
#define RECTWIDTH(rect) ((rect).right - (rect).left)
|
||||
#define RECTHEIGHT(rect) ((rect).bottom - (rect).top)
|
||||
|
||||
// forward declaration
|
||||
class COverlayCallback ;
|
||||
|
||||
//
|
||||
// DDraw object class to paint color key, flip etc etc.
|
||||
//
|
||||
class CDDrawObject {
|
||||
public: // public methods for Windows structure to call
|
||||
CDDrawObject(HWND hWndApp) ;
|
||||
~CDDrawObject(void) ;
|
||||
|
||||
BOOL Initialize(HWND hWndApp) ;
|
||||
HRESULT StartExclusiveMode(HWND hWndApp) ;
|
||||
HRESULT StopExclusiveMode(HWND hWndApp) ;
|
||||
HRESULT UpdateAndFlipSurfaces(void) ;
|
||||
void SetVideoPosition(DWORD dwVideoLeft, DWORD dwVideoTop,
|
||||
DWORD dwVideoWidth, DWORD dwVideoHeight) ;
|
||||
void SetBallPosition(DWORD dwVideoLeft, DWORD dwVideoTop,
|
||||
DWORD dwVideoWidth, DWORD dwVideoHeight) ;
|
||||
void MoveBallPosition(int iDirX, int iDirY) ;
|
||||
inline void SetColorKey(DWORD dwColorKey) { m_dwVideoKeyColor = dwColorKey ; } ;
|
||||
inline void GetScreenRect(RECT *pRect) { *pRect = m_RectScrn ; } ;
|
||||
inline BOOL IsInExclusiveMode(void) { return m_bInExclMode ; } ;
|
||||
inline LPDIRECTDRAW GetDDObject(void) { return m_pDDObject ; } ;
|
||||
inline LPDIRECTDRAWSURFACE GetDDPrimary(void) { return m_pPrimary ; } ;
|
||||
inline void SetOverlayState(BOOL bState) { m_bOverlayVisible = bState ; } ;
|
||||
inline IDDrawExclModeVideoCallback * GetCallbackInterface(void) { return m_pOverlayCallback ; } ;
|
||||
|
||||
private: // private helper methods for the class' own use
|
||||
HRESULT FillSurface(IDirectDrawSurface *pDDSurface) ;
|
||||
void DrawOnSurface(LPDIRECTDRAWSURFACE pSurface) ;
|
||||
HRESULT ConvertColorRefToPhysColor(COLORREF rgb, DWORD *pdwPhysColor) ;
|
||||
inline DWORD GetColorKey(DWORD dwColorKey) { return m_dwVideoKeyColor ; } ;
|
||||
inline void IncCount(void) { m_iCount++ ; } ;
|
||||
inline int GetCount(void) { return m_iCount ; } ;
|
||||
|
||||
private: // internal state info
|
||||
LPDIRECTDRAW m_pDDObject ; // DirectDraw interface
|
||||
LPDIRECTDRAWSURFACE m_pPrimary ; // primary surface
|
||||
LPDIRECTDRAWSURFACE m_pBackBuff ; // back buffer attached to primary
|
||||
|
||||
BOOL m_bInExclMode ; // Are we in exclusive mode now?
|
||||
RECT m_RectScrn ; // whole screen as a rect
|
||||
RECT m_RectVideo ; // current video position as rect
|
||||
DWORD m_dwScrnColor ; // physical color for surface filling
|
||||
DWORD m_dwVideoKeyColor ; // physical color for color keying video area
|
||||
int m_iCount ; // flip count
|
||||
int m_iBallCenterX ; // X-coord of ball's center
|
||||
int m_iBallCenterY ; // Y-coord of ball's center
|
||||
BOOL m_bFrontBuff ; // draw on front (or back) buffer?
|
||||
LPTSTR m_szFrontMsg ; // front surface string ("Front Buffer")
|
||||
LPTSTR m_szBackMsg ; // back surface string ("Back Buffer")
|
||||
LPTSTR m_szDirection ; // Direction string for users
|
||||
HPEN m_hPen ; // pen for drawing outline of the ball
|
||||
HBRUSH m_hBrush ; // brush for filling the ball
|
||||
BOOL m_bOverlayVisible ; // is overlay visible?
|
||||
IDDrawExclModeVideoCallback *m_pOverlayCallback ; // overlay callback handler interface
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Overlay callback handler object class
|
||||
//
|
||||
class COverlayCallback : public CUnknown, public IDDrawExclModeVideoCallback
|
||||
{
|
||||
public:
|
||||
COverlayCallback(CDDrawObject *pDDrawObj, HWND hWndApp, HRESULT *phr) ;
|
||||
~COverlayCallback() ;
|
||||
|
||||
DECLARE_IUNKNOWN
|
||||
//
|
||||
// IDDrawExclModeVideoCallback interface methods
|
||||
//
|
||||
STDMETHODIMP OnUpdateOverlay(BOOL bBefore,
|
||||
DWORD dwFlags,
|
||||
BOOL bOldVisible,
|
||||
const RECT *prcSrcOld,
|
||||
const RECT *prcDestOld,
|
||||
BOOL bNewVisible,
|
||||
const RECT *prcSrcNew,
|
||||
const RECT *prcDestNew) ;
|
||||
|
||||
STDMETHODIMP OnUpdateColorKey(COLORKEY const *pKey,
|
||||
DWORD dwColor) ;
|
||||
|
||||
STDMETHODIMP OnUpdateSize(DWORD dwWidth, DWORD dwHeight,
|
||||
DWORD dwARWidth, DWORD dwARHeight) ;
|
||||
|
||||
private:
|
||||
CDDrawObject *m_pDDrawObj ;
|
||||
HWND m_hWndApp ;
|
||||
} ;
|
||||
@@ -0,0 +1,871 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: DDrawXcl.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - DDraw Exclusive Mode Video Playback
|
||||
// test/sample application.
|
||||
//
|
||||
// Copyright (c) 1993-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include <streams.h>
|
||||
#include <windows.h>
|
||||
#include <commdlg.h>
|
||||
|
||||
#include <DVDEvCod.h>
|
||||
#include "VidPlay.h"
|
||||
#include "DDrawObj.h"
|
||||
#include "DDrawXcl.h"
|
||||
|
||||
//
|
||||
// WinMain(): Entry point to our sample app.
|
||||
//
|
||||
int APIENTRY WinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
MSG msg ;
|
||||
HACCEL hAccelTable ;
|
||||
|
||||
DbgInitialise(hInstance) ;
|
||||
|
||||
CoInitialize(NULL) ;
|
||||
|
||||
ghInstance = hInstance ;
|
||||
LoadString(ghInstance, IDS_APP_TITLE, gszAppTitle, 100) ;
|
||||
LoadString(ghInstance, IDS_APP_NAME, gszAppName, 10) ;
|
||||
|
||||
if (! InitApplication() )
|
||||
{
|
||||
DbgTerminate() ;
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
if (! InitInstance(nCmdShow) )
|
||||
{
|
||||
DbgTerminate() ;
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
hAccelTable = LoadAccelerators(hInstance, gszAppName) ;
|
||||
|
||||
//
|
||||
// Create a DDraw object and init it
|
||||
//
|
||||
gpDDrawObj = new CDDrawObject(ghWndApp) ;
|
||||
if (NULL == gpDDrawObj)
|
||||
{
|
||||
DbgTerminate() ;
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
gpPlayer = NULL ; // Init Video playback object pointer to NULL
|
||||
geVideoType = Unspecified ; // no video type specified on start up
|
||||
gbAppActive = TRUE ; // app is activated on start up
|
||||
|
||||
// Main message loop:
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (! TranslateAccelerator(msg.hwnd, hAccelTable, &msg) )
|
||||
{
|
||||
TranslateMessage(&msg) ;
|
||||
DispatchMessage(&msg) ;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Release the video playback object, if any
|
||||
//
|
||||
if (gpPlayer)
|
||||
delete gpPlayer ;
|
||||
|
||||
//
|
||||
// Release DDraw now
|
||||
//
|
||||
delete gpDDrawObj ;
|
||||
|
||||
CoUninitialize() ;
|
||||
|
||||
DbgTerminate() ;
|
||||
return (int) (msg.wParam) ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// InitApplication(): Registers the class if no other instance of this app is
|
||||
// already running.
|
||||
//
|
||||
BOOL InitApplication(void)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("App's InitApplication() entered"))) ;
|
||||
|
||||
WNDCLASSEX wc ;
|
||||
|
||||
// Win32 will always set hPrevInstance to NULL, so lets check
|
||||
// things a little closer. This is because we only want a single
|
||||
// version of this app to run at a time
|
||||
ghWndApp = FindWindow (gszAppName, gszAppTitle) ;
|
||||
if (ghWndApp) {
|
||||
// We found another version of ourself. Lets defer to it:
|
||||
if (IsIconic(ghWndApp)) {
|
||||
ShowWindow(ghWndApp, SW_RESTORE);
|
||||
}
|
||||
SetForegroundWindow(ghWndApp);
|
||||
|
||||
// If this app actually had any functionality, we would
|
||||
// also want to communicate any action that our 'twin'
|
||||
// should now perform based on how the user tried to
|
||||
// execute us.
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Register the app main window class
|
||||
wc.cbSize = sizeof(wc) ;
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW ;
|
||||
wc.lpfnWndProc = (WNDPROC) WndProc ;
|
||||
wc.cbClsExtra = 0 ;
|
||||
wc.cbWndExtra = 0 ;
|
||||
wc.hInstance = ghInstance ;
|
||||
wc.hIcon = LoadIcon(ghInstance, gszAppName) ;
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW) ;
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1) ;
|
||||
wc.lpszMenuName = gszAppName ;
|
||||
wc.lpszClassName = gszAppName ;
|
||||
wc.hIconSm = NULL ;
|
||||
if (0 == RegisterClassEx(&wc))
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0,
|
||||
TEXT("ERROR: RegisterClassEx() for app class failed (Error %ld)"),
|
||||
GetLastError())) ;
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// InitInstance(): Starts this instance of the app (creates the window).
|
||||
//
|
||||
BOOL InitInstance(int nCmdShow)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("App's InitInstance() entered"))) ;
|
||||
|
||||
ghWndApp = CreateWindowEx(0, gszAppName, gszAppTitle,
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
0, 0,
|
||||
DEFAULT_WIDTH, DEFAULT_HEIGHT,
|
||||
NULL, NULL, ghInstance, NULL);
|
||||
|
||||
if (! ghWndApp ) {
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
ShowWindow(ghWndApp, nCmdShow);
|
||||
UpdateWindow(ghWndApp) ;
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// MenuProc(): Handles menu choices picked by the user.
|
||||
//
|
||||
LRESULT CALLBACK MenuProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HMENU hMenu = GetMenu(hWnd) ;
|
||||
int wmId = LOWORD(wParam);
|
||||
// int wmEvent = HIWORD(wParam);
|
||||
|
||||
//Parse the menu selections:
|
||||
switch (wmId) {
|
||||
|
||||
case IDM_SELECTDVD:
|
||||
if (FileSelect(hWnd, DVD)) // selection changed
|
||||
{
|
||||
CheckMenuItem(hMenu, IDM_SELECTDVD, MF_CHECKED) ;
|
||||
CheckMenuItem(hMenu, IDM_SELECTFILE, MF_UNCHECKED) ;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_SELECTFILE:
|
||||
if (FileSelect(hWnd, File)) // selection changed
|
||||
{
|
||||
CheckMenuItem(hMenu, IDM_SELECTDVD, MF_UNCHECKED) ;
|
||||
CheckMenuItem(hMenu, IDM_SELECTFILE, MF_CHECKED) ;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_ABOUT:
|
||||
DialogBox(ghInstance, TEXT("AboutBox"), ghWndApp, (DLGPROC) About);
|
||||
break;
|
||||
|
||||
case IDM_EXIT:
|
||||
DestroyWindow(ghWndApp);
|
||||
break;
|
||||
|
||||
case IDM_STARTPLAY:
|
||||
if (StartPlay(hWnd)) // playback started successfully
|
||||
gbAppActive = TRUE ; // if we are playing, we must be active
|
||||
else // playback failed due to some reason
|
||||
MessageBox(hWnd,
|
||||
STR_EXCLUSIVE_MODE_FAILURE,
|
||||
TEXT("Error"), MB_OK | MB_ICONINFORMATION) ;
|
||||
break;
|
||||
|
||||
default:
|
||||
break ;
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// FileSelect(): Lets the user specify the file to play.
|
||||
//
|
||||
BOOL FileSelect(HWND hWnd, VIDEO_TYPE eType)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("App's FileSelect(%s) entered"),
|
||||
DVD == eType ? "DVD" : "File")) ;
|
||||
|
||||
OPENFILENAME ofn ;
|
||||
TCHAR achFileName[MAX_PATH] ;
|
||||
|
||||
// Init the filename buffer with either a filename or *.ifo
|
||||
if (DVD == eType)
|
||||
lstrcpy(achFileName, TEXT("*.ifo")) ;
|
||||
else
|
||||
lstrcpy(achFileName, TEXT("*.avi")) ;
|
||||
|
||||
ZeroMemory(&ofn, sizeof(OPENFILENAME)) ;
|
||||
ofn.lStructSize = sizeof(OPENFILENAME) ;
|
||||
ofn.hwndOwner = hWnd ;
|
||||
if (DVD == eType)
|
||||
{
|
||||
ofn.lpstrTitle = TEXT("Select DVD-Video Volume\0") ;
|
||||
ofn.lpstrFilter = TEXT("IFO Files\0*.ifo\0All Files\0*.*\0\0") ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ofn.lpstrTitle = TEXT("Select Video file\0") ;
|
||||
ofn.lpstrFilter = TEXT("AVI Files\0*.avi\0MPEG Files\0*.mpg\0All Files\0*.*\0\0") ;
|
||||
}
|
||||
ofn.nFilterIndex = 1 ;
|
||||
ofn.lpstrFile = achFileName ;
|
||||
ofn.nMaxFile = sizeof(achFileName) ;
|
||||
ofn.lpstrFileTitle = NULL ;
|
||||
ofn.nMaxFileTitle = 0 ;
|
||||
ofn.lpstrInitialDir = NULL ;
|
||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY ;
|
||||
|
||||
if (GetOpenFileName(&ofn)) // user specified a file
|
||||
{
|
||||
if (! CreatePlayer(eType) || // creating player failed!!
|
||||
NULL == gpPlayer ) // how!?!
|
||||
{
|
||||
DbgLog((LOG_ERROR, 0, TEXT("ERROR: Couldn't create %s player"),
|
||||
DVD == eType ? "DVD" : "File")) ;
|
||||
return FALSE ;
|
||||
}
|
||||
gpPlayer->SetFileName(achFileName) ;
|
||||
return TRUE ; // user specified file name
|
||||
}
|
||||
|
||||
// Either failed or user hit Esc.
|
||||
DbgLog((LOG_TRACE, 3, TEXT("GetOpenFileName() cancelled/failed (Error %lu)"),
|
||||
CommDlgExtendedError())) ;
|
||||
return FALSE ; // DVD-Video volume not changed
|
||||
}
|
||||
|
||||
|
||||
BOOL IsVideoTypeKnown(void)
|
||||
{
|
||||
return (Unspecified != geVideoType) ;
|
||||
}
|
||||
|
||||
|
||||
VIDEO_TYPE GetVideoType(void)
|
||||
{
|
||||
return geVideoType ;
|
||||
}
|
||||
|
||||
|
||||
BOOL CreatePlayer(VIDEO_TYPE eType)
|
||||
{
|
||||
if (geVideoType == eType) // same type as before
|
||||
{
|
||||
if (gpPlayer) // we have already have the player
|
||||
return TRUE ; // we'll use the same one; everything is OK
|
||||
}
|
||||
else // video type has changed
|
||||
{
|
||||
if (gpPlayer) // we created a player before...
|
||||
{
|
||||
delete gpPlayer ; // release it now
|
||||
gpPlayer = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
// If we are here, we need to create a new player of the specified type
|
||||
if (DVD == eType)
|
||||
gpPlayer = new CDVDPlayer ;
|
||||
else if (File == eType)
|
||||
gpPlayer = new CFilePlayer ;
|
||||
else // what then??
|
||||
{
|
||||
ASSERT(FALSE) ;
|
||||
return NULL ;
|
||||
}
|
||||
|
||||
geVideoType = eType ; // this our current video type
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// OnEndOfPlayback(): Releases everything on end of playback (but checks to
|
||||
// avoid doing it too many times) as it "may be" called a little more than
|
||||
// we would like to.
|
||||
//
|
||||
void OnEndOfPlayback(HWND hWndApp)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("App's OnEndOfPlayback() entered"))) ;
|
||||
|
||||
if (0 != guTimerID) // if any timer is still set
|
||||
{
|
||||
BOOL bRes = KillTimer(hWndApp, TIMER_ID) ; // don't need that timer anymore
|
||||
ASSERT(bRes) ; bRes = bRes; // Suppress C4189 warning
|
||||
guTimerID = 0 ; // timer released
|
||||
}
|
||||
|
||||
if (gpPlayer && gpPlayer->IsGraphReady())
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Turn off color keying before stopping the graph"))) ;
|
||||
gpDDrawObj->SetOverlayState(FALSE) ; // don't paint color key in video's position
|
||||
#ifndef NOFLIP
|
||||
gpDDrawObj->UpdateAndFlipSurfaces() ; // flip the surface so that video doesn't show anymore
|
||||
#endif // NOFLIP
|
||||
|
||||
gpPlayer->Stop() ;
|
||||
|
||||
// Remove the overlay callback interface for OverlayMixer
|
||||
HRESULT hr = gpPlayer->SetOverlayCallback(NULL) ;
|
||||
ASSERT(SUCCEEDED(hr)) ; hr = hr; // Suppress C4189 warning
|
||||
|
||||
gpPlayer->ClearGraph() ;
|
||||
}
|
||||
|
||||
if (gpDDrawObj->IsInExclusiveMode())
|
||||
{
|
||||
gpDDrawObj->StopExclusiveMode(hWndApp) ;
|
||||
|
||||
// Resize main window to default size
|
||||
SetWindowPos(ghWndApp, HWND_TOP, 0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// WndPorc(): Message handles for our sample app.
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static HDC hDC ;
|
||||
static PAINTSTRUCT ps ;
|
||||
|
||||
switch (message) {
|
||||
|
||||
case WM_ACTIVATEAPP:
|
||||
//
|
||||
// NOTE: We don't try to recover playback on switching back into focus.
|
||||
//
|
||||
gbAppActive = (BOOL) wParam ;
|
||||
if (! gbAppActive ) // losing activation
|
||||
{
|
||||
DbgLog((LOG_TRACE, 2, TEXT("Got a WM_ACTIVATEAPP message with Active = %s"),
|
||||
gbAppActive ? "TRUE" : "FALSE")) ;
|
||||
OnEndOfPlayback(hWnd) ; // should stop playback now
|
||||
}
|
||||
break ;
|
||||
|
||||
case WM_TIMER:
|
||||
DbgLog((LOG_TRACE, 4, TEXT("Got a WM_TIMER message with ID = %ld (Active = %s)"),
|
||||
wParam, gbAppActive ? "T" : "F")) ;
|
||||
if ( TIMER_ID != wParam || // this is not the timer we have set or
|
||||
! gbAppActive || // the app isn't active anymore or
|
||||
! gpPlayer->IsGraphReady() ) // the graph is not currently ready
|
||||
// (...but we should have turned timer off then anyway!!)
|
||||
break ; // don't do anything
|
||||
|
||||
//
|
||||
// We could do some status update here that could be used by the
|
||||
// UpdateAndFlipSurfaces() call below.
|
||||
//
|
||||
#ifndef NOFLIP
|
||||
gpDDrawObj->UpdateAndFlipSurfaces() ;
|
||||
#endif // NOFLIP
|
||||
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
DbgLog((LOG_TRACE, 4, TEXT("Got a WM_COMMAND message with wParam = %ld"), wParam)) ;
|
||||
MenuProc(hWnd, wParam, lParam) ;
|
||||
break;
|
||||
|
||||
case WM_PLAY_EVENT:
|
||||
DbgLog((LOG_TRACE, 4, TEXT("Got a WM_PLAY_EVENT message with wParam = %ld"), wParam)) ;
|
||||
if (1 == OnPlaybackEvent(hWnd, wParam, lParam)) // playback ended
|
||||
OnEndOfPlayback(hWnd) ; // do the necessary things
|
||||
break ;
|
||||
|
||||
case WM_SIZE_CHANGE:
|
||||
DbgLog((LOG_TRACE, 4, TEXT("Got a WM_SIZE_CHANGE message"))) ;
|
||||
if (gpPlayer->IsGraphReady()) // ONLY if the graph is ready
|
||||
SetVideoPosition(FALSE) ;
|
||||
else
|
||||
DbgLog((LOG_TRACE, 1, TEXT("WARNING: Got a WM_SIZE_CHANGE message after graph was released!!"))) ;
|
||||
break ;
|
||||
|
||||
case WM_KEYUP:
|
||||
DbgLog((LOG_TRACE, 4, TEXT("Got a WM_KEYUP message with wParam = %ld"), wParam)) ;
|
||||
KeyProc(hWnd, wParam, lParam) ;
|
||||
break ;
|
||||
|
||||
case WM_DESTROY:
|
||||
OnEndOfPlayback(hWnd) ; // must stop playback before quitting
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// KeyProc(): Handles key presses to exit playback (on Esc) or move the ball
|
||||
// using arrow keys.
|
||||
//
|
||||
LRESULT CALLBACK KeyProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("App's KeyProc() entered"))) ;
|
||||
|
||||
switch (wParam)
|
||||
{
|
||||
case VK_ESCAPE:
|
||||
OnEndOfPlayback(hWnd) ;
|
||||
break ;
|
||||
|
||||
case VK_UP:
|
||||
gpDDrawObj->MoveBallPosition(0, -BALL_STEP) ;
|
||||
break ;
|
||||
|
||||
case VK_DOWN:
|
||||
gpDDrawObj->MoveBallPosition(0, BALL_STEP) ;
|
||||
break ;
|
||||
|
||||
case VK_LEFT:
|
||||
gpDDrawObj->MoveBallPosition(-BALL_STEP, 0) ;
|
||||
break ;
|
||||
|
||||
case VK_RIGHT:
|
||||
gpDDrawObj->MoveBallPosition(BALL_STEP, 0) ;
|
||||
break ;
|
||||
|
||||
default:
|
||||
break ;
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// About(): Dialog box code for the About box.
|
||||
//
|
||||
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("App's About() entered"))) ;
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break ;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// OnPlaybackEvent(): Handles playback events, specially completed/stopped-on-error.
|
||||
//
|
||||
// Returns 0 if playback is continuing.
|
||||
// Returns 1 if playback is over for any reason.
|
||||
//
|
||||
LRESULT OnPlaybackEvent(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5,
|
||||
TEXT("App's OnPlaybackEvent(0x%lx, 0x%lx) entered"),
|
||||
wParam, lParam)) ;
|
||||
|
||||
IMediaEventEx *pME = (IMediaEventEx *) lParam ;
|
||||
if (NULL == pME || Playing != gpPlayer->GetState())
|
||||
{
|
||||
DbgLog((LOG_TRACE, 1, TEXT("Either pME = NULL or not playing anymore. Skip everything."))) ;
|
||||
return 0 ; // or 1 ??
|
||||
}
|
||||
|
||||
LONG lEvent ;
|
||||
LONG_PTR lParam1, lParam2 ;
|
||||
|
||||
//
|
||||
// Because the message mode for IMediaEvent may not be set before
|
||||
// we get the first event it's important to read all the events
|
||||
// pending when we get a window message to say there are events pending.
|
||||
// GetEvent() returns E_ABORT when no more event is left.
|
||||
//
|
||||
while (SUCCEEDED(pME->GetEvent(&lEvent, &lParam1, &lParam2, 0))) // no wait
|
||||
{
|
||||
switch (lEvent)
|
||||
{
|
||||
//
|
||||
// First the DVD related events
|
||||
//
|
||||
case EC_DVD_STILL_ON:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Playback Event: EC_DVD_STILL_ON"))) ;
|
||||
break ;
|
||||
|
||||
case EC_DVD_STILL_OFF:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Playback Event: EC_DVD_STILL_OFF"))) ;
|
||||
break ;
|
||||
|
||||
case EC_DVD_DOMAIN_CHANGE:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Playback Event: EC_DVD_DOMAIN_CHANGE, %ld"), lParam1)) ;
|
||||
switch (lParam1)
|
||||
{
|
||||
case DVD_DOMAIN_FirstPlay: // = 1
|
||||
case DVD_DOMAIN_Stop: // = 5
|
||||
break ;
|
||||
|
||||
case DVD_DOMAIN_VideoManagerMenu: // = 2
|
||||
case DVD_DOMAIN_VideoTitleSetMenu: // = 3
|
||||
// Inform the app to update the menu option to show "Resume" now
|
||||
break ;
|
||||
|
||||
case DVD_DOMAIN_Title: // = 4
|
||||
// Inform the app to update the menu option to show "Menu" again
|
||||
break ;
|
||||
|
||||
default: // hmmmm...
|
||||
break ;
|
||||
}
|
||||
break ;
|
||||
|
||||
case EC_DVD_BUTTON_CHANGE:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("DVD Event: Button Changed to %d out of %d"),
|
||||
lParam2, lParam1));
|
||||
break;
|
||||
|
||||
case EC_DVD_TITLE_CHANGE:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Playback Event: EC_DVD_TITLE_CHANGE"))) ;
|
||||
break ;
|
||||
|
||||
case EC_DVD_CHAPTER_START:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Playback Event: EC_DVD_CHAPTER_START"))) ;
|
||||
break ;
|
||||
|
||||
case EC_DVD_CURRENT_TIME:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Playback Event: EC_DVD_CURRENT_TIME"))) ;
|
||||
break ;
|
||||
|
||||
//
|
||||
// Then the general DirectShow related events
|
||||
//
|
||||
case EC_COMPLETE:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Playback Event: Playback complete"))) ;
|
||||
MessageBeep(MB_OK) ; // just to inform that the playback is over
|
||||
|
||||
// Remember to free the event params
|
||||
pME->FreeEventParams(lEvent, lParam1, lParam2) ;
|
||||
|
||||
// We don't do the release part here. That will be done in WndProc()
|
||||
// after return from this function.
|
||||
return 1 ; // playback over
|
||||
|
||||
case EC_USERABORT:
|
||||
case EC_ERRORABORT:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Playback Event: 0x%lx"), lEvent)) ;
|
||||
MessageBeep(MB_ICONEXCLAMATION) ; // to inform that the playback has errored out
|
||||
|
||||
// Remember to free the event params
|
||||
pME->FreeEventParams(lEvent, lParam1, lParam2) ;
|
||||
|
||||
// We don't do the release part here. That will be done in WndProc()
|
||||
// after return from this function.
|
||||
return 1 ; // playback over
|
||||
|
||||
default:
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Ignored unknown playback event: 0x%lx"), lEvent)) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
//
|
||||
// Remember to free the event params
|
||||
//
|
||||
pME->FreeEventParams(lEvent, lParam1, lParam2) ;
|
||||
|
||||
} // end of while (GetEvent()) loop
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
typedef enum _AM_TRANSFORM
|
||||
{
|
||||
AM_SHRINK,
|
||||
AM_STRETCH
|
||||
} AM_TRANSFORM ;
|
||||
|
||||
void TransformRect(RECT *prRect, double dPictAspectRatio, AM_TRANSFORM transform)
|
||||
{
|
||||
double dWidth, dHeight, dNewWidth, dNewHeight ;
|
||||
|
||||
double dResolutionRatio = 0.0, dTransformRatio = 0.0 ;
|
||||
|
||||
ASSERT(transform == AM_SHRINK || transform == AM_STRETCH) ;
|
||||
|
||||
dNewWidth = dWidth = prRect->right - prRect->left ;
|
||||
dNewHeight = dHeight = prRect->bottom - prRect->top ;
|
||||
|
||||
dResolutionRatio = dWidth / dHeight ;
|
||||
dTransformRatio = dPictAspectRatio / dResolutionRatio ;
|
||||
|
||||
// shrinks one dimension to maintain the coorect aspect ratio
|
||||
if (transform == AM_SHRINK)
|
||||
{
|
||||
if (dTransformRatio > 1.0)
|
||||
{
|
||||
dNewHeight = dNewHeight / dTransformRatio ;
|
||||
}
|
||||
else if (dTransformRatio < 1.0)
|
||||
{
|
||||
dNewWidth = dNewWidth * dTransformRatio ;
|
||||
}
|
||||
}
|
||||
// stretches one dimension to maintain the coorect aspect ratio
|
||||
else if (transform == AM_STRETCH)
|
||||
{
|
||||
if (dTransformRatio > 1.0)
|
||||
{
|
||||
dNewWidth = dNewWidth * dTransformRatio ;
|
||||
}
|
||||
else if (dTransformRatio < 1.0)
|
||||
{
|
||||
dNewHeight = dNewHeight / dTransformRatio ;
|
||||
}
|
||||
}
|
||||
|
||||
if (transform == AM_SHRINK)
|
||||
{
|
||||
ASSERT(dNewHeight <= dHeight) ;
|
||||
ASSERT(dNewWidth <= dWidth) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT(dNewHeight >= dHeight) ;
|
||||
ASSERT(dNewWidth >= dWidth) ;
|
||||
}
|
||||
|
||||
// cut or add equal portions to the changed dimension
|
||||
|
||||
prRect->left += (LONG)(dWidth - dNewWidth)/2 ;
|
||||
prRect->right = prRect->left + (LONG)dNewWidth ;
|
||||
|
||||
prRect->top += (LONG)(dHeight - dNewHeight)/2 ;
|
||||
prRect->bottom = prRect->top + (LONG)dNewHeight ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// SetVideoPosition(): Gets the original video size and positions it at the center.
|
||||
//
|
||||
void SetVideoPosition(BOOL bSetBallPosition)
|
||||
{
|
||||
DbgLog((LOG_TRACE, 5, TEXT("App's SetVideoPosition() entered"))) ;
|
||||
|
||||
DWORD dwVideoWidth, dwVideoHeight ;
|
||||
DWORD dwARX, dwARY ;
|
||||
gpPlayer->GetNativeVideoData(&dwVideoWidth, &dwVideoHeight, &dwARX, &dwARY) ;
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Native video size: %lu x %lu, Aspect Ratio: %lu x %lu"),
|
||||
dwVideoWidth, dwVideoHeight, dwARX, dwARY)) ;
|
||||
|
||||
// Update output size to make it aspect ratio corrected
|
||||
RECT rectCorrected ;
|
||||
SetRect(&rectCorrected, 0, 0, dwVideoWidth, dwVideoHeight) ;
|
||||
TransformRect(&rectCorrected, (double)dwARX / (double)dwARY, AM_STRETCH) ;
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Updated video size: %ld x %ld"),
|
||||
RECTWIDTH(rectCorrected), RECTHEIGHT(rectCorrected))) ;
|
||||
|
||||
RECT ScrnRect ;
|
||||
gpDDrawObj->GetScreenRect(&ScrnRect) ;
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Screen size is %ld x %ld"),
|
||||
RECTWIDTH(ScrnRect), RECTHEIGHT(ScrnRect))) ;
|
||||
|
||||
DWORD dwVideoTop ;
|
||||
DWORD dwVideoLeft ;
|
||||
if (RECTWIDTH(rectCorrected) <= RECTWIDTH(ScrnRect) && // video width less than screen
|
||||
RECTHEIGHT(rectCorrected) <= RECTHEIGHT(ScrnRect)) // video height less than screen
|
||||
{
|
||||
dwVideoLeft = (RECTWIDTH(ScrnRect) - RECTWIDTH(rectCorrected)) / 2 ;
|
||||
dwVideoTop = (RECTHEIGHT(ScrnRect) - RECTHEIGHT(rectCorrected)) / 2 ;
|
||||
}
|
||||
else // video width more than screen
|
||||
{
|
||||
rectCorrected = ScrnRect ;
|
||||
TransformRect(&rectCorrected, (double)dwARX / (double)dwARY, AM_SHRINK) ;
|
||||
dwVideoLeft = rectCorrected.left ;
|
||||
dwVideoTop = rectCorrected.top ;
|
||||
}
|
||||
gpDDrawObj->SetVideoPosition(dwVideoLeft, dwVideoTop,
|
||||
RECTWIDTH(rectCorrected), RECTHEIGHT(rectCorrected)) ;
|
||||
if (bSetBallPosition) // if ball position should be (re)set
|
||||
gpDDrawObj->SetBallPosition(dwVideoLeft, dwVideoTop,
|
||||
RECTWIDTH(rectCorrected), RECTHEIGHT(rectCorrected)) ;
|
||||
else // don't reset the ball position, just...
|
||||
gpDDrawObj->MoveBallPosition(0, 0) ; // ... make sure it's in the new video area
|
||||
gpPlayer->SetVideoPosition(dwVideoLeft, dwVideoTop,
|
||||
RECTWIDTH(rectCorrected), RECTHEIGHT(rectCorrected)) ;
|
||||
DbgLog((LOG_TRACE, 5, TEXT("Video is %ld x %ld at (%ld x %ld)"),
|
||||
RECTWIDTH(rectCorrected), RECTHEIGHT(rectCorrected), dwVideoLeft, dwVideoTop)) ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// StartPlay(): Switches to fulscreen exclusive mode, sets up for selected media
|
||||
// playback, gets the video size and positions video at the center, starts playing
|
||||
// and sets a timer to tell WndProc() every 1/10 second.
|
||||
//
|
||||
LRESULT StartPlay(HWND hWndApp)
|
||||
{
|
||||
HRESULT hr ;
|
||||
|
||||
DbgLog((LOG_TRACE, 5, TEXT("App's StartPlay() entered"))) ;
|
||||
|
||||
if (! IsVideoTypeKnown() )
|
||||
{
|
||||
MessageBox(hWndApp,
|
||||
TEXT("No playback option (DVD/File) has been specified through the menu option yet.\nCan't run test."),
|
||||
TEXT("Sorry"), MB_OK | MB_ICONINFORMATION) ;
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
//
|
||||
// Make sure that DShow components are installed etc so that
|
||||
// the graph building can be init-ed
|
||||
//
|
||||
if (! gpPlayer->Initialize() )
|
||||
{
|
||||
MessageBox(hWndApp,
|
||||
TEXT("DShow components couldn't be initialized.\n\nCan't run test.\nPlease check DxMedia installation"),
|
||||
TEXT("Sorry"), MB_OK | MB_ICONSTOP) ;
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
//
|
||||
// Go into fullscreen exclusive mode
|
||||
//
|
||||
hr = gpDDrawObj->StartExclusiveMode(hWndApp) ;
|
||||
if (FAILED(hr)) // error message shown by the above method
|
||||
{
|
||||
gpPlayer->ClearGraph() ;
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
//
|
||||
// Build video playback graph
|
||||
//
|
||||
hr = gpPlayer->BuildGraph(hWndApp, gpDDrawObj->GetDDObject(), gpDDrawObj->GetDDPrimary()) ;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
gpPlayer->ClearGraph() ;
|
||||
gpDDrawObj->StopExclusiveMode(hWndApp) ; // get out of exclusive mode
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
//
|
||||
// Specify the overlay callback interface for OverlayMixer to notify us
|
||||
//
|
||||
hr = gpPlayer->SetOverlayCallback(gpDDrawObj->GetCallbackInterface()) ;
|
||||
ASSERT(SUCCEEDED(hr)) ;
|
||||
|
||||
//
|
||||
// Pause the video playback graph to get it ready to play
|
||||
//
|
||||
BOOL bSuccess = gpPlayer->Pause() ;
|
||||
if (!bSuccess)
|
||||
{
|
||||
gpPlayer->SetOverlayCallback(NULL) ; // first remove overlay callback
|
||||
gpPlayer->ClearGraph() ; // then remove graph
|
||||
gpDDrawObj->StopExclusiveMode(hWndApp) ; // then get out of exclusive mode
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the color key info from the Player object and pass it to the DDraw object
|
||||
//
|
||||
DWORD dwVideoColorKey ;
|
||||
gpPlayer->GetColorKey(&dwVideoColorKey) ;
|
||||
gpDDrawObj->SetColorKey(dwVideoColorKey) ;
|
||||
|
||||
//
|
||||
// Get the video width and height, center it and pass the coordinates to
|
||||
// the player and the DDraw object
|
||||
//
|
||||
SetVideoPosition(TRUE) ;
|
||||
|
||||
//
|
||||
// Create the first screen on back buffer and then flip
|
||||
//
|
||||
#ifndef NOFLIP
|
||||
gpDDrawObj->UpdateAndFlipSurfaces() ;
|
||||
#endif // NOFLIP
|
||||
|
||||
//
|
||||
// Play video now...
|
||||
//
|
||||
if (! gpPlayer->Play() )
|
||||
{
|
||||
gpPlayer->SetOverlayCallback(NULL) ; // first remove overlay callback
|
||||
gpPlayer->ClearGraph() ; // then remove graph
|
||||
gpDDrawObj->StopExclusiveMode(hWndApp) ; // then get out of exclusive mode
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
//
|
||||
// Now set a timer based on which we'll update the buffers and flip
|
||||
//
|
||||
guTimerID = (UINT) SetTimer(hWndApp, TIMER_ID, TIMER_RATE, NULL) ;
|
||||
ASSERT(0 != guTimerID) ;
|
||||
|
||||
// We are done with starting the playback. WndProc will stop the playback on
|
||||
// playback event messages or user hitting Esc key as well the timer based
|
||||
// actions will be taken in WM_TIMER handler there.
|
||||
|
||||
return 1 ;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
; Module-Definition file for DDrawXCL Sample -- used by LINK.EXE
|
||||
; ==========================================================================
|
||||
; This isn't really needed for an Application, but it's handy to use for
|
||||
; setting the 'NAME DDrawXCL ; application's module name
|
||||
@@ -0,0 +1,133 @@
|
||||
# Microsoft Developer Studio Project File - Name="ddrawxcl" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=ddrawxcl - 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 "ddrawxcl.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 "ddrawxcl.mak" CFG="ddrawxcl - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ddrawxcl - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "ddrawxcl - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ddrawxcl - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# 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 ..\..\baseclasses\release\strmbase.lib quartz.lib kernel32.lib user32.lib comdlg32.lib ole32.lib oleaut32.lib gdi32.lib ddraw.lib msvcrt.lib uuid.lib advapi32.lib winmm.lib /nologo /stack:0x200000,0x200000 /subsystem:windows /pdb:none /machine:I386 /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "ddrawxcl - 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 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DEBUG" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# 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 ..\..\baseclasses\debug\strmbasd.lib quartz.lib kernel32.lib user32.lib comdlg32.lib ole32.lib oleaut32.lib gdi32.lib ddraw.lib msvcrtd.lib uuid.lib advapi32.lib winmm.lib /nologo /stack:0x200000,0x200000 /subsystem:windows /pdb:none /debug /machine:I386 /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ddrawxcl - Win32 Release"
|
||||
# Name "ddrawxcl - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "*.cpp;*.rc;*.ico"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddrawobj.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddrawxcl.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddrawxcl.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddrawxcl.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\vidplay.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "*.h"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddrawobj.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddrawxcl.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\vidplay.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ddrawxcl"=.\ddrawxcl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: DDrawXcl.h
|
||||
//
|
||||
// Desc: DirectShow sample code - DDraw Exclusive Mode Video Playback
|
||||
// test/sample application header file.
|
||||
//
|
||||
// Copyright (c) 1993-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// App menu ids
|
||||
//
|
||||
#define IDM_SELECTDVD 101
|
||||
#define IDM_SELECTFILE 102
|
||||
#define IDM_ABOUT 103
|
||||
#define IDM_EXIT 104
|
||||
|
||||
#define IDM_STARTPLAY 111
|
||||
|
||||
#define IDC_STATIC -1
|
||||
|
||||
//
|
||||
// Version info related constant ids
|
||||
//
|
||||
#define DLG_VERFIRST 400
|
||||
#define IDC_COMPANY DLG_VERFIRST
|
||||
#define IDC_FILEDESC DLG_VERFIRST+1
|
||||
#define IDC_PRODVER DLG_VERFIRST+2
|
||||
#define IDC_COPYRIGHT DLG_VERFIRST+3
|
||||
#define IDC_OSVERSION DLG_VERFIRST+4
|
||||
#define IDC_TRADEMARK DLG_VERFIRST+5
|
||||
#define DLG_VERLAST DLG_VERFIRST+5
|
||||
|
||||
#define IDC_LABEL DLG_VERLAST+1
|
||||
|
||||
//
|
||||
// Message displayed on failure to start playback
|
||||
//
|
||||
#define STR_EXCLUSIVE_MODE_FAILURE \
|
||||
TEXT("Exclusive mode playback failed to start.") \
|
||||
TEXT("\nPlease verify that the selected file can be played with your video card.") \
|
||||
TEXT("\n\nMore information:") \
|
||||
TEXT("\n----------------------") \
|
||||
TEXT("\nSome display cards do not support RGB overlays in hardware, but the decoder\n") \
|
||||
TEXT("used by the selected media file may require them. If the filter upstream\n") \
|
||||
TEXT("of the overlay mixer proposes only RGB formats, and the video card does not\n") \
|
||||
TEXT("support RGB overlays in hardware, then the filter graph manager will not\n") \
|
||||
TEXT("be able to connect the filters to complete the graph.")
|
||||
|
||||
|
||||
//
|
||||
// App string resource ids
|
||||
//
|
||||
#define IDS_APP_TITLE 500
|
||||
#define IDS_APP_NAME 501
|
||||
#define IDS_WINDOW_TITLE 502
|
||||
#define IDS_VER_INFO_LANG 503
|
||||
#define IDS_VERSION_ERROR 504
|
||||
|
||||
|
||||
//
|
||||
// Some constants
|
||||
//
|
||||
#define TIMER_ID 1
|
||||
#define TIMER_RATE 100
|
||||
|
||||
//
|
||||
// Some enumerated types
|
||||
//
|
||||
typedef enum {
|
||||
Unspecified = 0, DVD , File
|
||||
} VIDEO_TYPE ;
|
||||
|
||||
|
||||
//
|
||||
// Function signatures for Windows
|
||||
//
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine, int nCmdShow) ;
|
||||
BOOL InitApplication(void) ;
|
||||
BOOL InitInstance(int nCmdShow) ;
|
||||
LRESULT CALLBACK MenuProc(HWND hWnd, WPARAM wParam, LPARAM lParam) ;
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ;
|
||||
LRESULT CALLBACK KeyProc(HWND hWnd, WPARAM wParam, LPARAM lParam) ;
|
||||
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) ;
|
||||
LRESULT StartPlay(HWND hWndApp) ;
|
||||
LRESULT OnPlaybackEvent(HWND hWnd, WPARAM wParam, LPARAM lParam) ;
|
||||
void OnEndOfPlayback(HWND hWnd) ;
|
||||
void SetVideoPosition(BOOL bSetBallPosition) ;
|
||||
BOOL FileSelect(HWND hWnd, VIDEO_TYPE eType) ;
|
||||
BOOL CreatePlayer(VIDEO_TYPE eType) ;
|
||||
BOOL IsVideoTypeKnown(void) ;
|
||||
VIDEO_TYPE GetVideoType(void) ;
|
||||
|
||||
|
||||
//
|
||||
// Global variables used by the (Windows) app
|
||||
//
|
||||
HWND ghWndApp ;
|
||||
TCHAR gszAppName[10] ;
|
||||
TCHAR gszAppTitle[100] ;
|
||||
TCHAR gszDirection[100] ;
|
||||
HINSTANCE ghInstance ;
|
||||
|
||||
CBaseVideoPlayer *gpPlayer ;
|
||||
CDDrawObject *gpDDrawObj ;
|
||||
UINT guTimerID ;
|
||||
VIDEO_TYPE geVideoType ;
|
||||
BOOL gbAppActive ;
|
||||
|
After Width: | Height: | Size: 766 B |
@@ -0,0 +1,217 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on ddrawxcl.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=ddrawxcl - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to ddrawxcl - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "ddrawxcl - Win32 Release" && "$(CFG)" != "ddrawxcl - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ddrawxcl.mak" CFG="ddrawxcl - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ddrawxcl - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "ddrawxcl - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ddrawxcl - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\ddrawxcl.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\ddrawobj.obj"
|
||||
-@erase "$(INTDIR)\ddrawxcl.obj"
|
||||
-@erase "$(INTDIR)\ddrawxcl.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vidplay.obj"
|
||||
-@erase "$(OUTDIR)\ddrawxcl.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\ddrawxcl.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ddrawxcl.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=..\..\baseclasses\release\strmbase.lib quartz.lib kernel32.lib user32.lib comdlg32.lib ole32.lib oleaut32.lib gdi32.lib ddraw.lib msvcrt.lib uuid.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib /out:"$(OUTDIR)\ddrawxcl.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\ddrawobj.obj" \
|
||||
"$(INTDIR)\ddrawxcl.obj" \
|
||||
"$(INTDIR)\vidplay.obj" \
|
||||
"$(INTDIR)\ddrawxcl.res"
|
||||
|
||||
"$(OUTDIR)\ddrawxcl.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "ddrawxcl - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\ddrawxcl.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\ddrawobj.obj"
|
||||
-@erase "$(INTDIR)\ddrawxcl.obj"
|
||||
-@erase "$(INTDIR)\ddrawxcl.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(INTDIR)\vidplay.obj"
|
||||
-@erase "$(OUTDIR)\ddrawxcl.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DEBUG" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\ddrawxcl.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ddrawxcl.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=..\..\baseclasses\debug\strmbasd.lib quartz.lib kernel32.lib user32.lib comdlg32.lib ole32.lib oleaut32.lib gdi32.lib ddraw.lib msvcrtd.lib uuid.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /nodefaultlib /out:"$(OUTDIR)\ddrawxcl.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\ddrawobj.obj" \
|
||||
"$(INTDIR)\ddrawxcl.obj" \
|
||||
"$(INTDIR)\vidplay.obj" \
|
||||
"$(INTDIR)\ddrawxcl.res"
|
||||
|
||||
"$(OUTDIR)\ddrawxcl.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("ddrawxcl.dep")
|
||||
!INCLUDE "ddrawxcl.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "ddrawxcl.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "ddrawxcl - Win32 Release" || "$(CFG)" == "ddrawxcl - Win32 Debug"
|
||||
SOURCE=.\ddrawobj.cpp
|
||||
|
||||
"$(INTDIR)\ddrawobj.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\ddrawxcl.cpp
|
||||
|
||||
"$(INTDIR)\ddrawxcl.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\ddrawxcl.rc
|
||||
|
||||
"$(INTDIR)\ddrawxcl.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\vidplay.cpp
|
||||
|
||||
"$(INTDIR)\vidplay.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "ddrawxcl.h"
|
||||
#include "winver.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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
DDRAWXCL ICON DISCARDABLE "DDrawXcl.ICO"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
DDRAWXCL MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "Select &DVD...", IDM_SELECTDVD
|
||||
MENUITEM "Select &File...", IDM_SELECTFILE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Play", IDM_STARTPLAY
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&About...", IDM_ABOUT
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", IDM_EXIT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
DDRAWXCL ACCELERATORS MOVEABLE PURE
|
||||
BEGIN
|
||||
"?", IDM_ABOUT, ASCII, ALT
|
||||
"/", IDM_ABOUT, ASCII, ALT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
ABOUTBOX DIALOG DISCARDABLE 20, 20, 180, 94
|
||||
STYLE DS_MODALFRAME | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About DDrawXCL Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON "DDrawXcl",IDC_STATIC,19,7,21,20
|
||||
CTEXT "DDraw Exclusive Mode Video Playback Sample",IDC_STATIC,
|
||||
6,32,167,8
|
||||
CTEXT "Version 8.10",IDC_STATIC,6,42,167,8
|
||||
CTEXT "Copyright <20> 1998-2001 Microsoft Corporation",IDC_STATIC,
|
||||
6,53,167,8
|
||||
DEFPUSHBUTTON "OK",IDOK,73,70,32,14,WS_GROUP
|
||||
CTEXT "DDrawXCL Sample",IDC_STATIC,51,12,76,11
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 8,1,0,0
|
||||
PRODUCTVERSION 8,1,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0xbL
|
||||
#else
|
||||
FILEFLAGS 0xaL
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904e4"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "DDraw Exclusive Mode Video Playback Sample\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "DDrawXcl\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 1998-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "Microsoft(R) is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation\0"
|
||||
VALUE "OriginalFilename", "DDrawXCL.EXE\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
BLOCK "041104e4"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "DDraw Exclusive Mode Video Playback Sample\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "DDrawXcl\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 1998-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "Microsoft(R) is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation\0"
|
||||
VALUE "OriginalFilename", "DDrawXCL.EXE\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1252, 0x411, 1252
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""ddrawxcl.h""\r\n"
|
||||
"#include ""winver.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
"ABOUTBOX", DIALOG
|
||||
BEGIN
|
||||
BOTTOMMARGIN, 70
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
500 "DDraw Exclusive Mode Video Playback Sample"
|
||||
IDS_APP_NAME "DDrawXcl"
|
||||
IDS_WINDOW_TITLE "DDrawXCL Player"
|
||||
IDS_VER_INFO_LANG "\\StringFileInfo\\040904E4\\"
|
||||
IDS_VERSION_ERROR "Error %lu"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
DirectShow Sample -- DDrawXCL
|
||||
-----------------------------
|
||||
|
||||
|
||||
DirectDraw Exclusive Mode Video Playback Capability
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
General Information:
|
||||
====================
|
||||
Now video can be played back from AVI, MPEG files as well as DVD titles
|
||||
even in DirectDraw exclusive fullscreen mode. This is expected to be
|
||||
very helpful to games and interactive content development.
|
||||
|
||||
The DirectX SDK includes various components that together
|
||||
offer this capability. An updated Overlay Mixer filter in DirectShow
|
||||
is now capable of using a DirectDraw object and primary surface provided
|
||||
by an application, rather than insisting on using its own.
|
||||
|
||||
A new COM interface, IDDrawExclModeVideo, has been added on the Overlay
|
||||
Mixer filter which allows applications to specify DirectDraw parameters
|
||||
and playback position, size, etc. An app can do QueryInterface() on the
|
||||
Overlay Mixer filter to get the interface. This interface is fully
|
||||
documented in the SDK help documentation.
|
||||
|
||||
Also another new COM interface, IDDrawExclModeVideoCallback, has been
|
||||
defined in the SDK. An application should implement an object that supports
|
||||
this interface to have a notification set up with the OverlayMixer about
|
||||
any changes to the overlay size, position, color key, etc. This callback
|
||||
mechanism allows any color key flashes and/or strips to be avoided.
|
||||
|
||||
We have also updated the DVD graph builder object and some methods of the
|
||||
IDvdGraphBuilder interface which allows applications to use the updated
|
||||
DVD graph builder object to pass the DirectDraw-related information to the
|
||||
Overlay Mixer for use in DVD playback filter graph building operation.
|
||||
Using a couple of other methods available on the IDDrawExclModeVideo
|
||||
interface, applications can get the color key information for
|
||||
superimposing graphics on top of video playing in the background. All of
|
||||
these changes have been fully documented in the SDK help.
|
||||
|
||||
A sample application, DDrawXcl, has also been added to the SDK samples.
|
||||
This application consists of:
|
||||
|
||||
* A DirectDraw object (DDrawObj.h, .cpp) that wraps all DirectDraw
|
||||
functionality using IDirectDraw* COM interfaces as well as the
|
||||
IDDrawExclModeVideo interface.
|
||||
|
||||
* A video playback object (VidPlay.h, .cpp) that implements the details
|
||||
of building a filter graph to play AVI/MPEG files as well as DVD titles.
|
||||
|
||||
* An overlay notification sink object that receives the overlay change
|
||||
related callbacks from OverlayMixer and takes appropriate actions.
|
||||
|
||||
* A Windows application that uses the above objects to:
|
||||
|
||||
- Go into fullscreen exclusive mode, switch to 800x600x8 (we just chose
|
||||
one particular mode), and create a primary surface with one back buffer.
|
||||
|
||||
- Build a filter graph to playback the selected type of video using
|
||||
the DirectDraw object and surface provided by the application,
|
||||
starts playing it and sets a timer to fire every 0.1 second.
|
||||
|
||||
- On the timer event, the application draws color key of the required
|
||||
dimension on the back buffer, draws a ball that can be moved using
|
||||
keystrokes, draws an updated number of flips completed, and flips the
|
||||
surfaces.
|
||||
|
||||
- The callback notification object informs the DDraw object when color
|
||||
keying of the video area should be started/stopped.
|
||||
|
||||
This is one of the basic requirements for games and interactive
|
||||
content to play video using DirectShow inside the application.
|
||||
|
||||
|
||||
|
||||
The Limitations/Rules:
|
||||
======================
|
||||
1. The sequence of calls to get the application-created DirectDraw parameters
|
||||
to be used by OverlayMixer is as follows --
|
||||
|
||||
For DVD:
|
||||
- create the DVD graph builder object
|
||||
- call IDvdGraphBuilder::GetDvdInterface() for IDDrawExclModeVideo
|
||||
interface. This returns the IDDrawExclModeVideo interface of the
|
||||
OverlayMixer in the DVD playback filter graph.
|
||||
- call IDDrawExclModeVideo::SetDDrawObject() to set the DDraw object
|
||||
- call IDDrawExclModeVideo::SetDDrawSurface() to set the DDraw surface
|
||||
- call IDvdGraphBuilder::RenderDvdVideoVolume() to build a DVD graph
|
||||
- call IDvdGraphBuilder::GetDvdInterface() to get a IMixerPinConfig(2)
|
||||
interface pointer to the FIRST (only) input pin of the OverlayMixer.
|
||||
- get color key info using IMixerPinConfig(2)::GetColorKey()
|
||||
method. Also set the aspect ratio mode to stretching from the
|
||||
default letter box mode of the OverlayMixer.
|
||||
- call IDDrawExclModeVideo::SetCallbackInterface() with the pointer to the
|
||||
object implementing the IDDrawExclModeVideoCallback interface.
|
||||
- get the native video size and aspect ratio through
|
||||
IDDrawExclModeVideo::GetNativeVideoProps() method, transform the width
|
||||
and height based on the retrieved aspect ratio, and set the final video
|
||||
size and position using IDDrawExclModeVideo::SetDDrawParameters() method.
|
||||
|
||||
For AVI/MPEG:
|
||||
- create an empty filter graph
|
||||
- call IGraphBuilder::RenderFile() on the specified file to build graph.
|
||||
- instantiate the OverlayMixer filter and add it to the graph.
|
||||
- call IDDrawExclModeVideo::SetDDrawObject()
|
||||
- call IDDrawExclModeVideo::SetDDrawSurface()
|
||||
- connect the decoded video to the Overlay Mixer's first input pin
|
||||
- remove the Video Renderer filter as it's a windowless playback case.
|
||||
- get IMixerPinConfig(2) interface from the first input pin of the
|
||||
OverlayMixer to get the color key through GetColorKey() method.
|
||||
Also set the aspect ratio mode to stretching from the default letter box
|
||||
mode of the OverlayMixer.
|
||||
- call IDDrawExclModeVideo::SetCallbackInterface() with the pointer to the
|
||||
object implementing the IDDrawExclModeVideoCallback interface.
|
||||
- get the native video size and aspect ratio through
|
||||
IDDrawExclModeVideo::GetNativeVideoProps() method, transform the width
|
||||
and height based on the retrieved aspect ratio, and set the final video
|
||||
size and position using IDDrawExclModeVideo::SetDDrawParameters() method.
|
||||
|
||||
2. The object implementing IDDrawExclModeVideoCallback interface has been
|
||||
kept very simple. It stops color keying of the video area on the back buffer
|
||||
when it gets the OnUpdateOverlay() call with input parameter bBefore=TRUE.
|
||||
The color keying is turned on again on getting another OnUpdateOverlay() call
|
||||
with bBefore=FALSE and with the dwFlags indicating that the overlay is visible.
|
||||
|
||||
3. The SetDDraw*() methods can be called only when the pins of the Overlay
|
||||
Mixer are not connected. Otherwise, the calls will fail.
|
||||
|
||||
4. The application has to draw colorkey at the right position on the (back
|
||||
buffer of the) primary surface to get the video to appear. In the exclusive
|
||||
mode, the Overlay Mixer doesn't draw color key at all.
|
||||
|
||||
5. For DVDs, the subpicture and line21 (closed caption) data are intentionally
|
||||
not rendered in the exclusive mode. The DVD graph builder will not return
|
||||
S_FALSE for this only.
|
||||
|
||||
|
||||
|
||||
Known Issues:
|
||||
=============
|
||||
1. The ball drawn on top of the video only moves when an arrow key is
|
||||
pressed AND released. Holding the arrow key down doesn't move the ball.
|
||||
This was a conscious decision made for the sample application.
|
||||
|
||||
2. The application stops playing the video and tears down the filter graph
|
||||
when it switches to non exclusive mode on getting an Alt-Tab keystroke. The
|
||||
playback is not resumed on activating the application.
|
||||
|
||||
3. The application fills the whole back buffer with black color and then
|
||||
Blts the color key to the target video rectangle. This is not required unless
|
||||
the video is continually changing position. For video playing at the same
|
||||
position, just erasing the previous position of the ball with color key
|
||||
should be sufficient. The comment at the top of the CDDrawObject::FillSurface()
|
||||
method should hopefully not cause any confusion.
|
||||
|
||||
4. Some AVI files (MS-CRAM, Duck compressed) fail to connect to the
|
||||
OverlayMixer filter on some display cards. This causes the sample app to
|
||||
fail in building the graph. As a result, such files cannot be played back on
|
||||
some systems.
|
||||
@@ -0,0 +1,142 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: VidPlay.h
|
||||
//
|
||||
// Desc: DirectShow sample code - video (DVD and file) playback
|
||||
// class header file.
|
||||
//
|
||||
// Copyright (c) 1993-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Suppress C4127: conditional expression is constant
|
||||
#pragma warning(disable:4127)
|
||||
|
||||
//
|
||||
// Some enumerated type definitions...
|
||||
//
|
||||
|
||||
// Player state
|
||||
typedef enum {
|
||||
Uninitialized = 0, Stopped, Paused, Playing, Scanning
|
||||
} PLAYER_STATE ;
|
||||
|
||||
// Define a special WM message for playback related events from DShow filtergraph
|
||||
#define WM_PLAY_EVENT WM_USER + 100
|
||||
#define WM_SIZE_CHANGE WM_USER + 101
|
||||
|
||||
#define DEFAULT_WIDTH 400
|
||||
#define DEFAULT_HEIGHT 240
|
||||
|
||||
|
||||
//
|
||||
// Video Playback base class
|
||||
//
|
||||
class CBaseVideoPlayer
|
||||
{
|
||||
public: // public methods for Windows structure to call
|
||||
CBaseVideoPlayer(void) ;
|
||||
~CBaseVideoPlayer(void) ;
|
||||
|
||||
virtual BOOL Initialize(void) = 0 ;
|
||||
virtual HRESULT BuildGraph(HWND hWndApp, LPDIRECTDRAW pDDObj,
|
||||
LPDIRECTDRAWSURFACE pDDPrimary) = 0 ;
|
||||
virtual HRESULT ClearGraph(void) = 0 ;
|
||||
virtual HRESULT GetNativeVideoData(DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwARX, DWORD *pdwARY) = 0 ;
|
||||
virtual HRESULT SetVideoPosition(DWORD dwLeft, DWORD dwTop, DWORD dwWidth, DWORD dwHeight) = 0 ;
|
||||
virtual HRESULT GetInterfaces(HWND hWndApp) ;
|
||||
virtual HRESULT SetOverlayCallback(IDDrawExclModeVideoCallback *pCallback) = 0 ;
|
||||
HRESULT GetColorKey(DWORD *pdwColorKey) ;
|
||||
BOOL Play(void) ;
|
||||
BOOL Pause(void) ;
|
||||
BOOL Stop(void) ;
|
||||
inline void SetFileName(LPCTSTR lpszFileName) { lstrcpy(m_achFileName, lpszFileName) ; } ;
|
||||
inline BOOL IsGraphReady(void) { return (Uninitialized != m_eState) ; } ;
|
||||
inline PLAYER_STATE GetState(void) { return m_eState ; } ;
|
||||
inline void SetColorKey(DWORD dwColorKey) { m_dwColorKey = dwColorKey ; } ;
|
||||
inline LPCTSTR GetFileName(void) { return m_achFileName ; } ;
|
||||
|
||||
protected:
|
||||
virtual void ReleaseInterfaces(void) ;
|
||||
virtual HRESULT GetColorKeyInternal(IBaseFilter *pOvM = NULL) = 0 ;
|
||||
|
||||
private:
|
||||
void WaitForState(FILTER_STATE State) ;
|
||||
|
||||
protected: // semi-internal state info (to be shared with derived classes)
|
||||
IGraphBuilder *m_pGraph ; // IGraphBuilder interface
|
||||
|
||||
private: // internal state info
|
||||
PLAYER_STATE m_eState ; // player state (run/pause/stop/...)
|
||||
TCHAR m_achFileName[MAX_PATH] ; // current file name
|
||||
|
||||
IMediaControl *m_pMC ; // IMediaControl interface
|
||||
IMediaEventEx *m_pME ; // IMediaEventEx interface
|
||||
|
||||
DWORD m_dwColorKey ; // color key to be used for video
|
||||
} ;
|
||||
|
||||
|
||||
//
|
||||
// DVD Playback class
|
||||
//
|
||||
class CDVDPlayer : public CBaseVideoPlayer
|
||||
{
|
||||
public: // public methods for Windows structure to call
|
||||
CDVDPlayer(void) ;
|
||||
~CDVDPlayer(void) ;
|
||||
|
||||
BOOL Initialize(void) ;
|
||||
|
||||
HRESULT BuildGraph(HWND hWndApp, LPDIRECTDRAW pDDObj, LPDIRECTDRAWSURFACE pDDPrimary) ;
|
||||
HRESULT ClearGraph(void) ;
|
||||
HRESULT GetNativeVideoData(DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwARX, DWORD *pdwARY) ;
|
||||
HRESULT SetVideoPosition(DWORD dwLeft, DWORD dwTop, DWORD dwWidth, DWORD dwHeight) ;
|
||||
HRESULT GetInterfaces(HWND hWndApp) ;
|
||||
HRESULT SetOverlayCallback(IDDrawExclModeVideoCallback *pCallback) ;
|
||||
|
||||
private: // private helper methods for the class' own use
|
||||
void ReleaseInterfaces(void) ;
|
||||
HRESULT GetColorKeyInternal(IBaseFilter *pOvM = NULL) ;
|
||||
DWORD GetStatusText(AM_DVD_RENDERSTATUS *pStatus,
|
||||
LPTSTR lpszStatusText,
|
||||
DWORD dwMaxText) ;
|
||||
|
||||
private: // internal state info
|
||||
IDvdGraphBuilder *m_pDvdGB ; // IDvdGraphBuilder interface
|
||||
IDvdInfo2 *m_pDvdI ; // IDvdInfo interface
|
||||
IDvdControl2 *m_pDvdC ; // IDvdControl interface
|
||||
} ;
|
||||
|
||||
|
||||
//
|
||||
// File Playback class
|
||||
//
|
||||
class CFilePlayer : public CBaseVideoPlayer
|
||||
{
|
||||
public: // public methods for Windows structure to call
|
||||
CFilePlayer(void) ;
|
||||
~CFilePlayer(void) ;
|
||||
|
||||
BOOL Initialize(void) ;
|
||||
|
||||
HRESULT BuildGraph(HWND hWndApp, LPDIRECTDRAW pDDObj, LPDIRECTDRAWSURFACE pDDPrimary) ;
|
||||
HRESULT ClearGraph(void) ;
|
||||
HRESULT GetNativeVideoData(DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwARX, DWORD *pdwARY) ;
|
||||
HRESULT SetVideoPosition(DWORD dwLeft, DWORD dwTop, DWORD dwWidth, DWORD dwHeight) ;
|
||||
HRESULT GetInterfaces(HWND hWndApp) ;
|
||||
HRESULT SetOverlayCallback(IDDrawExclModeVideoCallback *pCallback) ;
|
||||
|
||||
private: // private helper methods for the class' own use
|
||||
void ReleaseInterfaces() ;
|
||||
HRESULT GetColorKeyInternal(IBaseFilter *pOvM = NULL) ;
|
||||
BOOL IsOvMConnected(IBaseFilter *pOvM) ;
|
||||
HRESULT GetVideoRendererInterface(IBaseFilter **ppVR) ;
|
||||
HRESULT AddOvMToGraph(IBaseFilter **ppOvM, LPDIRECTDRAW pDDObj,
|
||||
LPDIRECTDRAWSURFACE pDDPrimary) ;
|
||||
HRESULT SetDDrawParams(IBaseFilter *pOvM, LPDIRECTDRAW pDDObj,
|
||||
LPDIRECTDRAWSURFACE pDDPrimary) ;
|
||||
HRESULT PutVideoThroughOvM(IBaseFilter *pOvM, IBaseFilter *pVR) ;
|
||||
|
||||
private: // internal state info
|
||||
IDDrawExclModeVideo *m_pDDXM ; // IDDrawExclModeVideo interface
|
||||
} ;
|
||||
@@ -0,0 +1,73 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: Jukebox.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - an MFC based C++ jukebox application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Jukebox.h"
|
||||
#include "JukeboxDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CJukeboxApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CJukeboxApp)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxApp construction
|
||||
|
||||
CJukeboxApp::CJukeboxApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CJukeboxApp object
|
||||
|
||||
CJukeboxApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxApp initialization
|
||||
|
||||
BOOL CJukeboxApp::InitInstance()
|
||||
{
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
#ifdef _AFXDLL
|
||||
// In MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete because
|
||||
// their functionality is incorporated into Microsoft's 32-bit operating systems.
|
||||
#if (_MSC_VER <= 1200)
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#endif
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
CJukeboxDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
|
||||
dlg.DoModal();
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
return FALSE;
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
# Microsoft Developer Studio Project File - Name="Jukebox" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=Jukebox - 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 "Jukebox.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 "Jukebox.mak" CFG="Jukebox - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Jukebox - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "Jukebox - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Jukebox - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Gi /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 strmiids.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "Jukebox - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# SUBTRACT CPP /Fr
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 strmiids.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Jukebox - Win32 Release"
|
||||
# Name "Jukebox - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\globals.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Jukebox.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JukeboxDlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\playvideo.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Jukebox.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JukeboxDlg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mediatypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\playvideo.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=.\res\Jukebox.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Jukebox.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\Jukebox.rc2
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ReadMe.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Jukebox"=.\Jukebox.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: Jukebox.h
|
||||
//
|
||||
// Desc: DirectShow sample code - main header file for the Jukebox
|
||||
// application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#if !defined(AFX_JUKEBOX_H__A0CFADEB_2EC4_463F_947A_D0552C0D1CC1__INCLUDED_)
|
||||
#define AFX_JUKEBOX_H__A0CFADEB_2EC4_463F_947A_D0552C0D1CC1__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxApp:
|
||||
// See Jukebox.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CJukeboxApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CJukeboxApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CJukeboxApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CJukeboxApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
extern CJukeboxApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_JUKEBOX_H__A0CFADEB_2EC4_463F_947A_D0552C0D1CC1__INCLUDED_)
|
||||
@@ -0,0 +1,258 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on Jukebox.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=Jukebox - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to Jukebox - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "Jukebox - Win32 Release" && "$(CFG)" != "Jukebox - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Jukebox.mak" CFG="Jukebox - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Jukebox - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "Jukebox - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "Jukebox - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\Jukebox.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\globals.obj"
|
||||
-@erase "$(INTDIR)\Jukebox.obj"
|
||||
-@erase "$(INTDIR)\Jukebox.pch"
|
||||
-@erase "$(INTDIR)\Jukebox.res"
|
||||
-@erase "$(INTDIR)\JukeboxDlg.obj"
|
||||
-@erase "$(INTDIR)\playvideo.obj"
|
||||
-@erase "$(INTDIR)\StdAfx.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\Jukebox.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MD /W3 /Gi /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\Jukebox.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Jukebox.res" /d "NDEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\Jukebox.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=strmiids.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\Jukebox.pdb" /machine:I386 /out:"$(OUTDIR)\Jukebox.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\globals.obj" \
|
||||
"$(INTDIR)\Jukebox.obj" \
|
||||
"$(INTDIR)\JukeboxDlg.obj" \
|
||||
"$(INTDIR)\playvideo.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"$(INTDIR)\Jukebox.res"
|
||||
|
||||
"$(OUTDIR)\Jukebox.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "Jukebox - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\Jukebox.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\globals.obj"
|
||||
-@erase "$(INTDIR)\Jukebox.obj"
|
||||
-@erase "$(INTDIR)\Jukebox.pch"
|
||||
-@erase "$(INTDIR)\Jukebox.res"
|
||||
-@erase "$(INTDIR)\JukeboxDlg.obj"
|
||||
-@erase "$(INTDIR)\playvideo.obj"
|
||||
-@erase "$(INTDIR)\StdAfx.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\Jukebox.exe"
|
||||
-@erase "$(OUTDIR)\Jukebox.ilk"
|
||||
-@erase "$(OUTDIR)\Jukebox.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\Jukebox.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Jukebox.res" /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\Jukebox.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=strmiids.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\Jukebox.pdb" /debug /machine:I386 /out:"$(OUTDIR)\Jukebox.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\globals.obj" \
|
||||
"$(INTDIR)\Jukebox.obj" \
|
||||
"$(INTDIR)\JukeboxDlg.obj" \
|
||||
"$(INTDIR)\playvideo.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"$(INTDIR)\Jukebox.res"
|
||||
|
||||
"$(OUTDIR)\Jukebox.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("Jukebox.dep")
|
||||
!INCLUDE "Jukebox.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "Jukebox.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "Jukebox - Win32 Release" || "$(CFG)" == "Jukebox - Win32 Debug"
|
||||
SOURCE=.\globals.cpp
|
||||
|
||||
"$(INTDIR)\globals.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\Jukebox.pch"
|
||||
|
||||
|
||||
SOURCE=.\Jukebox.cpp
|
||||
|
||||
"$(INTDIR)\Jukebox.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\Jukebox.pch"
|
||||
|
||||
|
||||
SOURCE=.\JukeboxDlg.cpp
|
||||
|
||||
"$(INTDIR)\JukeboxDlg.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\Jukebox.pch"
|
||||
|
||||
|
||||
SOURCE=.\playvideo.cpp
|
||||
|
||||
"$(INTDIR)\playvideo.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\Jukebox.pch"
|
||||
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
|
||||
!IF "$(CFG)" == "Jukebox - Win32 Release"
|
||||
|
||||
CPP_SWITCHES=/nologo /MD /W3 /Gi /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\Jukebox.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\Jukebox.pch" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "Jukebox - Win32 Debug"
|
||||
|
||||
CPP_SWITCHES=/nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\Jukebox.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\Jukebox.pch" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\Jukebox.rc
|
||||
|
||||
"$(INTDIR)\Jukebox.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\Jukebox.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\Jukebox.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About Jukebox"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||
LTEXT "DirectShow Jukebox Sample",IDC_STATIC,40,10,119,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (c) 2000-2001 Microsoft Corporation",IDC_STATIC,40,
|
||||
34,188,8
|
||||
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
|
||||
LTEXT "Version 8.1",IDC_STATIC,40,22,119,8,SS_NOPREFIX
|
||||
END
|
||||
|
||||
IDD_JUKEBOX_DIALOG DIALOGEX 0, 0, 349, 326
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "DirectShow Jukebox Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LISTBOX IDC_LIST_FILES,7,62,155,120,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
|
||||
WS_TABSTOP,WS_EX_DLGMODALFRAME
|
||||
DEFPUSHBUTTON "&Play",IDC_BUTTON_PLAY,14,13,40,14
|
||||
PUSHBUTTON "&Stop",IDC_BUTTON_STOP,56,13,40,14
|
||||
PUSHBUTTON "P&ause",IDC_BUTTON_PAUSE,98,13,40,14
|
||||
PUSHBUTTON "&FrameStep",IDC_BUTTON_FRAMESTEP,144,13,40,14,
|
||||
WS_DISABLED
|
||||
CONTROL "&Thru",IDC_CHECK_PLAYTHROUGH,"Button",BS_AUTOCHECKBOX |
|
||||
BS_PUSHLIKE | WS_TABSTOP,198,13,40,14
|
||||
CONTROL "&Loop",IDC_CHECK_LOOP,"Button",BS_AUTOCHECKBOX |
|
||||
BS_PUSHLIKE | WS_TABSTOP,241,13,40,14
|
||||
CONTROL "&Mute",IDC_CHECK_MUTE,"Button",BS_AUTOCHECKBOX |
|
||||
BS_PUSHLIKE | WS_TABSTOP,292,13,40,14
|
||||
LISTBOX IDC_LIST_FILTERS,7,197,131,74,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_PINS_INPUT,145,197,79,31,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_PINS_OUTPUT,145,238,79,33,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
CONTROL "Display Events",IDC_CHECK_EVENTS,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,233,187,65,8
|
||||
PUSHBUTTON "&Clear",IDC_BUTTON_CLEAR_EVENTS,306,184,35,12
|
||||
LISTBOX IDC_LIST_EVENTS,233,197,108,74,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Filter P&roperties",IDC_BUTTON_PROPPAGE,7,286,72,14,
|
||||
WS_DISABLED
|
||||
LTEXT "<Media path>",IDC_STATUS_DIRECTORY,88,289,254,8
|
||||
CTEXT "Media Files",IDC_STATIC_FILELIST,9,52,148,8
|
||||
LTEXT "Video Screen",IDC_STATIC,181,52,56,8
|
||||
CONTROL "",IDC_MOVIE_SCREEN,"Static",SS_BLACKRECT,181,62,160,120
|
||||
CTEXT "Filters",IDC_STATIC,7,187,143,8
|
||||
CTEXT "Input Pins",IDC_STATIC,145,187,79,8
|
||||
CTEXT "Output Pins",IDC_STATIC,145,229,79,8
|
||||
LTEXT "<Status>",IDC_STATUS,7,273,70,8
|
||||
RTEXT "File size: 000000000 bytes",IDC_STATIC_FILESIZE,233,273,
|
||||
108,8
|
||||
CTEXT "File date: 00/00/0000",IDC_STATIC_FILEDATE,145,273,79,8
|
||||
CONTROL "Spin1",IDC_SPIN_FILES,"msctls_updown32",UDS_WRAP |
|
||||
UDS_ALIGNLEFT | UDS_ARROWKEYS,163,62,14,120
|
||||
PUSHBUTTON "Set Media &Directory",IDC_BUTTON_SET_MEDIADIR,7,304,72,
|
||||
14
|
||||
EDITTEXT IDC_EDIT_MEDIADIR,88,304,203,14,ES_AUTOHSCROLL
|
||||
RTEXT "00m:00s:000ms",IDC_STATIC_DURATION,80,273,57,8
|
||||
RTEXT "",IDC_STATIC_IMAGESIZE,236,52,105,8
|
||||
CONTROL "Slider1",IDC_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS |
|
||||
TBS_TOP | WS_DISABLED | WS_TABSTOP,82,27,256,20
|
||||
LTEXT "Position: 00m:00s",IDC_STATIC_POSITION,15,33,63,8
|
||||
GROUPBOX "",IDC_STATIC,7,3,334,46
|
||||
PUSHBUTTON "&GraphEdit",IDC_BUTTON_GRAPHEDIT,293,304,49,14
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 8,1,0,0
|
||||
PRODUCTVERSION 8,1,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "Jukebox MFC Application\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "Jukebox\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2000-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "Jukebox.EXE\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 228
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 48
|
||||
END
|
||||
|
||||
IDD_JUKEBOX_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 342
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 319
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_ABOUTBOX "&About Jukebox..."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#include "res\Jukebox.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
//==========================================================================;
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
|
||||
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
|
||||
// PURPOSE.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
//--------------------------------------------------------------------------;
|
||||
// JukeboxDlg.h : header file
|
||||
//
|
||||
|
||||
#if !defined(AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
|
||||
#define AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <dshow.h>
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
const int TICKLEN=100, TIMERID=55;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxDlg dialog
|
||||
|
||||
class CJukeboxDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CJukeboxDlg(CWnd* pParent = NULL); // standard constructor
|
||||
void FillFileList(LPTSTR pszCmdLine);
|
||||
|
||||
HRESULT PrepareMedia(LPTSTR lpszMovie);
|
||||
BOOL DisplayFileInfo(LPTSTR szFile);
|
||||
HRESULT DisplayFileDuration(void);
|
||||
BOOL DisplayImageInfo(void);
|
||||
void Say(LPTSTR szText);
|
||||
|
||||
LONG GetDXMediaPath(TCHAR *strPath);
|
||||
LONG GetGraphEditPath(TCHAR *szPath);
|
||||
void InitMediaDirectory(void);
|
||||
|
||||
HRESULT InitDirectShow(void);
|
||||
HRESULT FreeDirectShow(void);
|
||||
HRESULT HandleGraphEvent(void);
|
||||
|
||||
void ResetDirectShow(void);
|
||||
void DisplayECEvent(long lEventCode, long lParam1, long lParam2);
|
||||
void CenterVideo(void);
|
||||
void PlayNextFile(void);
|
||||
void PlayPreviousFile(void);
|
||||
void PlaySelectedFile(void);
|
||||
void ShowState(void);
|
||||
void ConfigureSeekbar(void);
|
||||
void StartSeekTimer(void);
|
||||
void StopSeekTimer(void);
|
||||
void HandleTrackbar(WPARAM wReq);
|
||||
void UpdatePosition(REFERENCE_TIME rtNow);
|
||||
void ReadMediaPosition(void);
|
||||
|
||||
BOOL CanStep(void);
|
||||
HRESULT StepFrame(void);
|
||||
HRESULT EnumFilters(void);
|
||||
HRESULT EnumPins(IBaseFilter *pFilter, PIN_DIRECTION PinDir, CListBox& Listbox);
|
||||
IBaseFilter * FindFilterFromName(LPTSTR szName);
|
||||
BOOL SupportsPropertyPage(IBaseFilter *pFilter);
|
||||
|
||||
void CALLBACK MediaTimer(UINT wTimerID, UINT msg, ULONG dwUser, ULONG dw1, ULONG dw2);
|
||||
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CJukeboxDlg)
|
||||
enum { IDD = IDD_JUKEBOX_DIALOG };
|
||||
CStatic m_StrPosition;
|
||||
CSliderCtrl m_Seekbar;
|
||||
CStatic m_StrImageSize;
|
||||
CStatic m_StrDuration;
|
||||
CEdit m_EditMediaDir;
|
||||
CSpinButtonCtrl m_SpinFiles;
|
||||
CButton m_ButtonFrameStep;
|
||||
CListBox m_ListEvents;
|
||||
CButton m_CheckEvents;
|
||||
CButton m_ButtonProperties;
|
||||
CStatic m_StrMediaPath;
|
||||
CButton m_CheckMute;
|
||||
CButton m_ButtonStop;
|
||||
CButton m_ButtonPlay;
|
||||
CButton m_ButtonPause;
|
||||
CButton m_CheckPlaythrough;
|
||||
CButton m_CheckLoop;
|
||||
CStatic m_StrFileDate;
|
||||
CStatic m_StrFileSize;
|
||||
CListBox m_ListPinsOutput;
|
||||
CListBox m_ListPinsInput;
|
||||
CStatic m_StrFileList;
|
||||
CStatic m_Status;
|
||||
CStatic m_Screen;
|
||||
CListBox m_ListInfo;
|
||||
CListBox m_ListFilters;
|
||||
CListBox m_ListFiles;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CJukeboxDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
int m_nCurrentFileSelection;
|
||||
REFERENCE_TIME g_rtTotalTime;
|
||||
UINT_PTR g_wTimerID;
|
||||
TCHAR m_szCurrentDir[MAX_PATH];
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CJukeboxDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnSelectFile();
|
||||
afx_msg void OnPause();
|
||||
afx_msg void OnPlay();
|
||||
afx_msg void OnStop();
|
||||
afx_msg void OnCheckMute();
|
||||
afx_msg void OnCheckLoop();
|
||||
afx_msg void OnCheckPlaythrough();
|
||||
afx_msg void OnSelchangeListFilters();
|
||||
afx_msg void OnDblclkListFilters();
|
||||
afx_msg void OnButtonProppage();
|
||||
afx_msg void OnCheckEvents();
|
||||
afx_msg void OnButtonFramestep();
|
||||
afx_msg void OnButtonClearEvents();
|
||||
afx_msg void OnDblclkListFiles();
|
||||
afx_msg void OnDeltaposSpinFiles(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnButtonSetMediadir();
|
||||
afx_msg void OnTimer(UINT nIDEvent);
|
||||
afx_msg void OnButtonGraphedit();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC *);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// Jukebox.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__7592F2D2_3E29_4340_A089_4A1B57E80874__INCLUDED_)
|
||||
#define AFX_STDAFX_H__7592F2D2_3E29_4340_A089_4A1B57E80874__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__7592F2D2_3E29_4340_A089_4A1B57E80874__INCLUDED_)
|
||||
@@ -0,0 +1,31 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: Globals.h
|
||||
//
|
||||
// Desc: DirectShow sample code - global data for Jukebox application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <dshow.h>
|
||||
|
||||
#include "playvideo.h"
|
||||
|
||||
//
|
||||
// Global data
|
||||
//
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaSeeking *pMS = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IMediaEventEx *pME = NULL;
|
||||
IBasicVideo *pBV = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
|
||||
FILTER_STATE g_psCurrent=State_Stopped;
|
||||
|
||||
BOOL g_bLooping=FALSE,
|
||||
g_bAudioOnly=FALSE,
|
||||
g_bDisplayEvents=FALSE,
|
||||
g_bGlobalMute=FALSE,
|
||||
g_bPlayThrough=FALSE;
|
||||
@@ -0,0 +1,52 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: MediaTypes.h
|
||||
//
|
||||
// Desc: DirectShow sample code - hardware/project-specific support for
|
||||
// Jukebox application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
typedef struct _media_info
|
||||
{
|
||||
LPTSTR pszType;
|
||||
LPTSTR pszName;
|
||||
|
||||
} MEDIA_INFO, *PMEDIA_INFO;
|
||||
|
||||
|
||||
//
|
||||
// Some projects support different types of DirectShow media
|
||||
//
|
||||
#define DEFAULT_SEARCH_PATH TEXT("\\")
|
||||
|
||||
#define NUM_MEDIA_TYPES 21
|
||||
|
||||
const MEDIA_INFO TypeInfo[NUM_MEDIA_TYPES] = {
|
||||
{TEXT("*.qt"), TEXT("QuickTime video") },
|
||||
{TEXT("*.mov"), TEXT("QuickTime video") },
|
||||
{TEXT("*.avi"), TEXT("AVI video") },
|
||||
{TEXT("*.mpg"), TEXT("MPEG video") },
|
||||
{TEXT("*.mpe*"), TEXT("MPEG video") }, /* MPE, MPEG */
|
||||
{TEXT("*.m1v"), TEXT("MPEG video") }, /* MPEG-1 video */
|
||||
{TEXT("*.wav"), TEXT("WAV audio") },
|
||||
{TEXT("*.au"), TEXT("AU audio") },
|
||||
{TEXT("*.aif*"), TEXT("AIFF audio") }, /* AIF, AIFF, AIFC */
|
||||
{TEXT("*.snd"), TEXT("SND audio") },
|
||||
{TEXT("*.mpa"), TEXT("MPEG audio") }, /* MPEG audio */
|
||||
{TEXT("*.mp1"), TEXT("MPEG audio") }, /* MPEG audio */
|
||||
{TEXT("*.mp2"), TEXT("MPEG audio") }, /* MPEG audio */
|
||||
{TEXT("*.mid"), TEXT("MIDI") }, /* MIDI */
|
||||
{TEXT("*.midi"), TEXT("MIDI") }, /* MIDI */
|
||||
{TEXT("*.rmi"), TEXT("MIDI") }, /* MIDI */
|
||||
{TEXT("*.asf"), TEXT("ASF Video") }, /* Advanced Streaming */
|
||||
{TEXT("*.wma"), TEXT("Windows Audio") }, /* Windows Media Audio */
|
||||
{TEXT("*.mp3"), TEXT("MP3 audio") }, /* MPEG-1 Layer III */
|
||||
{TEXT("*.wmv"), TEXT("Windows Video") }, /* Windows Media Video */
|
||||
{TEXT("*.dat"), TEXT("Video CD") }, /* Video CD format */
|
||||
};
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayVideo.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - media control functions.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <dshow.h>
|
||||
|
||||
#include "playvideo.h"
|
||||
|
||||
|
||||
HRESULT RunMedia()
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
if (!pMC)
|
||||
return S_OK;
|
||||
|
||||
// Start playback
|
||||
hr = pMC->Run();
|
||||
if (FAILED(hr)) {
|
||||
RetailOutput(TEXT("\r\n*** Failed(%08lx) in Run()!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Remember play state
|
||||
g_psCurrent = State_Running;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT StopMedia()
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
if (!pMC)
|
||||
return S_OK;
|
||||
|
||||
// If we're already stopped, don't check again
|
||||
if (g_psCurrent == State_Stopped)
|
||||
return hr;
|
||||
|
||||
// Stop playback
|
||||
hr = pMC->Stop();
|
||||
if (FAILED(hr)) {
|
||||
RetailOutput(TEXT("\r\n*** Failed(%08lx) in Stop()!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Remember play state
|
||||
g_psCurrent = State_Stopped;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT PauseMedia(void)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
if (!pMC)
|
||||
return S_OK;
|
||||
|
||||
// Play/pause
|
||||
if(g_psCurrent != State_Running)
|
||||
return S_OK;
|
||||
|
||||
hr = pMC->Pause();
|
||||
if (FAILED(hr)) {
|
||||
RetailOutput(TEXT("\r\n*** Failed(%08lx) in Pause()!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
// else
|
||||
// RetailOutput(TEXT("*** Media is PAUSED.\r\n"));
|
||||
|
||||
// Remember play state
|
||||
g_psCurrent = State_Paused;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT MuteAudio(void)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
IBasicAudio *pBA=NULL;
|
||||
long lVolume;
|
||||
|
||||
if (!pGB)
|
||||
return S_OK;
|
||||
|
||||
hr = pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA);
|
||||
if (FAILED(hr))
|
||||
return S_OK;
|
||||
|
||||
// Read current volume
|
||||
hr = pBA->get_Volume(&lVolume);
|
||||
if (hr == E_NOTIMPL)
|
||||
{
|
||||
// Fail quietly if this is a video-only media file
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
else if (FAILED(hr))
|
||||
{
|
||||
RetailOutput(TEXT("Failed in pBA->get_Volume! hr=0x%x\r\n"), hr);
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
lVolume = VOLUME_SILENCE;
|
||||
// RetailOutput(TEXT("*** Media is MUTING.\r\n"));
|
||||
|
||||
// Set new volume
|
||||
hr = pBA->put_Volume(lVolume);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
RetailOutput(TEXT("Failed in pBA->put_Volume! hr=0x%x\r\n"), hr);
|
||||
}
|
||||
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT ResumeAudio(void)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
IBasicAudio *pBA=NULL;
|
||||
long lVolume;
|
||||
|
||||
if (!pGB)
|
||||
return S_OK;
|
||||
|
||||
hr = pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA);
|
||||
if (FAILED(hr))
|
||||
return S_OK;
|
||||
|
||||
// Read current volume
|
||||
hr = pBA->get_Volume(&lVolume);
|
||||
if (hr == E_NOTIMPL)
|
||||
{
|
||||
// Fail quietly if this is a video-only media file
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
else if (FAILED(hr))
|
||||
{
|
||||
RetailOutput(TEXT("Failed in pBA->get_Volume! hr=0x%x\r\n"), hr);
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
lVolume = VOLUME_FULL;
|
||||
// RetailOutput(TEXT("*** Media is Resuming normal audio\r\n"));
|
||||
|
||||
// Set new volume
|
||||
hr = pBA->put_Volume(lVolume);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
RetailOutput(TEXT("Failed in pBA->put_Volume! hr=0x%x\r\n"), hr);
|
||||
}
|
||||
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
void RetailOutput(TCHAR *tszErr, ...)
|
||||
{
|
||||
TCHAR tszErrOut[MAX_PATH + 256];
|
||||
|
||||
va_list valist;
|
||||
|
||||
va_start(valist,tszErr);
|
||||
wvsprintf(tszErrOut, tszErr, valist);
|
||||
OutputDebugString(tszErrOut);
|
||||
va_end (valist);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayVideo.h
|
||||
//
|
||||
// Desc: DirectShow sample code - declarations for media control functions.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef PLAY_VID_H
|
||||
#define PLAY_VID_H
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
#define VOLUME_FULL 0L
|
||||
#define VOLUME_SILENCE -10000L
|
||||
|
||||
// Application-defined messages
|
||||
#define WM_GRAPHNOTIFY WM_APP + 1
|
||||
#define WM_FIRSTFILE WM_APP + 2
|
||||
#define WM_PLAYFILE WM_APP + 3
|
||||
#define WM_NEXTFILE WM_APP + 4
|
||||
#define WM_PREVIOUSFILE WM_APP + 5
|
||||
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(i) {if (i) i->Release(); i = NULL;}
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{RetailOutput(TEXT("FAILED(0x%x) ") TEXT(#x) TEXT("\n"), hr); goto CLEANUP;}
|
||||
|
||||
//
|
||||
// Global data
|
||||
//
|
||||
extern IGraphBuilder *pGB;
|
||||
extern IMediaSeeking *pMS;
|
||||
extern IMediaControl *pMC;
|
||||
extern IMediaEventEx *pME;
|
||||
extern IBasicVideo *pBV;
|
||||
extern IVideoWindow *pVW;
|
||||
|
||||
extern FILTER_STATE g_psCurrent;
|
||||
extern BOOL g_bLooping, g_bAudioOnly, g_bPlayThrough;
|
||||
extern BOOL g_bDisplayEvents, g_bGlobalMute;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// External function-prototypes
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT RunMedia(void);
|
||||
HRESULT StopMedia(void);
|
||||
HRESULT PauseMedia(void);
|
||||
HRESULT PlayMedia(LPTSTR lpszMovie, HINSTANCE hInstance);
|
||||
HRESULT CheckMovieState(BOOL *pbComplete);
|
||||
HRESULT GetInterfaces(void);
|
||||
HRESULT MuteAudio(void);
|
||||
HRESULT ResumeAudio(void);
|
||||
void CleanupInterfaces(void);
|
||||
void ToggleFullscreen(void);
|
||||
|
||||
void RetailOutput(TCHAR *tszErr, ...);
|
||||
|
||||
#endif // !defined(PLAY_VID_H)
|
||||
@@ -0,0 +1,54 @@
|
||||
DirectShow Sample -- Jukebox
|
||||
----------------------------
|
||||
|
||||
Description
|
||||
|
||||
Video jukebox application.
|
||||
|
||||
This application scans a directory for media files and displays a list of the
|
||||
relevant file names. The user can play an individual file or play all of the
|
||||
media files in order. The jukebox also displays information about the filter
|
||||
graphs that it creates, including the names of the filters, the names of their
|
||||
corresponding pins, and the event codes that are generated.
|
||||
|
||||
Note: This sample requires Microsoft Foundation Class Library 4.2 (Mfc42.dll).
|
||||
|
||||
Note: In order to launch GraphEdit to view the currently selected file, the GraphEdt.exe
|
||||
utility must exist in a directory on your search path (like c:\windows or c:\winnt).
|
||||
|
||||
|
||||
User's Guide
|
||||
|
||||
If a directory name is specified as a command-line argument, the jukebox scans
|
||||
that directory at startup. Otherwise, it scans the default SDK media directory,
|
||||
which is located at Samples\Multimedia\Media under the SDK root directory.
|
||||
The jukebox displays a list of all the media files in the directory, from which
|
||||
the user can select a file to play.
|
||||
|
||||
When you select a video file from the files list, Jukebox will display its
|
||||
first video frame in the "Video Screen" window. If you select an audio-only
|
||||
file, the video screen will be painted gray.
|
||||
|
||||
The jukebox offers the following user-interface elements:
|
||||
|
||||
Play, Stop, Pause, and FrameStep buttons: Use these buttons to control graph
|
||||
playback. (The FrameStep button might be disabled, if the graph does not
|
||||
support the IVideoFrameStep interface.)
|
||||
|
||||
Thru and Loop buttons: Click the Thru button to play through the entire file list,
|
||||
starting from the current selection. Click the Loop button to loop the same
|
||||
file repeatedly. These two buttons are mutually exclusive.
|
||||
|
||||
Mute button: Mutes the audio.
|
||||
|
||||
Filters, Input Pins, and Output Pins: When the jukebox creates a graph,
|
||||
it displays a list of the filters in the graph. If the user selects one
|
||||
of the filter names, the jukebox displays a list of the filter's input pins
|
||||
and a list of the filter's output pins.
|
||||
|
||||
Display Events: If this box is checked, the jukebox displays the event codes
|
||||
that it receives. To clear the list, click the Clear button.
|
||||
|
||||
Properties button: To view a filter's property pages, select the filter name
|
||||
and click the Properties button. If the filter does not support
|
||||
a property page, the button is disabled.
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// JUKEBOX.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,49 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by Jukebox.rc
|
||||
//
|
||||
#define IDM_ABOUTBOX 0x0010
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDS_ABOUTBOX 101
|
||||
#define IDD_JUKEBOX_DIALOG 102
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDC_LIST_FILES 1002
|
||||
#define IDC_MOVIE_SCREEN 1005
|
||||
#define IDC_LIST_FILTERS 1006
|
||||
#define IDC_LIST_PINS_INPUT 1007
|
||||
#define IDC_LIST_PINS_OUTPUT 1008
|
||||
#define IDC_BUTTON_PLAY 1009
|
||||
#define IDC_BUTTON_STOP 1010
|
||||
#define IDC_BUTTON_PAUSE 1011
|
||||
#define IDC_CHECK_MUTE 1013
|
||||
#define IDC_CHECK_LOOP 1014
|
||||
#define IDC_STATUS 1015
|
||||
#define IDC_CHECK_PLAYTHROUGH 1016
|
||||
#define IDC_STATIC_FILELIST 1017
|
||||
#define IDC_STATIC_FILESIZE 1018
|
||||
#define IDC_STATIC_FILEDATE 1019
|
||||
#define IDC_STATUS_DIRECTORY 1020
|
||||
#define IDC_BUTTON_FRAMESTEP 1022
|
||||
#define IDC_BUTTON_PROPPAGE 1027
|
||||
#define IDC_CHECK_EVENTS 1028
|
||||
#define IDC_LIST_EVENTS 1029
|
||||
#define IDC_BUTTON_CLEAR_EVENTS 1030
|
||||
#define IDC_SPIN_FILES 1031
|
||||
#define IDC_BUTTON_SET_MEDIADIR 1032
|
||||
#define IDC_EDIT_MEDIADIR 1033
|
||||
#define IDC_STATIC_DURATION 1034
|
||||
#define IDC_STATIC_IMAGESIZE 1035
|
||||
#define IDC_SLIDER 1036
|
||||
#define IDC_STATIC_POSITION 1037
|
||||
#define IDC_BUTTON_GRAPHEDIT 1038
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 132
|
||||
#define _APS_NEXT_COMMAND_VALUE 32781
|
||||
#define _APS_NEXT_CONTROL_VALUE 1039
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,73 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: JukeboxASF.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - an MFC based C++ jukebox application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "JukeboxASF.h"
|
||||
#include "JukeboxASFDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CJukeboxApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CJukeboxApp)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxApp construction
|
||||
|
||||
CJukeboxApp::CJukeboxApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CJukeboxApp object
|
||||
|
||||
CJukeboxApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxApp initialization
|
||||
|
||||
BOOL CJukeboxApp::InitInstance()
|
||||
{
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
#ifdef _AFXDLL
|
||||
// In MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete because
|
||||
// their functionality is incorporated into Microsoft's 32-bit operating systems.
|
||||
#if (_MSC_VER <= 1200)
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#endif
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
CJukeboxDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
|
||||
dlg.DoModal();
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
return FALSE;
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
# Microsoft Developer Studio Project File - Name="JukeboxASF" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=JukeboxASF - 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 "JukeboxASF.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 "JukeboxASF.mak" CFG="JukeboxASF - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "JukeboxASF - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "JukeboxASF - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "JukeboxASF - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Gi /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 strmiids.lib ..\..\common\wmstub.lib ..\..\common\wmvcore.lib /nologo /stack:0x200000,0x200000 /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "JukeboxASF - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# SUBTRACT CPP /Fr
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 strmiids.lib ..\..\common\wmstub.lib ..\..\common\wmvcore.lib /nologo /stack:0x200000,0x200000 /subsystem:windows /debug /machine:I386 /nodefaultlib:"msvcrt" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "JukeboxASF - Win32 Release"
|
||||
# Name "JukeboxASF - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\globals.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JukeboxASF.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JukeboxASFDlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\keyprovider.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\playvideo.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JukeboxASF.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JukeboxASFDlg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\keyprovider.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mediatypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\playvideo.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=.\res\Jukebox.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\JukeboxASF.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JukeboxASF.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\JukeboxASF.rc2
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ReadMe.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "JukeboxASF"=.\JukeboxASF.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: JukeboxASF.h
|
||||
//
|
||||
// Desc: DirectShow sample code - main header file for the Jukebox
|
||||
// application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#if !defined(AFX_JUKEBOX_H__A0CFADEB_2EC4_463F_947A_D0552C0D1CC1__INCLUDED_)
|
||||
#define AFX_JUKEBOX_H__A0CFADEB_2EC4_463F_947A_D0552C0D1CC1__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxApp:
|
||||
// See Jukebox.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CJukeboxApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CJukeboxApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CJukeboxApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CJukeboxApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
extern CJukeboxApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_JUKEBOX_H__A0CFADEB_2EC4_463F_947A_D0552C0D1CC1__INCLUDED_)
|
||||
@@ -0,0 +1,267 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on JukeboxASF.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=JukeboxASF - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to JukeboxASF - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "JukeboxASF - Win32 Release" && "$(CFG)" != "JukeboxASF - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "JukeboxASF.mak" CFG="JukeboxASF - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "JukeboxASF - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "JukeboxASF - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "JukeboxASF - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\JukeboxASF.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\globals.obj"
|
||||
-@erase "$(INTDIR)\JukeboxASF.obj"
|
||||
-@erase "$(INTDIR)\JukeboxASF.pch"
|
||||
-@erase "$(INTDIR)\JukeboxASF.res"
|
||||
-@erase "$(INTDIR)\JukeboxASFDlg.obj"
|
||||
-@erase "$(INTDIR)\keyprovider.obj"
|
||||
-@erase "$(INTDIR)\playvideo.obj"
|
||||
-@erase "$(INTDIR)\StdAfx.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\JukeboxASF.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MD /W3 /Gi /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\JukeboxASF.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\JukeboxASF.res" /d "NDEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\JukeboxASF.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=strmiids.lib ..\..\common\wmstub.lib ..\..\common\wmvcore.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\JukeboxASF.pdb" /machine:I386 /out:"$(OUTDIR)\JukeboxASF.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\globals.obj" \
|
||||
"$(INTDIR)\JukeboxASF.obj" \
|
||||
"$(INTDIR)\JukeboxASFDlg.obj" \
|
||||
"$(INTDIR)\keyprovider.obj" \
|
||||
"$(INTDIR)\playvideo.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"$(INTDIR)\JukeboxASF.res"
|
||||
|
||||
"$(OUTDIR)\JukeboxASF.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "JukeboxASF - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\JukeboxASF.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\globals.obj"
|
||||
-@erase "$(INTDIR)\JukeboxASF.obj"
|
||||
-@erase "$(INTDIR)\JukeboxASF.pch"
|
||||
-@erase "$(INTDIR)\JukeboxASF.res"
|
||||
-@erase "$(INTDIR)\JukeboxASFDlg.obj"
|
||||
-@erase "$(INTDIR)\keyprovider.obj"
|
||||
-@erase "$(INTDIR)\playvideo.obj"
|
||||
-@erase "$(INTDIR)\StdAfx.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\JukeboxASF.exe"
|
||||
-@erase "$(OUTDIR)\JukeboxASF.ilk"
|
||||
-@erase "$(OUTDIR)\JukeboxASF.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\JukeboxASF.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\JukeboxASF.res" /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\JukeboxASF.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=strmiids.lib ..\..\common\wmstub.lib ..\..\common\wmvcore.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\JukeboxASF.pdb" /debug /machine:I386 /out:"$(OUTDIR)\JukeboxASF.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\globals.obj" \
|
||||
"$(INTDIR)\JukeboxASF.obj" \
|
||||
"$(INTDIR)\JukeboxASFDlg.obj" \
|
||||
"$(INTDIR)\keyprovider.obj" \
|
||||
"$(INTDIR)\playvideo.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"$(INTDIR)\JukeboxASF.res"
|
||||
|
||||
"$(OUTDIR)\JukeboxASF.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("JukeboxASF.dep")
|
||||
!INCLUDE "JukeboxASF.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "JukeboxASF.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "JukeboxASF - Win32 Release" || "$(CFG)" == "JukeboxASF - Win32 Debug"
|
||||
SOURCE=.\globals.cpp
|
||||
|
||||
"$(INTDIR)\globals.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\JukeboxASF.pch"
|
||||
|
||||
|
||||
SOURCE=.\JukeboxASF.cpp
|
||||
|
||||
"$(INTDIR)\JukeboxASF.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\JukeboxASF.pch"
|
||||
|
||||
|
||||
SOURCE=.\JukeboxASFDlg.cpp
|
||||
|
||||
"$(INTDIR)\JukeboxASFDlg.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\JukeboxASF.pch"
|
||||
|
||||
|
||||
SOURCE=.\keyprovider.cpp
|
||||
|
||||
"$(INTDIR)\keyprovider.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\JukeboxASF.pch"
|
||||
|
||||
|
||||
SOURCE=.\playvideo.cpp
|
||||
|
||||
"$(INTDIR)\playvideo.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\JukeboxASF.pch"
|
||||
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
|
||||
!IF "$(CFG)" == "JukeboxASF - Win32 Release"
|
||||
|
||||
CPP_SWITCHES=/nologo /MD /W3 /Gi /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\JukeboxASF.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\JukeboxASF.pch" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "JukeboxASF - Win32 Debug"
|
||||
|
||||
CPP_SWITCHES=/nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\JukeboxASF.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\JukeboxASF.pch" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\JukeboxASF.rc
|
||||
|
||||
"$(INTDIR)\JukeboxASF.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\Jukebox.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\Jukebox.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About Jukebox"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||
LTEXT "DirectShow Jukebox ASF Sample",IDC_STATIC,40,10,119,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (c) 2000-2001 Microsoft Corporation",IDC_STATIC,40,
|
||||
34,188,8
|
||||
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
|
||||
LTEXT "Version 8.1",IDC_STATIC,40,22,119,8,SS_NOPREFIX
|
||||
END
|
||||
|
||||
IDD_JUKEBOX_DIALOG DIALOGEX 0, 0, 349, 326
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "DirectShow Jukebox ASF Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LISTBOX IDC_LIST_FILES,7,62,155,120,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
|
||||
WS_TABSTOP,WS_EX_DLGMODALFRAME
|
||||
DEFPUSHBUTTON "&Play",IDC_BUTTON_PLAY,14,13,40,14
|
||||
PUSHBUTTON "&Stop",IDC_BUTTON_STOP,56,13,40,14
|
||||
PUSHBUTTON "P&ause",IDC_BUTTON_PAUSE,98,13,40,14
|
||||
PUSHBUTTON "&FrameStep",IDC_BUTTON_FRAMESTEP,144,13,40,14,
|
||||
WS_DISABLED
|
||||
CONTROL "&Thru",IDC_CHECK_PLAYTHROUGH,"Button",BS_AUTOCHECKBOX |
|
||||
BS_PUSHLIKE | WS_TABSTOP,198,13,40,14
|
||||
CONTROL "&Loop",IDC_CHECK_LOOP,"Button",BS_AUTOCHECKBOX |
|
||||
BS_PUSHLIKE | WS_TABSTOP,241,13,40,14
|
||||
CONTROL "&Mute",IDC_CHECK_MUTE,"Button",BS_AUTOCHECKBOX |
|
||||
BS_PUSHLIKE | WS_TABSTOP,292,13,40,14
|
||||
LISTBOX IDC_LIST_FILTERS,7,197,131,74,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_PINS_INPUT,145,197,79,31,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_PINS_OUTPUT,145,238,79,33,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
CONTROL "Display Events",IDC_CHECK_EVENTS,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,233,187,65,8
|
||||
PUSHBUTTON "&Clear",IDC_BUTTON_CLEAR_EVENTS,306,184,35,12
|
||||
LISTBOX IDC_LIST_EVENTS,233,197,108,74,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Filter P&roperties",IDC_BUTTON_PROPPAGE,7,286,72,14,
|
||||
WS_DISABLED
|
||||
LTEXT "<Media path>",IDC_STATUS_DIRECTORY,88,289,254,8
|
||||
CTEXT "Media Files",IDC_STATIC_FILELIST,9,52,148,8
|
||||
LTEXT "Video Screen",IDC_STATIC,181,52,56,8
|
||||
CONTROL "",IDC_MOVIE_SCREEN,"Static",SS_BLACKRECT,181,62,160,120
|
||||
CTEXT "Filters",IDC_STATIC,7,187,143,8
|
||||
CTEXT "Input Pins",IDC_STATIC,145,187,79,8
|
||||
CTEXT "Output Pins",IDC_STATIC,145,229,79,8
|
||||
LTEXT "<Status>",IDC_STATUS,7,273,70,8
|
||||
RTEXT "File size: 000000000 bytes",IDC_STATIC_FILESIZE,233,273,
|
||||
108,8
|
||||
CTEXT "File date: 00/00/0000",IDC_STATIC_FILEDATE,145,273,79,8
|
||||
CONTROL "Spin1",IDC_SPIN_FILES,"msctls_updown32",UDS_WRAP |
|
||||
UDS_ALIGNLEFT | UDS_ARROWKEYS,163,62,14,120
|
||||
PUSHBUTTON "Set Media &Directory",IDC_BUTTON_SET_MEDIADIR,7,304,72,
|
||||
14
|
||||
EDITTEXT IDC_EDIT_MEDIADIR,88,304,203,14,ES_AUTOHSCROLL
|
||||
RTEXT "00m:00s:000ms",IDC_STATIC_DURATION,80,273,57,8
|
||||
RTEXT "",IDC_STATIC_IMAGESIZE,236,52,105,8
|
||||
CONTROL "Slider1",IDC_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS |
|
||||
TBS_TOP | WS_DISABLED | WS_TABSTOP,82,27,256,20
|
||||
LTEXT "Position: 00m:00s",IDC_STATIC_POSITION,15,33,63,8
|
||||
GROUPBOX "",IDC_STATIC,7,3,334,46
|
||||
PUSHBUTTON "&GraphEdit",IDC_BUTTON_GRAPHEDIT,293,304,49,14
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 8,1,0,0
|
||||
PRODUCTVERSION 8,1,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "JukeboxASF MFC Application\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "Jukebox\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2000-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "JukeboxASF.EXE\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 228
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 48
|
||||
END
|
||||
|
||||
IDD_JUKEBOX_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 342
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 319
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_ABOUTBOX "&About Jukebox ASF..."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#include "res\Jukebox.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: JukeboxASFDlg.h
|
||||
//
|
||||
// Desc: DirectShow sample code - main dialog header file for the Jukebox
|
||||
// application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if !defined(AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
|
||||
#define AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <dshow.h>
|
||||
#include "keyprovider.h"
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
const int TICKLEN=100, TIMERID=55;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CJukeboxDlg dialog
|
||||
|
||||
class CJukeboxDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CJukeboxDlg(CWnd* pParent = NULL); // standard constructor
|
||||
void FillFileList(LPTSTR pszCmdLine);
|
||||
|
||||
HRESULT PrepareMedia(LPTSTR lpszMovie);
|
||||
BOOL DisplayFileInfo(LPTSTR szFile);
|
||||
HRESULT DisplayFileDuration(void);
|
||||
BOOL DisplayImageInfo(void);
|
||||
void Say(LPTSTR szText);
|
||||
BOOL IsWindowsMediaFile(LPTSTR lpszFile);
|
||||
|
||||
LONG GetDXMediaPath(TCHAR *strPath);
|
||||
LONG GetGraphEditPath(TCHAR *szPath);
|
||||
void InitMediaDirectory(void);
|
||||
|
||||
HRESULT RenderWMFile(LPCWSTR wFile);
|
||||
HRESULT CreateFilter(REFCLSID clsid, IBaseFilter **ppFilter);
|
||||
HRESULT AddKeyProvider(IGraphBuilder *pGraph);
|
||||
HRESULT RenderOutputPins(IGraphBuilder *pGB, IBaseFilter *pReader);
|
||||
|
||||
HRESULT InitDirectShow(void);
|
||||
HRESULT FreeDirectShow(void);
|
||||
HRESULT HandleGraphEvent(void);
|
||||
|
||||
void ResetDirectShow(void);
|
||||
void DisplayECEvent(long lEventCode, long lParam1, long lParam2);
|
||||
void CenterVideo(void);
|
||||
void PlayNextFile(void);
|
||||
void PlayPreviousFile(void);
|
||||
void PlaySelectedFile(void);
|
||||
void ShowState(void);
|
||||
void ConfigureSeekbar(void);
|
||||
void StartSeekTimer(void);
|
||||
void StopSeekTimer(void);
|
||||
void HandleTrackbar(WPARAM wReq);
|
||||
void UpdatePosition(REFERENCE_TIME rtNow);
|
||||
void ReadMediaPosition(void);
|
||||
|
||||
BOOL CanStep(void);
|
||||
HRESULT StepFrame(void);
|
||||
HRESULT EnumFilters(void);
|
||||
HRESULT EnumPins(IBaseFilter *pFilter, PIN_DIRECTION PinDir, CListBox& Listbox);
|
||||
IBaseFilter * FindFilterFromName(LPTSTR szName);
|
||||
BOOL SupportsPropertyPage(IBaseFilter *pFilter);
|
||||
|
||||
void CALLBACK MediaTimer(UINT wTimerID, UINT msg, ULONG dwUser, ULONG dw1, ULONG dw2);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CJukeboxDlg)
|
||||
enum { IDD = IDD_JUKEBOX_DIALOG };
|
||||
CStatic m_StrPosition;
|
||||
CSliderCtrl m_Seekbar;
|
||||
CStatic m_StrImageSize;
|
||||
CStatic m_StrDuration;
|
||||
CEdit m_EditMediaDir;
|
||||
CSpinButtonCtrl m_SpinFiles;
|
||||
CButton m_ButtonFrameStep;
|
||||
CListBox m_ListEvents;
|
||||
CButton m_CheckEvents;
|
||||
CButton m_ButtonProperties;
|
||||
CStatic m_StrMediaPath;
|
||||
CButton m_CheckMute;
|
||||
CButton m_ButtonStop;
|
||||
CButton m_ButtonPlay;
|
||||
CButton m_ButtonPause;
|
||||
CButton m_CheckPlaythrough;
|
||||
CButton m_CheckLoop;
|
||||
CStatic m_StrFileDate;
|
||||
CStatic m_StrFileSize;
|
||||
CListBox m_ListPinsOutput;
|
||||
CListBox m_ListPinsInput;
|
||||
CStatic m_StrFileList;
|
||||
CStatic m_Status;
|
||||
CStatic m_Screen;
|
||||
CListBox m_ListInfo;
|
||||
CListBox m_ListFilters;
|
||||
CListBox m_ListFiles;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CJukeboxDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
int m_nCurrentFileSelection;
|
||||
REFERENCE_TIME g_rtTotalTime;
|
||||
UINT_PTR g_wTimerID;
|
||||
TCHAR m_szCurrentDir[MAX_PATH];
|
||||
|
||||
// Global key provider object created/released during the
|
||||
// Windows Media graph-building stage.
|
||||
CKeyProvider prov;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CJukeboxDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnSelectFile();
|
||||
afx_msg void OnPause();
|
||||
afx_msg void OnPlay();
|
||||
afx_msg void OnStop();
|
||||
afx_msg void OnCheckMute();
|
||||
afx_msg void OnCheckLoop();
|
||||
afx_msg void OnCheckPlaythrough();
|
||||
afx_msg void OnSelchangeListFilters();
|
||||
afx_msg void OnDblclkListFilters();
|
||||
afx_msg void OnButtonProppage();
|
||||
afx_msg void OnCheckEvents();
|
||||
afx_msg void OnButtonFramestep();
|
||||
afx_msg void OnButtonClearEvents();
|
||||
afx_msg void OnDblclkListFiles();
|
||||
afx_msg void OnDeltaposSpinFiles(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnButtonSetMediadir();
|
||||
afx_msg void OnTimer(UINT nIDEvent);
|
||||
afx_msg void OnButtonGraphedit();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC *);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// Jukebox.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__7592F2D2_3E29_4340_A089_4A1B57E80874__INCLUDED_)
|
||||
#define AFX_STDAFX_H__7592F2D2_3E29_4340_A089_4A1B57E80874__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__7592F2D2_3E29_4340_A089_4A1B57E80874__INCLUDED_)
|
||||
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: Globals.h
|
||||
//
|
||||
// Desc: DirectShow sample code - global data for Jukebox application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <dshow.h>
|
||||
|
||||
#include "playvideo.h"
|
||||
#include "keyprovider.h"
|
||||
|
||||
//
|
||||
// Global data
|
||||
//
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaSeeking *pMS = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IMediaEventEx *pME = NULL;
|
||||
IBasicVideo *pBV = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
|
||||
FILTER_STATE g_psCurrent=State_Stopped;
|
||||
|
||||
BOOL g_bLooping=FALSE,
|
||||
g_bAudioOnly=FALSE,
|
||||
g_bDisplayEvents=FALSE,
|
||||
g_bGlobalMute=FALSE,
|
||||
g_bPlayThrough=FALSE;
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: KeyProvider.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - provides a class to unkey Windows Media
|
||||
// for use with ASF, WMA, WMV media files.
|
||||
//
|
||||
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <streams.h>
|
||||
#include <atlbase.h>
|
||||
#include <atlimpl.cpp>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <dshowasf.h>
|
||||
#include "keyprovider.h"
|
||||
|
||||
|
||||
//
|
||||
// Build warning to remind developers of the dependency on the
|
||||
// Windows Media Format SDK libraries, which do not ship with
|
||||
// the DirectX SDK.
|
||||
//
|
||||
#pragma message("NOTE: To link and run this sample, you must install the Windows Media Format SDK.")
|
||||
#pragma message("After signing a license agreement with Microsoft, you will receive a")
|
||||
#pragma message("unique version of WMStub.LIB, which should be added to this VC++ project.")
|
||||
#pragma message("Without this library, you will receive linker errors for the following:")
|
||||
#pragma message(" WMCreateCertificate")
|
||||
#pragma message("You must also add WMVCore.LIB to the linker settings to resolve the following:")
|
||||
#pragma message(" WMCreateProfileManager")
|
||||
|
||||
|
||||
CKeyProvider::CKeyProvider() : m_cRef(0)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IUnknown methods
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ULONG CKeyProvider::AddRef()
|
||||
{
|
||||
return ++m_cRef;
|
||||
}
|
||||
|
||||
ULONG CKeyProvider::Release()
|
||||
{
|
||||
ASSERT(m_cRef > 0);
|
||||
|
||||
m_cRef--;
|
||||
|
||||
if(m_cRef == 0)
|
||||
{
|
||||
delete this;
|
||||
|
||||
// don't return m_cRef, because the object doesn't exist anymore
|
||||
return((ULONG) 0);
|
||||
}
|
||||
|
||||
return(m_cRef);
|
||||
}
|
||||
|
||||
//
|
||||
// QueryInterface
|
||||
//
|
||||
// We only support IUnknown and IServiceProvider
|
||||
//
|
||||
HRESULT CKeyProvider::QueryInterface(REFIID riid, void ** ppv)
|
||||
{
|
||||
if(riid == IID_IServiceProvider || riid == IID_IUnknown)
|
||||
{
|
||||
*ppv = (void *) static_cast<IServiceProvider *>(this);
|
||||
AddRef();
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CKeyProvider::QueryService(REFIID siid, REFIID riid, void **ppv)
|
||||
{
|
||||
if(siid == __uuidof(IWMReader) && riid == IID_IUnknown)
|
||||
{
|
||||
IUnknown *punkCert;
|
||||
|
||||
HRESULT hr = WMCreateCertificate(&punkCert);
|
||||
|
||||
if(SUCCEEDED(hr))
|
||||
*ppv = (void *) punkCert;
|
||||
else
|
||||
printf("CKeyProvider::QueryService failed to create certificate! hr=0x%x\n", hr);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: keyprovider.h
|
||||
//
|
||||
// Desc: DirectShow sample code - describes CKeyProvider helper class
|
||||
//
|
||||
// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class CKeyProvider : public IServiceProvider
|
||||
{
|
||||
public:
|
||||
//
|
||||
// IUnknown interface
|
||||
//
|
||||
STDMETHODIMP QueryInterface(REFIID riid, void ** ppv);
|
||||
STDMETHODIMP_(ULONG) AddRef();
|
||||
STDMETHODIMP_(ULONG) Release();
|
||||
|
||||
CKeyProvider();
|
||||
|
||||
// IServiceProvider
|
||||
STDMETHODIMP QueryService(REFIID siid, REFIID riid, void **ppv);
|
||||
|
||||
private:
|
||||
ULONG m_cRef;
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: MediaTypes.h
|
||||
//
|
||||
// Desc: DirectShow sample code - hardware/project-specific support for
|
||||
// Jukebox application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
typedef struct _media_info
|
||||
{
|
||||
LPTSTR pszType;
|
||||
LPTSTR pszName;
|
||||
|
||||
} MEDIA_INFO, *PMEDIA_INFO;
|
||||
|
||||
|
||||
//
|
||||
// Some projects support different types of DirectShow media
|
||||
//
|
||||
#define DEFAULT_SEARCH_PATH TEXT("\\")
|
||||
|
||||
#define NUM_MEDIA_TYPES 21
|
||||
|
||||
const MEDIA_INFO TypeInfo[NUM_MEDIA_TYPES] = {
|
||||
{TEXT("*.asf"), TEXT("ASF Video") }, /* Advanced Streaming */
|
||||
{TEXT("*.wma"), TEXT("Windows Media Audio") }, /* Windows Media Audio */
|
||||
{TEXT("*.wmv"), TEXT("Windows Media Video") }, /* Windows Media Video */
|
||||
{TEXT("*.mp3"), TEXT("MP3 audio") }, /* MPEG-1 Layer III */
|
||||
{TEXT("*.avi"), TEXT("AVI video") },
|
||||
{TEXT("*.mpg"), TEXT("MPEG video") },
|
||||
{TEXT("*.mpe*"), TEXT("MPEG video") }, /* MPE, MPEG */
|
||||
{TEXT("*.m1v"), TEXT("MPEG video") }, /* MPEG-1 video */
|
||||
{TEXT("*.wav"), TEXT("WAV audio") },
|
||||
{TEXT("*.au"), TEXT("AU audio") },
|
||||
{TEXT("*.aif*"), TEXT("AIFF audio") }, /* AIF, AIFF, AIFC */
|
||||
{TEXT("*.snd"), TEXT("SND audio") },
|
||||
{TEXT("*.mpa"), TEXT("MPEG audio") }, /* MPEG audio */
|
||||
{TEXT("*.mp1"), TEXT("MPEG audio") }, /* MPEG audio */
|
||||
{TEXT("*.mp2"), TEXT("MPEG audio") }, /* MPEG audio */
|
||||
{TEXT("*.mid"), TEXT("MIDI") }, /* MIDI */
|
||||
{TEXT("*.midi"), TEXT("MIDI") }, /* MIDI */
|
||||
{TEXT("*.rmi"), TEXT("MIDI") }, /* MIDI */
|
||||
{TEXT("*.qt"), TEXT("QuickTime video") },
|
||||
{TEXT("*.mov"), TEXT("QuickTime video") },
|
||||
{TEXT("*.dat"), TEXT("Video CD") }, /* Video CD format */
|
||||
};
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayVideo.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - media control functions.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <dshow.h>
|
||||
|
||||
#include "playvideo.h"
|
||||
|
||||
|
||||
HRESULT RunMedia()
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
if (!pMC)
|
||||
return S_OK;
|
||||
|
||||
// Start playback
|
||||
hr = pMC->Run();
|
||||
if (FAILED(hr)) {
|
||||
RetailOutput(TEXT("\r\n*** Failed(%08lx) in Run()!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Remember play state
|
||||
g_psCurrent = State_Running;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT StopMedia()
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
if (!pMC)
|
||||
return S_OK;
|
||||
|
||||
// If we're already stopped, don't check again
|
||||
if (g_psCurrent == State_Stopped)
|
||||
return hr;
|
||||
|
||||
// Stop playback
|
||||
hr = pMC->Stop();
|
||||
if (FAILED(hr)) {
|
||||
RetailOutput(TEXT("\r\n*** Failed(%08lx) in Stop()!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Remember play state
|
||||
g_psCurrent = State_Stopped;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT PauseMedia(void)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
if (!pMC)
|
||||
return S_OK;
|
||||
|
||||
// Play/pause
|
||||
if(g_psCurrent != State_Running)
|
||||
return S_OK;
|
||||
|
||||
hr = pMC->Pause();
|
||||
if (FAILED(hr)) {
|
||||
RetailOutput(TEXT("\r\n*** Failed(%08lx) in Pause()!\r\n"), hr);
|
||||
return hr;
|
||||
}
|
||||
// else
|
||||
// RetailOutput(TEXT("*** Media is PAUSED.\r\n"));
|
||||
|
||||
// Remember play state
|
||||
g_psCurrent = State_Paused;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT MuteAudio(void)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
IBasicAudio *pBA=NULL;
|
||||
long lVolume;
|
||||
|
||||
if (!pGB)
|
||||
return S_OK;
|
||||
|
||||
hr = pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA);
|
||||
if (FAILED(hr))
|
||||
return S_OK;
|
||||
|
||||
// Read current volume
|
||||
hr = pBA->get_Volume(&lVolume);
|
||||
if (hr == E_NOTIMPL)
|
||||
{
|
||||
// Fail quietly if this is a video-only media file
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
else if (FAILED(hr))
|
||||
{
|
||||
RetailOutput(TEXT("Failed in pBA->get_Volume! hr=0x%x\r\n"), hr);
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
lVolume = VOLUME_SILENCE;
|
||||
// RetailOutput(TEXT("*** Media is MUTING.\r\n"));
|
||||
|
||||
// Set new volume
|
||||
hr = pBA->put_Volume(lVolume);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
RetailOutput(TEXT("Failed in pBA->put_Volume! hr=0x%x\r\n"), hr);
|
||||
}
|
||||
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT ResumeAudio(void)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
IBasicAudio *pBA=NULL;
|
||||
long lVolume;
|
||||
|
||||
if (!pGB)
|
||||
return S_OK;
|
||||
|
||||
hr = pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA);
|
||||
if (FAILED(hr))
|
||||
return S_OK;
|
||||
|
||||
// Read current volume
|
||||
hr = pBA->get_Volume(&lVolume);
|
||||
if (hr == E_NOTIMPL)
|
||||
{
|
||||
// Fail quietly if this is a video-only media file
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
else if (FAILED(hr))
|
||||
{
|
||||
RetailOutput(TEXT("Failed in pBA->get_Volume! hr=0x%x\r\n"), hr);
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
lVolume = VOLUME_FULL;
|
||||
// RetailOutput(TEXT("*** Media is Resuming normal audio\r\n"));
|
||||
|
||||
// Set new volume
|
||||
hr = pBA->put_Volume(lVolume);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
RetailOutput(TEXT("Failed in pBA->put_Volume! hr=0x%x\r\n"), hr);
|
||||
}
|
||||
|
||||
pBA->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
void RetailOutput(TCHAR *tszErr, ...)
|
||||
{
|
||||
TCHAR tszErrOut[MAX_PATH + 256];
|
||||
|
||||
va_list valist;
|
||||
|
||||
va_start(valist,tszErr);
|
||||
wvsprintf(tszErrOut, tszErr, valist);
|
||||
OutputDebugString(tszErrOut);
|
||||
va_end (valist);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayVideo.h
|
||||
//
|
||||
// Desc: DirectShow sample code - declarations for media control functions.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef PLAY_VID_H
|
||||
#define PLAY_VID_H
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
#define VOLUME_FULL 0L
|
||||
#define VOLUME_SILENCE -10000L
|
||||
|
||||
// Application-defined messages
|
||||
#define WM_GRAPHNOTIFY WM_APP + 1
|
||||
#define WM_FIRSTFILE WM_APP + 2
|
||||
#define WM_PLAYFILE WM_APP + 3
|
||||
#define WM_NEXTFILE WM_APP + 4
|
||||
#define WM_PREVIOUSFILE WM_APP + 5
|
||||
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(i) {if (i) i->Release(); i = NULL;}
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{RetailOutput(TEXT("FAILED(0x%x) ") TEXT(#x) TEXT("\n"), hr); goto CLEANUP;}
|
||||
|
||||
//
|
||||
// Global data
|
||||
//
|
||||
extern IGraphBuilder *pGB;
|
||||
extern IMediaSeeking *pMS;
|
||||
extern IMediaControl *pMC;
|
||||
extern IMediaEventEx *pME;
|
||||
extern IBasicVideo *pBV;
|
||||
extern IVideoWindow *pVW;
|
||||
|
||||
extern FILTER_STATE g_psCurrent;
|
||||
extern BOOL g_bLooping, g_bAudioOnly, g_bPlayThrough;
|
||||
extern BOOL g_bDisplayEvents, g_bGlobalMute;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// External function-prototypes
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT RunMedia(void);
|
||||
HRESULT StopMedia(void);
|
||||
HRESULT PauseMedia(void);
|
||||
HRESULT PlayMedia(LPTSTR lpszMovie, HINSTANCE hInstance);
|
||||
HRESULT CheckMovieState(BOOL *pbComplete);
|
||||
HRESULT GetInterfaces(void);
|
||||
HRESULT MuteAudio(void);
|
||||
HRESULT ResumeAudio(void);
|
||||
void CleanupInterfaces(void);
|
||||
void ToggleFullscreen(void);
|
||||
|
||||
void RetailOutput(TCHAR *tszErr, ...);
|
||||
|
||||
#endif // !defined(PLAY_VID_H)
|
||||
@@ -0,0 +1,63 @@
|
||||
DirectShow Sample -- JukeboxASF
|
||||
-------------------------------
|
||||
|
||||
Description
|
||||
|
||||
Video jukebox application designed to play Windows Media files (ASF,WMA,WMV)
|
||||
that are not protected by Digital Rights Management (DRM).
|
||||
|
||||
-----------------------------------------------------------------------------------
|
||||
NOTE: To build this sample, you must install the Microsoft Windows Media Format SDK
|
||||
and obtain a software certificate. After you obtain the software certificate,
|
||||
build the sample by linking two additional libraries:
|
||||
WMStub.lib and WMVCore.lib.
|
||||
-----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
This application scans a directory for media files and displays a list of the
|
||||
relevant file names. The user can play an individual file or play all of the
|
||||
media files in order. The jukebox also displays information about the filter
|
||||
graphs that it creates, including the names of the filters, the names of their
|
||||
corresponding pins, and the event codes that are generated.
|
||||
|
||||
Note: This sample requires Microsoft Foundation Class Library 4.2 (Mfc42.dll).
|
||||
|
||||
Note: In order to launch GraphEdit to view the currently selected file, the GraphEdt.exe
|
||||
utility must exist in a directory on your search path (like c:\windows or c:\winnt).
|
||||
|
||||
|
||||
User's Guide
|
||||
|
||||
If a directory name is specified as a command-line argument, the jukebox scans
|
||||
that directory at startup. Otherwise, it scans the default SDK media directory,
|
||||
which is located at Samples\Multimedia\Media under the SDK root directory.
|
||||
The jukebox displays a list of all the media files in the directory, from which
|
||||
the user can select a file to play.
|
||||
|
||||
When you select a video file from the files list, Jukebox will display its
|
||||
first video frame in the "Video Screen" window. If you select an audio-only
|
||||
file, the video screen will be painted gray.
|
||||
|
||||
The jukebox offers the following user-interface elements:
|
||||
|
||||
Play, Stop, Pause, and FrameStep buttons: Use these buttons to control graph
|
||||
playback. (The FrameStep button might be disabled, if the graph does not
|
||||
support the IVideoFrameStep interface.)
|
||||
|
||||
Thru and Loop buttons: Click the Thru button to play through the entire file list,
|
||||
starting from the current selection. Click the Loop button to loop the same
|
||||
file repeatedly. These two buttons are mutually exclusive.
|
||||
|
||||
Mute button: Mutes the audio.
|
||||
|
||||
Filters, Input Pins, and Output Pins: When the jukebox creates a graph,
|
||||
it displays a list of the filters in the graph. If the user selects one
|
||||
of the filter names, the jukebox displays a list of the filter's input pins
|
||||
and a list of the filter's output pins.
|
||||
|
||||
Display Events: If this box is checked, the jukebox displays the event codes
|
||||
that it receives. To clear the list, click the Clear button.
|
||||
|
||||
Properties button: To view a filter's property pages, select the filter name
|
||||
and click the Properties button. If the filter does not support
|
||||
a property page, the button is disabled.
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// JUKEBOX.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,49 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by JukeboxASF.rc
|
||||
//
|
||||
#define IDM_ABOUTBOX 0x0010
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDS_ABOUTBOX 101
|
||||
#define IDD_JUKEBOX_DIALOG 102
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDC_LIST_FILES 1002
|
||||
#define IDC_MOVIE_SCREEN 1005
|
||||
#define IDC_LIST_FILTERS 1006
|
||||
#define IDC_LIST_PINS_INPUT 1007
|
||||
#define IDC_LIST_PINS_OUTPUT 1008
|
||||
#define IDC_BUTTON_PLAY 1009
|
||||
#define IDC_BUTTON_STOP 1010
|
||||
#define IDC_BUTTON_PAUSE 1011
|
||||
#define IDC_CHECK_MUTE 1013
|
||||
#define IDC_CHECK_LOOP 1014
|
||||
#define IDC_STATUS 1015
|
||||
#define IDC_CHECK_PLAYTHROUGH 1016
|
||||
#define IDC_STATIC_FILELIST 1017
|
||||
#define IDC_STATIC_FILESIZE 1018
|
||||
#define IDC_STATIC_FILEDATE 1019
|
||||
#define IDC_STATUS_DIRECTORY 1020
|
||||
#define IDC_BUTTON_FRAMESTEP 1022
|
||||
#define IDC_BUTTON_PROPPAGE 1027
|
||||
#define IDC_CHECK_EVENTS 1028
|
||||
#define IDC_LIST_EVENTS 1029
|
||||
#define IDC_BUTTON_CLEAR_EVENTS 1030
|
||||
#define IDC_SPIN_FILES 1031
|
||||
#define IDC_BUTTON_SET_MEDIADIR 1032
|
||||
#define IDC_EDIT_MEDIADIR 1033
|
||||
#define IDC_STATIC_DURATION 1034
|
||||
#define IDC_STATIC_IMAGESIZE 1035
|
||||
#define IDC_SLIDER 1036
|
||||
#define IDC_STATIC_POSITION 1037
|
||||
#define IDC_BUTTON_GRAPHEDIT 1038
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 132
|
||||
#define _APS_NEXT_COMMAND_VALUE 32781
|
||||
#define _APS_NEXT_CONTROL_VALUE 1038
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayDMO.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - main header for PlayDMO application
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "PlayDMO.h"
|
||||
#include "PlayDMODlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPlayDMOApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPlayDMOApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CPlayDMOApp)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPlayDMOApp construction
|
||||
|
||||
CPlayDMOApp::CPlayDMOApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CPlayDMOApp object
|
||||
|
||||
CPlayDMOApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPlayDMOApp initialization
|
||||
|
||||
BOOL CPlayDMOApp::InitInstance()
|
||||
{
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
#ifdef _AFXDLL
|
||||
// In MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete because
|
||||
// their functionality is incorporated into Microsoft's 32-bit operating systems.
|
||||
#if (_MSC_VER <= 1200)
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#endif
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
CPlayDMODlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
int nResponse = (int) dlg.DoModal();
|
||||
if (nResponse == IDOK)
|
||||
{
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with OK
|
||||
}
|
||||
else if (nResponse == IDCANCEL)
|
||||
{
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with Cancel
|
||||
}
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
return FALSE;
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
# Microsoft Developer Studio Project File - Name="PlayDMO" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=PlayDMO - 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 "PlayDMO.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 "PlayDMO.mak" CFG="PlayDMO - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "PlayDMO - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlayDMO - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\common" /I "..\..\..\..\include" /I "..\..\baseclasses" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 dmoguids.lib msdmo.lib ..\..\BaseClasses\Release\strmbase.lib winmm.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libcmt.lib" /OPT:NOREF /OPT:ICF /stack:0x200000,0x200000
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\common" /I "..\..\..\..\include" /I "..\..\baseclasses" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" /d "WIN32"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 dmoguids.lib msdmo.lib ..\..\BaseClasses\Debug\strmbasd.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "PlayDMO - Win32 Release"
|
||||
# Name "PlayDMO - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\dshowutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\mfcdmoutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\mfcutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\namedguid.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayDMO.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayDMO.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayDMODlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\dshowutil.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\mfcdmoutil.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\mfcutil.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\namedguid.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayDMO.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayDMODlg.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=.\res\PlayDMO.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\PlayDMO.rc2
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "PlayDMO"=.\PlayDMO.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayDMO.h
|
||||
//
|
||||
// Desc: DirectShow sample code - main header file for PlayDMO
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if !defined(AFX_PLAYDMO_H__123E1806_4ECC_487E_884B_EBF648ADB914__INCLUDED_)
|
||||
#define AFX_PLAYDMO_H__123E1806_4ECC_487E_884B_EBF648ADB914__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPlayDMOApp:
|
||||
// See PlayDMO.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CPlayDMOApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CPlayDMOApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPlayDMOApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CPlayDMOApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PLAYDMO_H__123E1806_4ECC_487E_884B_EBF648ADB914__INCLUDED_)
|
||||
@@ -0,0 +1,370 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on PlayDMO.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=PlayDMO - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to PlayDMO - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "PlayDMO - Win32 Release" && "$(CFG)" != "PlayDMO - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "PlayDMO.mak" CFG="PlayDMO - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "PlayDMO - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlayDMO - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\PlayDMO.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\dshowutil.obj"
|
||||
-@erase "$(INTDIR)\mfcdmoutil.obj"
|
||||
-@erase "$(INTDIR)\mfcutil.obj"
|
||||
-@erase "$(INTDIR)\namedguid.obj"
|
||||
-@erase "$(INTDIR)\PlayDMO.obj"
|
||||
-@erase "$(INTDIR)\PlayDMO.pch"
|
||||
-@erase "$(INTDIR)\PlayDMO.res"
|
||||
-@erase "$(INTDIR)\PlayDMODlg.obj"
|
||||
-@erase "$(INTDIR)\StdAfx.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\PlayDMO.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\..\common" /I "..\..\..\..\..\include" /I "..\..\baseclasses" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\PlayDMO.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\PlayDMO.res" /d "NDEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\PlayDMO.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dmoguids.lib msdmo.lib ..\..\BaseClasses\Release\strmbase.lib winmm.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\PlayDMO.pdb" /machine:I386 /nodefaultlib:"libcmt.lib" /out:"$(OUTDIR)\PlayDMO.exe" /OPT:NOREF /OPT:ICF /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\dshowutil.obj" \
|
||||
"$(INTDIR)\mfcdmoutil.obj" \
|
||||
"$(INTDIR)\mfcutil.obj" \
|
||||
"$(INTDIR)\namedguid.obj" \
|
||||
"$(INTDIR)\PlayDMO.obj" \
|
||||
"$(INTDIR)\PlayDMODlg.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"$(INTDIR)\PlayDMO.res"
|
||||
|
||||
"$(OUTDIR)\PlayDMO.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\PlayDMO.exe" "$(OUTDIR)\PlayDMO.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\dshowutil.obj"
|
||||
-@erase "$(INTDIR)\dshowutil.sbr"
|
||||
-@erase "$(INTDIR)\mfcdmoutil.obj"
|
||||
-@erase "$(INTDIR)\mfcdmoutil.sbr"
|
||||
-@erase "$(INTDIR)\mfcutil.obj"
|
||||
-@erase "$(INTDIR)\mfcutil.sbr"
|
||||
-@erase "$(INTDIR)\namedguid.obj"
|
||||
-@erase "$(INTDIR)\namedguid.sbr"
|
||||
-@erase "$(INTDIR)\PlayDMO.obj"
|
||||
-@erase "$(INTDIR)\PlayDMO.pch"
|
||||
-@erase "$(INTDIR)\PlayDMO.res"
|
||||
-@erase "$(INTDIR)\PlayDMO.sbr"
|
||||
-@erase "$(INTDIR)\PlayDMODlg.obj"
|
||||
-@erase "$(INTDIR)\PlayDMODlg.sbr"
|
||||
-@erase "$(INTDIR)\StdAfx.obj"
|
||||
-@erase "$(INTDIR)\StdAfx.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\PlayDMO.bsc"
|
||||
-@erase "$(OUTDIR)\PlayDMO.exe"
|
||||
-@erase "$(OUTDIR)\PlayDMO.ilk"
|
||||
-@erase "$(OUTDIR)\PlayDMO.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\common" /I "..\..\..\..\..\include" /I "..\..\baseclasses" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\PlayDMO.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\PlayDMO.res" /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\PlayDMO.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\dshowutil.sbr" \
|
||||
"$(INTDIR)\mfcdmoutil.sbr" \
|
||||
"$(INTDIR)\mfcutil.sbr" \
|
||||
"$(INTDIR)\namedguid.sbr" \
|
||||
"$(INTDIR)\PlayDMO.sbr" \
|
||||
"$(INTDIR)\PlayDMODlg.sbr" \
|
||||
"$(INTDIR)\StdAfx.sbr"
|
||||
|
||||
"$(OUTDIR)\PlayDMO.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dmoguids.lib msdmo.lib ..\..\BaseClasses\Debug\strmbasd.lib winmm.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\PlayDMO.pdb" /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"$(OUTDIR)\PlayDMO.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\dshowutil.obj" \
|
||||
"$(INTDIR)\mfcdmoutil.obj" \
|
||||
"$(INTDIR)\mfcutil.obj" \
|
||||
"$(INTDIR)\namedguid.obj" \
|
||||
"$(INTDIR)\PlayDMO.obj" \
|
||||
"$(INTDIR)\PlayDMODlg.obj" \
|
||||
"$(INTDIR)\StdAfx.obj" \
|
||||
"$(INTDIR)\PlayDMO.res"
|
||||
|
||||
"$(OUTDIR)\PlayDMO.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("PlayDMO.dep")
|
||||
!INCLUDE "PlayDMO.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "PlayDMO.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release" || "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
SOURCE=..\..\Common\dshowutil.cpp
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\dshowutil.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\dshowutil.obj" "$(INTDIR)\dshowutil.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=..\..\Common\mfcdmoutil.cpp
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\mfcdmoutil.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\mfcdmoutil.obj" "$(INTDIR)\mfcdmoutil.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=..\..\Common\mfcutil.cpp
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\mfcutil.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\mfcutil.obj" "$(INTDIR)\mfcutil.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=..\..\Common\namedguid.cpp
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\namedguid.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\namedguid.obj" "$(INTDIR)\namedguid.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\PlayDMO.cpp
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\PlayDMO.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\PlayDMO.obj" "$(INTDIR)\PlayDMO.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\PlayDMO.rc
|
||||
|
||||
"$(INTDIR)\PlayDMO.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\PlayDMODlg.cpp
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\PlayDMODlg.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\PlayDMODlg.obj" "$(INTDIR)\PlayDMODlg.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\PlayDMO.pch"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
|
||||
!IF "$(CFG)" == "PlayDMO - Win32 Release"
|
||||
|
||||
CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "..\..\common" /I "..\..\..\..\..\include" /I "..\..\baseclasses" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\PlayDMO.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\PlayDMO.pch" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayDMO - Win32 Debug"
|
||||
|
||||
CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\common" /I "..\..\..\..\..\include" /I "..\..\baseclasses" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\PlayDMO.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\StdAfx.sbr" "$(INTDIR)\PlayDMO.pch" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\PlayDMO.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\PlayDMO.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 89
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About PlayDMO DirectShow Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,11,17,21,20
|
||||
LTEXT "PlayDMO Version 8.1",IDC_STATIC,40,10,119,8,SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 2001 Microsoft Corporation",IDC_STATIC,40,
|
||||
26,150,8
|
||||
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
|
||||
LTEXT "This sample demonstrates using audio DMOs to affect the audio portion of an audio/video file. You can select from any audio DMO installed in your system, including Echo, Flanger, Chorus, and Reverb.",
|
||||
IDC_STATIC,40,42,176,40
|
||||
END
|
||||
|
||||
IDD_PLAYDMO_DIALOG DIALOGEX 0, 0, 347, 205
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "PlayDMO DirectShow Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
EDITTEXT IDC_EDIT_FILENAME,10,52,173,14,ES_AUTOHSCROLL
|
||||
LISTBOX IDC_LIST_AUDIO_DMOS,7,111,89,68,LBS_SORT |
|
||||
LBS_MULTIPLESEL | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Apply",IDC_BUTTON_ADD_DMO,7,183,42,14
|
||||
PUSHBUTTON "&Clear",IDC_BUTTON_CLEAR,54,183,42,14
|
||||
LISTBOX IDC_LIST_FILTERS,101,111,106,43,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
CTEXT "Audio Effects DMOs",IDC_STATIC,7,103,89,8
|
||||
CTEXT "Filters/DMOs In Graph",IDC_STATIC,107,103,89,8
|
||||
GROUPBOX "Audio DMO Input",IDC_STATIC,211,107,129,53
|
||||
GROUPBOX "Audio DMO Output",IDC_STATIC,211,162,129,35
|
||||
LTEXT "Max Latency :",IDC_STATIC,218,148,82,8
|
||||
LTEXT "0",IDC_STATIC_MAXLATENCY,306,148,30,8
|
||||
LTEXT "Minimum buffer size:",IDC_STATIC,218,119,82,8
|
||||
LTEXT "Buffer alignment (bytes):",IDC_STATIC,218,129,82,8
|
||||
LTEXT "Maximum lookahead:",IDC_STATIC,218,139,82,8
|
||||
LTEXT "0",IDC_STATIC_IN_MINBUFFERSIZE,306,119,30,8
|
||||
LTEXT "0",IDC_STATIC_IN_ALIGNMENT,306,129,30,8
|
||||
LTEXT "0",IDC_STATIC_IN_MAXLOOKAHEAD,306,139,30,8
|
||||
LTEXT "Minimum buffer size:",IDC_STATIC,215,173,82,8
|
||||
LTEXT "Buffer alignment (bytes):",IDC_STATIC,215,183,82,8
|
||||
LTEXT "0",IDC_STATIC_OUT_MINBUFFERSIZE,306,173,30,8
|
||||
LTEXT "0",IDC_STATIC_OUT_ALIGNMENT,306,183,30,8
|
||||
CTEXT "Input Pins",IDC_STATIC,101,156,47,8
|
||||
LISTBOX IDC_LIST_FILTER_INPUTS,101,166,50,31,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
CTEXT "Output Pins",IDC_STATIC,156,156,47,8
|
||||
LISTBOX IDC_LIST_FILTER_OUTPUTS,156,166,51,31,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&Browse For Media...",IDC_BUTTON_FILE,10,35,78,14
|
||||
CTEXT "Select a media file below, apply one or more audio effects DMOs, then click Play.",
|
||||
IDC_STATIC,11,11,167,21
|
||||
CONTROL "",IDC_SCREEN,"Static",SS_BLACKRECT,191,7,148,96
|
||||
PUSHBUTTON "&Filter Properties",IDC_BUTTON_PROPPAGE,105,35,78,14,
|
||||
WS_DISABLED
|
||||
GROUPBOX "",IDC_STATIC,7,3,180,96
|
||||
PUSHBUTTON "Pa&use",IDC_BUTTON_PAUSE,53,77,40,14
|
||||
PUSHBUTTON "&Stop",IDC_BUTTON_STOP,96,77,40,14
|
||||
PUSHBUTTON "&Play",IDC_BUTTON_PLAY,9,77,40,14
|
||||
CTEXT "Ready",IDC_STATIC_STATUS,137,80,46,8
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 8,1,0,0
|
||||
PRODUCTVERSION 8,1,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "PlayDMO MFC Application\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "PlayDMO\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2000-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "PlayDMO.EXE\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 228
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 82
|
||||
END
|
||||
|
||||
IDD_PLAYDMO_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 340
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 198
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_ABOUTBOX "&About PlayDMO..."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#include "res\PlayDMO.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayDMODlg.h
|
||||
//
|
||||
// Desc: DirectShow sample code - main header for CPlayDMODlg
|
||||
//
|
||||
// Copyright (c) 1996-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if !defined(AFX_PLAYDMODLG_H__AD2B59C5_9A0D_438F_A912_5441F8FC8B79__INCLUDED_)
|
||||
#define AFX_PLAYDMODLG_H__AD2B59C5_9A0D_438F_A912_5441F8FC8B79__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <dshow.h>
|
||||
#include <streams.h>
|
||||
#include <qedit.h>
|
||||
#include <atlbase.h>
|
||||
#include <dmo.h>
|
||||
#include <dmodshow.h>
|
||||
|
||||
// Include utility headers
|
||||
#include "mfcutil.h"
|
||||
#include "mfcdmoutil.h"
|
||||
#include "dshowutil.h"
|
||||
|
||||
// Constants
|
||||
#define MAX_DMOS 10
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPlayDMODlg dialog
|
||||
|
||||
class CPlayDMODlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CPlayDMODlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
HRESULT FillLists(void);
|
||||
void ClearLists(void);
|
||||
void SetDefaults(void);
|
||||
void EnableButtons(BOOL bEnable);
|
||||
|
||||
HRESULT GetInterfaces(void);
|
||||
void FreeInterfaces(void);
|
||||
|
||||
HRESULT HandleGraphEvent(void);
|
||||
HRESULT SetInputPinProperties(IAMAudioInputMixer *pPinMixer);
|
||||
HRESULT SetAudioProperties(void);
|
||||
HRESULT AddDMOsToGraph(void);
|
||||
HRESULT RemoveDMOsFromGraph(void);
|
||||
|
||||
void ClearAllocatedLists(void);
|
||||
void Say(TCHAR *szMsg);
|
||||
void ShowInputBufferInfo(IMediaObject *pDMO, int nSel);
|
||||
void ShowOutputBufferInfo(IMediaObject *pDMO, int nSel);
|
||||
|
||||
HRESULT PrepareMedia(LPTSTR lpszMovie);
|
||||
HRESULT InitDirectShow(void);
|
||||
HRESULT FreeDirectShow(void);
|
||||
|
||||
void ResetDirectShow(void);
|
||||
void CenterVideo(void);
|
||||
|
||||
HRESULT RunMedia(void);
|
||||
HRESULT StopMedia(void);
|
||||
HRESULT PauseMedia(void);
|
||||
HRESULT OnSelectFile();
|
||||
HRESULT ConnectDMOsToRenderer() ;
|
||||
|
||||
LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPlayDMODlg)
|
||||
enum { IDD = IDD_PLAYDMO_DIALOG };
|
||||
CButton m_btnProperties;
|
||||
CStatic m_strStatus;
|
||||
CStatic m_nOutBufferSize;
|
||||
CStatic m_nOutAlignment;
|
||||
CStatic m_nMaxLatency;
|
||||
CStatic m_nInBufferSize;
|
||||
CStatic m_nInLookahead;
|
||||
CStatic m_nInAlignment;
|
||||
CListBox m_ListFilters;
|
||||
CListBox m_ListFilterOutputs;
|
||||
CListBox m_ListFilterInputs;
|
||||
CListBox m_ListAudioDMO;
|
||||
CEdit m_StrFilename;
|
||||
CButton m_btnStop;
|
||||
CButton m_btnPlay;
|
||||
CButton m_btnPause;
|
||||
CStatic m_Screen;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPlayDMODlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
DWORD m_dwRegister; // Used by debug ROT functions
|
||||
|
||||
unsigned long m_ulDataBuffered;
|
||||
int m_nDMOCount;
|
||||
int m_nLoadedDMOs;
|
||||
|
||||
// DirectShow interfaces
|
||||
IGraphBuilder *m_pGB;
|
||||
IMediaSeeking *m_pMS;
|
||||
IMediaControl *m_pMC;
|
||||
IMediaEventEx *m_pME;
|
||||
IVideoWindow *m_pVW;
|
||||
|
||||
// List of DMO interfaces
|
||||
IBaseFilter *m_pDMOList[MAX_DMOS];
|
||||
|
||||
BOOL m_bAudioOnly;
|
||||
FILTER_STATE g_psCurrent;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CPlayDMODlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnButtonPlay();
|
||||
afx_msg void OnButtonPause();
|
||||
afx_msg void OnButtonStop();
|
||||
afx_msg void OnButtonFile();
|
||||
afx_msg void OnSelchangeListFilters();
|
||||
afx_msg void OnButtonAddDmo();
|
||||
afx_msg void OnButtonClear();
|
||||
afx_msg void OnButtonProppage();
|
||||
afx_msg void OnDblclkListFilters();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC *);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PLAYDMODLG_H__AD2B59C5_9A0D_438F_A912_5441F8FC8B79__INCLUDED_)
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// PlayDMO.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__85385154_D204_4E5B_BDCF_385AEE13E244__INCLUDED_)
|
||||
#define AFX_STDAFX_H__85385154_D204_4E5B_BDCF_385AEE13E244__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__85385154_D204_4E5B_BDCF_385AEE13E244__INCLUDED_)
|
||||
@@ -0,0 +1,20 @@
|
||||
DirectShow Sample -- PlayDMO
|
||||
----------------------------
|
||||
|
||||
PlayDMO allows you to open any media file, view its video component (if present), and
|
||||
apply any number of DMO audio effects to its audio component.
|
||||
|
||||
Select a media file by typing its name in the edit box or by clicking the
|
||||
Browse For Media button. Then select one or more audio effects DMOs to apply to
|
||||
the audio. Click Apply to immediately rebuild the filter graph with the selected DMOs.
|
||||
You may also click Play instead, and any selected DMOs will be added to the newly built
|
||||
filter graph.
|
||||
|
||||
Once you have started playing the media file, you can click on a filter or DMO in the
|
||||
Filters/DMO listbox and edit its properties by clicking the Filter Properties button.
|
||||
The corresponding filter properties dialog will be displayed. If you click on a DMO in
|
||||
the Filters/DMO list, you'll also see extra DMO-specific information provided by the IMediaObject interface.
|
||||
|
||||
Note: Since the filter graph is rebuilt when you click Play, don't set Filter Properties
|
||||
until the graph is already playing. Otherwise, you will lose your settings when you
|
||||
start playing the media file.
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// PLAYDMO.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,43 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by PlayDMO.rc
|
||||
//
|
||||
#define IDM_ABOUTBOX 0x0010
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDS_ABOUTBOX 101
|
||||
#define IDD_PLAYDMO_DIALOG 102
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDC_SCREEN 1000
|
||||
#define IDC_BUTTON_PLAY 1001
|
||||
#define IDC_BUTTON_PAUSE 1002
|
||||
#define IDC_BUTTON_STOP 1003
|
||||
#define IDC_BUTTON_RECORD 1004
|
||||
#define IDC_BUTTON_ADD_DMO 1005
|
||||
#define IDC_BUTTON_CLEAR 1006
|
||||
#define IDC_BUTTON_FILE 1007
|
||||
#define IDC_EDIT_FILENAME 1008
|
||||
#define IDC_BUTTON_PROPPAGE 1009
|
||||
#define IDC_LIST_OUTPUT_PINS 1010
|
||||
#define IDC_LIST_INPUT_PINS 1011
|
||||
#define IDC_LIST_AUDIO_DMOS 1012
|
||||
#define IDC_LIST_FILTERS 1013
|
||||
#define IDC_STATIC_MAXLATENCY 1014
|
||||
#define IDC_STATIC_IN_MINBUFFERSIZE 1015
|
||||
#define IDC_STATIC_IN_ALIGNMENT 1016
|
||||
#define IDC_STATIC_IN_MAXLOOKAHEAD 1017
|
||||
#define IDC_STATIC_OUT_MINBUFFERSIZE 1018
|
||||
#define IDC_STATIC_OUT_ALIGNMENT 1019
|
||||
#define IDC_LIST_FILTER_INPUTS 1020
|
||||
#define IDC_LIST_FILTER_OUTPUTS 1021
|
||||
#define IDC_STATIC_STATUS 1022
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,121 @@
|
||||
# Microsoft Developer Studio Project File - Name="PlayWnd" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=PlayWnd - 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 "PlayWnd.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 "PlayWnd.mak" CFG="PlayWnd - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "PlayWnd - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlayWnd - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "PlayWnd - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\..\..\include" /I "..\..\BaseClasses" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# 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 winspool.lib shell32.lib odbc32.lib odbccp32.lib quartz.lib msvcrt.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib winmm.lib msacm32.lib olepro32.lib oleaut32.lib advapi32.lib uuid.lib strmiids.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayWnd - 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 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\include" /I "..\..\BaseClasses" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# SUBTRACT CPP /Fr
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# 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 quartz.lib msvcrtd.lib winmm.lib msacm32.lib olepro32.lib strmiids.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib oleaut32.lib advapi32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib /pdbtype:sept /stack:0x200000,0x200000
|
||||
# SUBTRACT LINK32 /incremental:no
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "PlayWnd - Win32 Release"
|
||||
# Name "PlayWnd - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\playwnd.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\playwnd.rc
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\playwnd.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=.\playwnd.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "PlayWnd"=.\PlayWnd.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayWnd.h
|
||||
//
|
||||
// Desc: DirectShow sample code - header file for video in window movie
|
||||
// player application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// Function prototypes
|
||||
//
|
||||
HRESULT InitPlayerWindow(void);
|
||||
HRESULT InitVideoWindow(int nMultiplier, int nDivider);
|
||||
HRESULT HandleGraphEvent(void);
|
||||
HRESULT StepOneFrame(void);
|
||||
HRESULT StepFrames(int nFramesToStep);
|
||||
HRESULT ModifyRate(double dRateAdjust);
|
||||
HRESULT SetRate(double dRate);
|
||||
|
||||
BOOL GetFrameStepInterface(void);
|
||||
BOOL GetClipFileName(LPTSTR szName);
|
||||
|
||||
void PaintAudioWindow(void);
|
||||
void MoveVideoWindow(void);
|
||||
void CheckVisibility(void);
|
||||
void CloseInterfaces(void);
|
||||
|
||||
void OpenClip(void);
|
||||
void PauseClip(void);
|
||||
void StopClip(void);
|
||||
void CloseClip(void);
|
||||
|
||||
void UpdateMainTitle(void);
|
||||
void CheckSizeMenu(WPARAM wParam);
|
||||
void EnablePlaybackMenu(BOOL bEnable);
|
||||
void GetFilename(TCHAR *pszFull, TCHAR *pszFile);
|
||||
void Msg(TCHAR *szFormat, ...);
|
||||
|
||||
HRESULT AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister);
|
||||
void RemoveGraphFromRot(DWORD pdwRegister);
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
#define VOLUME_FULL 0L
|
||||
#define VOLUME_SILENCE -10000L
|
||||
|
||||
// File filter for OpenFile dialog
|
||||
#define FILE_FILTER_TEXT \
|
||||
TEXT("Video Files (*.avi; *.qt; *.mov; *.mpg; *.mpeg; *.m1v)\0*.avi; *.qt; *.mov; *.mpg; *.mpeg; *.m1v\0")\
|
||||
TEXT("Audio files (*.wav; *.mpa; *.mp2; *.mp3; *.au; *.aif; *.aiff; *.snd)\0*.wav; *.mpa; *.mp2; *.mp3; *.au; *.aif; *.aiff; *.snd\0")\
|
||||
TEXT("MIDI Files (*.mid, *.midi, *.rmi)\0*.mid; *.midi; *.rmi\0") \
|
||||
TEXT("Image Files (*.jpg, *.bmp, *.gif, *.tga)\0*.jpg; *.bmp; *.gif; *.tga\0") \
|
||||
TEXT("All Files (*.*)\0*.*;\0\0")
|
||||
|
||||
// Begin default media search at root directory
|
||||
#define DEFAULT_MEDIA_PATH TEXT("\\\0")
|
||||
|
||||
// Defaults used with audio-only files
|
||||
#define DEFAULT_AUDIO_WIDTH 240
|
||||
#define DEFAULT_AUDIO_HEIGHT 120
|
||||
#define DEFAULT_VIDEO_WIDTH 320
|
||||
#define DEFAULT_VIDEO_HEIGHT 240
|
||||
#define MINIMUM_VIDEO_WIDTH 200
|
||||
#define MINIMUM_VIDEO_HEIGHT 120
|
||||
|
||||
#define APPLICATIONNAME TEXT("PlayWnd Media Player")
|
||||
#define CLASSNAME TEXT("PlayWndMediaPlayer")
|
||||
|
||||
#define WM_GRAPHNOTIFY WM_USER+13
|
||||
|
||||
enum PLAYSTATE {Stopped, Paused, Running, Init};
|
||||
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return hr;}
|
||||
|
||||
#define LIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr);}
|
||||
|
||||
//
|
||||
// Resource constants
|
||||
//
|
||||
#define IDI_PLAYWND 100
|
||||
#define IDR_MENU 101
|
||||
#define IDD_ABOUTBOX 200
|
||||
#define ID_FILE_OPENCLIP 40001
|
||||
#define ID_FILE_EXIT 40002
|
||||
#define ID_FILE_PAUSE 40003
|
||||
#define ID_FILE_STOP 40004
|
||||
#define ID_FILE_CLOSE 40005
|
||||
#define ID_FILE_MUTE 40006
|
||||
#define ID_FILE_FULLSCREEN 40007
|
||||
#define ID_FILE_SIZE_NORMAL 40008
|
||||
#define ID_FILE_SIZE_HALF 40009
|
||||
#define ID_FILE_SIZE_DOUBLE 40010
|
||||
#define ID_FILE_SIZE_QUARTER 40011
|
||||
#define ID_FILE_SIZE_THREEQUARTER 40012
|
||||
#define ID_HELP_ABOUT 40014
|
||||
#define ID_RATE_INCREASE 40020
|
||||
#define ID_RATE_DECREASE 40021
|
||||
#define ID_RATE_NORMAL 40022
|
||||
#define ID_RATE_DOUBLE 40023
|
||||
#define ID_RATE_HALF 40024
|
||||
#define ID_SINGLE_STEP 40025
|
||||
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,201 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on PlayWnd.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=PlayWnd - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to PlayWnd - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "PlayWnd - Win32 Release" && "$(CFG)" != "PlayWnd - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "PlayWnd.mak" CFG="PlayWnd - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "PlayWnd - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlayWnd - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "PlayWnd - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\PlayWnd.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\playwnd.obj"
|
||||
-@erase "$(INTDIR)\playwnd.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\PlayWnd.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\..\..\..\include" /I "..\..\BaseClasses" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\PlayWnd.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\playwnd.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\PlayWnd.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=winspool.lib shell32.lib odbc32.lib odbccp32.lib quartz.lib msvcrt.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib winmm.lib msacm32.lib olepro32.lib oleaut32.lib advapi32.lib uuid.lib strmiids.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\PlayWnd.pdb" /machine:I386 /nodefaultlib /out:"$(OUTDIR)\PlayWnd.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\playwnd.obj" \
|
||||
"$(INTDIR)\playwnd.res"
|
||||
|
||||
"$(OUTDIR)\PlayWnd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayWnd - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\PlayWnd.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\playwnd.obj"
|
||||
-@erase "$(INTDIR)\playwnd.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\PlayWnd.exe"
|
||||
-@erase "$(OUTDIR)\PlayWnd.ilk"
|
||||
-@erase "$(OUTDIR)\PlayWnd.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\include" /I "..\..\BaseClasses" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\PlayWnd.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\playwnd.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\PlayWnd.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=quartz.lib msvcrtd.lib winmm.lib msacm32.lib olepro32.lib strmiids.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib oleaut32.lib advapi32.lib uuid.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\PlayWnd.pdb" /debug /machine:I386 /nodefaultlib /out:"$(OUTDIR)\PlayWnd.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\playwnd.obj" \
|
||||
"$(INTDIR)\playwnd.res"
|
||||
|
||||
"$(OUTDIR)\PlayWnd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("PlayWnd.dep")
|
||||
!INCLUDE "PlayWnd.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "PlayWnd.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "PlayWnd - Win32 Release" || "$(CFG)" == "PlayWnd - Win32 Debug"
|
||||
SOURCE=.\playwnd.cpp
|
||||
|
||||
"$(INTDIR)\playwnd.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\playwnd.rc
|
||||
|
||||
"$(INTDIR)\playwnd.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
//==========================================================================;
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
|
||||
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
|
||||
// PURPOSE.
|
||||
//
|
||||
// Copyright (c) 1998 - 2001 Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
//--------------------------------------------------------------------------;
|
||||
//
|
||||
// Resource file for Video in window movie player sample
|
||||
//
|
||||
|
||||
#include <windows.h>
|
||||
#include "playwnd.h"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&Open clip...", ID_FILE_OPENCLIP
|
||||
MENUITEM "&Close clip", ID_FILE_CLOSE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", ID_FILE_EXIT
|
||||
END
|
||||
POPUP "&Control"
|
||||
BEGIN
|
||||
MENUITEM "&Pause/Play\tP", ID_FILE_PAUSE
|
||||
MENUITEM "&Stop\tS", ID_FILE_STOP
|
||||
MENUITEM "&Mute/Unmute\tM", ID_FILE_MUTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Single F&rame Step\t<Space>", ID_SINGLE_STEP
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Half size (50%)\tH", ID_FILE_SIZE_HALF
|
||||
MENUITEM "&Three-quarter size (75%)\tT",ID_FILE_SIZE_THREEQUARTER
|
||||
MENUITEM "&Normal size (100%)\tN", ID_FILE_SIZE_NORMAL, CHECKED
|
||||
MENUITEM "&Double size (200%)\tD", ID_FILE_SIZE_DOUBLE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Full Screen\t<Enter> or F", ID_FILE_FULLSCREEN
|
||||
END
|
||||
POPUP "&Rate"
|
||||
BEGIN
|
||||
MENUITEM "&Increase Playback Rate\t<Right arrow>", ID_RATE_INCREASE
|
||||
MENUITEM "&Decrease Playback Rate\t<Left arrow>", ID_RATE_DECREASE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Normal Playback Rate\t<Down arrow>", ID_RATE_NORMAL
|
||||
MENUITEM "&Half Playback Rate", ID_RATE_HALF
|
||||
MENUITEM "Dou&ble Playback Rate", ID_RATE_DOUBLE
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About...", ID_HELP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
IDI_PLAYWND ICON DISCARDABLE "playwnd.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About PlayWnd"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDI_PLAYWND,-1,11,17,20,20
|
||||
LTEXT "DirectShow PlayWindow Sample",-1,40,10,131,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 1999-2001 Microsoft Corporation",-1,40,34,
|
||||
188,8
|
||||
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
|
||||
LTEXT "Version 8.1",-1,40,22,119,8,SS_NOPREFIX
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 8,1,0,0
|
||||
PRODUCTVERSION 8,1,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "PlayWnd Application\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "PlayWnd\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2000-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "PlayWnd.EXE\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
DirectShow Sample -- PlayWnd
|
||||
----------------------------
|
||||
|
||||
Usage:
|
||||
|
||||
playwnd <media filename>
|
||||
|
||||
Description:
|
||||
|
||||
This sample is an interactive audio/video media file player.
|
||||
It uses DirectShow to play any supported audio or video media file
|
||||
(MPG, AVI, QT, WAV, AU, SND, MID, etc.). The video will appear in
|
||||
a window on the screen, and you can use a mouse to move the window.
|
||||
|
||||
If the media has a video component, PlayWnd will read the video's
|
||||
default size and adjust the player's client area to allow the video
|
||||
to play at its preferred default size (taking into account the size of
|
||||
caption bar & borders).
|
||||
|
||||
You may mute the audio by pressing 'M'. You may toggle full-screen mode
|
||||
by pressing 'F'. You can pause/resume playback with 'P' and stop/rewind
|
||||
with 'S'. To close the media clip, hit ESC, F12, X, or Q.
|
||||
|
||||
If the media is audio-only, the player will display a small default window.
|
||||
|
||||
You can specify a media file as the only command line argument:
|
||||
Ex: playwnd \\myserver\mediafiles\video\sample.avi
|
||||
|
||||
If no file is specified, the application will automatically display the
|
||||
Windows OpenFile dialog so that you can choose a file.
|
||||
|
||||
Use the menu bar or the close button to exit the application.
|
||||
|
||||
|
||||
Accessing media files
|
||||
|
||||
The media file may exist in your hard disk, CD-ROM, or on a network server.
|
||||
|
||||
If the file is on a network server:
|
||||
You may read a media file from a network server if you provide the full URL.
|
||||
For example, "playwnd http://myserver/mediafiles/video/myvideo.avi" will
|
||||
read the file from the server into system memory. This approach will fail
|
||||
if the media file is too large to fit in memory.
|
||||
|
||||
|
||||
Limitations:
|
||||
|
||||
This sample will only render media files that are supported by the
|
||||
DirectShow subsystem. If you attempt to play a video (AVI, QuickTime, MPEG)
|
||||
that is encoded with an unsupported Codec, you will only see a black
|
||||
screen or no visible change to the display, although you should hear the
|
||||
associated audio component if it uses a supported format.
|
||||
|
||||
This sample will not play .ASX files.
|
||||
|
||||
|
||||
User Input:
|
||||
|
||||
Simple user input is supported through the keyboard or through the
|
||||
application's main menu bar.
|
||||
|
||||
Keyboard Action
|
||||
-------- ------
|
||||
P Play/Pause toggle
|
||||
S Stop and Rewind to beginning
|
||||
M Audio mute toggle
|
||||
F Full-screen mode toggle
|
||||
Quit to menu (closes file) ESC or Q or X or F12
|
||||
|
||||
|
||||
NOTE: This sample enforces a minimum window size (currently 200x120) to prevent
|
||||
window problems when small videos are resized. You may not resize a video to play
|
||||
in a window smaller than the defined minimum size.
|
||||
@@ -0,0 +1,137 @@
|
||||
# Microsoft Developer Studio Project File - Name="PlayWndASF" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=PlayWndASF - 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 "PlayWndASF.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 "PlayWndASF.mak" CFG="PlayWndASF - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "PlayWndASF - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlayWndASF - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "PlayWndASF - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\..\..\include" /I "..\..\BaseClasses" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# 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 winspool.lib shell32.lib odbc32.lib odbccp32.lib ..\..\common\wmstub.lib ..\..\common\wmvcore.lib quartz.lib msvcrt.lib winmm.lib msacm32.lib olepro32.lib strmiids.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib oleaut32.lib advapi32.lib uuid.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayWndASF - 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 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\include" /I "..\..\BaseClasses" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# SUBTRACT CPP /Fr
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# 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 ..\..\common\wmstub.lib ..\..\common\wmvcore.lib quartz.lib msvcrtd.lib winmm.lib msacm32.lib olepro32.lib strmiids.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib oleaut32.lib advapi32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib /pdbtype:sept /stack:0x200000,0x200000
|
||||
# SUBTRACT LINK32 /incremental:no
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "PlayWndASF - Win32 Release"
|
||||
# Name "PlayWndASF - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\keyprovider.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayWndASF.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayWndASF.rc
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\keyprovider.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayWndASF.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.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=.\playwnd.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayWndASF.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,185 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "playwndasf.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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&Open clip...", ID_FILE_OPENCLIP
|
||||
MENUITEM "&Close clip", ID_FILE_CLOSE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", ID_FILE_EXIT
|
||||
END
|
||||
POPUP "&Control"
|
||||
BEGIN
|
||||
MENUITEM "&Pause/Play\tP", ID_FILE_PAUSE
|
||||
MENUITEM "&Stop\tS", ID_FILE_STOP
|
||||
MENUITEM "&Mute/Unmute\tM", ID_FILE_MUTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Single F&rame Step\t<Space>", ID_SINGLE_STEP
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Half size (50%)\tH", ID_FILE_SIZE_HALF
|
||||
MENUITEM "&Three-quarter size (75%)\tT",ID_FILE_SIZE_THREEQUARTER
|
||||
MENUITEM "&Normal size (100%)\tN", ID_FILE_SIZE_NORMAL, CHECKED
|
||||
MENUITEM "&Double size (200%)\tD", ID_FILE_SIZE_DOUBLE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Full Screen\t<Enter> or F", ID_FILE_FULLSCREEN
|
||||
END
|
||||
POPUP "Rendering"
|
||||
BEGIN
|
||||
MENUITEM "Use new ASF Reader filter (recommended)",
|
||||
ID_RENDERING_USENEWASFREADER, CHECKED
|
||||
MENUITEM "Use legacy ASF Reader filter",
|
||||
ID_RENDERING_USELEGACYASFREADER
|
||||
|
||||
END
|
||||
POPUP "Help"
|
||||
BEGIN
|
||||
MENUITEM "About...", ID_HELP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_PLAYWND ICON DISCARDABLE "playwnd.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About PlayWnd ASF"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDI_PLAYWND,-1,11,17,20,20
|
||||
LTEXT "DirectShow PlayWindow ASF Sample",-1,40,10,131,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 1999-2001 Microsoft Corporation",-1,40,34,
|
||||
188,8
|
||||
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
|
||||
LTEXT "Version 8.1",-1,40,22,119,8,SS_NOPREFIX
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 8,1,0,0
|
||||
PRODUCTVERSION 8,1,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "DirectShow Sample\0"
|
||||
VALUE "CompanyName", "Microsoft\0"
|
||||
VALUE "FileDescription", "PlayWndASF Application\0"
|
||||
VALUE "FileVersion", "8.10\0"
|
||||
VALUE "InternalName", "PlayWndASF\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2000-2001 Microsoft Corporation\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "PlayWndASF.EXE\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "DirectX 8 SDK\0"
|
||||
VALUE "ProductVersion", "8.1\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""playwndasf.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: KeyProvider.cpp
|
||||
//
|
||||
// Desc: DirectShow sample code - provides a class to unkey Windows Media
|
||||
// for use with ASF, WMA, WMV media files.
|
||||
//
|
||||
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include <streams.h>
|
||||
#include <atlbase.h>
|
||||
#include <atlimpl.cpp>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <dshowasf.h>
|
||||
#include "keyprovider.h"
|
||||
|
||||
|
||||
//
|
||||
// Build warning to remind developers of the dependency on the
|
||||
// Windows Media Format SDK libraries, which do not ship with
|
||||
// the DirectX SDK.
|
||||
//
|
||||
#pragma message("NOTE: To link and run this sample, you must install the Windows Media Format SDK.")
|
||||
#pragma message("After signing a license agreement with Microsoft, you will receive a")
|
||||
#pragma message("unique version of WMStub.LIB, which should be added to this VC++ project.")
|
||||
#pragma message("Without this library, you will receive linker errors for the following:")
|
||||
#pragma message(" WMCreateCertificate")
|
||||
#pragma message("You must also add WMVCore.LIB to the linker settings to resolve the following:")
|
||||
#pragma message(" WMCreateProfileManager")
|
||||
|
||||
|
||||
CKeyProvider::CKeyProvider() : m_cRef(0)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IUnknown methods
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ULONG CKeyProvider::AddRef()
|
||||
{
|
||||
return ++m_cRef;
|
||||
}
|
||||
|
||||
ULONG CKeyProvider::Release()
|
||||
{
|
||||
ASSERT(m_cRef > 0);
|
||||
|
||||
m_cRef--;
|
||||
|
||||
if(m_cRef == 0)
|
||||
{
|
||||
delete this;
|
||||
|
||||
// don't return m_cRef, because the object doesn't exist anymore
|
||||
return((ULONG) 0);
|
||||
}
|
||||
|
||||
return(m_cRef);
|
||||
}
|
||||
|
||||
//
|
||||
// QueryInterface
|
||||
//
|
||||
// We only support IUnknown and IServiceProvider
|
||||
//
|
||||
HRESULT CKeyProvider::QueryInterface(REFIID riid, void ** ppv)
|
||||
{
|
||||
if(riid == IID_IServiceProvider || riid == IID_IUnknown)
|
||||
{
|
||||
*ppv = (void *) static_cast<IServiceProvider *>(this);
|
||||
AddRef();
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CKeyProvider::QueryService(REFIID siid, REFIID riid, void **ppv)
|
||||
{
|
||||
if(siid == __uuidof(IWMReader) && riid == IID_IUnknown)
|
||||
{
|
||||
IUnknown *punkCert;
|
||||
|
||||
HRESULT hr = WMCreateCertificate(&punkCert);
|
||||
|
||||
if(SUCCEEDED(hr))
|
||||
*ppv = (void *) punkCert;
|
||||
else
|
||||
printf("CKeyProvider::QueryService failed to create certificate! hr=0x%x\n", hr);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: keyprovider.h
|
||||
//
|
||||
// Desc: DirectShow sample code - describes CKeyProvider helper class
|
||||
//
|
||||
// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class CKeyProvider : public IServiceProvider
|
||||
{
|
||||
public:
|
||||
//
|
||||
// IUnknown interface
|
||||
//
|
||||
STDMETHODIMP QueryInterface(REFIID riid, void ** ppv);
|
||||
STDMETHODIMP_(ULONG) AddRef();
|
||||
STDMETHODIMP_(ULONG) Release();
|
||||
|
||||
CKeyProvider();
|
||||
|
||||
// IServiceProvider
|
||||
STDMETHODIMP QueryService(REFIID siid, REFIID riid, void **ppv);
|
||||
|
||||
private:
|
||||
ULONG m_cRef;
|
||||
};
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "PlayWndASF"=.\PlayWndASF.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on PlayWndASF.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=PlayWndASF - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to PlayWndASF - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "PlayWndASF - Win32 Release" && "$(CFG)" != "PlayWndASF - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "PlayWndASF.mak" CFG="PlayWndASF - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "PlayWndASF - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlayWndASF - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "PlayWndASF - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\PlayWndASF.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\keyprovider.obj"
|
||||
-@erase "$(INTDIR)\PlayWndASF.obj"
|
||||
-@erase "$(INTDIR)\PlayWndASF.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\PlayWndASF.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\..\..\..\include" /I "..\..\BaseClasses" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\PlayWndASF.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\PlayWndASF.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\PlayWndASF.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=winspool.lib shell32.lib odbc32.lib odbccp32.lib ..\..\common\wmstub.lib ..\..\common\wmvcore.lib quartz.lib msvcrt.lib winmm.lib msacm32.lib olepro32.lib strmiids.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib oleaut32.lib advapi32.lib uuid.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\PlayWndASF.pdb" /machine:I386 /nodefaultlib /out:"$(OUTDIR)\PlayWndASF.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\keyprovider.obj" \
|
||||
"$(INTDIR)\PlayWndASF.obj" \
|
||||
"$(INTDIR)\PlayWndASF.res"
|
||||
|
||||
"$(OUTDIR)\PlayWndASF.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlayWndASF - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\PlayWndASF.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\keyprovider.obj"
|
||||
-@erase "$(INTDIR)\PlayWndASF.obj"
|
||||
-@erase "$(INTDIR)\PlayWndASF.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\PlayWndASF.exe"
|
||||
-@erase "$(OUTDIR)\PlayWndASF.ilk"
|
||||
-@erase "$(OUTDIR)\PlayWndASF.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\include" /I "..\..\BaseClasses" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\PlayWndASF.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\PlayWndASF.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\PlayWndASF.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=..\..\common\wmstub.lib ..\..\common\wmvcore.lib quartz.lib msvcrtd.lib winmm.lib msacm32.lib olepro32.lib strmiids.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib oleaut32.lib advapi32.lib uuid.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\PlayWndASF.pdb" /debug /machine:I386 /nodefaultlib /out:"$(OUTDIR)\PlayWndASF.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\keyprovider.obj" \
|
||||
"$(INTDIR)\PlayWndASF.obj" \
|
||||
"$(INTDIR)\PlayWndASF.res"
|
||||
|
||||
"$(OUTDIR)\PlayWndASF.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("PlayWndASF.dep")
|
||||
!INCLUDE "PlayWndASF.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "PlayWndASF.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "PlayWndASF - Win32 Release" || "$(CFG)" == "PlayWndASF - Win32 Debug"
|
||||
SOURCE=.\keyprovider.cpp
|
||||
|
||||
"$(INTDIR)\keyprovider.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\PlayWndASF.cpp
|
||||
|
||||
"$(INTDIR)\PlayWndASF.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\PlayWndASF.rc
|
||||
|
||||
"$(INTDIR)\PlayWndASF.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// File: PlayWndASF.h
|
||||
//
|
||||
// Desc: DirectShow sample code - header file for video in window movie
|
||||
// player application.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// Function prototypes
|
||||
//
|
||||
HRESULT InitPlayerWindow(void);
|
||||
HRESULT InitVideoWindow(int nMultiplier, int nDivider);
|
||||
HRESULT HandleGraphEvent(void);
|
||||
HRESULT StepOneFrame(void);
|
||||
HRESULT StepFrames(int nFramesToStep);
|
||||
|
||||
BOOL GetFrameStepInterface(void);
|
||||
BOOL GetClipFileName(LPTSTR szName);
|
||||
BOOL IsWindowsMediaFile(LPTSTR lpszFile);
|
||||
|
||||
void PaintAudioWindow(void);
|
||||
void MoveVideoWindow(void);
|
||||
void CheckVisibility(void);
|
||||
void CloseInterfaces(void);
|
||||
void CheckSizeMenu(WPARAM wParam);
|
||||
void EnablePlaybackMenu(BOOL bEnable);
|
||||
|
||||
void OpenClip(void);
|
||||
void PauseClip(void);
|
||||
void StopClip(void);
|
||||
void CloseClip(void);
|
||||
|
||||
void UpdateMainTitle(void);
|
||||
void GetFilename(TCHAR *pszFull, TCHAR *pszFile);
|
||||
void Msg(TCHAR *szFormat, ...);
|
||||
|
||||
HRESULT AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister);
|
||||
void RemoveGraphFromRot(DWORD pdwRegister);
|
||||
|
||||
HRESULT CreateFilter(REFCLSID clsid, IBaseFilter **ppFilter);
|
||||
HRESULT AddKeyProvider(IGraphBuilder *pGraph);
|
||||
HRESULT RenderOutputPins(IGraphBuilder *pGB, IBaseFilter *pReader);
|
||||
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
#define VOLUME_FULL 0L
|
||||
#define VOLUME_SILENCE -10000L
|
||||
|
||||
// File filter for OpenFile dialog
|
||||
#define FILE_FILTER_TEXT \
|
||||
TEXT("Windows Media Files (*.asf; *.wma; *.wmv)\0*.asf; *.wma; *.wmv\0") \
|
||||
TEXT("Video Files (*.avi; *.qt; *.mov; *.mpg; *.mpeg; *.m1v)\0*.avi; *.qt; *.mov; *.mpg; *.mpeg; *.m1v\0")\
|
||||
TEXT("Audio files (*.wav; *.mpa; *.mp2; *.mp3; *.au; *.aif; *.aiff; *.snd)\0*.wav; *.mpa; *.mp2; *.mp3; *.au; *.aif; *.aiff; *.snd\0")\
|
||||
TEXT("MIDI Files (*.mid, *.midi, *.rmi)\0*.mid; *.midi; *.rmi\0") \
|
||||
TEXT("Image Files (*.jpg, *.bmp, *.gif, *.tga)\0*.jpg; *.bmp; *.gif; *.tga\0") \
|
||||
TEXT("All Files (*.*)\0*.*;\0\0")
|
||||
|
||||
// Begin default media search at root directory
|
||||
#define DEFAULT_MEDIA_PATH TEXT("\\\0")
|
||||
|
||||
// Defaults used with audio-only files
|
||||
#define DEFAULT_AUDIO_WIDTH 240
|
||||
#define DEFAULT_AUDIO_HEIGHT 120
|
||||
#define DEFAULT_VIDEO_WIDTH 320
|
||||
#define DEFAULT_VIDEO_HEIGHT 240
|
||||
#define MINIMUM_VIDEO_WIDTH 200
|
||||
#define MINIMUM_VIDEO_HEIGHT 120
|
||||
|
||||
#define APPLICATIONNAME TEXT("PlayWndASF Media Player")
|
||||
#define CLASSNAME TEXT("PlayWndASFMediaPlayer")
|
||||
|
||||
#define WM_GRAPHNOTIFY WM_USER+13
|
||||
|
||||
enum PLAYSTATE {Stopped, Paused, Running, Init};
|
||||
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return hr;}
|
||||
|
||||
#define LIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr);}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
DirectShow Sample -- PlayWndASF
|
||||
-------------------------------
|
||||
|
||||
Usage:
|
||||
|
||||
playwndasf <media filename>
|
||||
|
||||
Description:
|
||||
|
||||
This sample is an interactive audio/video media file player.
|
||||
It uses DirectShow to play any Windows Media audio or video media files
|
||||
(ASF, WMA, WMV) that are not protected by Digital Rights Management (DRM).
|
||||
The video will appear in a window on the screen, and you can use a mouse
|
||||
to move the window.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
NOTE: To build this sample, you must install the Microsoft Windows Media
|
||||
Format SDK and obtain a software certificate. After you obtain the software
|
||||
certificate, build the sample by linking two additional libraries:
|
||||
WMStub.lib and WMVCore.lib.
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
If the media has a video component, PlayWndASF will read the video's
|
||||
default size and adjust the player's client area to allow the video
|
||||
to play at its preferred default size (taking into account the size of
|
||||
caption bar & borders).
|
||||
|
||||
You may mute the audio by pressing 'M'. You may toggle full-screen mode
|
||||
by pressing 'F'. You can pause/resume playback with 'P' and stop/rewind
|
||||
with 'S'. To close the media clip, hit ESC, F12, X, or Q.
|
||||
|
||||
If the media is audio-only, the player will display a small default window.
|
||||
|
||||
You can specify a media file as the only command line argument:
|
||||
Ex: PlayWndASF \\myserver\mediafiles\video\sample.asf
|
||||
|
||||
If no file is specified, the application will automatically display the
|
||||
Windows OpenFile dialog so that you can choose a file.
|
||||
|
||||
Use the menu bar or the close button to exit the application.
|
||||
|
||||
|
||||
Accessing media files
|
||||
|
||||
The media file may exist in your hard disk, CD-ROM, or on a network server.
|
||||
|
||||
If the file is on a network server:
|
||||
You may read a media file from a network server if you provide the full URL.
|
||||
For example, "PlayWndASF http://myserver/mediafiles/video/myvideo.asf" will
|
||||
read the file from the server into system memory. This approach will fail
|
||||
if the media file is too large to fit in memory.
|
||||
|
||||
|
||||
Limitations:
|
||||
|
||||
This sample will only render media files that are supported by the
|
||||
DirectShow subsystem. If you attempt to play a video (AVI, QuickTime, MPEG)
|
||||
that is encoded with an unsupported Codec, you will only see a black
|
||||
screen or no visible change to the display, although you should hear the
|
||||
associated audio component if it uses a supported format.
|
||||
|
||||
This sample will not play .ASX files.
|
||||
|
||||
|
||||
User Input:
|
||||
|
||||
Simple user input is supported through the keyboard or through the
|
||||
application's main menu bar.
|
||||
|
||||
Keyboard Action
|
||||
-------- ------
|
||||
P Play/Pause toggle
|
||||
S Stop and Rewind to beginning
|
||||
M Audio mute toggle
|
||||
F Full-screen mode toggle
|
||||
Spacebar Step one frame
|
||||
Quit to menu (closes file) ESC or Q or X or F12
|
||||
|
||||
|
||||
NOTE: This sample enforces a minimum window size (currently 200x120) to prevent
|
||||
window problems when small videos are resized. You may not resize a video to play
|
||||
in a window smaller than the defined minimum size.
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by PlayWndASF.rc
|
||||
//
|
||||
#define IDI_PLAYWND 100
|
||||
#define IDR_MENU 101
|
||||
#define IDD_ABOUTBOX 200
|
||||
#define ID_FILE_OPENCLIP 40001
|
||||
#define ID_FILE_EXIT 40002
|
||||
#define ID_FILE_PAUSE 40003
|
||||
#define ID_FILE_STOP 40004
|
||||
#define ID_FILE_CLOSE 40005
|
||||
#define ID_FILE_MUTE 40006
|
||||
#define ID_FILE_FULLSCREEN 40007
|
||||
#define ID_FILE_SIZE_NORMAL 40008
|
||||
#define ID_FILE_SIZE_HALF 40009
|
||||
#define ID_FILE_SIZE_DOUBLE 40010
|
||||
#define ID_FILE_SIZE_QUARTER 40011
|
||||
#define ID_RENDERING_USENEWASFREADER 40011
|
||||
#define ID_FILE_SIZE_THREEQUARTER 40012
|
||||
#define ID_RENDERING_USELEGACYASFREADER 40013
|
||||
#define ID_HELP_ABOUT 40014
|
||||
#define ID_SINGLE_STEP 40015
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40015
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// StillView.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||