Skip to content
Open
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
11 changes: 7 additions & 4 deletions src/gcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static vector<Vehicle *> vehicles;
static std::vector<vehicle_config> vconfigs;
static vector<unsigned> jocsActiveIds;
static bool useMocap;
static int startPoint = 0;

void signal_sigint(int s) {
// TODO: Prevent
Expand Down Expand Up @@ -338,13 +339,13 @@ void loadJocsFile(const json &rawJsonArg) {
}


startPoint = rawJson["startPoint"];
initialized = false;
string jocsPath = rawJson["jocsPath"];
vector<unsigned> jocsActiveIds = rawJson["jocsActiveIds"];
scale = rawJson["theaterScale"];


int startPoint = rawJson["startPoint"];
player->cleanup();
player->loadJocs(searchWorkspacePath(jocsPath), scale, jocsActiveIds, startPoint);
vector<Point> homes = player->getHomes();
Expand Down Expand Up @@ -425,15 +426,17 @@ void osc_on_message(OSCMessage &msg) {

int num = std::stoi(msg.address[1]);

if(msg.address[2] == "load") {
if (msg.address[2] == "load") {
player->prepare();
}
else if(msg.address[2] == "start") {
printf("Starting at cue #: %d\n", num);
else if (msg.address[2] == "start" && startPoint == num) {

// Assert that it is already prepared at the given cue
printf("Starting at cue #: %d\n", num);

player->play();
} else if (startPoint != num) {
cout << "Can't start from the wrong cue" << endl;
}

}
Expand Down