Skip to content

Commit

Permalink
cleaned up commands in launcher.cpp.... We should launch the binary a…
Browse files Browse the repository at this point in the history
…nd save the son's pid in retrofe (like in gmenu2x)
  • Loading branch information
Vincent-FK committed Jun 19, 2021
1 parent 751cf64 commit ee5489b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions RetroFE/Source/Execute/Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,11 @@ bool Launcher::run(std::string collection, Item *collectionItem)
selectedItemsDirectory,
collection);

/* Create shell cmd */
/* Initialize keymap rom command */
std::string cmd = SHELL_CMD_MAPPING_ROM;
cmd += " '" + selectedItemsPath + "'";

/* Log shell cmd */
Logger::write(Logger::ZONE_INFO, "Launcher", "Applying keymap rom: \"" + selectedItemsPath + "\"");
printf("Applying keymap rom cmd: \"%s\"\n", cmd.c_str());

/* Launch shell cmd */
system(cmd.c_str());

/* Restart audio amp */
Expand All @@ -144,14 +140,12 @@ bool Launcher::run(std::string collection, Item *collectionItem)
/* Stop audio amp */
system(SHELL_CMD_AUDIO_AMP_OFF);

/* Log shell cmd */
/* Restore default keymap */
Logger::write(Logger::ZONE_INFO, "Launcher", "Applying keymap default");
printf("Applying keymap default cmd: \"%s\"\n", SHELL_CMD_MAPPING_DEFAULT);

/* Restore default key mapping */
system(SHELL_CMD_MAPPING_DEFAULT);

/* Restore stored PID */
/* Restore retrofe PID */
char shellCmd[20];
sprintf(shellCmd, "%s %d", SHELL_CMD_PID_RECORD, getpid());
Utils::executeRawPath((const char*)shellCmd);
Expand Down Expand Up @@ -230,7 +224,6 @@ bool Launcher::execute(std::string executable, std::string args, std::string cur
{
Logger::write(Logger::ZONE_ERROR, "Launcher", "Failed to run: " + executable);
}

else
{
#ifdef WIN32
Expand Down

0 comments on commit ee5489b

Please sign in to comment.