Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions CMOD/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "SignalHandlers.h"

//added by Sever must be a more elegant way
#include <filesystem>
#include <iostream>
#include <fstream>
using namespace std;
Expand Down Expand Up @@ -76,21 +77,16 @@ int main(int parameterCount, char **parameterList) {
return 0;
}

size_t lastSlash = path.find_last_of('/');
string workingPath = path.substr(0, lastSlash+1);
const filesystem::path projectPath(path);
filesystem::path workingDirectory = projectPath.parent_path();
if (workingDirectory.empty())
workingDirectory = ".";

string workingPath = workingDirectory.string();
cout << "Working in path: " << workingPath << endl;

//Determine the project name.
//remove extension .dissco
path = path.substr(0, path.length() - 7);
string projectName;

if (lastSlash!=string::npos){
projectName = path.substr(lastSlash+1);
}
else {
projectName = path;
}
string projectName = projectPath.stem().string();

//Determine project sound file output.
PieceHelper::createSoundFilesDirectory(workingPath);
Expand Down
5 changes: 3 additions & 2 deletions CMOD/src/Piece-experimental.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ Piece::Piece(string _workingPath, string _projectTitle){
MultiTrack* renderedScore = utilities->doneCMOD();
string soundFilename = getNextSoundFile();
//Write to file.
AuWriter::write(*renderedScore, soundFilename);
if (!AuWriter::write(*renderedScore, soundFilename))
buildSucceeded = false;
delete renderedScore;
}
if (scorePrinting) {
Expand Down Expand Up @@ -460,7 +461,7 @@ Piece::Piece(string _workingPath, string _projectTitle){
cout << endl;
cout << "-----------------------------------------------------------" <<
endl;
cout << "Build complete." << endl;
cout << (buildSucceeded ? "Build complete." : "Build failed.") << endl;
cout << "-----------------------------------------------------------" <<
endl << endl;
cout.flush();
Expand Down
2 changes: 1 addition & 1 deletion CMOD/src/Piece.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class Piece {
**/
~Piece();

/// Returns false when an external score-generation step failed.
/// Returns false when any requested output could not be generated.
bool completedSuccessfully() const { return buildSucceeded; }

/**
Expand Down
Loading
Loading