Initial commit: ROW Client source code
Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,317 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: Audiopath.cpp
|
||||
//
|
||||
// Desc: Uses a 3D Audiopath, and shows off various methods of PlaySegmentEx
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <basetsd.h>
|
||||
#include <commdlg.h>
|
||||
#include <commctrl.h>
|
||||
#include <dmusicc.h>
|
||||
#include <dmusici.h>
|
||||
#include <cguid.h>
|
||||
#include <dxerr8.h>
|
||||
#include <tchar.h>
|
||||
#include "resource.h"
|
||||
#include "DMUtil.h"
|
||||
#include "DXUtil.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Function-prototypes
|
||||
//-----------------------------------------------------------------------------
|
||||
INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
|
||||
HRESULT OnInitDialog( HWND hDlg );
|
||||
HRESULT PlaySegment( DWORD dwIndex );
|
||||
HRESULT SetPosition( float fXPos, float fYPos, float fZPos );
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Defines, constants, and global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
CMusicManager* g_pMusicManager = NULL;
|
||||
CMusicSegment* g_pMusicSegments[4] = { NULL,NULL,NULL,NULL };
|
||||
IDirectMusicAudioPath* g_p3DAudiopath = NULL;
|
||||
HINSTANCE g_hInst = NULL;
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: WinMain()
|
||||
// Desc: Entry point for the application. Since we use a simple dialog for
|
||||
// user interaction we don't need to pump messages.
|
||||
//-----------------------------------------------------------------------------
|
||||
INT APIENTRY WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR pCmdLine,
|
||||
INT nCmdShow )
|
||||
{
|
||||
g_hInst = hInst;
|
||||
|
||||
InitCommonControls();
|
||||
|
||||
// Display the main dialog box.
|
||||
DialogBox( hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDlgProc );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: MainDlgProc()
|
||||
// Desc: Handles dialog messages
|
||||
//-----------------------------------------------------------------------------
|
||||
INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
switch( msg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
if( FAILED( hr = OnInitDialog( hDlg ) ) )
|
||||
{
|
||||
DXTRACE_ERR( TEXT("OnInitDialog"), hr );
|
||||
MessageBox( hDlg, "Error initializing DirectMusic. Sample will now exit.",
|
||||
"DirectMusic Sample", MB_OK | MB_ICONERROR );
|
||||
EndDialog( hDlg, 0 );
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDCANCEL:
|
||||
EndDialog( hDlg, 0 );
|
||||
break;
|
||||
|
||||
case IDC_PLAY1:
|
||||
case IDC_PLAY2:
|
||||
case IDC_PLAY3:
|
||||
case IDC_PLAY4:
|
||||
{
|
||||
DWORD dwIndex = LOWORD(wParam) - IDC_PLAY1;
|
||||
if( FAILED( hr = PlaySegment( dwIndex ) ) )
|
||||
{
|
||||
DXTRACE_ERR( TEXT("PlaySegment"), hr );
|
||||
MessageBox( hDlg, "Error playing DirectMusic segment. Sample will now exit.",
|
||||
"DirectMusic Sample", MB_OK | MB_ICONERROR );
|
||||
EndDialog( hDlg, 0 );
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return FALSE; // Didn't handle message
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_HSCROLL:
|
||||
{
|
||||
// Set the 3D position
|
||||
int nXPos = (int)SendDlgItemMessage( hDlg, IDC_XPOS, TBM_GETPOS, 0, 0 );
|
||||
int nYPos = (int)SendDlgItemMessage( hDlg, IDC_YPOS, TBM_GETPOS, 0, 0 );
|
||||
int nZPos = (int)SendDlgItemMessage( hDlg, IDC_ZPOS, TBM_GETPOS, 0, 0 );
|
||||
SetDlgItemInt( hDlg, IDC_XDISPLAY, nXPos, TRUE );
|
||||
SetDlgItemInt( hDlg, IDC_YDISPLAY, nYPos, TRUE );
|
||||
SetDlgItemInt( hDlg, IDC_ZDISPLAY, nZPos, TRUE );
|
||||
SetPosition( (float) nXPos, (float) nYPos, (float) nZPos );
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_DESTROY:
|
||||
{
|
||||
// Cleanup everything
|
||||
SAFE_RELEASE( g_p3DAudiopath );
|
||||
|
||||
for( int i=0; i<4; i++ )
|
||||
SAFE_DELETE( g_pMusicSegments[i] );
|
||||
|
||||
SAFE_DELETE( g_pMusicManager );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return FALSE; // Didn't handle message
|
||||
}
|
||||
|
||||
return TRUE; // Handled message
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: OnInitDialog()
|
||||
// Desc: Initializes the dialogs (sets up UI controls, etc.)
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT OnInitDialog( HWND hDlg )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Load the icon
|
||||
HICON hIcon = LoadIcon( g_hInst, MAKEINTRESOURCE( IDR_MAINFRAME ) );
|
||||
|
||||
// Set the icon for this dialog.
|
||||
SendMessage( hDlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon ); // Set big icon
|
||||
SendMessage( hDlg, WM_SETICON, ICON_SMALL, (LPARAM) hIcon ); // Set small icon
|
||||
|
||||
g_pMusicManager = new CMusicManager();
|
||||
|
||||
if( FAILED( hr = g_pMusicManager->Initialize( hDlg ) ) )
|
||||
return DXTRACE_ERR( TEXT("Initialize"), hr );
|
||||
|
||||
// Create a 3D Audiopath. This creates a synth port that feeds a 3d buffer.
|
||||
// We can then play all segments into this buffer and directly control its
|
||||
// 3D parameters.
|
||||
IDirectMusicPerformance8* pPerformance = g_pMusicManager->GetPerformance();
|
||||
if( FAILED( hr = pPerformance->CreateStandardAudioPath( DMUS_APATH_DYNAMIC_3D, 128,
|
||||
TRUE, &g_p3DAudiopath ) ) )
|
||||
return DXTRACE_ERR( TEXT("CreateStandardAudioPath"), hr );
|
||||
|
||||
// Set the default media path (something like C:\MSSDK\SAMPLES\MULTIMEDIA\MEDIA)
|
||||
// to be used as the search directory for finding DirectMusic content.
|
||||
if( FAILED( hr = g_pMusicManager->SetSearchDirectory( DXUtil_GetDXSDKMediaPath() ) ) )
|
||||
return DXTRACE_ERR( TEXT("SetSearchDirectory"), hr );
|
||||
|
||||
TCHAR strFileNames[4][MAX_PATH] = { TEXT("Audiopath1.sgt"), // Lullaby theme
|
||||
TEXT("Audiopath2.sgt"), // Snoring
|
||||
TEXT("Audiopath3.wav"), // Muttering in sleep
|
||||
TEXT("Audiopath4.sgt") // Rude awakening
|
||||
};
|
||||
|
||||
// Create the segments from a file
|
||||
for (DWORD dwIndex = 0;dwIndex < 4; dwIndex++)
|
||||
{
|
||||
if( FAILED( hr = g_pMusicManager->CreateSegmentFromFile( &g_pMusicSegments[dwIndex],
|
||||
strFileNames[dwIndex] ) ) )
|
||||
return DXTRACE_ERR( TEXT("CreateSegmentFromFile"), hr );
|
||||
}
|
||||
|
||||
|
||||
// Get the listener from the in the Audiopath.
|
||||
IDirectSound3DListener* pDSListener = NULL;
|
||||
if( FAILED( hr = g_p3DAudiopath->GetObjectInPath( 0, DMUS_PATH_PRIMARY_BUFFER, 0,
|
||||
GUID_NULL, 0, IID_IDirectSound3DListener,
|
||||
(LPVOID*) &pDSListener ) ) )
|
||||
return DXTRACE_ERR( TEXT("GetObjectInPath"), hr );
|
||||
|
||||
// Set a new rolloff factor (1.0f is default)
|
||||
if( FAILED( hr = pDSListener->SetRolloffFactor( 0.25f, DS3D_IMMEDIATE ) ) )
|
||||
return DXTRACE_ERR( TEXT("SetRolloffFactor"), hr );
|
||||
|
||||
// Release the listener since we are done with it.
|
||||
SAFE_RELEASE( pDSListener );
|
||||
|
||||
// Setup the sliders
|
||||
HWND hSlider;
|
||||
hSlider = GetDlgItem( hDlg, IDC_XPOS );
|
||||
SendMessage( hSlider, TBM_SETRANGEMAX, TRUE, 20L );
|
||||
SendMessage( hSlider, TBM_SETRANGEMIN, TRUE, -20L );
|
||||
SendMessage( hSlider, TBM_SETPOS, TRUE, 0L );
|
||||
|
||||
hSlider = GetDlgItem( hDlg, IDC_YPOS );
|
||||
SendMessage( hSlider, TBM_SETRANGEMAX, TRUE, 20L );
|
||||
SendMessage( hSlider, TBM_SETRANGEMIN, TRUE, -20L );
|
||||
SendMessage( hSlider, TBM_SETPOS, TRUE, 0L );
|
||||
|
||||
hSlider = GetDlgItem( hDlg, IDC_ZPOS );
|
||||
SendMessage( hSlider, TBM_SETRANGEMAX, TRUE, 20L );
|
||||
SendMessage( hSlider, TBM_SETRANGEMIN, TRUE, -20L );
|
||||
SendMessage( hSlider, TBM_SETPOS, TRUE, 0L );
|
||||
|
||||
SetDlgItemInt( hDlg, IDC_XDISPLAY, 0, TRUE );
|
||||
SetDlgItemInt( hDlg, IDC_YDISPLAY, 0, TRUE );
|
||||
SetDlgItemInt( hDlg, IDC_ZDISPLAY, 0, TRUE );
|
||||
SetPosition( 0, 0, 0 );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: PlaySegment()
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT PlaySegment( DWORD dwIndex )
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if( g_pMusicSegments[dwIndex] )
|
||||
{
|
||||
switch( dwIndex )
|
||||
{
|
||||
case 0:
|
||||
// Lullaby theme. This should play as a primary segment.
|
||||
hr = g_pMusicSegments[dwIndex]->Play( DMUS_SEGF_DEFAULT, g_p3DAudiopath );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 2:
|
||||
// Sound effects. These play as secondary segments so
|
||||
// they can be triggered multiple times and will layer on top.
|
||||
hr = g_pMusicSegments[dwIndex]->Play( DMUS_SEGF_DEFAULT | DMUS_SEGF_SECONDARY,
|
||||
g_p3DAudiopath );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Rude awakening. Notice that this also passes the Audiopath
|
||||
// in pFrom, indicating that all segments currently playing on
|
||||
// the Audiopath should be stopped at the exact time
|
||||
// this starts.
|
||||
IDirectMusicSegment8* pSegment = g_pMusicSegments[dwIndex]->GetSegment();
|
||||
IDirectMusicPerformance8* pPerformance = g_pMusicManager->GetPerformance();
|
||||
|
||||
hr = pPerformance->PlaySegmentEx( pSegment, 0, NULL, 0, 0, 0,
|
||||
g_p3DAudiopath, g_p3DAudiopath );
|
||||
}
|
||||
}
|
||||
|
||||
if( FAILED(hr) )
|
||||
return DXTRACE_ERR( TEXT("PlaySegmentEx"), hr );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: SetPosition()
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT SetPosition( float fXPos, float fYPos, float fZPos )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if( NULL == g_p3DAudiopath )
|
||||
return E_INVALIDARG;
|
||||
|
||||
// First, get the 3D interface from the buffer by using GetObjectInPath.
|
||||
IDirectSound3DBuffer *pBuffer;
|
||||
if( FAILED( hr = g_p3DAudiopath->GetObjectInPath( DMUS_PCHANNEL_ALL, DMUS_PATH_BUFFER, 0,
|
||||
GUID_NULL, 0, IID_IDirectSound3DBuffer,
|
||||
(void **)&pBuffer ) ) )
|
||||
return DXTRACE_ERR( TEXT("GetObjectInPath"), hr );
|
||||
|
||||
// Then, set the coordinates and release.
|
||||
if( FAILED( hr = pBuffer->SetPosition( fXPos, fYPos, fZPos, DS3D_IMMEDIATE ) ) )
|
||||
return DXTRACE_ERR( TEXT("SetPosition"), hr );
|
||||
|
||||
SAFE_RELEASE( pBuffer );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
# Microsoft Developer Studio Project File - Name="AudioPath" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=AudioPath - 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 "audiopath.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 "audiopath.mak" CFG="AudioPath - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "AudioPath - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "AudioPath - 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)" == "AudioPath - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\common\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
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 comctl32.lib dxerr8.lib winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "AudioPath - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\common\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
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 comctl32.lib dxerr8.lib winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "AudioPath - Win32 Release"
|
||||
# Name "AudioPath - Win32 Debug"
|
||||
# Begin Group "Source"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AudioPath.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AudioPath.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\dmutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\include\dmutil.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\dxutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\include\dxutil.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\readme.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "AudioPath"=.\audiopath.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on audiopath.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=AudioPath - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to AudioPath - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "AudioPath - Win32 Release" && "$(CFG)" != "AudioPath - 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 "audiopath.mak" CFG="AudioPath - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "AudioPath - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "AudioPath - 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)" == "AudioPath - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\audiopath.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AudioPath.obj"
|
||||
-@erase "$(INTDIR)\AudioPath.res"
|
||||
-@erase "$(INTDIR)\dmutil.obj"
|
||||
-@erase "$(INTDIR)\dxutil.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\audiopath.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\common\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\audiopath.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\AudioPath.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\audiopath.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=comctl32.lib dxerr8.lib winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\audiopath.pdb" /machine:I386 /out:"$(OUTDIR)\audiopath.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\AudioPath.obj" \
|
||||
"$(INTDIR)\dmutil.obj" \
|
||||
"$(INTDIR)\dxutil.obj" \
|
||||
"$(INTDIR)\AudioPath.res"
|
||||
|
||||
"$(OUTDIR)\audiopath.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "AudioPath - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\audiopath.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AudioPath.obj"
|
||||
-@erase "$(INTDIR)\AudioPath.res"
|
||||
-@erase "$(INTDIR)\dmutil.obj"
|
||||
-@erase "$(INTDIR)\dxutil.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\audiopath.exe"
|
||||
-@erase "$(OUTDIR)\audiopath.ilk"
|
||||
-@erase "$(OUTDIR)\audiopath.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\common\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\audiopath.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\AudioPath.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\audiopath.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=comctl32.lib dxerr8.lib winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\audiopath.pdb" /debug /machine:I386 /out:"$(OUTDIR)\audiopath.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\AudioPath.obj" \
|
||||
"$(INTDIR)\dmutil.obj" \
|
||||
"$(INTDIR)\dxutil.obj" \
|
||||
"$(INTDIR)\AudioPath.res"
|
||||
|
||||
"$(OUTDIR)\audiopath.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("audiopath.dep")
|
||||
!INCLUDE "audiopath.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "audiopath.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "AudioPath - Win32 Release" || "$(CFG)" == "AudioPath - Win32 Debug"
|
||||
SOURCE=.\AudioPath.cpp
|
||||
|
||||
"$(INTDIR)\AudioPath.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\AudioPath.rc
|
||||
|
||||
"$(INTDIR)\AudioPath.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\..\common\src\dmutil.cpp
|
||||
|
||||
"$(INTDIR)\dmutil.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\..\common\src\dxutil.cpp
|
||||
|
||||
"$(INTDIR)\dxutil.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include <windows.h>
|
||||
#define IDC_STATIC -1
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_MAIN DIALOG DISCARDABLE 0, 0, 322, 180
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE |
|
||||
WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "DirectMusic Audiopath Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
GROUPBOX "DirectMusic Segments",IDC_STATIC,7,7,308,80
|
||||
PUSHBUTTON "Lullaby",IDC_PLAY1,15,19,63,13
|
||||
PUSHBUTTON "Snore",IDC_PLAY2,15,35,63,13
|
||||
PUSHBUTTON "Mumble",IDC_PLAY3,15,51,63,13
|
||||
PUSHBUTTON "Rude Awakening",IDC_PLAY4,15,67,63,13
|
||||
GROUPBOX "3D Positioning of AudioPath",IDC_STATIC,7,90,145,61
|
||||
LTEXT "X",IDC_STATIC,13,101,8,8
|
||||
CONTROL "Slider1",IDC_XPOS,"msctls_trackbar32",TBS_BOTH |
|
||||
TBS_NOTICKS | WS_TABSTOP,19,99,108,14
|
||||
LTEXT "Y",IDC_STATIC,13,117,8,8
|
||||
CONTROL "Slider1",IDC_YPOS,"msctls_trackbar32",TBS_BOTH |
|
||||
TBS_NOTICKS | WS_TABSTOP,19,115,108,14
|
||||
LTEXT "Z",IDC_STATIC,13,133,8,8
|
||||
CONTROL "Slider1",IDC_ZPOS,"msctls_trackbar32",TBS_BOTH |
|
||||
TBS_NOTICKS | WS_TABSTOP,19,131,108,14
|
||||
DEFPUSHBUTTON "Exit",IDCANCEL,265,157,50,14
|
||||
LTEXT "Segment file. Start over if pressed twice. Plays as primary segment.",
|
||||
IDC_STATIC,86,21,223,8
|
||||
LTEXT "Segment file. Overlaps if pressed twice. Plays as secondary segment. ",
|
||||
IDC_STATIC,86,37,223,8
|
||||
LTEXT "Wave file. Overlaps if pressed twice. Plays as secondary segment. ",
|
||||
IDC_STATIC,86,53,223,8
|
||||
LTEXT "Segment file. Stops all sound on audiopath. Plays as primary segment.",
|
||||
IDC_STATIC,86,69,223,8
|
||||
GROUPBOX "Description",IDC_STATIC,157,90,158,61
|
||||
LTEXT "All of the sounds above will play on a 3D audiopath. Click on the buttons to hear various methods of using PlaySegmentEx(). To the left, you can adjust the 3D position of the audiopath.",
|
||||
IDC_STATIC,165,101,143,43
|
||||
LTEXT "Static",IDC_ZDISPLAY,129,132,18,12
|
||||
LTEXT "Static",IDC_YDISPLAY,129,116,18,12
|
||||
LTEXT "Static",IDC_XDISPLAY,129,100,18,12
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_MAIN, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 315
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 171
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include <windows.h>\r\n"
|
||||
"#define IDC_STATIC -1\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\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 "directx.ico"
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,76 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Sample Name: AudioPath Sample
|
||||
//
|
||||
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// GM/GS® Sound Set Copyright ©1996, Roland Corporation U.S.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
The AudioPath sample demonstrates how different sounds can be played
|
||||
on an audiopath, and how the parameters of all sounds are affected
|
||||
by changes made on the audiopath.
|
||||
|
||||
Path
|
||||
====
|
||||
Source: DXSDK\Samples\Multimedia\DirectMusic\AudioPath
|
||||
|
||||
Executable: DXSDK\Samples\Multimedia\DirectMusic\Bin
|
||||
|
||||
User's Guide
|
||||
============
|
||||
Click Lullaby, Snore, and Mumble to play different sounds. Adjust the
|
||||
3-D position of the sounds by using the sliders. Click Rude Awakening
|
||||
to play a different sound and stop all other sounds.
|
||||
|
||||
Programming Notes
|
||||
=================
|
||||
The AudioPath sample is very similar in form to the PlayAudio sample. For
|
||||
detailed programming notes on the basics this sample, refer to Programming
|
||||
Notes section of the PlayAudio sample.
|
||||
|
||||
The AudioPath differs by showing some of the various uses of an
|
||||
audiopath. Here's how:
|
||||
|
||||
* Upon init. See OnInitDialog()
|
||||
1. Calls IDirectMusicPerformance8::CreateStandardAudioPath passing
|
||||
in DMUS_APATH_DYNAMIC_3D to create a 3D audiopath named g_p3DAudiopath.
|
||||
2. Uses the CMusicManager framework class to create CMusicSegments from a
|
||||
list a list of files.
|
||||
3. Gets the IDirectSound3DListener from the 3D audiopath, and
|
||||
calls SetRolloffFactor to set a new rolloff factor.
|
||||
|
||||
* Upon 3D positoin slider change. See SetPosition()
|
||||
1. Calls IDirectMusicAudioPath::GetObjectInPath on the 3D audiopath to
|
||||
get the IDirectSound3DBuffer from it.
|
||||
2. Calls IDirectSound3DBuffer::SetPosition to set a new 3D position on
|
||||
the buffer of the audiopath.
|
||||
3. Releases the 3D buffer.
|
||||
|
||||
* Upon button click. See PlaySegment().
|
||||
- If its the first button, "Lullaby", this plays the primary segment
|
||||
on the 3D audiopath by calling PlaySegmentEx passing in
|
||||
DMUS_SEGF_DEFAULT and the 3D audiopath.
|
||||
- If its the second or third button, this plays a secondary segment
|
||||
on the 3D audiopath by calling PlaySegmentEx passing in
|
||||
DMUS_SEGF_DEFAULT | DMUS_SEGF_SECONDARY and the 3D audiopath.
|
||||
- If its the forth button, "Rude Awakening", this plays a primary segment
|
||||
on the 3D audiopath by calling PlaySegmentEx passing in
|
||||
the 3D audiopath, and setting the pFrom to the 3D audiopath.
|
||||
This causes all currently playing segments to stop when this one starts.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by AudioPath.rc
|
||||
//
|
||||
#define IDD_MAIN 101
|
||||
#define IDR_MAINFRAME 102
|
||||
#define IDR_ACCELERATOR1 131
|
||||
#define IDC_PLAY 1002
|
||||
#define IDC_STOP 1003
|
||||
#define IDC_FILENAME 1004
|
||||
#define IDC_TEMPO_SLIDER 1005
|
||||
#define IDC_VOLUME_SLIDER 1006
|
||||
#define IDC_LOOP_CHECK 1009
|
||||
#define IDC_XPOS 1010
|
||||
#define IDC_SOUNDFILE 1011
|
||||
#define IDC_YPOS 1012
|
||||
#define IDC_ZPOS 1013
|
||||
#define IDC_XDISPLAY 1014
|
||||
#define IDC_YDISPLAY 1015
|
||||
#define IDC_ZDISPLAY 1016
|
||||
#define IDC_PLAY1 2000
|
||||
#define IDC_PLAY2 2001
|
||||
#define IDC_PLAY3 2002
|
||||
#define IDC_PLAY4 2003
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1007
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user