private bool executeABCM2PS() { string errOutput = ConsoleParser.ExecuteCommand( "\"" + StringConstants.ABCM2PS + "\"", "-c -g -w " + (this.pictureBox.Width - 90) + " -m 0 \"" + StringConstants.TEMP_ABC + "\" -O \"" + StringConstants.TEMP_SVG_WRITE + "\""); string[] multilineseparator = { "\r\n", "\n" }; char[] wordseparator = { ' ' }; string[] lines = errOutput.Split(multilineseparator, StringSplitOptions.RemoveEmptyEntries); bool output = false; //Search errors for (int i = 0; i < lines.Length; i++) { string[] line_words = lines[i].Split(wordseparator, StringSplitOptions.RemoveEmptyEntries); if (line_words.Length > 1 && line_words[1] == "error:") { List <string> aux = line_words.ToList(); aux.RemoveAt(0); aux.RemoveAt(0); string err_type = string.Join(" ", aux.ToArray()); if (!validError(err_type)) { return(false); } } else if (line_words[0] == "Output") { output = true; } } return(output); }
public void savePDF(string pdfPath) { AbcFileWriter.saveToFile(this.tune, StringConstants.TEMP_ABC, getTempo(), false); ConsoleParser.ExecuteCommand("\"" + StringConstants.ABCM2PS + "\"", "-c -g \"" + StringConstants.TEMP_ABC + "\" -E -O \"" + StringConstants.TEMP_EPS_WRITE + "\""); ConsoleParser.ExecuteCommand("\"" + StringConstants.EPSTOPDF + "\"", "--outfile=\"" + pdfPath + "\" \"" + StringConstants.TEMP_EPS_READ + "\""); }
private void saveMidi(string abcpath, string midipath) { string a = ConsoleParser.ExecuteCommand(StringConstants.ABC2MIDI, "\"" + abcpath + "\" -o \"" + midipath + "\""); }