Skip to content

Commit

Permalink
Different versioning scheme for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Feb 9, 2024
1 parent eb9a444 commit ef61734
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment ta
if(WIN32)
set(CMAKE_SYSTEM_VERSION 7.1 CACHE STRING INTERNAL FORCE) # Windows SDK for Windows 7 and up
endif()
project(BYOD VERSION 1.2.9)
if(APPLE AND (CMAKE_SYSTEM_NAME STREQUAL "iOS"))
project(BYOD VERSION 2.0.9)
else()
project(BYOD VERSION 1.2.9)
endif()
set(CMAKE_CXX_STANDARD 20)

# Useful for testing with address sanitizer:
Expand Down
14 changes: 12 additions & 2 deletions src/processors/chain/ProcessorChainStateHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,22 @@ void ProcessorChainStateHelper::loadProcChain (const XmlElement* xml,
paramForwardManager]
{
using namespace chowdsp::version_literals;
if (paramForwardManager != nullptr && stateVersion <= "1.2.1"_v)
if (paramForwardManager != nullptr
#if JUCE_IOS
&& stateVersion <= "2.0.0"_v)
#else
&& stateVersion <= "1.2.1"_v)
#endif
paramForwardManager->setUsingLegacyMode (true);

loadProcChainInternal (&xmlState, stateVersion, loadingPreset, safeComp.getComponent());

if (paramForwardManager != nullptr && stateVersion <= "1.2.1"_v)
if (paramForwardManager != nullptr
#if JUCE_IOS
&& stateVersion <= "2.0.0"_v)
#else
&& stateVersion <= "1.2.1"_v)
#endif
paramForwardManager->setUsingLegacyMode (false);

if (waiter != nullptr)
Expand Down
38 changes: 21 additions & 17 deletions src/processors/modulation/phaser/Phaser4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ const String mixTag = "mix";
} // namespace Phaser4Tags

Phaser4::Phaser4 (UndoManager* um) : BaseProcessor (
"Phaser4",
createParameterLayout(),
InputPort {},
OutputPort {},
um,
[] (InputPort port)
{
if (port == InputPort::ModulationInput)
return PortType::modulation;
return PortType::audio;
},
[] (OutputPort port)
{
if (port == OutputPort::ModulationOutput)
return PortType::modulation;
return PortType::audio;
})
"Phaser4",
createParameterLayout(),
InputPort {},
OutputPort {},
um,
[] (InputPort port)
{
if (port == InputPort::ModulationInput)
return PortType::modulation;
return PortType::audio;
},
[] (OutputPort port)
{
if (port == OutputPort::ModulationOutput)
return PortType::modulation;
return PortType::audio;
})
{
using namespace ParameterHelpers;
loadParameterPointer (rateHzParam, vts, Phaser4Tags::rateTag);
Expand Down Expand Up @@ -267,7 +267,11 @@ void Phaser4::fromXML (XmlElement* xml, const chowdsp::Version& version, bool lo
BaseProcessor::fromXML (xml, version, loadPosition);

using namespace std::string_view_literals;
#if JUCE_IOS
if (version <= chowdsp::Version { "2.0.0"sv })
#else
if (version <= chowdsp::Version { "1.2.0"sv })
#endif
{
// The "Mix" control was only introduced in version 1.2.1. Prior to that, mix was always at 100% wet.
auto* mixParam = vts.getParameter (Phaser4Tags::mixTag);
Expand Down

0 comments on commit ef61734

Please sign in to comment.