|
|
| version 1.15, 2007/10/28 16:01:35 | version 1.17, 2011/03/07 09:54:11 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | /** |
| #include <dsound.h> | * @file soundmng.cpp |
| #include "parts.h" | * @brief Sound Manager (DirectSound3) |
| #include "wavefile.h" | * |
| #include "np2.h" | * @author $Author$ |
| #include "soundmng.h" | * @date $Date$ |
| #include "extromio.h" | */ |
| #include "sound.h" | |
| #include "juliet.h" | #include "compiler.h" |
| #include <dsound.h> | |
| #include "parts.h" | |
| #include "wavefile.h" | |
| #include "np2.h" | |
| #include "soundmng.h" | |
| #include "extromio.h" | |
| #include "sound.h" | |
| #include "juliet.h" | |
| #if defined(VERMOUTH_LIB) | #if defined(VERMOUTH_LIB) |
| #include "vermouth.h" | #include "vermouth.h" |
| #endif | #endif |
| #if defined(MT32SOUND_DLL) | #if defined(MT32SOUND_DLL) |
| #include "mt32snd.h" | #include "mt32snd.h" |
| #endif | #endif |
| #if !defined(__GNUC__) | |
| #pragma comment(lib, "dsound.lib") | |
| #endif // !defined(__GNUC__) | |
| #if defined(_M_IA64) || defined(_M_AMD64) | #if defined(_M_IA64) || defined(_M_AMD64) |
| #define SOUNDBUFFERALIGN (1 << 3) | #define SOUNDBUFFERALIGN (1 << 3) |
| #else | #else |
| Line 61 static void (PARTSCALL *fnmix)(SINT16 | Line 73 static void (PARTSCALL *fnmix)(SINT16 |
| // ---- directsound | // ---- directsound |
| static BRESULT dsoundcreate(void) { | static BRESULT dsoundcreate(HWND hWnd) |
| { | |
| // DirectSoundの初期化 | // DirectSoundの初期化 |
| if (FAILED(DirectSoundCreate(0, &pDSound, 0))) { | if (FAILED(DirectSoundCreate(0, &pDSound, 0))) { |
| goto dscre_err; | goto dscre_err; |
| } | } |
| if (FAILED(pDSound->SetCooperativeLevel(hWndMain, DSSCL_PRIORITY))) { | if (FAILED(pDSound->SetCooperativeLevel(hWnd, DSSCL_PRIORITY))) |
| if (FAILED(pDSound->SetCooperativeLevel(hWndMain, DSSCL_NORMAL))) { | { |
| if (FAILED(pDSound->SetCooperativeLevel(hWnd, DSSCL_NORMAL))) | |
| { | |
| goto dscre_err; | goto dscre_err; |
| } | } |
| } | } |
| Line 469 void soundmng_pcmstop(UINT num) { | Line 483 void soundmng_pcmstop(UINT num) { |
| BRESULT soundmng_initialize(void) { | BRESULT soundmng_initialize(void) { |
| if (dsoundcreate() != SUCCESS) { | if (dsoundcreate(g_hWndMain) != SUCCESS) { |
| goto smcre_err; | goto smcre_err; |
| } | } |
| pcmcreate(); | pcmcreate(); |