Static void applyStyles(void) { short n1, n2, sn; Char s[256]; Char STR2[256]; *voices = '\0'; *clefs = '\0'; ninstr = 0; while (*cline[(long)style] != '\0') { n1 = voiceCount(voices) + 1; n2 = wordCount(voices) + 1; GetNextWord(s, cline[(long)style], blank_, comma_); curtail(s, comma_); sn = findStyle(s); if (sn == 0) { sprintf(STR2, "Style %s unknown", s); error(STR2, print); } line_no = orig_style_line[sn-1]; applyStyle(known_style[sn-1], s, n1, n2); style_used[sn-1] = true; } }
Voice* Part::voice(int index) { Q_ASSERT( index >= 0 && index < voiceCount() ); return d->voices[index]; }
Static void applyStyle(Char *s_, Char *stylename, stave_index first_inst, stave_index first_stave) { Char s[256]; Char clef[256], subline[256], subcommand[256]; stave_index0 i, last_inst, last_stave; boolean continuo = false, toosoon = false, vocal = false; Char STR2[256]; strcpy(s, s_); last_inst = first_inst - 1; GetNextWord(subline, s, blank_, colon_); while (*s != '\0') { GetNextWord(subline, s, semicolon, dummy); i = curtail(subline, semicolon); GetNextWord(subcommand, subline, blank_, dummy); if (equalsIgnoreCase(subcommand, "VOICES")) { sprintf(voices + strlen(voices), " %s", subline); last_stave = first_stave + wordCount(subline) - 1; last_inst = first_inst + voiceCount(subline) - 1; } else if (equalsIgnoreCase(subcommand, "CLEFS")) { strcpy(clef, subline); sprintf(clefs + strlen(clefs), " %s", clef); } else if (equalsIgnoreCase(subcommand, "VOCAL")) { if (last_inst < first_inst) toosoon = true; else { some_vocal = true; vocal = true; for (i = first_inst; i <= last_inst; i++) setVocal(i, true); } } else if (equalsIgnoreCase(subcommand, "CHORAL") || equalsIgnoreCase(subcommand, "GROUP")) { if (last_inst < first_inst) toosoon = true; else { if (equalsIgnoreCase(subcommand, "CHORAL")) { some_vocal = true; vocal = true; for (i = first_inst; i <= last_inst; i++) setVocal(i, true); } if (ngroups == maxgroups) error("Too many groups", print); else { ngroups++; group_start[ngroups-1] = first_stave; group_stop[ngroups-1] = last_stave; } } } else if (equalsIgnoreCase(subcommand, "CONTINUO")) continuo = true; else { sprintf(STR2, "Subcommand %s in STYLE unknown", subcommand); error(STR2, print); } if (toosoon) { sprintf(STR2, "You must first give VOICES before specifying %s", subcommand); error(STR2, print); } } if (vocal && continuo) error("A continuo instrument may not be vocal", print); if (wordCount(clef) != last_stave - first_stave + 1) error("Number of clefs does not match number of voices", print); if (first_stave == last_stave || continuo) { strcpy(instr_name[first_stave-1], stylename); /* p2c: preamble.pas, line 185: * Note: Possible string truncation in assignment [145] */ } else { for (i = first_stave - 1; i <= last_stave - 1; i++) *instr_name[i] = '\0'; } if (continuo) { ninstr++; stave[ninstr-1] = first_stave; for (i = first_stave - 1; i <= last_stave - 1; i++) instr[i] = ninstr; return; } for (i = first_stave; i <= last_stave; i++) { ninstr++; stave[ninstr-1] = i; instr[i-1] = ninstr; } }