Initial commit: ROW Client source code

Game client codebase including:
- CharacterActionControl: Character and creature management
- GlobalScript: Network, items, skills, quests, utilities
- RYLClient: Main client application with GUI and event handlers
- Engine: 3D rendering engine (RYLGL)
- MemoryManager: Custom memory allocation
- Library: Third-party dependencies (DirectX, boost, etc.)
- Tools: Development utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 16:24:34 +09:00
commit e067522598
5135 changed files with 1745744 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,209 @@
//------------------------------------------------------------------------------
// File: Dialogs.h
//
// Desc: This file contains the header information for the various dialog
// wrapper classes we use.
//
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Name: class CAboutDlg
// Desc: This class is a wrapper for the About Dialog
//------------------------------------------------------------------------------
class CAboutDlg
{
public:
static BOOL CALLBACK AboutDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool DoModal();
CAboutDlg(HINSTANCE hInstance, HWND hWnd);
virtual ~CAboutDlg();
private:
HINSTANCE m_hInstance;
HWND m_hWnd;
};
//------------------------------------------------------------------------------
// Name: class CSPLangDlg
// Desc: This class is a wrapper for the Subpicture Language Selection Dialog
//------------------------------------------------------------------------------
class CSPLangDlg
{
public:
static BOOL CALLBACK SPDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool DoModal();
CSPLangDlg(HINSTANCE hInstance, HWND hWnd);
virtual ~CSPLangDlg();
private:
bool GetSPLang(ULONG ulStream, TCHAR * buffer, int iBufLen);
int MakeSPStreamList(HWND hDlg, int iListID);
ULONG m_ulSPStream; // the current SP stream
BOOL m_bSPOn; // the state of the SP stream (on/off) - we use BOOL instead of bool because
// this is what GetCurrentSubpicture returns to us
ULONG m_ulNumLang; // the number of streams available
HINSTANCE m_hInstance;
HWND m_hWnd;
};
//------------------------------------------------------------------------------
// Name: class CAudioLangDlg
// Desc: This class is a wrapper for the Audio Language Selection Dialog
//------------------------------------------------------------------------------
class CAudioLangDlg
{
public:
static BOOL CALLBACK AudioDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool DoModal();
CAudioLangDlg(HINSTANCE hInstance, HWND hWnd);
virtual ~CAudioLangDlg();
private:
bool GetAudioLang(ULONG ulStream, TCHAR * buffer, int iBufLen);
int MakeAudioStreamList(HWND hDlg, int iListID);
ULONG m_ulAudioStream; // the current Audio stream
ULONG m_ulNumLang; // the number of streams available
HINSTANCE m_hInstance;
HWND m_hWnd;
};
//------------------------------------------------------------------------------
// Name: class CAngleDlg
// Desc: This class is a wrapper for the Angle Selection Dialog
//------------------------------------------------------------------------------
class CAngleDlg
{
public:
static BOOL CALLBACK AngleDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool DoModal();
CAngleDlg(HINSTANCE hInstance, HWND hWnd);
virtual ~CAngleDlg();
private:
int MakeAngleList(HWND hDlg, int iListID);
ULONG m_ulAngle; // the current Angle
ULONG m_ulNumAngle; // the number of angles available
HINSTANCE m_hInstance;
HWND m_hWnd;
};
//------------------------------------------------------------------------------
// Name: class CChapterDlg
// Desc: This class is a wrapper for the Chapter Selection Dialog
//------------------------------------------------------------------------------
class CChapterDlg
{
public:
ULONG GetChapter() { return m_ulChapter; }
static BOOL CALLBACK ChapterDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool DoModal();
CChapterDlg(HINSTANCE hInstance, HWND hWnd);
virtual ~CChapterDlg();
private:
ULONG m_ulChapter; // the chosen Chapter
HINSTANCE m_hInstance;
HWND m_hWnd;
};
//------------------------------------------------------------------------------
// Name: class CTitleDlg
// Desc: This class is a wrapper for the Title Selection Dialog
//------------------------------------------------------------------------------
class CTitleDlg
{
public:
ULONG GetChapter() { return m_ulChapter; }
ULONG GetTitle() { return m_ulTitle; }
static BOOL CALLBACK TitleDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool DoModal();
CTitleDlg(HINSTANCE hInstance, HWND hWnd);
virtual ~CTitleDlg();
private:
ULONG m_ulChapter; // the chosen Chapter
ULONG m_ulTitle; // the chosen Title
HINSTANCE m_hInstance;
HWND m_hWnd;
};
//------------------------------------------------------------------------------
// Name: class CTimeDlg
// Desc: This class is a wrapper for the Time Selection Dialog
//------------------------------------------------------------------------------
class CTimeDlg
{
public:
DVD_HMSF_TIMECODE GetTime() { return m_Time; }
void SetTime(DVD_HMSF_TIMECODE time) { m_Time = time; }
static BOOL CALLBACK TimeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool DoModal();
CTimeDlg(HINSTANCE hInstance, HWND hWnd);
virtual ~CTimeDlg();
private:
DVD_HMSF_TIMECODE m_Time; // the chosen time
HINSTANCE m_hInstance;
HWND m_hWnd;
};
//------------------------------------------------------------------------------
// Name: class CKaraokeDlg
// Desc: This class is a wrapper for the Karaoke Mixing Dialog
//------------------------------------------------------------------------------
class CKaraokeDlg
{
public:
static BOOL CALLBACK KaraokeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool DoModal();
CKaraokeDlg(HINSTANCE hInstance, HWND hWnd);
virtual ~CKaraokeDlg();
private:
const TCHAR * m_pszChannel2;
const TCHAR * m_pszChannel3;
const TCHAR * m_pszChannel4;
HINSTANCE m_hInstance;
HWND m_hWnd;
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,231 @@
//------------------------------------------------------------------------------
// File: DvdCore.h
//
// Desc: Declarations for DVD Playback capabilities
//
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#if !defined(AFX_DVDCORE_H__30902DC7_7AAD_11D3_9973_00C04F9900F6__INCLUDED_)
#define AFX_DVDCORE_H__30902DC7_7AAD_11D3_9973_00C04F9900F6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#pragma warning(disable:4189) // C4189: local var initialized but not referenced
//------------------------------------------------------------------------------
// Forward declarations
//------------------------------------------------------------------------------
struct IAMLine21Decoder;
struct IGraphBuilder;
struct IVideoWindow;
struct IMediaEventEx;
struct IMediaControl;
struct IDvdControl2;
struct IDvdInfo2;
struct IDvdGraphBuilder;
class IDvdCallback;
class CSPLangDlg;
class CAudioLangDlg;
class CAngleDlg;
class CKaraokeDlg;
//------------------------------------------------------------------------------
// Global data
//------------------------------------------------------------------------------
// DirectShow Graph state
enum GRAPH_STATE
{
Uninitialized = 0,
Graph_Stopped1, // stopped without reset
Graph_Stopped2, // stopped with reset
Nav_Stopped,
Playing,
Graph_Paused,
Nav_Paused,
Scanning
} ;
const DWORD WM_DVD_EVENT = WM_USER+100;
//------------------------------------------------------------------------------
// Name: class IDvdCallback
// Desc: This class is just the interface for our callback. We do this so we can establish
// a pointer to a function that we can call back to update the screen
//------------------------------------------------------------------------------
class IDvdCallback
{
public:
virtual void UpdateStatus(void) { } // used to tell the app that time or location changed
virtual void Prohibited(void) { } // used to notify the app that an operation was prohibited
virtual void Exit(void) { } // used to notify the app that the playback window was closed
virtual RECT GetAppWindow(void) { RECT r = {0,0,0,0}; return r; }
protected:
//private:
IDvdCallback() { } // so no one can instantiate this class directly.
};
//------------------------------------------------------------------------------
// Name: class CDvdCore
// Desc: This class does nothing . It's just here to show what
// a class header should look like.
//------------------------------------------------------------------------------
class CDvdCore : public IDvdCallback
{
// These are granted friend status to simplify the code. These should probably be
// forced to use some sort of accessor methods, but that would clutter the code too
// much for this sample.
friend CSPLangDlg;
friend CAudioLangDlg;
friend CAngleDlg;
friend CKaraokeDlg;
public:
bool GetSPAttributes( void );
bool GetVideoAttributes( void );
bool GetAudioAttributes( void );
bool GetDvdText( void );
bool PlayTime(DVD_HMSF_TIMECODE time);
bool PlayChapterInTitle(ULONG ulTitle, ULONG ulChapter);
bool PlayChapter(ULONG ulChap);
bool FrameStep(void);
bool SetParentalLevel(ULONG ulLevel);
ULONG GetParentalLevel(void);
bool RestoreBookmark();
bool SaveBookmark(void);
bool SetVideoWindowTitle(TCHAR * pszTitle);
bool EnableCaptions(bool bOn);
bool TitleMenu(void);
bool ToggleFullScreen( void );
bool RootMenu(void);
bool Pause(void);
bool FastForward(void);
bool Rewind(void);
bool Stop(void);
bool PrevChapter(void);
bool NextChapter(void);
HRESULT Play();
bool Init();
explicit CDvdCore(HINSTANCE hInstance, IDvdCallback * pIDC = NULL);
virtual ~CDvdCore();
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMessage, WPARAM wParam,
LPARAM lParam);
LRESULT OnKeyEvent(WPARAM wParam, LPARAM lParam);
inline GRAPH_STATE GetState(void) { return m_eState; }
inline DVD_HMSF_TIMECODE & GetTime(void) { return m_CurTime; }
inline ULONG GetTitle(void) { return m_ulCurTitle; }
inline ULONG GetChapter(void) { return m_ulCurChapter; }
bool SetDirectory(TCHAR * szDirectory);
private:
RECT GetPlaybackWindowRect( void );
LRESULT OnClose( void );
void UnInitMessageSink();
bool DoesFileExist(PTSTR pszFile);
bool GetDriveLetter(TCHAR * pszDrive);
bool ChangeDvdRegion(void);
void ShowMouseCursor(bool bShow);
LRESULT OnMouseEvent(UINT uMessage, WPARAM wParam, LPARAM lParam);
LRESULT OnDvdEvent(UINT uMessage, WPARAM wParam, LPARAM lParam);
bool StopFullScreen(void);
bool StartFullScreen(void);
bool SetPlaybackOptions(void);
bool InitMessageSink(void);
DWORD GetStatusText(AM_DVD_RENDERSTATUS *pStatus, PTSTR pszStatusText, DWORD dwMaxText);
void ReleaseInterfaces();
inline void SetState(GRAPH_STATE state) { m_eState = state; };
bool BuildGraph();
LRESULT OnMouseTimer(WPARAM wParam, LPARAM lParam);
LRESULT OnSize(WPARAM wParam, LPARAM lParam);
void UpdateStatus(void); // this will be am empty implementation to allow us to call
// m_pCallback without checking for NULL
ULONG m_ulCurChapter; // track the current chapter number
ULONG m_ulCurTitle; // track the current title number
DVD_HMSF_TIMECODE m_CurTime; // track the current playback time
IDvdCallback * m_pCallback; // pointer to some class implementing the IDvdCallback interface
bool m_bMenuOn; // we are in a menu
bool m_bFirstPlay; // Used to track if this is the first time we're playing or not
bool m_bFullScreenOn; // used to track if we are in fullscreen mode or not
RECT m_RectOrigVideo; // used to store the original video rectangle during fullscreen playback
LONG m_lOrigStyle ; // original video window style bits (before fullscreen)
LONG m_lOrigStyleEx ; // original video window extended style bits (.....)
HHOOK m_hMouseHook ; // hook handle for mouse messages in fullscreen mode
DWORD m_dwMouseMoveTime ; // last time the mouse moved (in milliseconds)
int m_iMouseShowCount ; // ShowCursor() returned mouse state
HWND m_hWnd; // the hWnd for our container window
bool m_bStillOn; // used to track if there is a still frame on or not
HINSTANCE m_hInstance; // the hInstance of the calling program
IAMLine21Decoder * m_pIL21Dec; // IAMLine21Decoder interface
IGraphBuilder * m_pGraph; // IGraphBuilder interface
IVideoWindow * m_pIVW; // IVideoWindow interface
IMediaEventEx * m_pIME; // IMediaEventEx interface
IMediaControl * m_pIMC; // IMediaControl interface
IDvdControl2 * m_pIDvdC2; // IDvdControl2 interface
IDvdInfo2 * m_pIDvdI2; // IDvdInfo2 interface
IDvdGraphBuilder * m_pIDvdGB; // IDvdGraphBuilder interface
DWORD m_dwRenderFlags; // the flags used to render the graph. May be used to set different flags.
TCHAR m_szDiscPath[MAX_PATH]; // may be used to set the initial disc path
GRAPH_STATE m_eState; // the state of our current graph
bool m_bMessageSink; // did we set up the message sink?
};
//------------------------------------------------------------------------------
// Remove Debug logging
//------------------------------------------------------------------------------
#ifndef DbgLog
#define DbgLog(a)
#endif
#ifndef ASSERT
#define ASSERT(x)
#endif
///////////////////////////////////////////////////////////////////////////
// The following definitions come from the Platform SDK and are required if
// the application is being compiled with the headers from Visual C++ 6.0.
///////////////////////////////////////////////////////////////////////////
#ifndef GetWindowLongPtr
#define GetWindowLongPtrA GetWindowLongA
#define GetWindowLongPtrW GetWindowLongW
#ifdef UNICODE
#define GetWindowLongPtr GetWindowLongPtrW
#else
#define GetWindowLongPtr GetWindowLongPtrA
#endif // !UNICODE
#endif // !GetWindowLongPtr
#ifndef SetWindowLongPtr
#define SetWindowLongPtrA SetWindowLongA
#define SetWindowLongPtrW SetWindowLongW
#ifdef UNICODE
#define SetWindowLongPtr SetWindowLongPtrW
#else
#define SetWindowLongPtr SetWindowLongPtrA
#endif // !UNICODE
#endif // !SetWindowLongPtr
#ifndef GWLP_USERDATA
#define GWLP_USERDATA (-21)
#endif
///////////////////////////////////////////////////////////////////////////
// End Platform SDK definitions
///////////////////////////////////////////////////////////////////////////
#endif // !defined(AFX_DVDCORE_H__30902DC7_7AAD_11D3_9973_00C04F9900F6__INCLUDED_)

View File

@@ -0,0 +1,940 @@
//------------------------------------------------------------------------------
// File: DvdSample.cpp
//
// Desc: DVD Playback sample app using IDvdGraphBuilder,
// IDvdInfo2, and IDvdControl2 interfaces.
//
// This contains all Windows-related "plumbing" for the application
//
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include <windows.h>
#include <commdlg.h>
#include <commctrl.h>
#include <dshow.h>
#include "resource.h"
#include "DvdCore.h"
#include "Dialogs.h"
#include "DvdSample.h"
//------------------------------------------------------------------------------
// Global data
//------------------------------------------------------------------------------
const PTSTR APPNAME = TEXT("DVDSample");
CApp g_App;
//------------------------------------------------------------------------------
// Type Definitions
//------------------------------------------------------------------------------
typedef UINT (CALLBACK* PFNDLL_STES)(UINT);
//------------------------------------------------------------------------------
// Name: WinMain()
// Desc: This method is the standard Windows program entry point.
//------------------------------------------------------------------------------
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PSTR pCmdLine,
int nCmdShow)
{
DbgInitialise(hInstance);
g_App.SetAppValues(hInstance, APPNAME, IDS_APP_TITLE) ;
// Perform application initialization:
if (! g_App.InitInstance(nCmdShow) )
{
DbgTerminate();
return (FALSE) ;
}
HACCEL hAccelTable ;
hAccelTable = LoadAccelerators(hInstance, g_App.GetAppName()) ;
// Main message loop:
MSG msg ;
while (GetMessage(&msg, NULL, 0, 0))
{
if (! TranslateAccelerator(msg.hwnd, hAccelTable, &msg) )
{
TranslateMessage(&msg) ;
DispatchMessage(&msg) ;
}
}
DbgTerminate();
return (msg.wParam) ;
}
//------------------------------------------------------------------------------
// Name: CApp::CApp()
// Desc: This is the constructor for CApp. It sets default values and disables
// power saving.
//------------------------------------------------------------------------------
CApp::CApp() : m_hInstance(NULL),
m_hWnd(NULL),
m_bCaptionsOn(false),
m_pDvdCore(NULL),
m_bFullScreenOn(false),
m_pParentLevels(NULL),
m_pLangLookup(NULL),
m_hwndToolBar(0),
m_dwProhibitedTime(0)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::CApp()"))) ;
ZeroMemory(m_szAppTitle, sizeof(m_szAppTitle)) ;
ZeroMemory(m_szAppName, sizeof(m_szAppName)) ;
m_pParentLevels = new CParentLevels();
m_pLangLookup = new CDVDLanguages();
// notify the power manager that the display is in use so it won't go to sleep
// SetThreadExecutionState() is a Win98/Win2k API.
// The following code lets it fail gracefully on Win95
PFNDLL_STES pfn;
pfn = (PFNDLL_STES) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),
"SetThreadExecutionState");
if (pfn)
{
pfn(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
}
}
//------------------------------------------------------------------------------
// Name: CApp::~CApp()
// Desc: This is the destructor for CApp.
//------------------------------------------------------------------------------
CApp::~CApp()
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::~CApp()"))) ;
delete m_pParentLevels;
delete m_pLangLookup;
if (m_pDvdCore)
{
delete m_pDvdCore;
m_pDvdCore = NULL;
}
// notify the power manager that the display is no longer in use and it can go to sleep
// SetThreadExecutionState() is a Win98/Win2k API.
// The following code lets it fail gracefully on Win95
PFNDLL_STES pfn;
pfn = (PFNDLL_STES) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),
"SetThreadExecutionState");
if (pfn)
{
pfn(ES_CONTINUOUS);
}
}
//------------------------------------------------------------------------------
// Name: CApp::SetAppValues()
// Desc: This method sets the basic application values like szAppName and hInstance
//------------------------------------------------------------------------------
void CApp::SetAppValues(HINSTANCE hInst, PTSTR szAppName, int iAppTitleResId)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::SetAppValues()"))) ;
// The Windows stuff
m_hInstance = hInst ;
lstrcpy(m_szAppName, APPNAME) ;
LoadString(m_hInstance, IDS_APP_TITLE, m_szAppTitle, 100) ;
}
//------------------------------------------------------------------------------
// Name: CApp::InitInstance()
// Desc: This method registers and creates our window and toolbar.
//------------------------------------------------------------------------------
bool CApp::InitInstance(int nCmdShow)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::InitInstance()"))) ;
// 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
m_hWnd = FindWindow (m_szAppName, m_szAppTitle) ;
if (m_hWnd)
{
// We found another instance of ourself. Lets use that one:
if (IsIconic(m_hWnd))
{
ShowWindow(m_hWnd, SW_RESTORE);
}
SetForegroundWindow(m_hWnd);
// If this app actually had any methodality, 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
WNDCLASSEX wc ;
wc.cbSize = sizeof(wc) ;
wc.style = CS_HREDRAW | CS_VREDRAW ;
wc.lpfnWndProc = (WNDPROC) WndProc ;
wc.cbClsExtra = 0 ;
wc.cbWndExtra = 0 ;
wc.hInstance = m_hInstance ;
wc.hIcon = LoadIcon(m_hInstance, MAKEINTRESOURCE(IDI_APPICON));
wc.hCursor = LoadCursor(NULL, IDC_ARROW) ;
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1) ;
wc.lpszMenuName = TEXT("DvdSample_Menu");
wc.lpszClassName = m_szAppName ;
wc.hIconSm = NULL ;
if (0 == RegisterClassEx(&wc))
{
DbgLog((LOG_ERROR, 0,
TEXT("ERROR: RegisterClassEx() for app class failed (Error %ld)"),
GetLastError())) ;
return false ;
}
// Determine where to put the Application Window
RECT rDesktop;
SystemParametersInfo(SPI_GETWORKAREA, NULL, &rDesktop, NULL);
// Create an instance of the window we just registered
// locate it at the bottom of the screen (bottom of screen - height of player)
m_hWnd = CreateWindowEx(0, m_szAppName, m_szAppTitle, WS_OVERLAPPEDWINDOW, //& ~WS_THICKFRAME,
160, rDesktop.bottom - 150, 300, 150, NULL, NULL, m_hInstance, NULL);
if (!m_hWnd)
{
DbgLog((LOG_ERROR, 0,
TEXT("ERROR: CreateWindowEx() failed (Error %ld)"),
GetLastError())) ;
return false ;
}
// We now create the toolbar
INITCOMMONCONTROLSEX cc;
cc.dwSize = sizeof(INITCOMMONCONTROLSEX);
cc.dwICC = ICC_BAR_CLASSES; // register only the toolbar control
InitCommonControlsEx(&cc);
TBBUTTON tbb[] =
{
0, ID_PLAYBACK_PREVIOUSCHAPTER, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
1, ID_PLAYBACK_REWIND, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
2, ID_PLAYBACK_PAUSE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
3, ID_PLAYBACK_PLAY, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
4, ID_PLAYBACK_STOP, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
5, ID_PLAYBACK_FASTFORWARD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
6, ID_PLAYBACK_NEXTCHAPTER, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
9, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
7, ID_PLAYBACK_MENUROOT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
8, ID_OPTIONS_FULLSCREEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
9, ID_PLAYBACK_STEPFORWARD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0
};
m_hwndToolBar = CreateToolbarEx(m_hWnd, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | CCS_TOP
| TBSTYLE_TOOLTIPS, 1, 10, m_hInstance, IDR_TOOLBAR1, tbb, 11, 0, 0, 0, 0,
sizeof(TBBUTTON));
if (!m_hwndToolBar)
{
DbgLog((LOG_ERROR, 0,
TEXT("ERROR: CreateToolbarEx() failed (Error %ld)"),
GetLastError())) ;
return false ;
}
// we now set up the dvd playback class
m_pDvdCore = new CDvdCore(m_hInstance, this);
if (!m_pDvdCore->Init())
{
DbgLog((LOG_ERROR, 0, TEXT("ERROR: CDvdCore::Init() failed"))) ;
return false;
}
m_pDvdCore->SetVideoWindowTitle(TEXT("DvdSample Video Window"));
// and finally, we make the window visible
ShowWindow(m_hWnd, nCmdShow);
UpdateWindow(m_hWnd) ;
return true;
}
//------------------------------------------------------------------------------
// Name: WndProc()
// Desc: This method is our main window procedure. It parses the messages
// and farms out the work to other procedures.
//------------------------------------------------------------------------------
LRESULT CApp::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HDC hDC ;
static PAINTSTRUCT ps ;
switch (message) {
case WM_INITMENUPOPUP:
// UpdateMenuState() ;
break ;
case WM_PAINT:
hDC = BeginPaint(hWnd, &ps) ;
ASSERT(hDC) ;
g_App.DrawStatus(hDC);
EndPaint(hWnd, &ps) ;
break ;
case WM_KEYUP:
g_App.KeyProc(wParam, lParam) ;
break ;
case WM_COMMAND:
g_App.MenuProc(hWnd, wParam, lParam) ;
break;
case WM_NOTIFY:
return g_App.ToolTipProc(hWnd, message, wParam, lParam);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_SIZE:
// we do this to cause the toolbar to resize correctly
SendMessage(g_App.m_hwndToolBar, WM_SIZE, wParam, lParam);
return DefWindowProc(hWnd, message, wParam, lParam);
break;
default:
return (DefWindowProc(hWnd, message, wParam, lParam));
}
return 0 ; // let Windows know we handled the message
}
//------------------------------------------------------------------------------
// Name: ToolTipProc()
// Desc: This method is a MessageProc for our toolbar tooltips.
// This checks whether the WM_NOTIFY message is really a tooltip.
// If it is, we compare it to the buttons on the toolbar and send the right text back.
// Note that older code would use TTN_NEEDTEXT instead of TTN_GETDISPINFO.
//------------------------------------------------------------------------------
LRESULT CApp::ToolTipProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::ToolTipProc()"))) ;
LPNMTTDISPINFO TText;
TText = (LPNMTTDISPINFO) lParam;
if (TTN_GETDISPINFO == TText->hdr.code)
{
switch (TText->hdr.idFrom)
{
case ID_PLAYBACK_PREVIOUSCHAPTER:
TText->lpszText = TEXT("Previous Chapter");
break;
case ID_PLAYBACK_REWIND:
TText->lpszText = TEXT("Rewind");
break;
case ID_PLAYBACK_PAUSE:
TText->lpszText = TEXT("Pause");
break;
case ID_PLAYBACK_PLAY:
TText->lpszText = TEXT("Play");
break;
case ID_PLAYBACK_STOP:
TText->lpszText = TEXT("Stop");
break;
case ID_PLAYBACK_FASTFORWARD:
TText->lpszText = TEXT("FastForward");
break;
case ID_PLAYBACK_NEXTCHAPTER:
TText->lpszText = TEXT("Next Chapter");
break;
case ID_PLAYBACK_MENUROOT:
TText->lpszText = TEXT("Root Menu / Resume");
break;
case ID_OPTIONS_FULLSCREEN:
TText->lpszText = TEXT("Full Screen");
break;
case ID_PLAYBACK_STEPFORWARD:
TText->lpszText = TEXT("Step Forward");
break;
}
return 0;
}
else
return DefWindowProc(hWnd, message, wParam, lParam); // it wasn't a tooltip message
}
//------------------------------------------------------------------------------
// Name: CApp::MenuProc()
// Desc: This method handles all of the menu messages for our application. It is
// passed these messages by the main message proc.
//------------------------------------------------------------------------------
LRESULT CApp::MenuProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::MenuProc()"))) ;
HMENU hMenu = GetMenu(hWnd) ;
//Parse the menu selections:
switch (LOWORD(wParam))
{
case ID_PLAYBACK_PLAY:
m_pDvdCore->Play();
break;
case ID_PLAYBACK_PREVIOUSCHAPTER:
m_pDvdCore->PrevChapter();
break;
case ID_PLAYBACK_REWIND:
m_pDvdCore->Rewind();
break;
case ID_PLAYBACK_PAUSE:
m_pDvdCore->Pause();
break;
case ID_PLAYBACK_STOP:
m_pDvdCore->Stop();
break;
case ID_PLAYBACK_FASTFORWARD:
m_pDvdCore->FastForward();
break;
case ID_PLAYBACK_NEXTCHAPTER:
m_pDvdCore->NextChapter();
break;
case ID_PLAYBACK_MENUROOT:
m_pDvdCore->RootMenu();
break;
case ID_OPTIONS_FULLSCREEN:
{
m_pDvdCore->ToggleFullScreen();
}
break;
case ID_PLAYBACK_TITLEMENU:
m_pDvdCore->TitleMenu();
break;
case ID_FILE_EXIT:
DestroyWindow(m_hWnd);
break;
case ID_OPTIONS_CLOSEDCAPTION:
if (false == m_bCaptionsOn) // turn them on
{
HMENU hSubMenu = GetSubMenu(hMenu, 2); // Options is the 3rd menu starting with 0
CheckMenuItem(hSubMenu, ID_OPTIONS_CLOSEDCAPTION, MF_BYCOMMAND | MF_CHECKED);
if (m_pDvdCore->EnableCaptions(true))
m_bCaptionsOn = true;
}
else // turn them off
{
HMENU hSubMenu = GetSubMenu(hMenu, 2); // Options is the 3rd menu starting with 0
CheckMenuItem(hSubMenu, ID_OPTIONS_CLOSEDCAPTION, MF_BYCOMMAND | MF_UNCHECKED);
if (m_pDvdCore->EnableCaptions(false))
m_bCaptionsOn = false;
}
break;
case ID_OPTIONS_SAVEBOOKMARK:
m_pDvdCore->SaveBookmark();
break;
case ID_OPTIONS_RESTOREBOOKMARK:
m_pDvdCore->RestoreBookmark();
break;
case ID_OPTIONS_PARENTALLEVEL:
if (Nav_Stopped != m_pDvdCore->GetState() && Graph_Stopped2 != m_pDvdCore->GetState())
// can't change parental level except in stop state
{
MessageBox(m_hWnd,
TEXT("Can't change parental control level during playback. Please stop (twice) first."),
TEXT("Error"), MB_OK | MB_ICONINFORMATION) ;
break ;
}
DialogBox(m_hInstance, MAKEINTRESOURCE(IDD_PARENTLEVELS), m_hWnd,
reinterpret_cast<DLGPROC>(SelectParentalLevel));
break;
case ID_HELP_ABOUTDVDSAMPLE:
{
CAboutDlg aDlg(m_hInstance, m_hWnd);
aDlg.DoModal();
}
break;
case ID_OPTIONS_SUBPICTURE:
{
CSPLangDlg aDlg(m_hInstance, m_hWnd);
aDlg.DoModal();
}
break;
case ID_OPTIONS_AUDIOLANGUAGE:
{
CAudioLangDlg aDlg(m_hInstance, m_hWnd);
aDlg.DoModal();
}
break;
case ID_OPTIONS_ANGLE:
{
CAngleDlg aDlg(m_hInstance, m_hWnd);
aDlg.DoModal();
}
break;
case ID_FILE_SELECTDISC:
OnSelectDisc();
break;
case ID_PLAYBACK_STEPFORWARD:
m_pDvdCore->FrameStep();
break;
case ID_PLAYBACK_GOTO_CHAPTER:
{
CChapterDlg aDlg(m_hInstance, m_hWnd);
if (false == aDlg.DoModal())
break;
m_pDvdCore->PlayChapter(aDlg.GetChapter());
}
break;
case ID_PLAYBACK_GOTO_TITLE:
{
CTitleDlg aDlg(m_hInstance, m_hWnd);
if (false == aDlg.DoModal())
break;
m_pDvdCore->PlayChapterInTitle(aDlg.GetTitle(), aDlg.GetChapter());
}
break;
case ID_PLAYBACK_GOTO_TIME:
{
CTimeDlg aDlg(m_hInstance, m_hWnd);
DVD_HMSF_TIMECODE time = m_pDvdCore->GetTime();
aDlg.SetTime(time);
if (false == aDlg.DoModal())
break;
m_pDvdCore->PlayTime(aDlg.GetTime());
}
break;
case ID_OPTIONS_GETDISCTEXT:
m_pDvdCore->GetDvdText();
break;
case ID_OPTIONS_GETAUDIOATTRIBUTES:
m_pDvdCore->GetAudioAttributes();
break;
case ID_OPTIONS_GETVIDEOATTRIBUTES:
m_pDvdCore->GetVideoAttributes();
break;
case ID_OPTIONS_GETSUBPICTUREATTRIBUTES:
m_pDvdCore->GetSPAttributes();
break;
case ID_OPTIONS_SETKARAOKEMIXING:
{
CKaraokeDlg aDlg(m_hInstance, m_hWnd);
aDlg.DoModal(); // all work happens in the dialog code
}
break;
default:
break;
}
return 0;
}
//------------------------------------------------------------------------------
// Name: CApp::KeyProc()
// Desc: This method will process all key presses sent to our application window.
// At present it passes all of the keys along to the DvdCore but this is where
// you would implement shortcut keys, etc.
//------------------------------------------------------------------------------
LRESULT CApp::KeyProc(WPARAM wParam, LPARAM lParam)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::KeyProc()"))) ;
switch (wParam)
{
case VK_ESCAPE: // exit full screen
case VK_RETURN: // activate the currently selected button
case VK_LEFT: // select the left button
case VK_RIGHT: // select the right button
case VK_UP: // select the upper button
case VK_DOWN: // select the lower button
return m_pDvdCore->OnKeyEvent(wParam, lParam); // pass these keys on to the Core.
}
return DefWindowProc(m_hWnd, WM_KEYUP, wParam, lParam);
}
//------------------------------------------------------------------------------
// Name: CApp::SelectParentalLevel()
// Desc: This method is the MessageProc for the Parental Level Dialog. It is used
// to allow the user to select the parental level setting.
//
// The Dialog wrapper class is not used to demonstrate an alternate way to
// handle dialogs.
//------------------------------------------------------------------------------
BOOL CALLBACK CApp::SelectParentalLevel(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::SelectParentalLevel()"))) ;
switch (message)
{
case WM_INITDIALOG:
g_App.MakeParentLevelList(hDlg, IDC_LEVEL_LIST) ;
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
{
LONG lLevel ;
lLevel = SendDlgItemMessage(hDlg, IDC_LEVEL_LIST, LB_GETCURSEL,
static_cast<WPARAM>(0), static_cast<LPARAM>(0) );
if (CB_ERR == lLevel)
DbgLog((LOG_ERROR, 1, TEXT("WARNING: Couldn't get selected parental control level (Error %d)"), lLevel)) ;
else
g_App.m_pDvdCore->SetParentalLevel(g_App.m_pParentLevels->GetValue(lLevel)) ;
}
// Now fall through to just end the dialog
case IDCANCEL:
EndDialog(hDlg, TRUE);
return TRUE;
}
break;
default:
break ;
}
return FALSE;
}
//------------------------------------------------------------------------------
// Name: CApp::UpdateStatus()
// Desc: This method is notified every time that status of the player changes
// (Time, title, Chapter, etc.). This invalidates the client rectangle to force
// a redraw of the screen.
//------------------------------------------------------------------------------
void CApp::UpdateStatus(void)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::UpdateStatus()"))) ;
RECT Rect;
if (FALSE != GetClientRect(m_hWnd, &Rect))
{
Rect.top += 30; // so we don't redraw the toolbar - 30 is just a rough number
InvalidateRect(m_hWnd, &Rect, TRUE);
}
else
{
DWORD res = GetLastError();
DbgLog((LOG_ERROR, 1, TEXT("GetClientRect failed: %#x"), res)) ;
}
}
//------------------------------------------------------------------------------
// Name: CApp::DrawStatus()
// Desc: This method draws our status test (time, title, chapter) on the screen
//------------------------------------------------------------------------------
void CApp::DrawStatus(HDC hDC)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::DrawStatus()"))) ;
TCHAR location[25];
wsprintf(location, TEXT("Title: %-6uChapter: %u"), m_pDvdCore->GetTitle(),
m_pDvdCore->GetChapter());
TextOut(hDC, 10, 50, location, lstrlen(location));
TCHAR time[15];
wsprintf(time, TEXT("Time: %02d:%02d:%02d"), m_pDvdCore->GetTime().bHours,
m_pDvdCore->GetTime().bMinutes, m_pDvdCore->GetTime().bSeconds);
TextOut(hDC, 10, 65, time, lstrlen(time));
if (timeGetTime() <= (m_dwProhibitedTime + 5000)) // if less than 5 seconds has passed
{
SetTextColor(hDC, RGB(255, 0, 0));
TextOut(hDC, 180, 80, TEXT("Prohibited!"), 11);
}
}
//------------------------------------------------------------------------------
// Name: CApp::OnSelectDisc()
// Desc: This method brings up a common file dialog to ask the user to find the
// dvd disc they wish to watch. We look for the video_ts.ifo file.
//------------------------------------------------------------------------------
bool CApp::OnSelectDisc()
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::OnSelectDisc()"))) ;
OPENFILENAME ofn ; // structure used by the common file dialog
TCHAR szFileName[MAX_PATH] ;
// Init the filename buffer with *.ifo
lstrcpy(szFileName, TEXT("*.ifo")) ;
ZeroMemory(&ofn, sizeof(OPENFILENAME)) ;
ofn.lStructSize = sizeof(OPENFILENAME) ;
ofn.hwndOwner = m_hWnd ;
ofn.lpstrFilter = TEXT("IFO Files\0*.ifo\0All Files\0*.*\0") ;
ofn.nFilterIndex = 1 ;
ofn.lpstrFile = szFileName ;
ofn.nMaxFile = sizeof(szFileName) ;
ofn.lpstrFileTitle = NULL ;
ofn.lpstrTitle = TEXT("Select DVD-Video Volume") ;
ofn.nMaxFileTitle = 0 ;
ofn.lpstrInitialDir = NULL ;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY ;
// GetOpenFileName will bring up the common file dialog in open mode
if (GetOpenFileName(&ofn)) // user specified a file
{
return m_pDvdCore->SetDirectory(szFileName);
}
// Either failed or user hit Esc.
DWORD dw = CommDlgExtendedError() ;
DbgLog((LOG_TRACE, 3, TEXT("GetOpenFileName() cancelled/failed with error %lu"), dw)) ;
return false ; // DVD-Video volume not changed
}
//------------------------------------------------------------------------------
// Name: CApp::Prohibited()
// Desc: This method is called by the DVDCore whenever an operation is attempted that
// is prohibited by UOP. We set a time value and then invalidate the rectangle.
//------------------------------------------------------------------------------
void CApp::Prohibited()
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::Prohibited()"))) ;
m_dwProhibitedTime = timeGetTime();
RECT Rect;
if (FALSE != GetClientRect(m_hWnd, &Rect))
{
Rect.top += 30; // so we don't redraw the toolbar - 30 is just a rough number
InvalidateRect(m_hWnd, &Rect, TRUE);
}
else
{
DWORD res = GetLastError();
DbgLog((LOG_ERROR, 1, TEXT("GetClientRect failed: %#x"), res)) ;
}
}
//------------------------------------------------------------------------------
// Name: CApp::Exit()
// Desc: This method is part of IDvdCallBack. It is called by the DVDCore whenever
// the playback window si closed. We then close down the application.
//------------------------------------------------------------------------------
void CApp::Exit()
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::Exit()"))) ;
PostQuitMessage(0);
}
//------------------------------------------------------------------------------
// Name: CApp::GetAppWindow()
// Desc: This method is a member of IDVDCallback. It returns the location and size
// of the player window to the application.
//------------------------------------------------------------------------------
RECT CApp::GetAppWindow()
{
RECT rWindow;
GetWindowRect(m_hWnd, &rWindow);
return rWindow;
}
//------------------------------------------------------------------------------
// Name: CApp::MakeParentLevelList()
// Desc: This method creates a list of parental levels and adds them to the
// parental level dialog box's listbox.
//------------------------------------------------------------------------------
int CApp::MakeParentLevelList(HWND hDlg, int iListID)
{
DbgLog((LOG_TRACE, 5, TEXT("CApp::MakeParentalLevelList(0x%lx, %d)"),
hDlg, iListID)) ;
int iLevels = m_pParentLevels->GetCount() ;
int iResult ;
// add all defined parental levels
for (int i = 0 ; i < iLevels ; i++)
{
// Add to the listbox now
iResult = SendDlgItemMessage(hDlg, iListID, LB_ADDSTRING, (WPARAM) 0,
(LPARAM)(LPVOID) m_pParentLevels->GetName(i)) ;
if (LB_ERR == iResult || LB_ERRSPACE == iResult)
{
DbgLog((LOG_ERROR, 1,
TEXT("Error (%d) adding parental level '%s'(%d) to list"),
iResult, m_pParentLevels->GetName(i), i)) ;
}
}
if (iLevels > 0)
{
iResult = SendDlgItemMessage(hDlg, iListID, LB_SETCURSEL,
(WPARAM) m_pDvdCore->GetParentalLevel(), (LPARAM) 0) ;
if (LB_ERR == iResult)
{
DbgLog((LOG_ERROR, 1,
TEXT("WARNING: Couldn't set %ld as selected parent level (Error %d)"),
m_ulParentCtrlLevel, iResult)) ;
}
}
return iLevels ;
}
//------------------------------------------------------------------------------
// Name: CDVDLanguages::CDVDLanguages()
// Desc: This is the constructor. It sets up our lookup table
// Only 10 languages have been used here as a sample.
// The list can be extended to include any language listed in ISO 639.
//------------------------------------------------------------------------------
CDVDLanguages::CDVDLanguages()
{
DbgLog((LOG_TRACE, 5, TEXT("CDVDLanguages::CDVDLanguages()"))) ;
m_lcidCodes[0] = 0x0407 ; m_apszLangNames[0] = TEXT("German") ;
m_lcidCodes[1] = 0x0409 ; m_apszLangNames[1] = TEXT("English") ;
m_lcidCodes[2] = 0x040a ; m_apszLangNames[2] = TEXT("Spanish") ;
m_lcidCodes[3] = 0x040c ; m_apszLangNames[3] = TEXT("French") ;
m_lcidCodes[4] = 0x0411 ; m_apszLangNames[4] = TEXT("Japanese") ;
m_lcidCodes[5] = 0x0412 ; m_apszLangNames[5] = TEXT("Korean") ;
m_lcidCodes[6] = 0x0413 ; m_apszLangNames[6] = TEXT("Dutch") ;
m_lcidCodes[7] = 0x0816 ; m_apszLangNames[7] = TEXT("Portuguese") ;
m_lcidCodes[8] = 0x041d ; m_apszLangNames[8] = TEXT("Swedish") ;
m_lcidCodes[9] = 0x0804 ; m_apszLangNames[9] = TEXT("Chinese") ;
}
//------------------------------------------------------------------------------
// Name: CDVDLanguages::GetLangString()
// Desc: This method is our lookup function. It takes an LCID language code
// and returns an English string language name.
//------------------------------------------------------------------------------
bool CDVDLanguages::GetLangString(LCID LangCode, PTSTR pszLang, int iMaxLen)
{
DbgLog((LOG_TRACE, 5, TEXT("CDVDLanguages::GetLangString()"))) ;
for (int i = 0 ; i < 10 ; i++)
{
if (LangCode == m_lcidCodes[i]) // match!!
{
if (iMaxLen < lstrlen(m_apszLangNames[i]))
{
lstrcpy(pszLang, m_apszLangNames[i]) ;
return true ; // got a match
}
// let it fall through if that fails
}
}
if (iMaxLen < lstrlen(TEXT("Unknown")))
{
lstrcpy(pszLang, TEXT("Unknown")) ;
}
return false ; // didn't get a match
}
//------------------------------------------------------------------------------
// Name: CParentLevels::CParentLevels()
// Desc: This is the constructor for CParentLevels. It can be modified to change
// the parental levels shown to the user.
// Remember that the mapping of parental levels to MPAA ratings shown here
// is only valid for the U.S. and Canada. In other countries, the parental
// levels will have different specific meanings, although parental level 1
// is always the least restrictive level and level 8 is the most restrictive.
//------------------------------------------------------------------------------
CParentLevels::CParentLevels()
{
DbgLog((LOG_TRACE, 5, TEXT("CParentLevels::CParentLevels()"))) ;
m_iCount = LEVELS ;
m_alpszNames[0] = TEXT(" G ") ; m_aiValues[0] = 1 ;
m_alpszNames[1] = TEXT(" PG ") ; m_aiValues[1] = 3 ;
m_alpszNames[2] = TEXT(" PG-13 ") ; m_aiValues[2] = 4 ;
m_alpszNames[3] = TEXT(" R ") ; m_aiValues[3] = 6 ;
m_alpszNames[4] = TEXT(" NC-17 ") ; m_aiValues[4] = 7 ;
m_alpszNames[5] = TEXT(" Not Rated ") ; m_aiValues[5] = 8 ;
}

