@@ -0,0 +1,5 @@ | |||||
#pragma once | |||||
namespace rack { | |||||
bool sandboxInit(); | |||||
} |
@@ -1,6 +1,7 @@ | |||||
#include "engine.hpp" | #include "engine.hpp" | ||||
#include "gui.hpp" | #include "gui.hpp" | ||||
#include "app.hpp" | #include "app.hpp" | ||||
#include "sandbox.hpp" | |||||
#include "plugin.hpp" | #include "plugin.hpp" | ||||
#include "settings.hpp" | #include "settings.hpp" | ||||
#include "asset.hpp" | #include "asset.hpp" | ||||
@@ -31,6 +32,7 @@ int main(int argc, char* argv[]) { | |||||
info("Local directory: %s", localDir.c_str()); | info("Local directory: %s", localDir.c_str()); | ||||
} | } | ||||
sandboxInit(); | |||||
pluginInit(); | pluginInit(); | ||||
engineInit(); | engineInit(); | ||||
guiInit(); | guiInit(); | ||||
@@ -0,0 +1,28 @@ | |||||
#include "sandbox.hpp" | |||||
#include "util.hpp" | |||||
namespace rack { | |||||
#if defined(ARCH_MAC) | |||||
#include <sandbox.h> | |||||
bool sandboxInit() { | |||||
char* error_buff = NULL; | |||||
//int error = sandbox_init(final_sandbox_profile_str.c_str(), 0, &error_buff); | |||||
int error = sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, &error_buff); | |||||
bool success = (error == 0 && error_buff == NULL); | |||||
if(!success) { | |||||
info("Sandbox initialization error (%d): %s", error, error_buff); | |||||
} else { | |||||
info("Sandbox initialized!"); | |||||
} | |||||
sandbox_free_error(error_buff); | |||||
return success; | |||||
} | |||||
#else | |||||
bool sandboxInit() { | |||||
return false; | |||||
} | |||||
#endif | |||||
} |