--- np2/sound/vermouth/midimod.c 2006/12/16 22:23:24 1.11 +++ np2/sound/vermouth/midimod.c 2011/02/04 01:59:32 1.15 @@ -380,7 +380,7 @@ static BRESULT VERMOUTHCL cfgfile_load(M (midimod_getfile(mod, filename, buf, NELEMENTS(buf)) != SUCCESS)) { goto cfl_err; } -// TRACEOUT(("open: %s", buf)); +// TRACEOUT(("open: %s", buf)); tfh = textfile_open(buf, 0x1000); if (tfh == NULL) { goto cfl_err; @@ -579,12 +579,14 @@ VEXTERN void VEXPORT midimod_loadall(MID } -VEXTERN void VEXPORT midimod_loadallex(MIDIMOD mod, FNMIDIOUTLAEXCB cb, +VEXTERN int VEXPORT midimod_loadallex(MIDIMOD mod, FNMIDIOUTLAEXCB cb, void *userdata) { - MIDIOUTLAEXPARAM param; - UINT b; + int result; + MIDIOUTLAEXPARAM param; + UINT b; + result = MIDIOUT_SUCCESS; if (mod) { ZeroMemory(¶m, sizeof(param)); param.userdata = userdata; @@ -593,8 +595,13 @@ VEXTERN void VEXPORT midimod_loadallex(M } for (b=0; b<(MIDI_BANKS*2); b++) { param.bank = b; - inst_bankloadex(mod, b, cb, ¶m); + result = inst_bankloadex(mod, b, cb, ¶m); + if (result != MIDIOUT_SUCCESS) + { + break; + } } } + return result; }