-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectXAudio.h
74 lines (62 loc) · 2.97 KB
/
DirectXAudio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// -----------------------------------------------------------------
// Learning Team B
// Members:
// Adam LeMmon
// Faith Satterthwaite
// Tom Fletcher
// Justin Ball
// CS 4280 – 11:30 am
// Final Project
// Dr. Rague
// Due: 12/06/12
// Version: 2.4
// -----------------------------------------------------------------
// We made five major improvements to this game
// 1) New controls
// 2) Enemy attack
// 3) HUD (heads up display)
// 4) Enemy health bars
// 5) New Weapon
// -----------------------------------------------------------------
// DirectXAudio.h
// Brett Eames
// 4/18/2009
//-----------------------------------------------------------------------------
//Defines an Audio Class using DirectX 9.0 (Novemeber 2008) release
//uses the XACT 3 sound engine with hardcoded wave bank file "Wave Bank.xwb"
//and hardcoded sound bank file "Sound Bank.xsb"
//-----------------------------------------------------------------------------
#pragma once
#ifndef __DIRECTXAUDIO_H__
#define __DIRECTXAUDIO_H__
#define _WIN32_WINNT 0x0400 //Allows CoInitializeEx command
#include <xact3.h>
#include <iostream> //for cerr
using namespace std; //for cerr
class CDirectXAudio
{
private:
IXACT3Engine* pEngine; //pointer to the instanc of the XACT 3 sound engine
IXACT3WaveBank* pWaveBank; //pointer to the wave bank loaded into memory
IXACT3SoundBank* pSoundBank; //pointer to the sound bank loaded into memory
VOID* pbWaveBank; // Handle to memory mapped wave bank data
VOID* pbSoundBank; // Pointer to sound bank data.(not memory mapped)
void LoadWaveBank(LPCSTR filename); //function to load wave bank into memory
void LoadSoundBank(LPCSTR filename); //function to load sound bank into memory
public:
XACTINDEX iExplode; //xact index to the cue defined for the Explode noise
XACTINDEX iChimes; //xact index to the cue defined for the chime noise (not used)
XACTINDEX iAmbient; //xact index to the cue defined for the background noise
XACTINDEX iGameover; //xact index to the cue defined for the background noise
XACTINDEX iNuke;
XACTINDEX iWilhelm;
XACTINDEX iJets;
CDirectXAudio(); //default constructor
~CDirectXAudio(); //destructor
void Kill(); //function to correctly release resources and shut down sound engine
void InitSound(LPCSTR cue, XACTINDEX& sound); //funciton to initialize a sound (not used)
void PlaySoundDX(XACTINDEX& sound); //function to Play a sound using that sounds cue
void StopSoundDX(XACTINDEX& sound); //function to Stop a sound playing using it's sound cue index
void Update(); //function to call the soundengine work loop
};
#endif