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
MusicPlace.h
Package: LwGame2.0.rar [view]
Upload User: semy2100
Upload Date: 2013-01-22
Package Size: 3633k
Code Size: 2k
Category:
Shot Game
Development Platform:
Visual C++
- /********************************************************************
- * 空运爆发 *
- * Version 2.0 *
- * 本游戏全部代码由: *
- * 冲天实验室 梁锋 编写 *
- * 邮箱:lenwine@126.com *
- * bbs: http://free2.e-168.cn/lenwind (正在开发中...) *
- **********************************************************************/
- #ifndef MUSICPLACE
- #define MUSICPLACE
- //设置两个全局变量控制音量
- extern int m_bMusVoLF;//用控制背景音乐音量大小
- extern int m_cMusVoLF;//用于控制音效音量大小
- //wave 文件头格式
- struct LWaveF
- {
- BYTE RIFF[4]; //"RIFF"
- DWORD dwSize; //Size of data to follow
- BYTE WAVE[4]; //"WAVE"
- BYTE fmt_[4]; //"fmt"
- DWORD dw16; //16
- WORD wOne_O; //1
- WORD wChnls; //Number of Channels
- DWORD dwSRate; //Sample Rate
- DWORD BytesPerSec; //Sample Rate
- WORD wBlkAlign; //1
- WORD BitsPerSample; //Sample size
- BYTE DATA[4]; //"DATA"
- DWORD dwDSize; //Number of Samples
- };
- class MusicPlace
- {
- protected:
- LPDIRECTSOUNDBUFFER m_lMusBuf;//声音缓冲区对象
- public:
- MusicPlace(const char* FileName,BOOL m_bgMusic,LPDIRECTSOUND lpDS,DWORD dwFlags=DSBCAPS_CTRLVOLUME);
- virtual ~MusicPlace();
- public:
- BOOL ActionPlay(BOOL bContinue=FALSE);//播放声音
- BOOL ActionStop();
- BOOL CreateSoundBuffer(LPDIRECTSOUND lpDS,DWORD dwFlags,DWORD dwBufSize,DWORD dwFreq,DWORD dwBitsPerSample,DWORD dwBlkAlign,BOOL bStereo);
- BOOL Access(FILE* pFile,DWORD dwSize,DWORD dwPos);//数据访问
- BOOL bTrue();
- LPDIRECTSOUNDBUFFER GetBuffer(){return m_lMusBuf;}
- void CtrlVolume(int vol=0);//设置音量
- private:
- BOOL m_lenbm;//判断背景音乐
- };
- #endif