View File

@@ -0,0 +1,152 @@
# Microsoft Developer Studio Project File - Name="DVDSample" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=DVDSample - 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 "dvdsample.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 "dvdsample.mak" CFG="DVDSample - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "DVDSample - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "DVDSample - 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)" == "DVDSample - 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 /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"dshow.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"
# ADD RSC /l 0x409 /i "..\..\BaseClasses" /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 comctl32.lib quartz.lib strmiids.lib winmm.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\..\..\..\lib" /stack:0x200000,0x200000
!ELSEIF "$(CFG)" == "DVDSample - 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 /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DEBUG" /Yu"dshow.h" /FD /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 /i "..\..\BaseClasses" /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 comctl32.lib quartz.lib strmiids.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\lib" /stack:0x200000,0x200000
!ENDIF
# Begin Target
# Name "DVDSample - Win32 Release"
# Name "DVDSample - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\Dialogs.cpp
# End Source File
# Begin Source File
SOURCE=.\DvdCore.cpp
# End Source File
# Begin Source File
SOURCE=.\DVDSample.cpp
# ADD CPP /Yc"dshow.h"
# End Source File
# Begin Source File
SOURCE=.\StringUtil.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\Dialogs.h
# End Source File
# Begin Source File
SOURCE=.\DvdCore.h
# End Source File
# Begin Source File
SOURCE=.\DVDSample.h
# End Source File
# Begin Source File
SOURCE=.\resource.h
# End Source File
# Begin Source File
SOURCE=.\StringUtil.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=.\DVDSample.ico
# End Source File
# Begin Source File
SOURCE=.\DVDSample.rc
# End Source File
# Begin Source File
SOURCE=.\toolbar.bmp
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "DVDSample"=.\dvdsample.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -0,0 +1,135 @@
//------------------------------------------------------------------------------
// File: DvdSample.h
//
// Desc: DVD Playback sample app using IDvdGraphBuilder,
// IDvdInfo2, and IDvdControl2 interfaces.
//
// This contains headers for all Windows-related "plumbing" for the application
//
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Class Forward Declarations
//------------------------------------------------------------------------------
class CDvdCore;
class CParentLevels;
class CApp;
extern CApp g_App;
class CSPLangDlg;
class CAudioLangDlg;
class CDVDLanguages;
class CAngleDlg;
class CKaraokeDlg;
//------------------------------------------------------------------------------
// Name: class CApp
// Desc: This class contains the application interface
//------------------------------------------------------------------------------
class CApp : public IDvdCallback
{
friend CSPLangDlg;
friend CAudioLangDlg;
friend CAngleDlg;
friend CKaraokeDlg;
public:
RECT GetAppWindow(void);
void Prohibited( void );
void Exit( void );
static BOOL CALLBACK SelectParentalLevel(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool InitInstance(int nCmdShow);
inline const TCHAR * GetAppName(void) const { return m_szAppName; };
void SetAppValues(HINSTANCE hInst, PTSTR szAppName, int iAppTitleResId);
CApp();
virtual ~CApp();
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ;
void UpdateStatus(void); // to implement the IDvdCallback interface requirements
private:
LRESULT MenuProc(HWND hWnd, WPARAM wParam, LPARAM lParam);
LRESULT KeyProc(WPARAM wParam, LPARAM lParam);
bool OnSelectDisc(void);
void DrawStatus(HDC hDC);
int MakeParentLevelList(HWND hDlg, int iListID);
LRESULT ToolTipProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
DWORD m_dwProhibitedTime;
HWND m_hwndToolBar;
CDVDLanguages * m_pLangLookup;
bool m_bFullScreenOn;
bool m_bCaptionsOn;
CDvdCore * m_pDvdCore;
HWND m_hWnd;
TCHAR m_szAppName[50] ; // internal name of the app
TCHAR m_szAppTitle[50]; // title bar text
HINSTANCE m_hInstance;
CParentLevels * m_pParentLevels;
};
//------------------------------------------------------------------------------
// Name: class CParentLevels
// Desc: This is a class to wrap the viewing level numbers and names.
// This makes it easy to add viewing level definitions or change them to,
// say, those of another country.
//------------------------------------------------------------------------------
const int LEVELS = 6;
class CParentLevels
{
public:
CParentLevels() ;
int GetCount(void) { return m_iCount ; } ;
LPCTSTR GetName(int i) { return m_alpszNames[i] ; } ;
int GetValue(int i) { return m_aiValues[i] ; } ;
private:
LPCTSTR m_alpszNames[LEVELS] ;
int m_aiValues[LEVELS] ;
int m_iCount ;
} ;
//------------------------------------------------------------------------------
// Name: class CDVDLanguages
// Desc: A class to wrap a few language names and the corresponding 2-char codes
// We have only 10 languages from ISO 639 as a sample. It can be extended to
// include any other language in ISO 639.
//------------------------------------------------------------------------------
class CDVDLanguages
{
public:
CDVDLanguages() ;
bool GetLangString(LCID LangCode, PTSTR pszLang, int iMaxLen) ;
private:
LCID m_lcidCodes[10] ;
LPCTSTR m_apszLangNames[10] ;
} ;
//------------------------------------------------------------------------------
// Remove Debug logging
//------------------------------------------------------------------------------
#ifndef DbgLog
#define DbgLog(a)
#endif
#ifndef ASSERT
#define ASSERT(x)
#endif
#ifndef DbgInitialise
#define DbgInitialise(x)
#endif
#ifndef DbgTerminate
#define DbgTerminate()
#endif
#pragma warning ( disable : 4390 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,249 @@
# Microsoft Developer Studio Generated NMAKE File, Based on dvdsample.dsp
!IF "$(CFG)" == ""
CFG=DVDSample - Win32 Debug
!MESSAGE No configuration specified. Defaulting to DVDSample - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "DVDSample - Win32 Release" && "$(CFG)" != "DVDSample - 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 "dvdsample.mak" CFG="DVDSample - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "DVDSample - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "DVDSample - 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)" == "DVDSample - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
ALL : "$(OUTDIR)\dvdsample.exe"
CLEAN :
-@erase "$(INTDIR)\Dialogs.obj"
-@erase "$(INTDIR)\DvdCore.obj"
-@erase "$(INTDIR)\DVDSample.obj"
-@erase "$(INTDIR)\dvdsample.pch"
-@erase "$(INTDIR)\DVDSample.res"
-@erase "$(INTDIR)\StringUtil.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\dvdsample.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\dvdsample.pch" /Yu"dshow.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)\DVDSample.res" /i "..\..\BaseClasses" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dvdsample.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 comctl32.lib quartz.lib strmiids.lib winmm.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\dvdsample.pdb" /machine:I386 /out:"$(OUTDIR)\dvdsample.exe" /libpath:"..\..\..\..\..\lib" /stack:0x200000,0x200000
LINK32_OBJS= \
"$(INTDIR)\Dialogs.obj" \
"$(INTDIR)\DvdCore.obj" \
"$(INTDIR)\DVDSample.obj" \
"$(INTDIR)\StringUtil.obj" \
"$(INTDIR)\DVDSample.res"
"$(OUTDIR)\dvdsample.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "DVDSample - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
ALL : "$(OUTDIR)\dvdsample.exe"
CLEAN :
-@erase "$(INTDIR)\Dialogs.obj"
-@erase "$(INTDIR)\DvdCore.obj"
-@erase "$(INTDIR)\DVDSample.obj"
-@erase "$(INTDIR)\dvdsample.pch"
-@erase "$(INTDIR)\DVDSample.res"
-@erase "$(INTDIR)\StringUtil.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\dvdsample.exe"
-@erase "$(OUTDIR)\dvdsample.ilk"
-@erase "$(OUTDIR)\dvdsample.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DEBUG" /Fp"$(INTDIR)\dvdsample.pch" /Yu"dshow.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 "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\DVDSample.res" /i "..\..\BaseClasses" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dvdsample.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 comctl32.lib quartz.lib strmiids.lib winmm.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\dvdsample.pdb" /debug /machine:I386 /out:"$(OUTDIR)\dvdsample.exe" /pdbtype:sept /libpath:"..\..\..\..\..\lib" /stack:0x200000,0x200000
LINK32_OBJS= \
"$(INTDIR)\Dialogs.obj" \
"$(INTDIR)\DvdCore.obj" \
"$(INTDIR)\DVDSample.obj" \
"$(INTDIR)\StringUtil.obj" \
"$(INTDIR)\DVDSample.res"
"$(OUTDIR)\dvdsample.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("dvdsample.dep")
!INCLUDE "dvdsample.dep"
!ELSE
!MESSAGE Warning: cannot find "dvdsample.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "DVDSample - Win32 Release" || "$(CFG)" == "DVDSample - Win32 Debug"
SOURCE=.\Dialogs.cpp
"$(INTDIR)\Dialogs.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dvdsample.pch"
SOURCE=.\DvdCore.cpp
"$(INTDIR)\DvdCore.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dvdsample.pch"
SOURCE=.\DVDSample.cpp
!IF "$(CFG)" == "DVDSample - Win32 Release"
CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\dvdsample.pch" /Yc"dshow.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\DVDSample.obj" "$(INTDIR)\dvdsample.pch" : $(SOURCE) "$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ELSEIF "$(CFG)" == "DVDSample - Win32 Debug"
CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DEBUG" /Fp"$(INTDIR)\dvdsample.pch" /Yc"dshow.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\DVDSample.obj" "$(INTDIR)\dvdsample.pch" : $(SOURCE) "$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ENDIF
SOURCE=.\StringUtil.cpp
"$(INTDIR)\StringUtil.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\dvdsample.pch"
SOURCE=.\DVDSample.rc
"$(INTDIR)\DVDSample.res" : $(SOURCE) "$(INTDIR)"
$(RSC) $(RSC_PROJ) $(SOURCE)
!ENDIF

