From bbd2184e3b661143ad89d9cc8672512de60f880d Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 19 Mar 2020 19:20:18 +0000 Subject: [PATCH] Demos: Fix some build issues in demos with more warnings enabled --- examples/Plugins/AUv3SynthPluginDemo.h | 6 +- examples/Plugins/ArpeggiatorPluginDemo.h | 2 - examples/Plugins/GainPluginDemo.h | 2 - .../Plugins/InterAppAudioEffectPluginDemo.h | 27 ++-- examples/Plugins/MultiOutSynthPluginDemo.h | 2 - examples/Plugins/NoiseGatePluginDemo.h | 2 - examples/Plugins/SamplerPluginDemo.h | 130 +++++++----------- examples/Utilities/InAppPurchasesDemo.h | 4 +- examples/Utilities/PushNotificationsDemo.h | 2 +- .../AU/juce_AU_Wrapper.mm | 22 +-- .../AU/juce_AUv3_Wrapper.mm | 22 +-- .../juce_audio_plugin_client_AU_2.mm | 1 + .../native/juce_ios_InAppPurchases.cpp | 11 +- 13 files changed, 102 insertions(+), 131 deletions(-) diff --git a/examples/Plugins/AUv3SynthPluginDemo.h b/examples/Plugins/AUv3SynthPluginDemo.h index 36f58805fb..b4f6516293 100644 --- a/examples/Plugins/AUv3SynthPluginDemo.h +++ b/examples/Plugins/AUv3SynthPluginDemo.h @@ -180,9 +180,9 @@ class AUv3SynthEditor : public AudioProcessorEditor, { public: //============================================================================== - AUv3SynthEditor (AudioProcessor& processor) - : AudioProcessorEditor (processor), - roomSizeSlider (Slider::LinearHorizontal, Slider::NoTextBox) + AUv3SynthEditor (AudioProcessor& processorIn) + : AudioProcessorEditor (processorIn), + roomSizeSlider (Slider::LinearHorizontal, Slider::NoTextBox) { LookAndFeel::setDefaultLookAndFeel (&materialLookAndFeel); diff --git a/examples/Plugins/ArpeggiatorPluginDemo.h b/examples/Plugins/ArpeggiatorPluginDemo.h index 132e1b2ca7..74e5c9c15d 100644 --- a/examples/Plugins/ArpeggiatorPluginDemo.h +++ b/examples/Plugins/ArpeggiatorPluginDemo.h @@ -61,8 +61,6 @@ public: addParameter (speed = new AudioParameterFloat ("speed", "Arpeggiator Speed", 0.0, 1.0, 0.5)); } - ~Arpeggiator() {} - //============================================================================== void prepareToPlay (double sampleRate, int samplesPerBlock) override { diff --git a/examples/Plugins/GainPluginDemo.h b/examples/Plugins/GainPluginDemo.h index 850c7de30a..4e50cdd97f 100644 --- a/examples/Plugins/GainPluginDemo.h +++ b/examples/Plugins/GainPluginDemo.h @@ -62,8 +62,6 @@ public: addParameter (gain = new AudioParameterFloat ("gain", "Gain", 0.0f, 1.0f, 0.5f)); } - ~GainProcessor() {} - //============================================================================== void prepareToPlay (double, int) override {} void releaseResources() override {} diff --git a/examples/Plugins/InterAppAudioEffectPluginDemo.h b/examples/Plugins/InterAppAudioEffectPluginDemo.h index 4b750e86ce..9a008cf83b 100644 --- a/examples/Plugins/InterAppAudioEffectPluginDemo.h +++ b/examples/Plugins/InterAppAudioEffectPluginDemo.h @@ -157,8 +157,6 @@ public: { } - ~IAAEffectProcessor() {} - //============================================================================== void prepareToPlay (double, int) override { @@ -284,11 +282,11 @@ private: IAAEffectEditor (IAAEffectProcessor& p, AudioProcessorValueTreeState& vts) : AudioProcessorEditor (p), - processor (p), + iaaEffectProcessor (p), parameters (vts) { // Register for meter value updates. - processor.addMeterListener (*this); + iaaEffectProcessor.addMeterListener (*this); gainSlider.setSliderStyle (Slider::SliderStyle::LinearVertical); gainSlider.setTextBoxStyle (Slider::TextEntryBoxPosition::TextBoxAbove, false, 60, 20); @@ -310,7 +308,7 @@ private: rewindButton.onClick = [this] { if (transportControllable()) - processor.getPlayHead()->transportRewind(); + iaaEffectProcessor.getPlayHead()->transportRewind(); }; addChildComponent (rewindButton); @@ -320,7 +318,7 @@ private: playButton.onClick = [this] { if (transportControllable()) - processor.getPlayHead()->transportPlay (! lastPosInfo.isPlaying); + iaaEffectProcessor.getPlayHead()->transportPlay (! lastPosInfo.isPlaying); }; addChildComponent (playButton); @@ -330,7 +328,7 @@ private: recordButton.onClick = [this] { if (transportControllable()) - processor.getPlayHead()->transportRecord (! lastPosInfo.isRecording); + iaaEffectProcessor.getPlayHead()->transportRecord (! lastPosInfo.isRecording); }; addChildComponent (recordButton); @@ -359,9 +357,9 @@ private: startTimerHz (60); } - ~IAAEffectEditor() + ~IAAEffectEditor() override { - processor.removeMeterListener (*this); + iaaEffectProcessor.removeMeterListener (*this); } //============================================================================== @@ -411,7 +409,7 @@ private: //============================================================================== void timerCallback () override { - auto timeInfoSuccess = processor.updateCurrentTimeInfoFromHost (lastPosInfo); + auto timeInfoSuccess = iaaEffectProcessor.updateCurrentTimeInfoFromHost (lastPosInfo); transportText.setVisible (timeInfoSuccess); if (timeInfoSuccess) @@ -425,7 +423,7 @@ private: //============================================================================== bool transportControllable() { - auto playHead = processor.getPlayHead(); + auto playHead = iaaEffectProcessor.getPlayHead(); return playHead != nullptr && playHead->canControlTransport(); } @@ -481,8 +479,8 @@ private: void updateTransportButtonsDisplay() { - auto visible = processor.getPlayHead() != nullptr - && processor.getPlayHead()->canControlTransport(); + auto visible = iaaEffectProcessor.getPlayHead() != nullptr + && iaaEffectProcessor.getPlayHead()->canControlTransport(); if (rewindButton.isVisible() != visible) { @@ -524,7 +522,7 @@ private: } } - IAAEffectProcessor& processor; + IAAEffectProcessor& iaaEffectProcessor; AudioProcessorValueTreeState& parameters; const int buttonSize = 30; @@ -549,7 +547,6 @@ private: //============================================================================== AudioProcessorValueTreeState parameters; float previousGain = 0.0f; - std::array meterValues = { { 0, 0 } }; // This keeps a copy of the last set of timing info that was acquired during an // audio callback - the UI component will display this. diff --git a/examples/Plugins/MultiOutSynthPluginDemo.h b/examples/Plugins/MultiOutSynthPluginDemo.h index 6442077cdc..d10f51990e 100644 --- a/examples/Plugins/MultiOutSynthPluginDemo.h +++ b/examples/Plugins/MultiOutSynthPluginDemo.h @@ -94,8 +94,6 @@ public: loadNewSample (createAssetInputStream ("singing.ogg"), "ogg"); } - ~MultiOutSynth() {} - //============================================================================== bool canAddBus (bool isInput) const override { return (! isInput && getBusCount (false) < maxMidiChannel); } bool canRemoveBus (bool isInput) const override { return (! isInput && getBusCount (false) > 1); } diff --git a/examples/Plugins/NoiseGatePluginDemo.h b/examples/Plugins/NoiseGatePluginDemo.h index 620e0936e8..a8e3b7d64d 100644 --- a/examples/Plugins/NoiseGatePluginDemo.h +++ b/examples/Plugins/NoiseGatePluginDemo.h @@ -63,8 +63,6 @@ public: addParameter (alpha = new AudioParameterFloat ("alpha", "Alpha", 0.0f, 1.0f, 0.8f)); } - ~NoiseGate() {} - //============================================================================== bool isBusesLayoutSupported (const BusesLayout& layouts) const override { diff --git a/examples/Plugins/SamplerPluginDemo.h b/examples/Plugins/SamplerPluginDemo.h index 28a3dfb1a9..a64a71d26f 100644 --- a/examples/Plugins/SamplerPluginDemo.h +++ b/examples/Plugins/SamplerPluginDemo.h @@ -516,9 +516,9 @@ public: class MemoryAudioFormatReaderFactory : public AudioFormatReaderFactory { public: - MemoryAudioFormatReaderFactory (const void* sampleData, size_t dataSize) - : sampleData (sampleData), - dataSize (dataSize) + MemoryAudioFormatReaderFactory (const void* sampleDataIn, size_t dataSizeIn) + : sampleData (sampleDataIn), + dataSize (dataSizeIn) {} std::unique_ptr make (AudioFormatManager&manager ) const override @@ -540,8 +540,8 @@ private: class FileAudioFormatReaderFactory : public AudioFormatReaderFactory { public: - explicit FileAudioFormatReaderFactory (File file) - : file (std::move (file)) + explicit FileAudioFormatReaderFactory (File fileIn) + : file (std::move (fileIn)) {} std::unique_ptr make (AudioFormatManager& manager) const override @@ -925,12 +925,12 @@ public: virtual void loopPointsSecondsChanged (Range) {} }; - explicit DataModel (AudioFormatManager& audioFormatManager) - : DataModel (audioFormatManager, ValueTree (IDs::DATA_MODEL)) + explicit DataModel (AudioFormatManager& audioFormatManagerIn) + : DataModel (audioFormatManagerIn, ValueTree (IDs::DATA_MODEL)) {} - DataModel (AudioFormatManager& audioFormatManager, const ValueTree& vt) - : audioFormatManager (&audioFormatManager), + DataModel (AudioFormatManager& audioFormatManagerIn, const ValueTree& vt) + : audioFormatManager (&audioFormatManagerIn), valueTree (vt), sampleReader (valueTree, IDs::sampleReader, nullptr), centreFrequencyHz (valueTree, IDs::centreFrequencyHz, nullptr), @@ -1415,13 +1415,13 @@ public: using MouseCallback = std::function; LoopPointMarker (String marker, - MouseCallback onMouseDown, - MouseCallback onMouseDrag, - MouseCallback onMouseUp) + MouseCallback onMouseDownIn, + MouseCallback onMouseDragIn, + MouseCallback onMouseUpIn) : text (std::move (marker)), - onMouseDown (move (onMouseDown)), - onMouseDrag (move (onMouseDrag)), - onMouseUp (move (onMouseUp)) + onMouseDown (std::move (onMouseDownIn)), + onMouseDrag (std::move (onMouseDragIn)), + onMouseUp (std::move (onMouseUpIn)) { setMouseCursor (MouseCursor::LeftRightResizeCursor); } @@ -1585,7 +1585,7 @@ class LoopPointsOverlay : public Component, public: LoopPointsOverlay (const DataModel& dModel, const VisibleRangeDataModel& vModel, - UndoManager& undoManager) + UndoManager& undoManagerIn) : dataModel (dModel), visibleRange (vModel), beginMarker ("B", @@ -1596,7 +1596,7 @@ public: [this] (LoopPointMarker& m, const MouseEvent& e) { this->loopPointMouseDown (m, e); }, [this] (LoopPointMarker& m, const MouseEvent& e) { this->loopPointDragged (m, e); }, [this] (LoopPointMarker& m, const MouseEvent& e) { this->loopPointMouseUp (m, e); }), - undoManager (&undoManager) + undoManager (&undoManagerIn) { dataModel .addListener (*this); visibleRange.addListener (*this); @@ -1686,9 +1686,9 @@ class PlaybackPositionOverlay : public Component, public: using Provider = std::function()>; PlaybackPositionOverlay (const VisibleRangeDataModel& model, - Provider provider) + Provider providerIn) : visibleRange (model), - provider (move (provider)) + provider (std::move (providerIn)) { visibleRange.addListener (*this); startTimer (16); @@ -1853,7 +1853,7 @@ private: loopPoints.setVisible (value != LoopMode::none); } - void sampleReaderChanged (std::shared_ptr value) override + void sampleReaderChanged (std::shared_ptr) override { auto lengthInSeconds = dataModel.getSampleLengthSeconds(); visibleRange.setTotalRange (Range (0, lengthInSeconds), nullptr); @@ -2027,34 +2027,6 @@ struct ProcessorState LoopMode loopMode; }; -//============================================================================== -// We store the current sampler sound in a shared_ptr. Although we never -// call mutating member functions on this shared_ptr, we do read from it on -// both the audio and gui threads. Such concurrent reads should be safe -// without using atomic methods, but we use a tiny wrapper to enforce atomic -// accesses anyway - if nothing else, this wrapper enforces and documents that -// we never mutate the shared_ptr in a way which could cause a data race. -template -class AtomicSharedPtr final -{ -public: - AtomicSharedPtr() = default; - explicit AtomicSharedPtr (std::shared_ptr contents) - : contents (move (contents)) - {} - - AtomicSharedPtr (const AtomicSharedPtr& other) = delete; - AtomicSharedPtr& operator= (const AtomicSharedPtr& other) = delete; - - std::shared_ptr load() const - { - return atomic_load (&contents); - } - -private: - std::shared_ptr contents; -}; - //============================================================================== class SamplerAudioProcessor : public AudioProcessor { @@ -2072,7 +2044,7 @@ public: AudioFormatManager manager; manager.registerBasicFormats(); auto reader = readerFactory->make (manager); - auto sound = samplerSound.load(); + auto sound = samplerSound; auto sample = std::unique_ptr (new Sample (*reader, 10.0)); auto lengthInSeconds = sample->getLength() / sample->getSampleRate(); sound->setLoopPointsInSeconds ({lengthInSeconds * 0.1, lengthInSeconds * 0.9 }); @@ -2113,7 +2085,7 @@ public: state.mpeZoneLayout = synthesiser.getZoneLayout(); state.readerFactory = readerFactory == nullptr ? nullptr : readerFactory->clone(); - auto sound = samplerSound.load(); + auto sound = samplerSound; state.loopPointsSeconds = sound->getLoopPointsInSeconds(); state.centreFrequencyHz = sound->getCentreFrequencyInHz(); state.loopMode = sound->getLoopMode(); @@ -2168,7 +2140,7 @@ public: synthesiser.renderNextBlock (buffer, midiMessages, 0, buffer.getNumSamples()); - auto loadedSamplerSound = samplerSound.load(); + auto loadedSamplerSound = samplerSound; if (loadedSamplerSound->getSample() == nullptr) return; @@ -2195,18 +2167,18 @@ public: { public: SetSampleCommand (std::unique_ptr r, - std::unique_ptr sample, - std::vector> newVoices) - : readerFactory (move (r)), - sample (move (sample)), - newVoices (move (newVoices)) + std::unique_ptr sampleIn, + std::vector> newVoicesIn) + : readerFactory (std::move (r)), + sample (std::move (sampleIn)), + newVoices (std::move (newVoicesIn)) {} void operator() (SamplerAudioProcessor& proc) { proc.readerFactory = move (readerFactory); - auto sound = proc.samplerSound.load(); - sound->setSample (move (sample)); + auto sound = proc.samplerSound; + sound->setSample (std::move (sample)); auto numberOfVoices = proc.synthesiser.getNumVoices(); proc.synthesiser.clearVoices(); @@ -2224,7 +2196,7 @@ public: // Note that all allocation happens here, on the main message thread. Then, // we transfer ownership across to the audio thread. - auto loadedSamplerSound = samplerSound.load(); + auto loadedSamplerSound = samplerSound; std::vector> newSamplerVoices; newSamplerVoices.reserve (maxVoices); @@ -2250,7 +2222,7 @@ public: { pushCommand ([centreFrequency] (SamplerAudioProcessor& proc) { - auto loaded = proc.samplerSound.load(); + auto loaded = proc.samplerSound; if (loaded != nullptr) loaded->setCentreFrequencyInHz (centreFrequency); }); @@ -2260,7 +2232,7 @@ public: { pushCommand ([loopMode] (SamplerAudioProcessor& proc) { - auto loaded = proc.samplerSound.load(); + auto loaded = proc.samplerSound; if (loaded != nullptr) loaded->setLoopMode (loopMode); }); @@ -2270,7 +2242,7 @@ public: { pushCommand ([loopPoints] (SamplerAudioProcessor& proc) { - auto loaded = proc.samplerSound.load(); + auto loaded = proc.samplerSound; if (loaded != nullptr) loaded->setLoopPointsInSeconds (loopPoints); }); @@ -2314,8 +2286,8 @@ public: class SetNumVoicesCommand { public: - SetNumVoicesCommand (std::vector> newVoices) - : newVoices (move (newVoices)) + SetNumVoicesCommand (std::vector> newVoicesIn) + : newVoices (move (newVoicesIn)) {} void operator() (SamplerAudioProcessor& proc) @@ -2332,7 +2304,7 @@ public: }; numberOfVoices = std::min (maxVoices, numberOfVoices); - auto loadedSamplerSound = samplerSound.load(); + auto loadedSamplerSound = samplerSound; std::vector> newSamplerVoices; newSamplerVoices.reserve ((size_t) numberOfVoices); @@ -2361,7 +2333,7 @@ private: public: SamplerAudioProcessorEditor (SamplerAudioProcessor& p, ProcessorState state) : AudioProcessorEditor (&p), - processor (p), + samplerAudioProcessor (p), mainSamplerView (dataModel, [&p] { @@ -2451,33 +2423,33 @@ private: void sampleReaderChanged (std::shared_ptr value) override { - processor.setSample (value == nullptr ? nullptr : value->clone(), - dataModel.getAudioFormatManager()); + samplerAudioProcessor.setSample (value == nullptr ? nullptr : value->clone(), + dataModel.getAudioFormatManager()); } void centreFrequencyHzChanged (double value) override { - processor.setCentreFrequency (value); + samplerAudioProcessor.setCentreFrequency (value); } void loopPointsSecondsChanged (Range value) override { - processor.setLoopPoints (value); + samplerAudioProcessor.setLoopPoints (value); } void loopModeChanged (LoopMode value) override { - processor.setLoopMode (value); + samplerAudioProcessor.setLoopMode (value); } void synthVoicesChanged (int value) override { - processor.setNumberOfVoices (value); + samplerAudioProcessor.setNumberOfVoices (value); } void voiceStealingEnabledChanged (bool value) override { - processor.setVoiceStealingEnabled (value); + samplerAudioProcessor.setVoiceStealingEnabled (value); } void legacyModeEnabledChanged (bool value) override @@ -2510,17 +2482,17 @@ private: void setProcessorLegacyMode() { - processor.setLegacyModeEnabled (mpeSettings.getLegacyPitchbendRange(), - Range (mpeSettings.getLegacyFirstChannel(), - mpeSettings.getLegacyLastChannel())); + samplerAudioProcessor.setLegacyModeEnabled (mpeSettings.getLegacyPitchbendRange(), + Range (mpeSettings.getLegacyFirstChannel(), + mpeSettings.getLegacyLastChannel())); } void setProcessorMPEMode() { - processor.setMPEZoneLayout (mpeSettings.getMPEZoneLayout()); + samplerAudioProcessor.setMPEZoneLayout (mpeSettings.getMPEZoneLayout()); } - SamplerAudioProcessor& processor; + SamplerAudioProcessor& samplerAudioProcessor; AudioFormatManager formatManager; DataModel dataModel { formatManager }; UndoManager undoManager; @@ -2609,7 +2581,7 @@ private: MemoryBlock mb; std::unique_ptr readerFactory; - AtomicSharedPtr samplerSound { std::make_shared() }; + std::shared_ptr samplerSound = std::make_shared(); MPESynthesiser synthesiser; // This mutex is used to ensure we don't modify the processor state during diff --git a/examples/Utilities/InAppPurchasesDemo.h b/examples/Utilities/InAppPurchasesDemo.h index af585a6187..1336974459 100644 --- a/examples/Utilities/InAppPurchasesDemo.h +++ b/examples/Utilities/InAppPurchasesDemo.h @@ -91,7 +91,7 @@ public: VoiceProduct {"jb", "JB", false, false, false, "Retrieving price..." } }); } - ~VoicePurchases() + ~VoicePurchases() override { InAppPurchases::getInstance()->removeListener (this); } @@ -516,7 +516,7 @@ public: #endif } - ~InAppPurchasesDemo() + ~InAppPurchasesDemo() override { dm.closeAudioDevice(); dm.removeAudioCallback (&player); diff --git a/examples/Utilities/PushNotificationsDemo.h b/examples/Utilities/PushNotificationsDemo.h index 7de0da7614..1daf536e6d 100644 --- a/examples/Utilities/PushNotificationsDemo.h +++ b/examples/Utilities/PushNotificationsDemo.h @@ -238,7 +238,7 @@ public: #endif } - ~PushNotificationsDemo() + ~PushNotificationsDemo() override { PushNotifications::getInstance()->removeListener (this); diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 14c4e9a35f..fefa8f7341 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -44,6 +44,7 @@ #pragma clang diagnostic ignored "-Wextra-semi" #pragma clang diagnostic ignored "-Wcast-align" #pragma clang diagnostic ignored "-Wshadow" + #pragma clang diagnostic ignored "-Wswitch-enum" #if __has_warning("-Wzero-as-null-pointer-constant") #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" #endif @@ -1085,16 +1086,19 @@ public: switch (lastTimeStamp.mSMPTETime.mType) { - case kSMPTETimeType2398: info.frameRate = AudioPlayHead::fps23976; break; - case kSMPTETimeType24: info.frameRate = AudioPlayHead::fps24; break; - case kSMPTETimeType25: info.frameRate = AudioPlayHead::fps25; break; - case kSMPTETimeType30Drop: info.frameRate = AudioPlayHead::fps30drop; break; - case kSMPTETimeType30: info.frameRate = AudioPlayHead::fps30; break; - case kSMPTETimeType2997: info.frameRate = AudioPlayHead::fps2997; break; + case kSMPTETimeType2398: info.frameRate = AudioPlayHead::fps23976; break; + case kSMPTETimeType24: info.frameRate = AudioPlayHead::fps24; break; + case kSMPTETimeType25: info.frameRate = AudioPlayHead::fps25; break; + case kSMPTETimeType30Drop: info.frameRate = AudioPlayHead::fps30drop; break; + case kSMPTETimeType30: info.frameRate = AudioPlayHead::fps30; break; + case kSMPTETimeType2997: info.frameRate = AudioPlayHead::fps2997; break; case kSMPTETimeType2997Drop: info.frameRate = AudioPlayHead::fps2997drop; break; - case kSMPTETimeType60: info.frameRate = AudioPlayHead::fps60; break; - case kSMPTETimeType60Drop: info.frameRate = AudioPlayHead::fps60drop; break; - default: info.frameRate = AudioPlayHead::fpsUnknown; break; + case kSMPTETimeType60: info.frameRate = AudioPlayHead::fps60; break; + case kSMPTETimeType60Drop: info.frameRate = AudioPlayHead::fps60drop; break; + case kSMPTETimeType5994: + case kSMPTETimeType5994Drop: + case kSMPTETimeType50: + default: info.frameRate = AudioPlayHead::fpsUnknown; break; } if (CallHostBeatAndTempo (&info.ppqPosition, &info.bpm) != noErr) diff --git a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm index 93cd35d7fa..4921f06bc5 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm @@ -970,16 +970,19 @@ public: switch (lastTimeStamp.mSMPTETime.mType) { - case kSMPTETimeType2398: info.frameRate = AudioPlayHead::fps23976; break; - case kSMPTETimeType24: info.frameRate = AudioPlayHead::fps24; break; - case kSMPTETimeType25: info.frameRate = AudioPlayHead::fps25; break; - case kSMPTETimeType2997: info.frameRate = AudioPlayHead::fps2997; break; + case kSMPTETimeType2398: info.frameRate = AudioPlayHead::fps23976; break; + case kSMPTETimeType24: info.frameRate = AudioPlayHead::fps24; break; + case kSMPTETimeType25: info.frameRate = AudioPlayHead::fps25; break; + case kSMPTETimeType2997: info.frameRate = AudioPlayHead::fps2997; break; case kSMPTETimeType2997Drop: info.frameRate = AudioPlayHead::fps2997drop; break; - case kSMPTETimeType30Drop: info.frameRate = AudioPlayHead::fps30drop; break; - case kSMPTETimeType30: info.frameRate = AudioPlayHead::fps30; break; - case kSMPTETimeType60Drop: info.frameRate = AudioPlayHead::fps60drop; break; - case kSMPTETimeType60: info.frameRate = AudioPlayHead::fps60; break; - default: info.frameRate = AudioPlayHead::fpsUnknown; break; + case kSMPTETimeType30Drop: info.frameRate = AudioPlayHead::fps30drop; break; + case kSMPTETimeType30: info.frameRate = AudioPlayHead::fps30; break; + case kSMPTETimeType60Drop: info.frameRate = AudioPlayHead::fps60drop; break; + case kSMPTETimeType60: info.frameRate = AudioPlayHead::fps60; break; + case kSMPTETimeType5994: + case kSMPTETimeType5994Drop: + case kSMPTETimeType50: + default: info.frameRate = AudioPlayHead::fpsUnknown; break; } double num; @@ -1427,6 +1430,7 @@ private: } break; + case AURenderEventMIDISysEx: default: break; } diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm index 5b83f67116..b8752d9487 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm @@ -39,6 +39,7 @@ #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" #pragma clang diagnostic ignored "-Wshadow-all" #pragma clang diagnostic ignored "-Wcast-align" + #pragma clang diagnostic ignored "-Wswitch-enum" #if __has_warning("-Wzero-as-null-pointer-constant") #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" #endif diff --git a/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp b/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp index 3d66bd0600..0ccbb261be 100644 --- a/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp +++ b/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp @@ -100,7 +100,7 @@ struct InAppPurchases::Pimpl : public SKDelegateAndPaymentObserver [download retain]; } - ~DownloadImpl() + ~DownloadImpl() override { [download release]; } @@ -109,10 +109,10 @@ struct InAppPurchases::Pimpl : public SKDelegateAndPaymentObserver String getContentVersion() const override { return nsStringToJuce (download.contentVersion); } #if JUCE_IOS - int64 getContentLength() const override { return download.contentLength; } + int64 getContentLength() const override { return download.expectedContentLength; } Status getStatus() const override { return SKDownloadStateToDownloadStatus (download.downloadState); } #else - int64 getContentLength() const override { return [download.contentLength longLongValue]; } + int64 getContentLength() const override { return download.expectedContentLength; } Status getStatus() const override { return SKDownloadStateToDownloadStatus (download.state); } #endif @@ -180,7 +180,7 @@ struct InAppPurchases::Pimpl : public SKDelegateAndPaymentObserver //============================================================================== Pimpl (InAppPurchases& p) : owner (p) { [[SKPaymentQueue defaultQueue] addTransactionObserver: delegate.get()]; } - ~Pimpl() noexcept { [[SKPaymentQueue defaultQueue] removeTransactionObserver: delegate.get()]; } + ~Pimpl() noexcept override { [[SKPaymentQueue defaultQueue] removeTransactionObserver: delegate.get()]; } //============================================================================== bool isInAppPurchasesSupported() const { return true; } @@ -567,7 +567,8 @@ struct InAppPurchases::Pimpl : public SKDelegateAndPaymentObserver #endif // TODO: use juce URL here - auto storeRequest = [NSMutableURLRequest requestWithURL: [NSURL URLWithString: nsStringLiteral (storeURL)]]; + auto* urlPtr = [NSURL URLWithString: nsStringLiteral (storeURL)]; + auto storeRequest = [NSMutableURLRequest requestWithURL: urlPtr]; [storeRequest setHTTPMethod: nsStringLiteral ("POST")]; [storeRequest setHTTPBody: requestData];