|
|
| version 1.1, 2003/10/16 17:58:10 | version 1.3, 2003/11/28 08:01:33 |
|---|---|
| Line 321 BOOL cfgfile_getfile(MIDIMOD mod, const | Line 321 BOOL cfgfile_getfile(MIDIMOD mod, const |
| } | } |
| p = mod->pathlist; | p = mod->pathlist; |
| while(p) { | while(p) { |
| milstr_ncpy(path, p->path, size); | file_cpyname(path, p->path, size); |
| milstr_ncat(path, filename, size); | file_catname(path, filename, size); |
| attr = file_attr(path); | attr = file_attr(path); |
| if (attr != -1) { | if (attr != -1) { |
| return(SUCCESS); | return(SUCCESS); |
| Line 423 MIDIMOD midimod_create(UINT samprate) { | Line 423 MIDIMOD midimod_create(UINT samprate) { |
| size += sizeof(INSTRUMENT) * 128 * 2; | size += sizeof(INSTRUMENT) * 128 * 2; |
| size += sizeof(_TONECFG) * 128 * 2; | size += sizeof(_TONECFG) * 128 * 2; |
| ret = (MIDIMOD)_MALLOC(size, "MIDIMOD"); | ret = (MIDIMOD)_MALLOC(size, "MIDIMOD"); |
| if (ret) { | if (ret == NULL) { |
| ZeroMemory(ret, size); | goto mmcre_err1; |
| ret->samprate = samprate; | } |
| ret->tone[0] = (INSTRUMENT *)(ret + 1); | ZeroMemory(ret, size); |
| ret->tone[1] = ret->tone[0] + 128; | ret->samprate = samprate; |
| ret->tonecfg[0] = (TONECFG)(ret->tone[1] + 128); | ret->tone[0] = (INSTRUMENT *)(ret + 1); |
| ret->tonecfg[1] = ret->tonecfg[0] + 128; | ret->tone[1] = ret->tone[0] + 128; |
| ret->pathtbl = listarray_new(sizeof(_PATHLIST), 64); | ret->tonecfg[0] = (TONECFG)(ret->tone[1] + 128); |
| pathadd(ret, NULL); | ret->tonecfg[1] = ret->tonecfg[0] + 128; |
| pathadd(ret, file_getcd(str_null)); | ret->pathtbl = listarray_new(sizeof(_PATHLIST), 64); |
| ret->namelist = listarray_new(MAX_NAME, 128); | pathadd(ret, NULL); |
| r = cfgfile_load(ret, file_timiditycfg, 0); | pathadd(ret, file_getcd(str_null)); |
| ret->namelist = listarray_new(MAX_NAME, 128); | |
| r = cfgfile_load(ret, file_timiditycfg, 0); | |
| #if defined(TIMIDITY_CFGFILE) | #if defined(TIMIDITY_CFGFILE) |
| if (r != SUCCESS) { | if (r != SUCCESS) { |
| r = cfgfile_load(ret, TIMIDITY_CFGFILE, 0); | r = cfgfile_load(ret, TIMIDITY_CFGFILE, 0); |
| } | } |
| #endif | #endif |
| if (r != SUCCESS) { | |
| goto mmcre_err2; | |
| } | } |
| return(ret); | return(ret); |
| mmcre_err2: | |
| _MFREE(ret); | |
| mmcre_err1: | |
| return(NULL); | |
| } | } |
| void midimod_destroy(MIDIMOD hdl) { | void midimod_destroy(MIDIMOD hdl) { |
| Line 493 void midimod_loadrhythm(MIDIMOD hdl, UIN | Line 503 void midimod_loadrhythm(MIDIMOD hdl, UIN |
| } | } |
| } | } |
| void midimod_loadgm(MIDIMOD hdl) { | |
| if (hdl) { | |
| inst_bankload(hdl, 0); | |
| inst_bankload(hdl, 1); | |
| } | |
| } | |
| void midimod_loadall(MIDIMOD hdl) { | |
| UINT b; | |
| if (hdl) { | |
| for (b=0; b<(MIDI_BANKS*2); b++) { | |
| inst_bankload(hdl, b); | |
| } | |
| } | |
| } | |