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

View File

@@ -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;
}

View File

@@ -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

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: "JukeboxASF"=.\JukeboxASF.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -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_)

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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_)

View File

@@ -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"

View File

@@ -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_)

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;
};

View File

@@ -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 */
};

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -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...
/////////////////////////////////////////////////////////////////////////////

View File

@@ -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