--- np2/win9x/cmmidi.cpp 2005/03/03 06:59:42 1.8 +++ np2/win9x/cmmidi.cpp 2011/03/07 09:54:11 1.12 @@ -1,18 +1,29 @@ -#include "compiler.h" -#include "np2.h" -#include "mimpidef.h" -#include "commng.h" +/** + * @file cmmidi.cpp + * @brief Communication port manager (MIDI) + * + * @author $Author: yui $ + * @date $Date: 2011/03/07 09:54:11 $ + */ + +#include "compiler.h" +#include "np2.h" +#include "mimpidef.h" +#include "commng.h" #if defined(VERMOUTH_LIB) || defined(MT32SOUND_DLL) -#include "sound.h" +#include "sound.h" #endif #if defined(VERMOUTH_LIB) -#include "vermouth.h" +#include "vermouth.h" #endif #if defined(MT32SOUND_DLL) -#include "mt32snd.h" +#include "mt32snd.h" #endif -#include "keydisp.h" +#include "keydisp.h" +#if !defined(__GNUC__) +#pragma comment(lib, "winmm.lib") +#endif // !defined(__GNUC__) #if defined(VERMOUTH_LIB) extern MIDIMOD vermouth_module; @@ -59,6 +70,7 @@ enum { MIDI_TIMECODE = 0xf1, MIDI_SONGPOS = 0xf2, MIDI_SONGSELECT = 0xf3, + MIDI_CABLESELECT = 0xf5, MIDI_TUNEREQUEST = 0xf6, MIDI_EOX = 0xf7, MIDI_TIMING = 0xf8, @@ -208,7 +220,7 @@ static UINT module2number(const OEMCHAR UINT i; for (i=0; imidisyscnt = 2; break; - case MIDI_TUNEREQUEST: + case MIDI_CABLESELECT: midi->midictrl = MIDICTRL_SYSTEM; midi->midisyscnt = 1; break; +// case MIDI_TUNEREQUEST: // case MIDI_EOX: default: return(1); @@ -770,7 +783,7 @@ COMMNG cmmidi_create(const OEMCHAR *midi } } if (getmidiinid(midiin, &id) == SUCCESS) { - if (midiInOpen(&hmidiin, id, (DWORD)hWndMain, 0, CALLBACK_WINDOW) + if (midiInOpen(&hmidiin, id, (DWORD)g_hWndMain, 0, CALLBACK_WINDOW) == MMSYSERR_NOERROR) { midiInReset(hmidiin); opened |= CMMIDI_MIDIIN;