--- np2/sound/vermouth/midimod.c 2005/03/18 09:23:11 1.6 +++ np2/sound/vermouth/midimod.c 2006/12/10 11:14:31 1.8 @@ -3,6 +3,9 @@ #include "dosio.h" #include "textfile.h" #include "midiout.h" +#if defined(SUPPORT_ARC) +#include "arc.h" +#endif #define CFG_MAXAMP 400 @@ -36,6 +39,7 @@ static const OEMCHAR str_env[] = OEMTEXT static const OEMCHAR str_loop[] = OEMTEXT("loop"); static const OEMCHAR str_tail[] = OEMTEXT("tail"); static const OEMCHAR file_timiditycfg[] = OEMTEXT("timidity.cfg"); +static const OEMCHAR str_basedir[] = OEMTEXT("${basedir}"); static void pathadd(MIDIMOD mod, const OEMCHAR *path) { @@ -49,7 +53,10 @@ static void pathadd(MIDIMOD mod, const O // separator change! file_catname(pl.path, path, NELEMENTS(pl.path)); if (path[0]) { - file_setseparator(pl.path, NELEMENTS(pl.path)); +#if defined(SUPPORT_ARC) + if (milstr_chr(pl.path, '#') == NULL) +#endif + file_setseparator(pl.path, NELEMENTS(pl.path)); } } @@ -67,6 +74,21 @@ static void pathadd(MIDIMOD mod, const O } } +static void pathaddex(MIDIMOD mod, const OEMCHAR *path) { + + OEMCHAR _path[MAX_PATH]; + + if (milstr_memcmp(path, str_basedir)) { + pathadd(mod, path); + } + else { + file_cpyname(_path, file_getcd(str_null), NELEMENTS(_path)); + file_cutseparator(_path); + file_catname(_path, path + 10, NELEMENTS(_path)); + pathadd(mod, _path); + } +} + static int cfggetarg(OEMCHAR *str, OEMCHAR *arg[], int maxarg) { int ret; @@ -324,7 +346,11 @@ BRESULT cfgfile_getfile(MIDIMOD mod, con while(p) { file_cpyname(path, p->path, size); file_catname(path, filename, size); +#if defined(SUPPORT_ARC) + attr = arcex_attr(path); +#else attr = file_attr(path); +#endif if (attr != -1) { return(SUCCESS); } @@ -372,7 +398,7 @@ BRESULT cfgfile_load(MIDIMOD mod, const switch(cfg) { case CFG_DIR: for (i=1; i