AnalogTapeModel

Physical modelling signal processing for analog tape recording
Log | Files | Refs | Submodules | README | LICENSE

commit 4a0c87c46fdbffd55a93de4e8b7bf993da74cf75
parent 24f83b8d3bf40a2e560c7b259342f2f04e8289d5
Author: jatinchowdhury18 <jatinchowdhury18@gmail.com>
Date:   Tue,  2 Mar 2021 00:04:44 -0800

Start work on iOS builds (#148)

* Update submodules

* First pass at compiling on iOS

* Add iOS workflow for gh-actions

* Update build and validation scripts

* Fix provisioning profile name
Diffstat:
A.github/workflows/ios.yml | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.gitmodules | 5++++-
MPlugin/CMakeLists.txt | 52++++++++++++++++++++++++++++++++++++++++++----------
MPlugin/Source/CMakeLists.txt | 1+
APlugin/Source/GUI/Assets/gui_ios.xml | 229+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MPlugin/Source/GUI/AutoUpdating.cpp | 13++++++++++++-
MPlugin/Source/GUI/AutoUpdating.h | 1+
MPlugin/Source/GUI/MyLNF.cpp | 12++++++++++++
MPlugin/Source/GUI/MyLNF.h | 2++
MPlugin/Source/PluginProcessor.cpp | 4++++
MPlugin/modules/CMakeLists.txt | 6+++++-
APlugin/modules/DISTRHO-JUCE | 1+
Aios_builds.sh | 48++++++++++++++++++++++++++++++++++++++++++++++++
Mvalidate.sh | 2+-
14 files changed, 425 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml @@ -0,0 +1,63 @@ +name: CI-iOS + +on: + push: + branches: + - master + - develop + paths-ignore: + - 'Manual/**' + - 'Paper/**' + - 'Simulations/**' + - 'Testing/**' + - '*.sh' + - '*.md' + pull_request: + branches: + - master + - develop + paths-ignore: + - 'Manual/**' + - 'Paper/**' + - 'Simulations/**' + - 'Testing/**' + - '*.sh' + - '*.md' + + workflow_dispatch: + +jobs: + build_and_test: + if: contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false + name: Build AUv3 plugin for iOS + runs-on: macos-latest + + steps: + - name: Get latest CMake + uses: lukka/get-cmake@latest + + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: Apple-Actions/import-codesign-certs@v1 + with: + p12-file-base64: ${{ secrets.MAC_CERTIFICATES_BASE64 }} + p12-password: ${{ secrets.MAC_CERTIFICATES_PASS }} + + - uses: Apple-Actions/download-provisioning-profiles@v1 + with: + bundle-id: com.chowdsp.CHOWTapeModel* + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }} + + - name: Configure + shell: bash + run: cmake -Bbuild-ios Plugin -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=11.4 -DCMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY="1,2" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE="Manual" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="Apple Distribution" -DCMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER="ChowTapeModel" -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=${{ secrets.APPLE_TEAM_ID }} + + + - name: Build + shell: bash + run: cmake --build build-ios --config Release --parallel 4 | xcpretty diff --git a/.gitmodules b/.gitmodules @@ -1,5 +1,5 @@ [submodule "Plugin/Juce"] - path = Plugin/modules/JUCE + path = Plugin/modules/DISTRHO-JUCE url = https://github.com/Chowdhury-DSP/DISTRHO-JUCE.git [submodule "Plugin/foleys_gui_magic"] path = Plugin/modules/foleys_gui_magic @@ -10,3 +10,6 @@ [submodule "Plugin/modules/RTNeural"] path = Plugin/modules/RTNeural url = https://github.com/jatinchowdhury18/RTNeural +[submodule "Plugin/modules/JUCE"] + path = Plugin/modules/JUCE + url = https://github.com/juce-framework/JUCE diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt @@ -10,16 +10,28 @@ include_directories(modules/RTNeural) # juce_set_vst2_sdk_path(C:/SDKs/VST_SDK/VST2_SDK/) # include_directories(ASIO_SDK) -juce_add_plugin(CHOWTapeModel - COMPANY_NAME chowdsp - PLUGIN_MANUFACTURER_CODE Chow - PLUGIN_CODE Jdox - FORMATS AU VST3 Standalone LV2 #VST - ProductName "CHOWTapeModel" - LV2_URI https://github.com/jatinchowdhury18/AnalogTapeModel - ICON_BIG Source/GUI/Assets/logo.png - MICROPHONE_PERMISSION_ENABLED TRUE -) +if(IOS) + juce_add_plugin(CHOWTapeModel + COMPANY_NAME chowdsp + PLUGIN_MANUFACTURER_CODE Chow + PLUGIN_CODE Jdox + FORMATS Standalone AUv3 + ProductName "CHOWTapeModel" + ICON_BIG Source/GUI/Assets/logo.png + MICROPHONE_PERMISSION_ENABLED TRUE + ) +else() + juce_add_plugin(CHOWTapeModel + COMPANY_NAME chowdsp + PLUGIN_MANUFACTURER_CODE Chow + PLUGIN_CODE Jdox + FORMATS AU VST3 Standalone LV2 #VST + ProductName "CHOWTapeModel" + LV2_URI https://github.com/jatinchowdhury18/AnalogTapeModel + ICON_BIG Source/GUI/Assets/logo.png + MICROPHONE_PERMISSION_ENABLED TRUE + ) +endif() # create JUCE header juce_generate_juce_header(CHOWTapeModel) @@ -48,3 +60,23 @@ if(MACOS_RELEASE) # 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) + set_target_properties(${target} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "./" + ARCHIVE_OUTPUT_DIRECTORY "./" + LIBRARY_OUTPUT_DIRECTORY "./") + endforeach() + + set_target_properties(CHOWTapeModel_Standalone PROPERTIES + XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)" + XCODE_ATTRIBUTE_SKIP_INSTALL "NO") + + set_target_properties(CHOWTapeModel_AUv3 PROPERTIES + XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)/CHOWTapeModel.app/PlugIns" + XCODE_ATTRIBUTE_SKIP_INSTALL "NO") +endif() diff --git a/Plugin/Source/CMakeLists.txt b/Plugin/Source/CMakeLists.txt @@ -14,6 +14,7 @@ target_sources(CHOWTapeModel PRIVATE juce_add_binary_data(BinaryData SOURCES GUI/Assets/Background.svg GUI/Assets/gui.xml + GUI/Assets/gui_ios.xml GUI/Assets/knob.svg GUI/Assets/pointer.svg GUI/Assets/powerswitch.svg diff --git a/Plugin/Source/GUI/Assets/gui_ios.xml b/Plugin/Source/GUI/Assets/gui_ios.xml @@ -0,0 +1,229 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<magic> + <Styles> + <Style name="default"> + <Nodes/> + <Classes> + <plot-view border="2" background-color="black" border-color="silver" display="contents"/> + <nomargin margin="0" padding="0" border="0"/> + <group margin="5" padding="5" border="2" flex-direction="column"/> + <Slider background-color="00000000" caption-color="FFFFFFFF" slider-text-outline="00000000" + slider-type="rotary-horizontal-vertical" slider-textbox="textbox-below" + lookAndFeel="MyLNF" slider-background="ff595c6b" slider-track="ff9cbcbd" + slidertext-width="80" slidertext-height="17" caption-size="21.25"> + <media/> + </Slider> + </Classes> + <Types> + <Slider border="0" slider-type="rotary-horizontal-vertical" slider-textbox="textbox-below"/> + <ToggleButton border="0" max-height="50" caption-size="0" text="Active"/> + <TextButton border="0" max-height="50" caption-size="0"/> + <ComboBox border="0" max-height="50" caption-size="0"/> + <Plot border="0" margin="0" padding="0" background-color="00000000" + radius="0"/> + <XYDragComponent border="0" margin="0" padding="0" background-color="00000000" + radius="0"/> + </Types> + </Style> + </Styles> + <View id="root" resizable="1" resize-corner="1" flex-direction="column" + padding="0" width="580" height="580" background-color="FF8B3232" + background-image="Background_svg" image-placement="stretch"> + <View max-height="100" padding="0" margin="0" background-color=""> + <View margin="2" padding="" background-color="00000000" flex-direction="column" + flex-grow="0.75"> + <View flex-grow="0.333" background-color="00000000"/> + <TitleComp background-color="00000000" title="Chow Tape Model" font="28" + padding="3" flex-grow="1.0"/> + <InfoComp background-color="00000000" text1="FFEAA92C" flex-grow="0.7" + padding="0" margin="5" border=""/> + <View background-color="00000000" flex-grow="0.33"/> + </View> + <Plot source="scope" plot-color="FFEAA92C" padding="0" background-color="33000000" + plot-decay="0.0" plot-fill-color="FFFFFFFF"/> + </View> + <View padding="0" margin="" background-color="" lookAndFeel=""> + <View display="tabbed" padding="0" background-color="FF31323A" lookAndFeel="MyLNF"> + <View flex-direction="column" tab-color="" background-color="FF31323A" + padding="0" tab-caption="Gain"> + <Slider caption="Input Gain [dB]" parameter="ingain" class="Slider" name="Input Gain" + padding="0" margin="0" tooltip="Sets the input gain to the tape model in Decibels."/> + <Slider caption="Dry/Wet" parameter="drywet" class="Slider" tooltip="Sets dry/wet mix of the entire plugin." + padding="0" margin="0" name="Dry/Wet" slider-track="FF0BBDC2"/> + <Slider caption="Output Gain [dB]" parameter="outgain" class="Slider" + padding="0" margin="0" name="Output Gain" tooltip="Sets the output gain from the tape model in Decibels."/> + </View> + <View flex-direction="column" tab-color="" background-color="FF31323A" + padding="0" tab-caption="Filters" margin="0"> + <Slider caption="Low Cut" parameter="ifilt_low" class="Slider" name="Low Cut" + tooltip="Applies a low cut filter before applying tape processing."/> + <Slider caption="High Cut" parameter="ifilt_high" class="Slider" name="High Cut" + tooltip="Applies a high cut filter before applying tape processing."/> + <TextButton parameter="ifilt_makeup" text="Makeup" background-color="00000000" + margin="0" padding="5" button-color="00000000" flex-grow="0.35" + button-on-color="FF8B3232" lookAndFeel="SpeedButtonLNF" name="Makeup" + tooltip="Adds the signal cut out by the cut filters back to the processed signal."/> + <PowerButton background-color="00000000" max-height="25" min-height="20" margin="0" + padding="0" button-color="ff595c6b" button-on-color="FFEAA92C" + parameter="ifilt_onoff" name="Filters On/Off" tooltip="Turns the pre-processing filters on or off."/> + </View> + </View> + <View display="tabbed" padding="0" background-color="FF31323A" lookAndFeel="MyLNF"> + <View flex-direction="column" tab-color="" background-color="FF31323A" + padding="0" tab-caption="Tape" margin="0"> + <View margin="0" padding="0" flex-grow="0.05" background-color="00000000"/> + <Slider caption="Bias" parameter="width" class="Slider" name="Bias" padding="0" + margin="0" tooltip="Controls the amount of bias used by the tape recorder. Turning down the bias can create &quot;deadzone&quot; distortion."/> + <Slider caption="Saturation" parameter="sat" class="Slider" name="Saturation" + padding="0" margin="0" tooltip="Controls the amount of tape saturation applied to the signal."/> + <Slider caption="Drive" parameter="drive" class="Slider" name="Drive" + padding="0" margin="0" tooltip="Controls the amount of amplification done during the tape magnetisation process. Note that unlike the &quot;Input Gain&quot;, this amplification is highly nonlinear."/> + <PowerButton flex-grow="1.0" margin="0" padding="0" background-color="00000000" + button-on-color="FFEAA92C" min-height="20" max-height="25" button-color="ff595c6b" + parameter="hyst_onoff" name="Tape On/Off" tooltip="Turns the tape processing on or off."/> + </View> + <View flex-direction="column" tab-color="" background-color="FF31323A" + padding="0" tab-caption="Tone" margin="0"> + <View margin="0" padding="0" flex-grow="0.05" background-color="00000000"/> + <Slider caption="Treble" parameter="h_treble" class="Slider" name="Treble" + padding="0" margin="0" tooltip="Controls the treble response of the pre/post-emphasis filters."/> + <Slider caption="Bass" parameter="h_bass" class="Slider" name="Bass" + padding="0" margin="0" tooltip="Controls the bass response of the pre/post-emphasis filters."/> + <Slider caption="Frequency" parameter="h_tfreq" class="Slider" name="Transition Frequency" + padding="0" margin="0" tooltip="Controls the transition frequency between the bass and treble sections of the EQ."/> + <PowerButton max-height="25" min-height="20" margin="0" padding="0" background-color="00000000" + button-color="ff595c6b" button-on-color="FFEAA92C" parameter="tone_onoff" + name="Tone On/Off" tooltip="Turns the tone control processing on or off."/> + </View> + </View> + <View display="tabbed" padding="0" background-color="FF31323A" flex-grow="1.5" + 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="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"> + <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."/> + <TextButton text="7.5" margin="0" padding="2" button-color="00000000" background-color="00000000" + onClick="set_speed_7.50" lookAndFeel="SpeedButtonLNF" button-on-color="00000000" + name="7.5 ips" tooltip="Snaps the tape speed to 7.5 inches per second."/> + <TextButton margin="0" padding="2" text="15" button-color="00000000" button-on-color="00000000" + background-color="00000000" onClick="set_speed_15.00" lookAndFeel="SpeedButtonLNF" + name="15 ips" tooltip="Snaps the tape speed to 15 inches per second."/> + <TextButton margin="0" padding="2" background-color="00000000" onClick="set_speed_30.00" + lookAndFeel="SpeedButtonLNF" text="30" button-color="00000000" + button-on-color="00000000" name="30 ips" tooltip="Snaps the tape speed to 30 inches per second."/> + </View> + <View flex-grow="0.01" background-color="00000000"/> + <PowerButton margin="0" padding="0" background-color="00000000" max-height="25" + min-height="20" button-color="ff595c6b" button-on-color="FFEAA92C" + parameter="loss_onoff" name="Loss On/Off" tooltip="Turns the loss filters on or off."/> + </View> + <View tab-caption="Degrade" padding="0" flex-direction="column" background-color="FF31323A" + margin="0"> + <View margin="0" padding="0" flex-grow="0.05" background-color="00000000"/> + <Slider parameter="deg_depth" caption="Depth" class="Slider" name="Depth" + tooltip="Sets the depth of the tape degradation." padding="0" + margin="0"/> + <Slider caption="Amount" parameter="deg_amt" class="Slider" name="Amount" + padding="0" margin="0" tooltip="Sets the amount of the tape that is degraded. At large values all of the tape will be affected, at small values only some sections will be affected."/> + <Slider parameter="deg_var" caption="Variance" class="Slider" name="Variance" + padding="0" margin="0" tooltip="Sets the variance of the tape degradation. Use lower values for uniform degradation, or higher values for variation across different sections of tape."/> + <PowerButton margin="0" padding="0" background-color="00000000" max-height="25" + min-height="20" button-color="ff595c6b" button-on-color="FFEAA92C" + parameter="deg_onoff" name="Degrade On/Off" tooltip="Turns the degradation processing on or off."/> + </View> + <View tab-caption="CHEW" padding="0" flex-direction="column" background-color="FF31323A" + margin="0"> + <View margin="0" padding="0" flex-grow="0.05" background-color="00000000"/> + <Slider parameter="chew_depth" caption="Depth" padding="0" margin="0" + class="Slider" name="Chew Depth" tooltip="Controls how intensely the tape has been chewed up."/> + <Slider caption="Frequency" parameter="chew_freq" padding="0" margin="0" + class="Slider" name="Chew Frequency" tooltip="Controls the amount of time in between chewed-up sections of tape."/> + <Slider caption="Variance" parameter="chew_var" padding="0" margin="0" + class="Slider" name="Chew Variance" tooltip="Controls the amount of variance in the chew frequency."/> + <PowerButton margin="0" padding="0" background-color="00000000" max-height="25" + min-height="20" button-color="ff595c6b" button-on-color="FFEAA92C" + parameter="chew_onoff" name="Chew On/Off" tooltip="Turns the chew processing on or off."/> + </View> + </View> + <View display="tabbed" padding="0" margin="2" background-color="FF31323A" lookAndFeel="MyLNF"> + <View tab-caption="Flutter" flex-direction="column" background-color="FF31323A"> + <Slider caption="Depth" parameter="depth" max-height="150" class="Slider" + name="Flutter Depth" tooltip="Sets depth of the tape flutter." + margin="0" padding="0"/> + <Slider caption="Rate" parameter="rate" class="Slider" max-height="150" + name="Flutter Rate" tooltip="Sets the rate of the tape flutter." + margin="0" padding="0"/> + <Plot source="flutter" plot-decay="0.8" background-color="FF1E1F22" + flex-grow="0.8" plot-color="FFEAA92C" plot-fill-color="CC8B3232"/> + <PowerButton margin="0" padding="0" background-color="00000000" max-height="25" + min-height="20" button-color="ff595c6b" button-on-color="FFEAA92C" + parameter="flutter_onoff" name="Wow/Flutter On/Off" tooltip="Turns the wow and flutter processing on or off."/> + </View> + <View tab-caption="Wow" flex-direction="column" background-color="FF31323A" padding="0" margin="3"> + <Slider caption="Depth" parameter="wow_depth" max-height="150" class="Slider" + name="Wow Depth" tooltip="Sets the depth of the tape wow." margin="0" + padding="0" slider-type="linear-horizontal"/> + <Slider caption="Rate" parameter="wow_rate" class="Slider" max-height="150" + name="Wow Rate" tooltip="Sets the rate of the tape wow." margin="0" + padding="0" slider-type="linear-horizontal"/> + <Slider caption="Variance" parameter="wow_var" class="Slider" max-height="150" + name="Wow Variance" tooltip="Sets the amount of variance in the tape wow." margin="0" + padding="0" slider-type="linear-horizontal"/> + <Slider caption="Drift" parameter="wow_drift" class="Slider" max-height="150" + name="Wow Drift" tooltip="Sets the amount of drift in the tape wow." margin="0" + padding="0" slider-type="linear-horizontal"/> + <Plot source="wow" plot-decay="0.8" flex-grow="1.45" background-color="FF1E1F22" + plot-color="FFEAA92C" plot-fill-color="CC8B3232"/> + <PowerButton margin="0" padding="0" background-color="00000000" max-height="25" + min-height="20" button-color="ff595c6b" button-on-color="FFEAA92C" + parameter="flutter_onoff" name="Wow/Flutter On/Off" tooltip="Turns the wow and flutter processing on or off."/> + </View> + </View> + </View> + <View max-height="50" margin="0" padding="0" background-color="FF31323A" + flex-grow="0.1"> + <View background-color="00000000" flex-grow="0.1"/> + <ComboBox caption="Oversampling" parameter="os" class="Slider" caption-size="0" + padding="0" combo-text="FFEAA92C" combo-background="00000000" + max-height="100" margin="" lookAndFeel="ComboBoxLNF" name="Oversampling" + tooltip="Sets the amount of oversampling used for the hysteresis processing. More oversampling will reduce aliasing artifacts, but requires more CPU resources."/> + <ComboBox lookAndFeel="ComboBoxLNF" padding="0" border="0" background-color="00000000" + name="Hysteresis Mode" caption="Hysteresis Mode" caption-size="0" + combo-text="FFEAA92C" caption-color="FFFFFFFF" max-height="100" + margin="" parameter="mode" combo-background="00000000" tooltip="Selects the mode to use for hysteresis processing. Choose between 2nd/4th order Runge-Kutta method, 4 or 8 Newton-Raphson iterations, or revert to version 1.0."/> + <View flex-grow="0.1" background-color="00000000"/> + <ComboBox lookAndFeel="ComboBoxLNF" padding="0" border="0" background-color="00000000" + name="Mix Group" caption="Mix Group" caption-size="0" flex-grow="0.85" + combo-text="FFEAA92C" caption-color="FFFFFFFF" max-height="100" + margin="0" parameter="mix_group" combo-background="00000000" + tooltip="Adds this plugin to a mix group. When the plugin is added to a group, the group parameters will be copied to this plugin, and their parameters will remain in sync."/> + <MixGroupViz flex-grow="0.3" margin="5" padding="0" background-color="00000000"/> + <presets margin="5" padding="0" background-color="00000000" border-color="595C6B" + radius="" border="" lookAndFeel="PresetsLNF" flex-grow="1.9" + max-height="100"/> + </View> + </View> +</magic> diff --git a/Plugin/Source/GUI/AutoUpdating.cpp b/Plugin/Source/GUI/AutoUpdating.cpp @@ -60,18 +60,29 @@ void AutoUpdater::paint (Graphics& g) g.fillAll (backgroundColour); g.setColour (Colours::white); +#if JUCE_IOS + g.setFont (Font (22.0f)); + const auto promptHeight = 80; +#else g.setFont (Font (36.0f)); + const auto promptHeight = 50; +#endif String updatePrompt = String ("Version " + newVersion.removeCharacters ("v") + " of CHOW Tape is available. Would you like to download?"); const auto promptWidth = getWidth() * 2 / 3; const auto promptX = getWidth() / 6; - const auto promptHeight = 50; const auto promptY = getHeight() / 2 - promptHeight; g.drawFittedText (updatePrompt, promptX, promptY, promptWidth, promptHeight, Justification::centred, 2); } +void AutoUpdater::parentSizeChanged() +{ + setSize (getParentWidth(), getParentHeight()); + repaint(); +} + void AutoUpdater::resized() { const auto y = getHeight() / 2 + 10; diff --git a/Plugin/Source/GUI/AutoUpdating.h b/Plugin/Source/GUI/AutoUpdating.h @@ -31,6 +31,7 @@ public: void paint (Graphics& g) override; void resized() override; + void parentSizeChanged() override; void showUpdaterScreen (Component* parent); diff --git a/Plugin/Source/GUI/MyLNF.cpp b/Plugin/Source/GUI/MyLNF.cpp @@ -241,6 +241,18 @@ Label* MyLNF::createSliderTextBox (Slider& slider) return l; } +Component* MyLNF::getParentComponentForMenuOptions (const PopupMenu::Options& options) +{ +#if JUCE_IOS + if (PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_AudioUnitv3) + { + if (options.getParentComponent() == nullptr && options.getTargetComponent() != nullptr) + return options.getTargetComponent()->getTopLevelComponent(); + } +#endif + return LookAndFeel_V2::getParentComponentForMenuOptions (options); +} + void ComboBoxLNF::drawComboBox (Graphics& g, int width, int height, bool, int, int, int, int, ComboBox& box) { auto cornerSize = 5.0f; diff --git a/Plugin/Source/GUI/MyLNF.h b/Plugin/Source/GUI/MyLNF.h @@ -22,6 +22,8 @@ public: Slider::SliderLayout getSliderLayout (Slider& slider) override; Label* createSliderTextBox (Slider& slider) override; + Component* getParentComponentForMenuOptions (const PopupMenu::Options& options) override; + private: std::unique_ptr<Drawable> knob = Drawable::createFromImageData (BinaryData::knob_svg, BinaryData::knob_svgSize); std::unique_ptr<Drawable> pointer = Drawable::createFromImageData (BinaryData::pointer_svg, BinaryData::pointer_svgSize); diff --git a/Plugin/Source/PluginProcessor.cpp b/Plugin/Source/PluginProcessor.cpp @@ -309,7 +309,11 @@ AudioProcessorEditor* ChowtapeModelAudioProcessor::createEditor() }); } +#if JUCE_IOS + auto* editor = new foleys::MagicPluginEditor (magicState, BinaryData::gui_ios_xml, BinaryData::gui_ios_xmlSize, std::move (builder)); +#else auto* editor = new foleys::MagicPluginEditor (magicState, BinaryData::gui_xml, BinaryData::gui_xmlSize, std::move (builder)); +#endif onOffManager.setOnOffForNewEditor (editor); updater.showUpdaterScreen (editor); return editor; diff --git a/Plugin/modules/CMakeLists.txt b/Plugin/modules/CMakeLists.txt @@ -1,5 +1,9 @@ # set up JUCE and modules -add_subdirectory(JUCE) +if(UNIX AND NOT APPLE) + add_subdirectory(DISTRHO-JUCE) +else() + add_subdirectory(JUCE) +endif() juce_add_modules(foleys_gui_magic) juce_add_modules(chowdsp_utils) diff --git a/Plugin/modules/DISTRHO-JUCE b/Plugin/modules/DISTRHO-JUCE @@ -0,0 +1 @@ +Subproject commit 5d503f334ddb849b3e13f5d7d28e553686f44f9e diff --git a/ios_builds.sh b/ios_builds.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -e +TEAM_ID=$(more ~/Developer/mac_id) + +if [ "$1" == "help" ]; then + echo "Run bash ios_build.sh build clean" + echo "Run bash ios_build.sh version" + echo "Go to Xcode Archive Organizer and upload!" + exit +fi + +cd Plugin + +if [ "$1" == "build" ]; then +echo "Running CMake configuration..." + +# clean up old builds +if [ "$2" == "clean" ]; then rm -Rf build-ios; fi + +# generate new builds +cmake -Bbuild-ios -GXcode -DCMAKE_SYSTEM_NAME=iOS \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=11.4 \ + -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM="$TEAM_ID" \ + -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 +fi + +if [ "$1" == "version" ]; then + # set version number to include commit hash + COMMIT=$(git log --pretty=format:'%h' -n 1) + VERSION=$(cut -f 2 -d '=' <<< "$(grep 'CMAKE_PROJECT_VERSION:STATIC' build-ios/CMakeCache.txt)") + BUILD_NUMBER="$VERSION-$COMMIT" + echo "Setting version for archive: $BUILD_NUMBER" + + PLIST=CHOWTapeModel.xcarchive/Info.plist + /usr/libexec/Plistbuddy -c "Set ApplicationProperties:CFBundleVersion $BUILD_NUMBER" "$PLIST" + + # move to archives folder so Xcode can find it + archive_dir="$HOME/Library/Developer/Xcode/Archives/$(date '+%Y-%m-%d')" + echo "Moving to directory: $archive_dir" + mkdir -p "$archive_dir" + mv CHOWTapeModel.xcarchive "$archive_dir/CHOWTapeModel-$COMMIT.xcarchive" +fi diff --git a/validate.sh b/validate.sh @@ -41,7 +41,7 @@ n_tries=0 result=1 until [ "$n_tries" -ge 4 ] || [ "$result" -eq 0 ] do - $pluginval --strictness-level 8 --validate-in-process --validate $plugin + $pluginval --strictness-level 8 --timeout-ms 90000 --validate-in-process --skip-gui-tests --validate $plugin result=$? n_tries=$((n_tries+1)) done