📄 sound.h
字号:
// Sound.h: interface for the CSound class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SOUND_H__C89CE19D_7C1D_4741_BE61_5AD0836FCF3A__INCLUDED_)
#define AFX_SOUND_H__C89CE19D_7C1D_4741_BE61_5AD0836FCF3A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Base.h"
class CSound : public CBase
{
public:
bool IsPlaying();
bool Stop();
bool Play(DWORD dwNumOfRepeats = 0);
bool LoadSound(const char* szSoundFilePath);
void InitialiseForWavMidi(IDirectMusicPerformance8* pDirectAudioPerformance, IDirectMusicLoader8* pDirectAudioLoader);
void InitialiseForMP3();
CSound(); //Use this constructor for mp3 files
virtual ~CSound();
private:
enum Format {Unknown, MP3, WavMidi};
IDirectMusicSegment8* m_pSegment;
IDirectMusicPerformance8* m_pDirectAudioPerformance;
IDirectMusicLoader8* m_pDirectAudioLoader;
IGraphBuilder* m_pGraph;
IMediaControl* m_pMediaControl;
IMediaPosition* m_pMediaPosition;
Format m_enumFormat;
};
#endif // !defined(AFX_SOUND_H__C89CE19D_7C1D_4741_BE61_5AD0836FCF3A__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -