Skip to content

Commit

Permalink
Refactor state resizing and enablement logic in reallm.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ak5k committed Mar 21, 2024
1 parent 9cabb1c commit cff529a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/WDL
Submodule WDL updated from 805967 to 46db2f
8 changes: 5 additions & 3 deletions src/reallm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,9 @@ void main()
GetProjExtState(0, "ak5k", "reallm_sz", buf, BUFSIZ);
auto state_size = buf[0] != '\0' ? std::stoi(buf) : 0;
static std::string state;
if (state_size > (int)state.size())
state.resize(state_size);
state.clear();
state.resize(state_size);

GetProjExtState(0, "ak5k", "reallm", &state[0], state_size);
fx_set_prev.clear();
fx_set_prev = deserializeFxSet(state);
Expand Down Expand Up @@ -753,7 +754,8 @@ void main()
automation_temp_override = GetGlobalAutomationOverride();
SetGlobalAutomationOverride(6);
}
(*it)->enable();
if (!(*it)->getSafe())
(*it)->enable();
}
if (!(*it)->getSafe())
it = fx_set_prev.erase(it);
Expand Down

0 comments on commit cff529a

Please sign in to comment.