Skip to content

Commit

Permalink
fix oops
Browse files Browse the repository at this point in the history
  • Loading branch information
Jengamon committed Aug 23, 2024
1 parent efcdc8c commit 940e80c
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions src/json/engine_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,68 +350,6 @@ SC_STREAMDEF(scxt::engine::Zone::AssociatedSample, SC_FROM({
assert(!s.active);
}
}));
template <> struct scxt_traits<scxt::engine::Zone::AssociatedSample>
{

template <template <typename...> class Traits>
static void assign(tao::json::basic_value<Traits> &v,
const scxt::engine::Zone::AssociatedSample &s)
{
if (s.active)
{
v = {{"active", s.active},
{"id", s.sampleID},
{"startSample", s.startSample},
{"endSample", s.endSample},
{"startLoop", s.startLoop},
{"endLoop", s.endLoop},
{"playMode", s.playMode},
{"loopActive", s.loopActive},
{"playReverse", s.playReverse},
{"loopMode", s.loopMode},
{"loopDirection", s.loopDirection},
{"loopCountWhenCounted", s.loopCountWhenCounted},
{"loopFade", s.loopFade},
{"normalizationFactor", s.normalizationFactor},
{"pitchOffset", s.pitchOffset},
{"amplitude", s.amplitude}};
}
else
{
v = {{"active", s.active}};
}
}

template <template <typename...> class Traits>
static void to(const tao::json::basic_value<Traits> &v, scxt::engine::Zone::AssociatedSample &s)
{
findOrSet(v, "active", false, s.active);
if (s.active)
{
findIf(v, "id", s.sampleID);
findOrSet(v, "startSample", -1, s.startSample);
findOrSet(v, "endSample", -1, s.endSample);
findOrSet(v, "startLoop", -1, s.startLoop);
findOrSet(v, "endLoop", -1, s.endLoop);
findOrSet(v, "playMode", engine::Zone::PlayMode::NORMAL, s.playMode);
findOrSet(v, "loopActive", false, s.loopActive);
findOrSet(v, "playReverse", false, s.playReverse);
findOrSet(v, "loopMode", engine::Zone::LoopMode::LOOP_DURING_VOICE, s.loopMode);
findOrSet(v, "loopDirection", engine::Zone::LoopDirection::FORWARD_ONLY,
s.loopDirection);
findOrSet(v, "loopFade", 0, s.loopFade);
findOrSet(v, "loopCountWhenCounted", 0, s.loopCountWhenCounted);
findOrSet(v, "normalizationFactor", 0.f, s.normalizationFactor);
findOrSet(v, "pitchOffset", 0.f, s.pitchOffset);
findOrSet(v, "amplitude", 0.f, s.amplitude);
}
else
{
s = scxt::engine::Zone::AssociatedSample();
assert(!s.active);
}
}
};

SC_STREAMDEF(scxt::engine::Zone::AssociatedSampleSet, SC_FROM({
v = {{"samples", t.samples}, {"variantPlaybackMode", t.variantPlaybackMode}};
Expand Down

0 comments on commit 940e80c

Please sign in to comment.