Skip to content

Commit

Permalink
Update Unserialization.cpp
Browse files Browse the repository at this point in the history
Fix bugs w/ `pos`
  • Loading branch information
sdatkinson authored Nov 23, 2024
1 parent 7a9df28 commit 73578c6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions NeuralAmpModeler/Unserialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ void _UpdateConfigFrom_0_7_12(nlohmann::json& config)

int _GetConfigFrom_0_7_12(const iplug::IByteChunk& chunk, int startPos, nlohmann::json& config)
{
int pos = startPos;
std::vector<std::string> paramNames{"Input",
"Threshold",
"Bass",
Expand All @@ -120,7 +119,7 @@ int _GetConfigFrom_0_7_12(const iplug::IByteChunk& chunk, int startPos, nlohmann
"InputCalibrationLevel",
"OutputMode"};

pos = _UnserializePathsAndExpectedKeys(chunk, pos, config, paramNames);
int pos = _UnserializePathsAndExpectedKeys(chunk, startPos, config, paramNames);
// Then update:
_UpdateConfigFrom_0_7_12(config);
return pos;
Expand All @@ -144,7 +143,7 @@ int _GetConfigFrom_0_7_10(const iplug::IByteChunk& chunk, int startPos, nlohmann
{
std::vector<std::string> paramNames{
"Input", "Threshold", "Bass", "Middle", "Treble", "Output", "NoiseGateActive", "ToneStack", "OutNorm", "IRToggle"};
int pos = _UnserializePathsAndExpectedKeys(chunk, pos, config, paramNames);
int pos = _UnserializePathsAndExpectedKeys(chunk, startPos, config, paramNames);
// Then update:
_UpdateConfigFrom_0_7_10(config);
return pos;
Expand Down

0 comments on commit 73578c6

Please sign in to comment.