Change the order of slot_list to match the order of the -io options on
the command-line and fix the way slot_list searched using the MIDI
channel number of the CC-07 message.
Reported and analysed by Dirk-Wilhelm Peters <peters at schwertfisch.de>
Thanks!
slot_new(char *path, int mode, struct aparams *par, int hdr,
int cmin, int cmax, int rate, int dup, int vol, long long pos)
{
- struct slot *s;
+ struct slot *s, **ps;
s = xmalloc(sizeof(struct slot));
if (!afile_open(&s->afile, path, hdr,
}
log_puts("\n");
}
- s->next = slot_list;
- slot_list = s;
+ for (ps = &slot_list; *ps != NULL; ps = &(*ps)->next)
+ ;
+ s->next = NULL;
+ *ps = s;
return 1;
}
#endif
break;
}
+ midich--;
}
}