📄 timidity.c
字号:
"%s: line %d: Invalid map name: %s", name, line, w[1]); CHECKERRLIMIT; continue; } if ((mapfrom = mapname2id(w[2], &fromisdrum)) == -1) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Invalid map name: %s", name, line, w[2]); CHECKERRLIMIT; continue; } if (toisdrum != fromisdrum) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Map type should be matched", name, line); CHECKERRLIMIT; continue; } if (copymap(mapto, mapfrom, toisdrum)) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: No free %s available to map", name, line, toisdrum ? "drum set" : "tone bank"); CHECKERRLIMIT; continue; } } /* #extension HTTPproxy hostname:port */ else if(strcmp(w[0], "HTTPproxy") == 0) { if(words < 2) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: No proxy name given", name, line); CHECKERRLIMIT; continue; } /* If network is not supported, this extension is ignored. */#ifdef SUPPORT_SOCKET url_http_proxy_host = safe_strdup(w[1]); if((cp = strchr(url_http_proxy_host, ':')) == NULL) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Syntax error", name, line); CHECKERRLIMIT; continue; } *cp++ = '\0'; if((url_http_proxy_port = atoi(cp)) <= 0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Port number must be " "positive number", name, line); CHECKERRLIMIT; continue; }#endif } /* #extension FTPproxy hostname:port */ else if(strcmp(w[0], "FTPproxy") == 0) { if(words < 2) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: No proxy name given", name, line); CHECKERRLIMIT; continue; } /* If network is not supported, this extension is ignored. */#ifdef SUPPORT_SOCKET url_ftp_proxy_host = safe_strdup(w[1]); if((cp = strchr(url_ftp_proxy_host, ':')) == NULL) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Syntax error", name, line); CHECKERRLIMIT; continue; } *cp++ = '\0'; if((url_ftp_proxy_port = atoi(cp)) <= 0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Port number " "must be positive number", name, line); CHECKERRLIMIT; continue; }#endif } /* #extension mailaddr somebody@someware.domain.com */ else if(strcmp(w[0], "mailaddr") == 0) { if(words < 2) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: No mail address given", name, line); CHECKERRLIMIT; continue; } if(strchr(w[1], '@') == NULL) { ctl->cmsg(CMSG_WARNING, VERB_NOISY, "%s: line %d: Warning: Mail address %s is not valid", name, line); } /* If network is not supported, this extension is ignored. */#ifdef SUPPORT_SOCKET user_mailaddr = safe_strdup(w[1]);#endif /* SUPPORT_SOCKET */ } /* #extension opt [-]{option}[optarg] */ else if (strcmp(w[0], "opt") == 0) { int c, longind, err; char *p, *cmd, *arg; if (words != 2 && words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Syntax error", name, line); CHECKERRLIMIT; continue; } if (*w[1] == '-') { int optind_save = optind; optind = 0; c = getopt_long(words, w, optcommands, longopts, &longind); err = set_tim_opt_long(c, optarg, longind); optind = optind_save; } else { /* backward compatibility */ if ((p = strchr(optcommands, c = *(cmd = w[1]))) == NULL) err = 1; else { if (*(p + 1) == ':') arg = (words == 2) ? cmd + 1 : w[2]; else arg = ""; err = set_tim_opt_short(c, arg); } } if (err) { /* error */ ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Invalid command line option", name, line); errcnt += err - 1; CHECKERRLIMIT; continue; } } /* #extension undef program */ else if(strcmp(w[0], "undef") == 0) { if(words < 2) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: No undef number given", name, line); CHECKERRLIMIT; continue; } i = atoi(w[1]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension undef " "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or " "drum set before assignment", name, line); CHECKERRLIMIT; continue; } free_tone_bank_element(&bank->tone[i]); } /* #extension altassign numbers... */ else if(strcmp(w[0], "altassign") == 0) { ToneBank *bk; if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before altassign", name, line); CHECKERRLIMIT; continue; } if(words < 2) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: No alternate assignment", name, line); CHECKERRLIMIT; continue; } if(!dr) { ctl->cmsg(CMSG_WARNING, VERB_NORMAL, "%s: line %d: Warning: Not a drumset altassign" " (ignored)", name, line); continue; } bk = drumset[bankno]; bk->alt = add_altassign_string(bk->alt, w + 1, words - 1); } /* #extension legato [program] [0 or 1] */ else if(strcmp(w[0], "legato") == 0) { if(words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before assignment", name, line); CHECKERRLIMIT; continue; } i = atoi(w[1]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension legato " "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } bank->tone[i].legato = atoi(w[2]); } /* #extension damper [program] [0 or 1] */ else if(strcmp(w[0], "damper") == 0) { if(words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before assignment", name, line); CHECKERRLIMIT; continue; } i = atoi(w[1]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension damper " "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } bank->tone[i].damper_mode = atoi(w[2]); } /* #extension rnddelay [program] [0 or 1] */ else if(strcmp(w[0], "rnddelay") == 0) { if(words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before assignment", name, line); CHECKERRLIMIT; continue; } i = atoi(w[1]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension rnddelay " "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } bank->tone[i].rnddelay = atoi(w[2]); } /* #extension level program tva_level */ else if(strcmp(w[0], "level") == 0) { if(words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before assignment", name, line); CHECKERRLIMIT; continue; } i = atoi(w[2]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension level " "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } cp = w[1]; do { if (string_to_7bit_range(cp, &j, &k)) { while (j <= k) bank->tone[j++].tva_level = i; } cp = strchr(cp, ','); } while(cp++ != NULL); } /* #extension reverbsend */ else if(strcmp(w[0], "reverbsend") == 0) { if(words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before assignment", name, line); CHECKERRLIMIT; continue; } i = atoi(w[2]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension reverbsend " "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } cp = w[1]; do { if (string_to_7bit_range(cp, &j, &k)) { while (j <= k) bank->tone[j++].reverb_send = i; } cp = strchr(cp, ','); } while(cp++ != NULL); } /* #extension chorussend */ else if(strcmp(w[0], "chorussend") == 0) { if(words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before assignment", name, line); CHECKERRLIMIT; continue; } i = atoi(w[2]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension chorussend " "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } cp = w[1]; do { if (string_to_7bit_range(cp, &j, &k)) { while (j <= k) bank->tone[j++].chorus_send = i; } cp = strchr(cp, ','); } while(cp++ != NULL); } /* #extension delaysend */ else if(strcmp(w[0], "delaysend") == 0) { if(words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before assignment", name, line); CHECKERRLIMIT; continue; } i = atoi(w[2]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension delaysend " "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } cp = w[1]; do { if (string_to_7bit_range(cp, &j, &k)) { while (j <= k) bank->tone[j++].delay_send = i; } cp = strchr(cp, ','); } while(cp++ != NULL); } /* #extension playnote */ else if(strcmp(w[0], "playnote") == 0) { if(words != 3) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error", name, line); CHECKERRLIMIT; continue; } if(!bank) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: Must specify tone bank or drum set " "before assignment", name, line); CHECKERRLIMIT; continue; } i = atoi(w[2]); if(i < 0 || i > 127) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: extension playnote" "must be between 0 and 127", name, line); CHECKERRLIMIT; continue; } cp = w[1]; do { if (string_to_7bit_range(cp, &j, &k)) { while (j <= k) bank->tone[j++].play_note = i; } cp = strchr(cp, ','); } while(cp++ != NULL); } else if(!strcmp(w[0], "soundfont")) { int order, cutoff, isremove, reso, amp; char *sf_file; if(words < 2) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: No soundfont file given", name, line); CHECKERRLIMIT; continue; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -