From 8df332c06231a6bb09a54a5a227020e2e9bcfe8c Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Sun, 27 Jul 2008 20:40:20 +0000 Subject: Oops, revert unrelated changes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18139 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/midi/synth.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'apps/plugins/midi/synth.c') diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c index 09ea1c68c2..0819722030 100644 --- a/apps/plugins/midi/synth.c +++ b/apps/plugins/midi/synth.c @@ -140,11 +140,10 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig) return -1; } - char name[MAX_PATH]; - char fn[MAX_PATH]; + char name[40]; + char fn[40]; /* Scan our config file and load the right patches as needed */ - char *p; int c = 0; name[0] = '\0'; printf("Loading instruments"); @@ -152,12 +151,8 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig) { while(readChar(file)!=' ' && !eof(file)); readTextBlock(file, name); - DEBUGF("name: %s\n", name); - p = rb->strrchr(name, '.'); - if (!p || rb->strncmp(p, ".pat", 4)) - rb->snprintf(fn, MAX_PATH, ROCKBOX_DIR "/patchset/%s.pat", name); - else - rb->snprintf(fn, MAX_PATH, ROCKBOX_DIR "/patchset/%s", name); + + rb->snprintf(fn, 40, ROCKBOX_DIR "/patchset/%s.pat", name); /* printf("\nLOADING: <%s> ", fn); */ if(patchUsed[a]==1) @@ -172,7 +167,7 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig) c = readChar(file); } rb->close(file); -DEBUGF("drums!!\n"); + file = rb->open(drumConfig, O_RDONLY); if(file < 0) { @@ -188,7 +183,7 @@ DEBUGF("drums!!\n"); { readTextBlock(file, number); readTextBlock(file, name); - rb->snprintf(fn, MAX_PATH, ROCKBOX_DIR "/patchset/%s.pat", name); + rb->snprintf(fn, 40, ROCKBOX_DIR "/patchset/%s.pat", name); idx = rb->atoi(number); if(idx == 0) -- cgit v1.2.3