View File

@@ -0,0 +1,438 @@
//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
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
DVDSAMPLE_MENU MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Select Disc", ID_FILE_SELECTDISC
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_FILE_EXIT
END
POPUP "&Playback"
BEGIN
MENUITEM "&Play", ID_PLAYBACK_PLAY
MENUITEM "P&ause", ID_PLAYBACK_PAUSE
MENUITEM "&Stop", ID_PLAYBACK_STOP
MENUITEM "Step &Forward", ID_PLAYBACK_STEPFORWARD
MENUITEM SEPARATOR
POPUP "&Go To"
BEGIN
MENUITEM "&Next Chapter", ID_PLAYBACK_NEXTCHAPTER
MENUITEM "&Previous Chapter", ID_PLAYBACK_PREVIOUSCHAPTER
MENUITEM SEPARATOR
MENUITEM "&Chapter...", ID_PLAYBACK_GOTO_CHAPTER
MENUITEM "&Time...", ID_PLAYBACK_GOTO_TIME
MENUITEM "T&itle...", ID_PLAYBACK_GOTO_TITLE
END
POPUP "Pla&y Speed"
BEGIN
MENUITEM "&Fast Forward", ID_PLAYBACK_FASTFORWARD
MENUITEM "&Rewind", ID_PLAYBACK_REWIND
END
MENUITEM SEPARATOR
MENUITEM "&Menu (Root)", ID_PLAYBACK_MENUROOT
MENUITEM "&Title Menu", ID_PLAYBACK_TITLEMENU
END
POPUP "&Options"
BEGIN
MENUITEM "&Subpicture...", ID_OPTIONS_SUBPICTURE
MENUITEM "&Audio...", ID_OPTIONS_AUDIOLANGUAGE
MENUITEM "&Parental Level...", ID_OPTIONS_PARENTALLEVEL
MENUITEM "&Closed Caption", ID_OPTIONS_CLOSEDCAPTION
MENUITEM "&Full Screen", ID_OPTIONS_FULLSCREEN
MENUITEM "An&gle...", ID_OPTIONS_ANGLE
MENUITEM SEPARATOR
POPUP "&Bookmarks"
BEGIN
MENUITEM "&Save Bookmark", ID_OPTIONS_SAVEBOOKMARK
MENUITEM "&Restore Bookmark", ID_OPTIONS_RESTOREBOOKMARK
END
MENUITEM SEPARATOR
MENUITEM "Get Disc Te&xt", ID_OPTIONS_GETDISCTEXT
MENUITEM "Get Audio Attributes", ID_OPTIONS_GETAUDIOATTRIBUTES
MENUITEM "Get Video Attributes", ID_OPTIONS_GETVIDEOATTRIBUTES
MENUITEM "Get Subpicture Attributes", ID_OPTIONS_GETSUBPICTUREATTRIBUTES
MENUITEM "Set Karaoke Mixing", ID_OPTIONS_SETKARAOKEMIXING
END
POPUP "&Help"
BEGIN
MENUITEM "&About DvdSample", ID_HELP_ABOUTDVDSAMPLE
MENUITEM "Test", ID_HELP_TEST
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_APPICON ICON DISCARDABLE "DvdSample.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_TOOLBAR1 TOOLBAR DISCARDABLE 16, 15
BEGIN
BUTTON ID_PLAYBACK_PREVIOUSCHAPTER
BUTTON ID_PLAYBACK_REWIND
BUTTON ID_PLAYBACK_PAUSE
BUTTON ID_PLAYBACK_PLAY
BUTTON ID_PLAYBACK_STOP
BUTTON ID_PLAYBACK_FASTFORWARD
BUTTON ID_PLAYBACK_NEXTCHAPTER
SEPARATOR
BUTTON ID_PLAYBACK_MENUROOT
BUTTON ID_OPTIONS_FULLSCREEN
BUTTON ID_BUTTON40027
END
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_TOOLBAR1 BITMAP DISCARDABLE "toolbar.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_PARENTLEVELS DIALOG DISCARDABLE 0, 0, 173, 78
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Parental Levels"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,116,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,116,24,50,14
LTEXT "Level:",IDC_STATIC,7,25,20,8
LTEXT "Select Parental Level",IDC_STATIC,7,7,68,8
LISTBOX IDC_LEVEL_LIST,32,25,76,40,LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
END
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 166, 87
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About DVDSample"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,95,14,50,14
ICON IDI_APPICON,IDC_STATIC,38,13,20,20
LTEXT "DVDSample - Version 8.1",IDC_STATIC,9,35,85,8
LTEXT "DVD-Video Sample Application",IDC_STATIC,9,46,98,8
LTEXT "Copyright <20> 1999-2001 Microsoft Corporation.",
IDC_STATIC,9,57,147,8
LTEXT "All rights reserved.",IDC_STATIC,9,68,58,8
END
IDD_SPDLG DIALOG DISCARDABLE 0, 0, 167, 71
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Subpicture Stream"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,110,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,110,24,50,14
LTEXT "Choose Subpicture Stream:",IDC_STATIC,7,7,87,8
COMBOBOX IDC_SPLANG,7,20,85,33,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP
CONTROL "Show Subpicture",IDC_SHOWSP,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,45,70,10
END
IDD_AUDIODLG DIALOG DISCARDABLE 0, 0, 167, 50
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Audio Stream"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,110,6,50,14
PUSHBUTTON "Cancel",IDCANCEL,110,24,50,14
COMBOBOX IDC_AUDIOLANG,7,25,93,35,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP
LTEXT "Choose Audio Stream:",IDC_STATIC,7,6,71,8
END
IDD_ANGLEDLG DIALOG DISCARDABLE 0, 0, 167, 50
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Angle"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,110,6,50,14
PUSHBUTTON "Cancel",IDCANCEL,110,24,50,14
COMBOBOX IDC_ANGLE,7,25,93,35,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP
LTEXT "Choose Angle:",IDC_STATIC,7,6,47,8
END
IDD_CHAPTERDLG DIALOG DISCARDABLE 0, 0, 130, 47
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Play Chapter"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,73,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,73,24,50,14
LTEXT "Chapter:",IDC_STATIC,7,19,28,8
EDITTEXT IDC_PLAYCHAPTER,37,17,33,14,ES_AUTOHSCROLL | ES_NUMBER
END
IDD_TITLEDLG DIALOG DISCARDABLE 0, 0, 144, 47
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Play Chapter In Title"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,87,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,87,26,50,14
LTEXT "Title:",IDC_STATIC,7,10,16,8
LTEXT "Chapter:",IDC_STATIC,7,28,28,8
EDITTEXT IDC_PLAYTITLE,40,7,33,14,ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_PLAYCHAPTER,39,25,34,14,ES_AUTOHSCROLL | ES_NUMBER
END
IDD_TIMEDLG DIALOG DISCARDABLE 0, 0, 189, 46
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Play at Specified Time"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,132,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,132,24,50,14
EDITTEXT IDC_HOURS,45,15,23,14,ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_MINUTES,74,15,23,14,ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_SECONDS,103,15,23,14,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "HH:MM:SS",IDC_STATIC,7,18,37,8
END
IDD_KARAOKEDLG DIALOG DISCARDABLE 0, 0, 161, 50
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Karoake Mixing"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,104,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,104,24,50,14
CONTROL "Channel 2",IDC_CHANNEL2,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,7,92,10
CONTROL "Channel 3",IDC_CHANNEL3,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,18,92,10
CONTROL "Channel 4",IDC_CHANNEL4,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,31,92,10
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_PARENTLEVELS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 166
TOPMARGIN, 7
BOTTOMMARGIN, 71
END
IDD_ABOUT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 159
TOPMARGIN, 7
BOTTOMMARGIN, 80
END
IDD_SPDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 160
TOPMARGIN, 7
BOTTOMMARGIN, 64
END
IDD_AUDIODLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 160
TOPMARGIN, 6
BOTTOMMARGIN, 43
END
IDD_ANGLEDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 160
TOPMARGIN, 6
BOTTOMMARGIN, 43
END
IDD_CHAPTERDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 123
TOPMARGIN, 7
BOTTOMMARGIN, 40
END
IDD_TITLEDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 137
TOPMARGIN, 7
BOTTOMMARGIN, 40
END
IDD_TIMEDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 182
TOPMARGIN, 7
BOTTOMMARGIN, 39
END
IDD_KARAOKEDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 154
TOPMARGIN, 7
BOTTOMMARGIN, 43
END
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 8,1,0,0
PRODUCTVERSION 8,1,0,0
FILEFLAGSMASK 0x30003fL
#ifdef _DEBUG
FILEFLAGS 0xbL
#else
FILEFLAGS 0xaL
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "ActiveMovie", "\0"
VALUE "Comment", "DirectShow Sample\0"
VALUE "Comments", "\0"
VALUE "CompanyName", "Microsoft Corporation\0"
VALUE "FileDescription", "DVD Sample Application\0"
VALUE "FileVersion", "8.10\0"
VALUE "InternalName", "DVDSample.exe\0"
VALUE "LegalCopyright", "Copyright (C) 1992-2001 Microsoft Corporation\0"
VALUE "LegalTrademarks", "\0"
VALUE "OLESelfRegister", "AM20\0"
VALUE "OriginalFilename", "DVDSample.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "DirectX 8.1 Sample\0"
VALUE "ProductVersion", "8.10\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_APP_TITLE "Dvd Sample"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,6 @@
DirectShow Sample -- DVDSample
------------------------------
DVDSample is a C++ DVD application. It demonstrates all basic playback
and navigation functions, as well as advanced features such as parental level
management, bookmarks, karaoke, and command synchronization.

