Skip to content

Commit

Permalink
Apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 28, 2024
1 parent 3b16ab4 commit 7aad3e2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ std::enable_if_t<TypeTraits::IsIterable<ParamContainerType>, void>
add (others...);
}


[[nodiscard]] inline int ParamHolder::count() const noexcept
{
auto count = static_cast<int> (things.count());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ template <typename>
typename Serializer::SerializedType PluginStateImpl<ParameterState, NonParameterState, Serializer>::serialize (const PluginStateImpl& object)
{
#if ! CHOWDSP_USE_LEGACY_STATE_SERIALIZATION
return {
return
{
#if defined JucePlugin_VersionString
{ "version", currentPluginVersion },
#else
{ "version", chowdsp::Version {} },
#endif
{ "params", Serializer::template serialize<Serializer, ParamHolder> (object.params) },
{ "non-params", Serializer::template serialize<Serializer, NonParamState> (object.nonParams) },
{ "params", Serializer::template serialize<Serializer, ParamHolder> (object.params) },
{ "non-params", Serializer::template serialize<Serializer, NonParamState> (object.nonParams) },
};
#else
auto serial = Serializer::createBaseElement();
Expand Down
11 changes: 8 additions & 3 deletions modules/plugin/chowdsp_plugin_state/Backend/chowdsp_StateValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ struct StateValueBase
virtual void reset() {}

#if CHOWDSP_USE_LEGACY_STATE_SERIALIZATION
virtual void serialize (JSONSerializer::SerializedType&) const {}
virtual void serialize (JSONSerializer::SerializedType&) const
{
}
virtual void deserialize (JSONSerializer::DeserializedType) {}
#else
[[nodiscard]] virtual nlohmann::json serialize () const { return {}; }
[[nodiscard]] virtual nlohmann::json serialize() const
{
return {};
}
virtual void deserialize (const nlohmann::json&) {}
#endif

Expand Down Expand Up @@ -88,7 +93,7 @@ struct StateValue : StateValueBase
}
#else
/** JSON Serializer */
[[nodiscard]] nlohmann::json serialize () const override
[[nodiscard]] nlohmann::json serialize() const override
{
return get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void PresetState::deserialize (JSONSerializer::DeserializedType deserial)
set (PresetPtr { deserial });
}
#else
nlohmann::json PresetState::serialize () const
nlohmann::json PresetState::serialize() const
{
if (preset != nullptr)
return preset->toJson();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PresetState : public StateValueBase
void deserialize (JSONSerializer::DeserializedType deserial) override;
#else
/** Internal use only! */
[[nodiscard]] nlohmann::json serialize () const override;
[[nodiscard]] nlohmann::json serialize() const override;

/** Internal use only! */
void deserialize (const nlohmann::json& deserial) override;
Expand Down
2 changes: 1 addition & 1 deletion tests/common_tests/chowdsp_json_test/JSONTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TEST_CASE ("JSON Test", "[common][json]")
}
{
const auto badVersion = chowdsp::json::object().get<chowdsp::Version>();
REQUIRE (badVersion == chowdsp::Version{});
REQUIRE (badVersion == chowdsp::Version {});
}
}

Expand Down

0 comments on commit 7aad3e2

Please sign in to comment.