MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / OnConsoleInput

Method OnConsoleInput

Source/ModularSynth.cpp:3035–3177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3033}
3034
3035void ModularSynth::OnConsoleInput(std::string command /* = "" */)
3036{
3037 if (command.empty())
3038 command = mConsoleText;
3039 std::vector<std::string> tokens = ofSplitString(command, " ", true, true);
3040
3041 if (tokens.size() > 0)
3042 {
3043 if (tokens[0] == "")
3044 {
3045 }
3046 else if (tokens[0] == "clearerrors")
3047 {
3048 mErrors.clear();
3049 }
3050 else if (tokens[0] == "clearall")
3051 {
3052 mAudioThreadMutex.Lock("clearall");
3053 std::lock_guard<std::recursive_mutex> renderLock(mRenderLock);
3054 ResetLayout();
3055 mAudioThreadMutex.Unlock();
3056 }
3057 else if (tokens[0] == "load")
3058 {
3059 LoadLayout(ofToDataPath(tokens[1]));
3060 }
3061 else if (tokens[0] == "save")
3062 {
3063 if (tokens.size() > 1)
3064 SaveLayout(ofToDataPath(tokens[1]));
3065 else
3066 SaveLayout();
3067 }
3068 else if (tokens[0] == "write")
3069 {
3070 SaveOutput();
3071 }
3072 else if (tokens[0] == "reconnect")
3073 {
3074 ReconnectMidiDevices();
3075 }
3076 else if (tokens[0] == "profiler")
3077 {
3078 Profiler::ToggleProfiler();
3079 }
3080 else if (tokens[0] == "clear")
3081 {
3082 mErrors.clear();
3083 mEvents.clear();
3084 }
3085 else if (tokens[0] == "minimizeall")
3086 {
3087 const std::vector<IDrawableModule*> modules = mModuleContainer.GetModules();
3088 for (auto iter = modules.begin(); iter != modules.end(); ++iter)
3089 {
3090 (*iter)->SetMinimized(true);
3091 }
3092 }

Callers 2

oscMessageReceivedMethod · 0.80
TextEntryCompleteMethod · 0.80

Calls 15

ofSplitStringFunction · 0.85
ofToDataPathFunction · 0.85
DumpUnfreedMemoryFunction · 0.85
ofLogClass · 0.85
ofGetWidthFunction · 0.85
ofGetHeightFunction · 0.85
ofToStringFunction · 0.85
emptyMethod · 0.80
sizeMethod · 0.80
LockMethod · 0.80
UnlockMethod · 0.80
SetMinimizedMethod · 0.80

Tested by

no test coverage detected