View File

@@ -0,0 +1,75 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by DvdSample.rc
//
#define IDS_APP_TITLE 1
#define DVDSample 101
#define IDM_MENU1 101
#define ID_SPINCONTROL 101
#define IDI_APPICON 103
#define IDR_TOOLBAR1 117
#define IDD_PARENTLEVELS 120
#define IDD_ABOUT 122
#define IDD_SPDLG 123
#define IDD_AUDIODLG 124
#define IDD_ANGLEDLG 125
#define IDD_CHAPTERDLG 126
#define IDD_TITLEDLG 127
#define IDD_TIMEDLG 128
#define IDD_KARAOKEDLG 129
#define IDC_LEVEL_LIST 1002
#define IDC_SPLANG 1003
#define IDC_SHOWSP 1004
#define IDC_AUDIOLANG 1005
#define IDC_ANGLE 1006
#define IDC_PLAYCHAPTER 1007
#define IDC_PLAYTITLE 1010
#define IDC_HOURS 1011
#define IDC_MINUTES 1012
#define IDC_SECONDS 1013
#define IDC_CHANNEL2 1016
#define IDC_CHANNEL3 1017
#define IDC_CHANNEL4 1018
#define ID_HELP_ABOUTDVDSAMPLE 40001
#define ID_FILE_EXIT 40002
#define ID_PLAYBACK_PLAY 40003
#define ID_PLAYBACK_PAUSE 40004
#define ID_PLAYBACK_STOP 40005
#define ID_PLAYBACK_FASTFORWARD 40006
#define ID_PLAYBACK_REWIND 40007
#define ID_PLAYBACK_NEXTCHAPTER 40008
#define ID_PLAYBACK_PREVIOUSCHAPTER 40009
#define ID_PLAYBACK_MENUROOT 40010
#define ID_PLAYBACK_TITLEMENU 40011
#define ID_OPTIONS_SUBPICTURE 40012
#define ID_OPTIONS_AUDIOLANGUAGE 40013
#define ID_OPTIONS_PARENTALLEVEL 40014
#define ID_OPTIONS_CLOSEDCAPTION 40015
#define ID_OPTIONS_FULLSCREEN 40016
#define ID_OPTIONS_ANGLE 40017
#define ID_FILE_SELECTDISC 40018
#define ID_TEST 40019
#define ID_HELP_TEST 40021
#define ID_OPTIONS_SAVEBOOKMARK 40022
#define ID_OPTIONS_RESTOREBOOKMARK 40023
#define ID_PLAYBACK_GOTO_CHAPTER 40024
#define ID_PLAYBACK_GOTO_TIME 40025
#define ID_PLAYBACK_GOTO_TITLE 40026
#define ID_BUTTON40027 40027
#define ID_PLAYBACK_STEPFORWARD 40029
#define ID_OPTIONS_GETDISCTEXT 40030
#define ID_OPTIONS_GETAUDIOATTRIBUTES 40031
#define ID_OPTIONS_GETVIDEOATTRIBUTES 40032
#define ID_OPTIONS_GETSUBPICTUREATTRIBUTES 40033
#define ID_OPTIONS_SETKARAOKEMIXING 40035
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 40036
#define _APS_NEXT_CONTROL_VALUE 1020
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif

