📄 md_audio.h
字号:
//********************************************************************
// MD 引擎 音乐管理 内核部件的定义
// Powered by @J--S Studio Johnhans 2002.9.18
//********************************************************************
#ifndef MD_AUDIO_H
#define MD_AUDIO_H
#ifdef MDENGINE_EXPORTS
#define MDENGINE_API __declspec(dllexport)
#else
#define MDENGINE_API __declspec(dllimport)
#endif
#define DIRECTSOUND_VERSION 0x0700
#include <dsound.h>
#define VOLUME_MIN DMUS_VOLUME_MIN
#define VOLUME_MAX DMUS_VOLUME_MAX
class MDENGINE_API CMD_Audio
{
public:
CMD_Audio();
virtual ~CMD_Audio();
public:
bool Create(HWND hWnd, DWORD dwSample=44100, unsigned short dwBit=16,bool Stereo=true);
void Free(void);
bool ChangeAudioFormat(DWORD dwSample=44100, unsigned short dwBit=16,bool Stereo=true);
LPDIRECTSOUND *GetDSObject(void) { return &m_lpDS; }
void EnableSound(bool Enable=true) { m_bEnableSound=Enable; }
bool IsEnableSound(void) { return m_bEnableSound; }
void SetVolume(long volume);
long GetVolume(void);
private:
LPDIRECTSOUND m_lpDS; // DirectSound内核
bool m_bEnableSound; // 允许播放声音
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -