Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Audio.h
Package: 3dexplorerTest.rar [view]
Upload User: hkb425
Upload Date: 2007-06-16
Package Size: 34191k
Code Size: 2k
Category:
Game Engine
Development Platform:
Visual C++
- // Audio.h: interface for the CAudio class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_AUDIO_H__C59411DC_4F55_40AF_945A_7157AAE6F15B__INCLUDED_)
- #define AFX_AUDIO_H__C59411DC_4F55_40AF_945A_7157AAE6F15B__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- include <dmusicc.h>
- #include <dmusici.h>
- #define INIT_GUID
- #define LPDIRECTMUSICLOADER8 IDirectMusicLoader8*
- #define LPDIRECTMUSICPERFORMANCE8 IDirectMusicPerformance8*
- #define LPDIRECTMUSICSEGMENT8 IDirectMusicSegment8*
- #define LPDIRECTMUSICAUDIOPATH IDirectMusicAudioPath*
- #define LPDIRECTCSound3DBUFFER IDirectSound3DBuffer*
- #define LPDIRECTCSound3DLISTENER IDirectSound3DListener*
- class CSound
- {
- public:
- LPDIRECTMUSICSEGMENT8 dmSegment;
- LPDIRECTCSound3DBUFFER ds3DBuffer;
- bool is3DSound;
- void Set3DPos(float x, float y, float z);
- void Set3DDistances(float minDistance, float maxDistance);
- void Shutdown(void);
- CSound() : dmSegment(NULL), ds3DBuffer(NULL), is3DSound(false)
- { }
- ~CSound()
- { }
- };
- class CAudio
- {
- protected:
- LPDIRECTMUSICLOADER8 dmLoader; // the loader
- LPDIRECTMUSICPERFORMANCE8 dmPerformance; // the performance
- LPDIRECTMUSICAUDIOPATH dm3DAudioPath; // the audiopath
- LPDIRECTCSound3DLISTENER ds3DListener; // 3d listener
- DS3DLISTENER dsListenerParams; // 3d listener properties
- //////////////////////////////////
- CSound *pSound;
- unsigned int m_MaxNum;//max number of CSound object
- public:
- bool Init(HWND hwnd,unsigned int MaxNumber);
- void Shutdown(void);
- bool Create(unsigned int NumOfSound, char* filename, bool is3DSound);
- void Play(unsigned int NumOfSound, DWORD numRepeats);
- void Stop(unsigned int NumOfSound);
- void SetListenerPos(float x, float y, float z);
- void SetListenerRolloff(float rolloff);
- void SetListenerOrientation(float forwardX, float forwardY, float forwardZ, float topX, float topY, float topZ);
- CAudio(): dm3DAudioPath(NULL), dmLoader(NULL), dmPerformance(NULL),
- ds3DListener(NULL),pSound(NULL),m_MaxNum(0)
- { }
- virtual ~CAudio()
- { }
- };
- #endif // !defined(AFX_AUDIO_H__C59411DC_4F55_40AF_945A_7157AAE6F15B__INCLUDED_)