View File

@@ -0,0 +1,240 @@
//------------------------------------------------------------------------------
// File: StringUtil.cpp
//
// Desc: This file contains several enum to string conversion functions
// which are used throughout the rest of the program.
//
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include <dshow.h>
#include <TCHAR.H>
#include "StringUtil.h"
//------------------------------------------------------------------------------
// Macros
//------------------------------------------------------------------------------
// this will create a case statement from the name of the enum type
#define ENUM_CASE( x ) case x: return TEXT(#x)
//------------------------------------------------------------------------------
// Name: AsStr()
// Desc: This overloaded function converts enumerationd into human-readable
// text. In most cases, it utilizes the ENUM_CASE macro to create
// generic strings out of the enumerated types. If you want more user-friendly
// strings, use the form found in the DVD_TextStringType function.
//------------------------------------------------------------------------------
const TCHAR* AsStr( DVD_TextStringType IDCD )
// Turn an Enumerated TextStringType into a human-readable string
{
switch( IDCD ) {
case DVD_Struct_Volume: return TEXT("Struct_Volume");
case DVD_Struct_Title: return TEXT("Struct_Title");
case DVD_Struct_ParentalID: return TEXT("Struct_ParentalID");
case DVD_Struct_PartOfTitle: return TEXT("Struct_Chapter");
case DVD_Struct_Cell: return TEXT("Struct_Cell");
case DVD_Stream_Audio: return TEXT("Stream_Audio");
case DVD_Stream_Subpicture: return TEXT("Stream_Sub-picture");
case DVD_Stream_Angle: return TEXT("Stream_Angle");
case DVD_Channel_Audio: return TEXT("Audio Channel");
case DVD_General_Name: return TEXT("General_name");
case DVD_General_Comments: return TEXT("General_comments");
case DVD_Title_Series: return TEXT("Title_Series");
case DVD_Title_Movie: return TEXT("Title_Movie");
case DVD_Title_Video: return TEXT("Title_Video");
case DVD_Title_Album: return TEXT("Title_Album");
case DVD_Title_Song: return TEXT("Title_Song");
case DVD_Title_Other: return TEXT("Title_Other");
case DVD_Title_Sub_Series: return TEXT("Title_Sub_Series");
case DVD_Title_Sub_Movie: return TEXT("Title_Sub_Movie");
case DVD_Title_Sub_Video: return TEXT("Title_Sub_Video");
case DVD_Title_Sub_Album: return TEXT("Title_Sub_Album");
case DVD_Title_Sub_Song: return TEXT("Title_Sub_Song");
case DVD_Title_Sub_Other: return TEXT("Title_Sub_Other");
case DVD_Title_Orig_Series: return TEXT("Title_Orig_Series");
case DVD_Title_Orig_Movie: return TEXT("Title_Orig_Movie");
case DVD_Title_Orig_Video: return TEXT("Title_Orig_Video");
case DVD_Title_Orig_Album: return TEXT("Title_Orig_Album");
case DVD_Title_Orig_Song: return TEXT("Title_Orig_Song");
case DVD_Title_Orig_Other: return TEXT("Title_Orig_Other");
default: return TEXT("Unknown");
}
}
const TCHAR* AsStr( DVD_AUDIO_LANG_EXT ext )
{
switch( ext )
{
ENUM_CASE( DVD_AUD_EXT_NotSpecified );
ENUM_CASE( DVD_AUD_EXT_Captions );
ENUM_CASE( DVD_AUD_EXT_VisuallyImpaired );
ENUM_CASE( DVD_AUD_EXT_DirectorComments1 );
ENUM_CASE( DVD_AUD_EXT_DirectorComments2 );
default:
return TEXT("UNKNOWN");
}
}
const TCHAR* AsStr( DVD_SUBPICTURE_LANG_EXT ext )
{
switch( ext )
{
ENUM_CASE( DVD_SP_EXT_NotSpecified );
ENUM_CASE( DVD_SP_EXT_Caption_Normal );
ENUM_CASE( DVD_SP_EXT_Caption_Big );
ENUM_CASE( DVD_SP_EXT_Caption_Children );
ENUM_CASE( DVD_SP_EXT_CC_Normal );
ENUM_CASE( DVD_SP_EXT_CC_Big );
ENUM_CASE( DVD_SP_EXT_CC_Children );
ENUM_CASE( DVD_SP_EXT_Forced );
ENUM_CASE( DVD_SP_EXT_DirectorComments_Normal );
ENUM_CASE( DVD_SP_EXT_DirectorComments_Big );
ENUM_CASE( DVD_SP_EXT_DirectorComments_Children );
default:
return TEXT("UNKNOWN");
}
}
const TCHAR* AsStr( DVD_AUDIO_APPMODE ext )
{
switch( ext )
{
ENUM_CASE( DVD_AudioMode_None );
ENUM_CASE( DVD_AudioMode_Karaoke );
ENUM_CASE( DVD_AudioMode_Surround );
ENUM_CASE( DVD_AudioMode_Other );
default:
return TEXT("UNKNOWN");
}
}
const TCHAR* AsStr( DVD_AUDIO_FORMAT ext )
{
switch( ext )
{
ENUM_CASE( DVD_AudioFormat_AC3 );
ENUM_CASE( DVD_AudioFormat_MPEG1 );
ENUM_CASE( DVD_AudioFormat_MPEG1_DRC );
ENUM_CASE( DVD_AudioFormat_MPEG2 );
ENUM_CASE( DVD_AudioFormat_MPEG2_DRC );
ENUM_CASE( DVD_AudioFormat_LPCM );
ENUM_CASE( DVD_AudioFormat_DTS );
ENUM_CASE( DVD_AudioFormat_SDDS );
ENUM_CASE( DVD_AudioFormat_Other );
default:
return TEXT("UNKNOWN");
}
}
const TCHAR* AsStr( DVD_KARAOKE_ASSIGNMENT ext )
{
switch( ext )
{
ENUM_CASE( DVD_Assignment_reserved0 );
ENUM_CASE( DVD_Assignment_reserved1 );
ENUM_CASE( DVD_Assignment_LR );
ENUM_CASE( DVD_Assignment_LRM );
ENUM_CASE( DVD_Assignment_LR1 );
ENUM_CASE( DVD_Assignment_LRM1);
ENUM_CASE( DVD_Assignment_LR12);
ENUM_CASE( DVD_Assignment_LRM12);
default:
return TEXT("UNKNOWN");
}
}
const TCHAR* AsStr( DVD_SUBPICTURE_TYPE type )
{
switch( type )
{
ENUM_CASE( DVD_SPType_NotSpecified );
ENUM_CASE( DVD_SPType_Language );
ENUM_CASE( DVD_SPType_Other );
default:
return TEXT("UNKNOWN");
}
}
const TCHAR* AsStr( DVD_SUBPICTURE_CODING type )
{
switch( type )
{
ENUM_CASE( DVD_SPCoding_RunLength );
ENUM_CASE( DVD_SPCoding_Extended );
ENUM_CASE( DVD_SPCoding_Other );
default:
return TEXT("UNKNOWN");
}
}
const TCHAR* AsStr( DVD_VIDEO_COMPRESSION type )
{
switch( type )
{
ENUM_CASE( DVD_VideoCompression_Other );
ENUM_CASE( DVD_VideoCompression_MPEG1 );
ENUM_CASE( DVD_VideoCompression_MPEG2 );
default:
return TEXT("UNKNOWN");
}
}
const TCHAR* AsStr( bool b )
{
if( b )
return TEXT("true");
else
return TEXT("false");
}
const TCHAR* AsStr( BOOL b )
{
if( b )
return TEXT("true");
else
return TEXT("false");
}
//------------------------------------------------------------------------------
// Name: KaraokeAsStr()
// Desc: This method returns the text name of the contents of a karaoke channel.
// a function header should look like. This function is set apart from
// the other AsStr functions because the DVD_KARAOKE_CONTENTS type is passed
// as a word, not an enum.
//
// A single channel can contain several of these content types. Here just
// the first is returned.
//------------------------------------------------------------------------------
const TCHAR* KaraokeAsStr (WORD type)
{
if (type & DVD_Karaoke_GuideVocal1)
return TEXT("GuideVocal1");
if (type & DVD_Karaoke_GuideVocal2)
return TEXT("GuideVocal2");
if (type & DVD_Karaoke_GuideMelody1)
return TEXT("GuideMelody1");
if (type & DVD_Karaoke_GuideMelody2)
return TEXT("GuideMelody2");
if (type & DVD_Karaoke_GuideMelodyA)
return TEXT("GuideMelodyA");
if (type & DVD_Karaoke_GuideMelodyB)
return TEXT("GuideMelodyB");
if (type & DVD_Karaoke_SoundEffectA)
return TEXT("SoundEffectA");
if (type & DVD_Karaoke_SoundEffectB)
return TEXT("SoundEffectB");
else return TEXT("Unknown");
}

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// File: StringUtil.h
//
// Desc: This header file contains several enum to string conversion functions
// which are used throughout the rest of the program.
//
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Name: AsStr()
// Desc: This overloaded function converts enumerationd into human-readable
// text. In most cases, it utilizes the ENUM_CASE macro to create
// generic strings out of the enumerated types. If you want more user-friendly
// strings, use the form found in the DVD_TextStringType function.
//------------------------------------------------------------------------------
const TCHAR* AsStr( DVD_TextStringType IDCD );
const TCHAR* AsStr( DVD_AUDIO_LANG_EXT ext );
const TCHAR* AsStr( DVD_SUBPICTURE_LANG_EXT ext );
const TCHAR* AsStr( DVD_AUDIO_APPMODE ext );
const TCHAR* AsStr( DVD_AUDIO_FORMAT ext );
const TCHAR* AsStr( DVD_KARAOKE_ASSIGNMENT ext );
const TCHAR* AsStr( DVD_SUBPICTURE_TYPE type );
const TCHAR* AsStr( DVD_SUBPICTURE_CODING type );
const TCHAR* AsStr( DVD_VIDEO_COMPRESSION type );
const TCHAR* AsStr( bool b );
const TCHAR* AsStr( BOOL b );
const TCHAR* KaraokeAsStr (WORD type);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB