commit 851a9a4969ca021d82a14b4ec542ac064435923b
parent 0350cb505388259660bd1d95e6e39fd3e81d81f6
Author: jatinchowdhury18 <jatinchowdhury18@gmail.com>
Date: Wed, 10 Mar 2021 19:11:35 -0800
Some updates to the iOS build process (#156)
* Update UI and save/load code for iOS
* Update archiving process
* {Apply clang-format}
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Diffstat:
4 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt
@@ -57,14 +57,12 @@ if(MACOS_RELEASE)
message(STATUS "Setting MacOS release flags...")
set_target_properties(CHOWTapeModel_Standalone PROPERTIES
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES)
- # set_target_properties(ChowCentaur_AUv3 PROPERTIES
- # XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES)
endif()
if(IOS)
message(STATUS "Setting iOS-specific properties...")
- foreach(target IN ITEMS BinaryData juce_plugin_modules CHOWTapeModel CHOWTapeModel_Standalone CHOWTapeModel_AUv3)
+ foreach(target IN ITEMS BinaryData RTNeural juce_plugin_modules CHOWTapeModel CHOWTapeModel_Standalone CHOWTapeModel_AUv3)
set_target_properties(${target}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "./"
diff --git a/Plugin/Source/GUI/Assets/gui_ios.xml b/Plugin/Source/GUI/Assets/gui_ios.xml
@@ -101,27 +101,27 @@
lookAndFeel="MyLNF">
<View flex-direction="column" tab-caption="Loss" tab-color="" background-color="FF31323A"
padding="0" margin="0">
- <View flex-grow="0.05" background-color="00000000"/>
<Slider caption="Gap [microns]" parameter="gap" slider-type="linear-horizontal"
class="Slider" padding="0" slider-background="ff595c6b" slider-track="ff9cbcbd"
name="Gap" tooltip="Sets the width of the playhead gap. Certain frequencies that resonate with the gap width will be emphasized."
slidertext-height="18" caption-placement="top-left"/>
- <View flex-grow="0.1" background-color="00000000"/>
<Slider caption="Thickness [microns]" parameter="thick" class="Slider"
slider-type="linear-horizontal" padding="0" slider-background="ff595c6b"
slider-track="ff9cbcbd" name="Thickness" tooltip="Sets the thickness of the tape. Thicker tape has a more muted high-frequency response."
caption-placement="top-left"/>
- <View flex-grow="0.1" background-color="00000000"/>
<Slider caption="Spacing [microns]" parameter="spacing" slider-type="linear-horizontal"
class="Slider" padding="0" slider-background="ff595c6b" slider-track="ff9cbcbd"
name="Spacing" tooltip="Sets the spacing between the tape and the playhead. A larger spacing means more high frequency signal is lost during playback."
caption-placement="top-left"/>
- <View flex-grow="0.1" background-color="00000000"/>
+ <Slider caption="Azimuth [degrees]" parameter="azimuth" slider-type="linear-horizontal"
+ class="Slider" padding="0" slider-background="ff595c6b" slider-track="ff9cbcbd"
+ name="Azimuth" tooltip="Sets the azimuth angle between the playhead and the tape. This can create a stereo widening effect at higher tape speeds."
+ caption-placement="top-left"/>
<Slider caption="Speed [ips]" parameter="speed" slider-type="linear-horizontal"
class="Slider" padding="0" slider-background="ff595c6b" slider-track="ff9cbcbd"
name="Speed" tooltip="Sets the speed of the tape as it affects the playhead loss effects. Note that this control does not affect the wow/flutter processing."
caption-placement="top-left"/>
- <View flex-grow="0.57" margin="0" padding="2" background-color="00000000">
+ <View flex-grow="0.53" margin="0" padding="2" background-color="00000000">
<TextButton margin="0" padding="2" text="3.75" button-color="00000000" background-color="00000000"
onClick="set_speed_3.75" lookAndFeel="SpeedButtonLNF" button-on-color="00000000"
name="3.75 ips" tooltip="Snaps the tape speed to 3.75 inches per second."/>
diff --git a/Plugin/Source/PluginProcessor.cpp b/Plugin/Source/PluginProcessor.cpp
@@ -21,16 +21,7 @@ constexpr int maxNumPresets = 999;
//==============================================================================
ChowtapeModelAudioProcessor::ChowtapeModelAudioProcessor()
-#ifndef JucePlugin_PreferredChannelConfigurations
- : AudioProcessor (BusesProperties()
-#if ! JucePlugin_IsMidiEffect
-#if ! JucePlugin_IsSynth
- .withInput ("Input", AudioChannelSet::stereo(), true)
-#endif
- .withOutput ("Output", AudioChannelSet::stereo(), true)
-#endif
- ),
-#endif
+ : AudioProcessor (BusesProperties().withInput ("Input", juce::AudioChannelSet::stereo(), true).withOutput ("Output", juce::AudioChannelSet::stereo(), true)),
vts (*this, nullptr, Identifier ("Parameters"), createParameterLayout()),
inputFilters (vts),
toneControl (vts),
@@ -322,13 +313,27 @@ AudioProcessorEditor* ChowtapeModelAudioProcessor::createEditor()
//==============================================================================
void ChowtapeModelAudioProcessor::getStateInformation (MemoryBlock& destData)
{
+#if JUCE_IOS
+ auto state = vts.copyState();
+ std::unique_ptr<XmlElement> xml (state.createXml());
+ copyXmlToBinary (*xml, destData);
+#else
magicState.getStateInformation (destData);
+#endif
}
void ChowtapeModelAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
+#if JUCE_IOS
+ std::unique_ptr<juce::XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
+
+ if (xmlState.get() != nullptr)
+ if (xmlState->hasTagName (vts.state.getType()))
+ vts.replaceState (juce::ValueTree::fromXml (*xmlState));
+#else
MessageManagerLock mml;
magicState.setStateInformation (data, sizeInBytes, getActiveEditor());
+#endif
presetManager.presetUpdated();
}
diff --git a/ios_builds.sh b/ios_builds.sh
@@ -25,9 +25,9 @@ cmake -Bbuild-ios -GXcode -DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY="1,2" \
-DCMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE="NO"
-# xcodebuild -project build-ios/CHOWTapeModel.xcodeproj \
-# -scheme ChowCentaur_Standalone archive -configuration Release \
-# -sdk iphoneos -jobs 12 -archivePath CHOWTapeModel.xcarchive | xcpretty
+xcodebuild -project build-ios/CHOWTapeModel.xcodeproj \
+ -scheme CHOWTapeModel_Standalone archive -configuration Release \
+ -sdk iphoneos -jobs 12 -archivePath CHOWTapeModel.xcarchive | xcpretty
fi
if [ "$1" == "version" ]; then