+2009-03-04 TAMUKI Shoichi <tamuki@linet.gr.jp>
+
+ * interface/ncurs_c.c, timidity/readmidi.c:
+ Fix to fit with MAX_CHANNELS > 32
+ * timidity/playmidi.c (find_voice): Beautify
+
2008-12-06 Keishi Suenaga <skeishi@yahoo.co.jp>
* configure.in: Fix mingw detection and replace wsock32 by ws2_32.
static void ctl_ncurs_mode_init(void)
{
- int i;
-
- display_channels = LINES - 8;
- if(display_channels > MAX_CHANNELS)
- display_channels = MAX_CHANNELS;
- if(current_file_info != NULL && current_file_info->max_channel < 16)
- display_channels = 16;
-
- display_play_system(play_system_mode);
- display_intonation(opt_pure_intonation);
- switch(ctl_ncurs_mode)
- {
- case NCURS_MODE_MAIN:
- touchwin(msgwin);
- wrefresh(msgwin);
- break;
- case NCURS_MODE_TRACE:
- touchwin(dftwin);
- for(i = 0; i < MAX_CHANNELS; i++)
- init_trace_window_chan(i);
- N_ctl_refresh();
- break;
- case NCURS_MODE_HELP:
- break;
- case NCURS_MODE_LIST:
- touchwin(listwin);
- ctl_list_mode(NC_LIST_NOW);
- break;
- case NCURS_MODE_DIR:
- ctl_cmd_L_dir(0);
- break;
- }
+ int i;
+
+ if (current_file_info != NULL)
+ display_channels = (current_file_info->max_channel / 16) * 16 + 16;
+ else
+ display_channels = LINES - 8;
+ if (display_channels > LINES - 8)
+ display_channels = LINES - 8;
+ display_play_system(play_system_mode);
+ display_intonation(opt_pure_intonation);
+ switch (ctl_ncurs_mode) {
+ case NCURS_MODE_MAIN:
+ touchwin(msgwin);
+ wrefresh(msgwin);
+ break;
+ case NCURS_MODE_TRACE:
+ touchwin(dftwin);
+ for (i = 0; i < MAX_CHANNELS; i++)
+ init_trace_window_chan(i);
+ N_ctl_refresh();
+ break;
+ case NCURS_MODE_HELP:
+ break;
+ case NCURS_MODE_LIST:
+ touchwin(listwin);
+ ctl_list_mode(NC_LIST_NOW);
+ break;
+ case NCURS_MODE_DIR:
+ ctl_cmd_L_dir(0);
+ break;
+ }
}
static void display_key_helpmsg(void)
finish_note(i); /* drop sustain */
else
kill_note(i);
- } else if (mono_check
- || (altassign && find_altassign(altassign, voice[i].note)))
+ } else if (mono_check)
kill_note(i);
- else if (voice[i].note == note &&
- (channel[ch].assign_mode == 0
- || (channel[ch].assign_mode == 1
- && voice[i].proximate_flag == 0)))
+ else if (altassign && find_altassign(altassign, voice[i].note))
+ kill_note(i);
+ else if (voice[i].note == note && (channel[ch].assign_mode == 0
+ || channel[ch].assign_mode == 1
+ && voice[i].proximate_flag == 0))
kill_note(i);
}
for (i = 0; i < upper_voices; i++)
0, val[7], (val[0] == 0x7f));
num_events++;
} else {
- for (i = j = 0; i < MAX_CHANNELS; i++)
+ for (i = j = 0; i < 32; i++)
if (channel_tt & 1 << i) {
SETMIDIEVENT(evm[j], 0, ME_TEMPER_TYPE,
MERGE_CHANNEL_PORT(i),
if (chidx[ch = e->event.channel] != -1)
ch = e->event.channel = chidx[ch];
else { /* -1 */
- newch = ch % REDUCE_CHANNELS;
- while (newch < ch && newch < MAX_CHANNELS) {
- if (chidx[newch] == -1) {
- ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
- "channel %d => %d", ch, newch);
- ch = e->event.channel = chidx[ch] = newch;
- break;
+ if (ch >= MAX_CHANNELS) {
+ newch = ch % REDUCE_CHANNELS;
+ while (newch < ch && newch < MAX_CHANNELS) {
+ if (chidx[newch] == -1) {
+ ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
+ "channel %d => %d", ch, newch);
+ ch = e->event.channel = chidx[ch] = newch;
+ break;
+ }
+ newch += REDUCE_CHANNELS;
}
- newch += REDUCE_CHANNELS;
}
if (chidx[ch] == -1) {
if (ch < MAX_CHANNELS)