Browse Source

Convert ignoreUnused to [[maybe_unused]]

v7.0.9
reuk 2 years ago
parent
commit
28f2157912
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
100 changed files with 811 additions and 872 deletions
  1. +31
    -0
      modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.cpp
  2. +4
    -4
      modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h
  3. +5
    -12
      modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp
  4. +3
    -0
      modules/juce_audio_basics/juce_audio_basics.cpp
  5. +37
    -0
      modules/juce_audio_basics/midi/ump/juce_UMPIterator.cpp
  6. +3
    -10
      modules/juce_audio_basics/midi/ump/juce_UMPIterator.h
  7. +8
    -0
      modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp
  8. +7
    -7
      modules/juce_audio_basics/mpe/juce_MPEInstrument.h
  9. +28
    -0
      modules/juce_audio_basics/sources/juce_PositionableAudioSource.cpp
  10. +1
    -1
      modules/juce_audio_basics/sources/juce_PositionableAudioSource.h
  11. +3
    -4
      modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp
  12. +8
    -0
      modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp
  13. +1
    -5
      modules/juce_audio_devices/audio_io/juce_AudioIODevice.h
  14. +6
    -0
      modules/juce_audio_devices/midi_io/juce_MidiDevices.cpp
  15. +1
    -4
      modules/juce_audio_devices/midi_io/juce_MidiDevices.h
  16. +14
    -24
      modules/juce_audio_devices/native/juce_android_Oboe.cpp
  17. +28
    -35
      modules/juce_audio_devices/native/juce_ios_Audio.cpp
  18. +2
    -4
      modules/juce_audio_devices/native/juce_linux_JackAudio.cpp
  19. +1
    -2
      modules/juce_audio_devices/native/juce_mac_CoreMidi.mm
  20. +4
    -4
      modules/juce_audio_devices/native/juce_win32_DirectSound.cpp
  21. +1
    -2
      modules/juce_audio_devices/native/juce_win32_WASAPI.cpp
  22. +1
    -3
      modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp
  23. +1
    -2
      modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp
  24. +1
    -2
      modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp
  25. +2
    -2
      modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp
  26. +1
    -1
      modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp
  27. +2
    -4
      modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
  28. +11
    -17
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  29. +4
    -11
      modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm
  30. +1
    -2
      modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h
  31. +1
    -4
      modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp
  32. +3
    -9
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
  33. +7
    -12
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm
  34. +6
    -7
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  35. +4
    -3
      modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp
  36. +1
    -3
      modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp
  37. +9
    -15
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  38. +1
    -3
      modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp
  39. +3
    -8
      modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp
  40. +11
    -17
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  41. +1
    -3
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  42. +1
    -0
      modules/juce_audio_processors/juce_audio_processors.cpp
  43. +9
    -14
      modules/juce_audio_processors/processors/juce_AudioProcessor.cpp
  44. +2
    -2
      modules/juce_audio_processors/processors/juce_AudioProcessor.h
  45. +2
    -4
      modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp
  46. +30
    -46
      modules/juce_audio_processors/utilities/ARA/juce_ARADocumentController.cpp
  47. +94
    -0
      modules/juce_audio_processors/utilities/ARA/juce_ARAModelObjects.cpp
  48. +57
    -228
      modules/juce_audio_processors/utilities/ARA/juce_ARAModelObjects.h
  49. +27
    -5
      modules/juce_audio_processors/utilities/ARA/juce_ARAPlugInInstanceRoles.cpp
  50. +7
    -28
      modules/juce_audio_processors/utilities/ARA/juce_ARAPlugInInstanceRoles.h
  51. +6
    -14
      modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h
  52. +2
    -5
      modules/juce_audio_processors/utilities/juce_PluginHostType.cpp
  53. +39
    -0
      modules/juce_audio_processors/utilities/juce_VSTCallbackHandler.cpp
  54. +2
    -9
      modules/juce_audio_processors/utilities/juce_VSTCallbackHandler.h
  55. +5
    -0
      modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp
  56. +3
    -3
      modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h
  57. +1
    -2
      modules/juce_audio_utils/native/juce_mac_AudioCDReader.mm
  58. +41
    -34
      modules/juce_core/containers/juce_Array.h
  59. +2
    -2
      modules/juce_core/containers/juce_ArrayBase.h
  60. +1
    -4
      modules/juce_core/containers/juce_ElementComparator.h
  61. +56
    -51
      modules/juce_core/containers/juce_OwnedArray.h
  62. +41
    -35
      modules/juce_core/containers/juce_ReferenceCountedArray.h
  63. +1
    -2
      modules/juce_core/files/juce_File.cpp
  64. +3
    -3
      modules/juce_core/javascript/juce_Javascript.cpp
  65. +1
    -2
      modules/juce_core/maths/juce_Expression.cpp
  66. +1
    -1
      modules/juce_core/memory/juce_ContainerDeletePolicy.h
  67. +5
    -12
      modules/juce_core/native/juce_android_AndroidDocument.cpp
  68. +1
    -3
      modules/juce_core/native/juce_mac_Files.mm
  69. +7
    -11
      modules/juce_core/native/juce_mac_Network.mm
  70. +4
    -4
      modules/juce_core/native/juce_mac_ObjCHelpers.h
  71. +1
    -2
      modules/juce_core/native/juce_posix_NamedPipe.cpp
  72. +3
    -6
      modules/juce_core/native/juce_posix_SharedCode.h
  73. +1
    -1
      modules/juce_core/native/juce_win32_Files.cpp
  74. +1
    -2
      modules/juce_core/native/juce_win32_SystemStats.cpp
  75. +1
    -3
      modules/juce_core/native/juce_win32_Threads.cpp
  76. +7
    -8
      modules/juce_core/network/juce_Socket.cpp
  77. +2
    -4
      modules/juce_core/network/juce_URL.cpp
  78. +7
    -0
      modules/juce_core/network/juce_WebInputStream.cpp
  79. +1
    -5
      modules/juce_core/network/juce_WebInputStream.h
  80. +1
    -2
      modules/juce_core/system/juce_StandardHeader.h
  81. +1
    -2
      modules/juce_cryptography/encryption/juce_BlowFish.cpp
  82. +1
    -0
      modules/juce_data_structures/juce_data_structures.cpp
  83. +31
    -0
      modules/juce_data_structures/undomanager/juce_UndoableAction.cpp
  84. +1
    -1
      modules/juce_data_structures/undomanager/juce_UndoableAction.h
  85. +2
    -3
      modules/juce_dsp/containers/juce_FixedSizeFunction.h
  86. +2
    -2
      modules/juce_dsp/containers/juce_FixedSizeFunction_test.cpp
  87. +3
    -3
      modules/juce_dsp/juce_dsp.h
  88. +2
    -4
      modules/juce_events/native/juce_linux_Messaging.cpp
  89. +1
    -1
      modules/juce_events/native/juce_win32_Messaging.cpp
  90. +2
    -2
      modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp
  91. +4
    -9
      modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp
  92. +2
    -4
      modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp
  93. +1
    -2
      modules/juce_graphics/native/juce_win32_Fonts.cpp
  94. +5
    -13
      modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp
  95. +1
    -2
      modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp
  96. +1
    -3
      modules/juce_gui_basics/layout/juce_SidePanel.cpp
  97. +1
    -2
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp
  98. +5
    -11
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp
  99. +1
    -2
      modules/juce_gui_basics/menus/juce_PopupMenu.cpp
  100. +1
    -3
      modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp

+ 31
- 0
modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.cpp View File

@@ -0,0 +1,31 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
bool AudioPlayHead::canControlTransport() { return false; }
void AudioPlayHead::transportPlay ([[maybe_unused]] bool shouldStartPlaying) {}
void AudioPlayHead::transportRecord ([[maybe_unused]] bool shouldStartRecording) {}
void AudioPlayHead::transportRewind() {}
} // namespace juce

+ 4
- 4
modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h View File

@@ -578,16 +578,16 @@ public:
virtual Optional<PositionInfo> getPosition() const = 0; virtual Optional<PositionInfo> getPosition() const = 0;
/** Returns true if this object can control the transport. */ /** Returns true if this object can control the transport. */
virtual bool canControlTransport() { return false; }
virtual bool canControlTransport();
/** Starts or stops the audio. */ /** Starts or stops the audio. */
virtual void transportPlay (bool shouldStartPlaying) { ignoreUnused (shouldStartPlaying); }
virtual void transportPlay (bool shouldStartPlaying);
/** Starts or stops recording the audio. */ /** Starts or stops recording the audio. */
virtual void transportRecord (bool shouldStartRecording) { ignoreUnused (shouldStartRecording); }
virtual void transportRecord (bool shouldStartRecording);
/** Rewinds the audio. */ /** Rewinds the audio. */
virtual void transportRewind() {}
virtual void transportRewind();
}; };
} // namespace juce } // namespace juce

+ 5
- 12
modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp View File

@@ -938,15 +938,13 @@ namespace
#if JUCE_USE_VDSP_FRAMEWORK #if JUCE_USE_VDSP_FRAMEWORK
vDSP_vabs ((float*) src, 1, dest, 1, (vDSP_Length) num); vDSP_vabs ((float*) src, 1, dest, 1, (vDSP_Length) num);
#else #else
FloatVectorHelpers::signMask32 signMask;
[[maybe_unused]] FloatVectorHelpers::signMask32 signMask;
signMask.i = 0x7fffffffUL; signMask.i = 0x7fffffffUL;
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = std::abs (src[i]), JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = std::abs (src[i]),
Mode::bit_and (s, mask), Mode::bit_and (s, mask),
JUCE_LOAD_SRC, JUCE_LOAD_SRC,
JUCE_INCREMENT_SRC_DEST, JUCE_INCREMENT_SRC_DEST,
const Mode::ParallelType mask = Mode::load1 (signMask.f);) const Mode::ParallelType mask = Mode::load1 (signMask.f);)
ignoreUnused (signMask);
#endif #endif
} }
@@ -956,7 +954,7 @@ namespace
#if JUCE_USE_VDSP_FRAMEWORK #if JUCE_USE_VDSP_FRAMEWORK
vDSP_vabsD ((double*) src, 1, dest, 1, (vDSP_Length) num); vDSP_vabsD ((double*) src, 1, dest, 1, (vDSP_Length) num);
#else #else
FloatVectorHelpers::signMask64 signMask;
[[maybe_unused]] FloatVectorHelpers::signMask64 signMask;
signMask.i = 0x7fffffffffffffffULL; signMask.i = 0x7fffffffffffffffULL;
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = std::abs (src[i]), JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = std::abs (src[i]),
@@ -964,8 +962,6 @@ namespace
JUCE_LOAD_SRC, JUCE_LOAD_SRC,
JUCE_INCREMENT_SRC_DEST, JUCE_INCREMENT_SRC_DEST,
const Mode::ParallelType mask = Mode::load1 (signMask.d);) const Mode::ParallelType mask = Mode::load1 (signMask.d);)
ignoreUnused (signMask);
#endif #endif
} }
@@ -1456,7 +1452,7 @@ intptr_t JUCE_CALLTYPE FloatVectorOperations::getFpStatusRegister() noexcept
return fpsr; return fpsr;
} }
void JUCE_CALLTYPE FloatVectorOperations::setFpStatusRegister (intptr_t fpsr) noexcept
void JUCE_CALLTYPE FloatVectorOperations::setFpStatusRegister ([[maybe_unused]] intptr_t fpsr) noexcept
{ {
#if JUCE_INTEL && JUCE_USE_SSE_INTRINSICS #if JUCE_INTEL && JUCE_USE_SSE_INTRINSICS
// the volatile keyword here is needed to workaround a bug in AppleClang 13.0 // the volatile keyword here is needed to workaround a bug in AppleClang 13.0
@@ -1481,11 +1477,10 @@ void JUCE_CALLTYPE FloatVectorOperations::setFpStatusRegister (intptr_t fpsr) no
#if ! (defined (JUCE_INTEL) || defined (JUCE_ARM)) #if ! (defined (JUCE_INTEL) || defined (JUCE_ARM))
jassertfalse; // No support for getting the floating point status register for your platform jassertfalse; // No support for getting the floating point status register for your platform
#endif #endif
ignoreUnused (fpsr);
#endif #endif
} }
void JUCE_CALLTYPE FloatVectorOperations::enableFlushToZeroMode (bool shouldEnable) noexcept
void JUCE_CALLTYPE FloatVectorOperations::enableFlushToZeroMode ([[maybe_unused]] bool shouldEnable) noexcept
{ {
#if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || (JUCE_64BIT && JUCE_ARM)) #if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || (JUCE_64BIT && JUCE_ARM))
#if JUCE_USE_SSE_INTRINSICS #if JUCE_USE_SSE_INTRINSICS
@@ -1498,11 +1493,10 @@ void JUCE_CALLTYPE FloatVectorOperations::enableFlushToZeroMode (bool shouldEnab
#if ! (defined (JUCE_INTEL) || defined (JUCE_ARM)) #if ! (defined (JUCE_INTEL) || defined (JUCE_ARM))
jassertfalse; // No support for flush to zero mode on your platform jassertfalse; // No support for flush to zero mode on your platform
#endif #endif
ignoreUnused (shouldEnable);
#endif #endif
} }
void JUCE_CALLTYPE FloatVectorOperations::disableDenormalisedNumberSupport (bool shouldDisable) noexcept
void JUCE_CALLTYPE FloatVectorOperations::disableDenormalisedNumberSupport ([[maybe_unused]] bool shouldDisable) noexcept
{ {
#if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || (JUCE_64BIT && JUCE_ARM)) #if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || (JUCE_64BIT && JUCE_ARM))
#if JUCE_USE_SSE_INTRINSICS #if JUCE_USE_SSE_INTRINSICS
@@ -1513,7 +1507,6 @@ void JUCE_CALLTYPE FloatVectorOperations::disableDenormalisedNumberSupport (bool
setFpStatusRegister ((getFpStatusRegister() & (~mask)) | (shouldDisable ? mask : 0)); setFpStatusRegister ((getFpStatusRegister() & (~mask)) | (shouldDisable ? mask : 0));
#else #else
ignoreUnused (shouldDisable);
#if ! (defined (JUCE_INTEL) || defined (JUCE_ARM)) #if ! (defined (JUCE_INTEL) || defined (JUCE_ARM))
jassertfalse; // No support for disable denormals mode on your platform jassertfalse; // No support for disable denormals mode on your platform


+ 3
- 0
modules/juce_audio_basics/juce_audio_basics.cpp View File

@@ -85,13 +85,16 @@
#include "sources/juce_ResamplingAudioSource.cpp" #include "sources/juce_ResamplingAudioSource.cpp"
#include "sources/juce_ReverbAudioSource.cpp" #include "sources/juce_ReverbAudioSource.cpp"
#include "sources/juce_ToneGeneratorAudioSource.cpp" #include "sources/juce_ToneGeneratorAudioSource.cpp"
#include "sources/juce_PositionableAudioSource.cpp"
#include "synthesisers/juce_Synthesiser.cpp" #include "synthesisers/juce_Synthesiser.cpp"
#include "audio_play_head/juce_AudioPlayHead.cpp"
#include "midi/ump/juce_UMP.h" #include "midi/ump/juce_UMP.h"
#include "midi/ump/juce_UMPUtils.cpp" #include "midi/ump/juce_UMPUtils.cpp"
#include "midi/ump/juce_UMPView.cpp" #include "midi/ump/juce_UMPView.cpp"
#include "midi/ump/juce_UMPSysEx7.cpp" #include "midi/ump/juce_UMPSysEx7.cpp"
#include "midi/ump/juce_UMPMidi1ToMidi2DefaultTranslator.cpp" #include "midi/ump/juce_UMPMidi1ToMidi2DefaultTranslator.cpp"
#include "midi/ump/juce_UMPIterator.cpp"
#if JUCE_UNIT_TESTS #if JUCE_UNIT_TESTS
#include "utilities/juce_ADSR_test.cpp" #include "utilities/juce_ADSR_test.cpp"


+ 37
- 0
modules/juce_audio_basics/midi/ump/juce_UMPIterator.cpp View File

@@ -0,0 +1,37 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
namespace universal_midi_packets
{
Iterator::Iterator (const uint32_t* ptr, [[maybe_unused]] size_t bytes) noexcept
: view (ptr)
#if JUCE_DEBUG
, bytesRemaining (bytes)
#endif
{
}
} // namespace universal_midi_packets
} // namespace juce

+ 3
- 10
modules/juce_audio_basics/midi/ump/juce_UMPIterator.h View File

@@ -43,14 +43,7 @@ public:
Iterator() noexcept = default; Iterator() noexcept = default;
/** Creates an iterator pointing at `ptr`. */ /** Creates an iterator pointing at `ptr`. */
explicit Iterator (const uint32_t* ptr, size_t bytes) noexcept
: view (ptr)
#if JUCE_DEBUG
, bytesRemaining (bytes)
#endif
{
ignoreUnused (bytes);
}
explicit Iterator (const uint32_t* ptr, size_t bytes) noexcept;
using difference_type = std::iterator_traits<const uint32_t*>::difference_type; using difference_type = std::iterator_traits<const uint32_t*>::difference_type;
using value_type = View; using value_type = View;
@@ -124,7 +117,7 @@ private:
#endif #endif
}; };
}
}
} // namespace universal_midi_packets
} // namespace juce
#endif #endif

+ 8
- 0
modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp View File

@@ -853,6 +853,14 @@ void MPEInstrument::releaseAllNotes()
notes.clear(); notes.clear();
} }
//==============================================================================
void MPEInstrument::Listener::noteAdded ([[maybe_unused]] MPENote newNote) {}
void MPEInstrument::Listener::notePressureChanged ([[maybe_unused]] MPENote changedNote) {}
void MPEInstrument::Listener::notePitchbendChanged ([[maybe_unused]] MPENote changedNote) {}
void MPEInstrument::Listener::noteTimbreChanged ([[maybe_unused]] MPENote changedNote) {}
void MPEInstrument::Listener::noteKeyStateChanged ([[maybe_unused]] MPENote changedNote) {}
void MPEInstrument::Listener::noteReleased ([[maybe_unused]] MPENote finishedNote) {}
void MPEInstrument::Listener::zoneLayoutChanged() {}
//============================================================================== //==============================================================================
//============================================================================== //==============================================================================


+ 7
- 7
modules/juce_audio_basics/mpe/juce_MPEInstrument.h View File

@@ -265,12 +265,12 @@ public:
/** Implement this callback to be informed whenever a new expressive MIDI /** Implement this callback to be informed whenever a new expressive MIDI
note is triggered. note is triggered.
*/ */
virtual void noteAdded (MPENote newNote) { ignoreUnused (newNote); }
virtual void noteAdded (MPENote newNote);
/** Implement this callback to be informed whenever a currently playing /** Implement this callback to be informed whenever a currently playing
MPE note's pressure value changes. MPE note's pressure value changes.
*/ */
virtual void notePressureChanged (MPENote changedNote) { ignoreUnused (changedNote); }
virtual void notePressureChanged (MPENote changedNote);
/** Implement this callback to be informed whenever a currently playing /** Implement this callback to be informed whenever a currently playing
MPE note's pitchbend value changes. MPE note's pitchbend value changes.
@@ -279,12 +279,12 @@ public:
master channel pitchbend event, or if both occur simultaneously. master channel pitchbend event, or if both occur simultaneously.
Call MPENote::getFrequencyInHertz to get the effective note frequency. Call MPENote::getFrequencyInHertz to get the effective note frequency.
*/ */
virtual void notePitchbendChanged (MPENote changedNote) { ignoreUnused (changedNote); }
virtual void notePitchbendChanged (MPENote changedNote);
/** Implement this callback to be informed whenever a currently playing /** Implement this callback to be informed whenever a currently playing
MPE note's timbre value changes. MPE note's timbre value changes.
*/ */
virtual void noteTimbreChanged (MPENote changedNote) { ignoreUnused (changedNote); }
virtual void noteTimbreChanged (MPENote changedNote);
/** Implement this callback to be informed whether a currently playing /** Implement this callback to be informed whether a currently playing
MPE note's key state (whether the key is down and/or the note is MPE note's key state (whether the key is down and/or the note is
@@ -293,19 +293,19 @@ public:
Note: If the key state changes to MPENote::off, noteReleased is Note: If the key state changes to MPENote::off, noteReleased is
called instead. called instead.
*/ */
virtual void noteKeyStateChanged (MPENote changedNote) { ignoreUnused (changedNote); }
virtual void noteKeyStateChanged (MPENote changedNote);
/** Implement this callback to be informed whenever an MPE note /** Implement this callback to be informed whenever an MPE note
is released (either by a note-off message, or by a sustain/sostenuto is released (either by a note-off message, or by a sustain/sostenuto
pedal release for a note that already received a note-off), pedal release for a note that already received a note-off),
and should therefore stop playing. and should therefore stop playing.
*/ */
virtual void noteReleased (MPENote finishedNote) { ignoreUnused (finishedNote); }
virtual void noteReleased (MPENote finishedNote);
/** Implement this callback to be informed whenever the MPE zone layout /** Implement this callback to be informed whenever the MPE zone layout
or legacy mode settings of this instrument have been changed. or legacy mode settings of this instrument have been changed.
*/ */
virtual void zoneLayoutChanged() {}
virtual void zoneLayoutChanged();
}; };
//============================================================================== //==============================================================================


+ 28
- 0
modules/juce_audio_basics/sources/juce_PositionableAudioSource.cpp View File

@@ -0,0 +1,28 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
void PositionableAudioSource::setLooping ([[maybe_unused]] bool shouldLoop) {}
} // namespace juce

+ 1
- 1
modules/juce_audio_basics/sources/juce_PositionableAudioSource.h View File

@@ -70,7 +70,7 @@ public:
virtual bool isLooping() const = 0; virtual bool isLooping() const = 0;
/** Tells the source whether you'd like it to play in a loop. */ /** Tells the source whether you'd like it to play in a loop. */
virtual void setLooping (bool shouldLoop) { ignoreUnused (shouldLoop); }
virtual void setLooping (bool shouldLoop);
}; };
} // namespace juce } // namespace juce

+ 3
- 4
modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp View File

@@ -482,15 +482,14 @@ void Synthesiser::handleSostenutoPedal (int midiChannel, bool isDown)
} }
} }
void Synthesiser::handleSoftPedal (int midiChannel, bool /*isDown*/)
void Synthesiser::handleSoftPedal ([[maybe_unused]] int midiChannel, bool /*isDown*/)
{ {
ignoreUnused (midiChannel);
jassert (midiChannel > 0 && midiChannel <= 16); jassert (midiChannel > 0 && midiChannel <= 16);
} }
void Synthesiser::handleProgramChange (int midiChannel, int programNumber)
void Synthesiser::handleProgramChange ([[maybe_unused]] int midiChannel,
[[maybe_unused]] int programNumber)
{ {
ignoreUnused (midiChannel, programNumber);
jassert (midiChannel > 0 && midiChannel <= 16); jassert (midiChannel > 0 && midiChannel <= 16);
} }


+ 8
- 0
modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp View File

@@ -23,6 +23,14 @@
namespace juce namespace juce
{ {
void AudioIODeviceCallback::audioDeviceIOCallbackWithContext ([[maybe_unused]] const float* const* inputChannelData,
[[maybe_unused]] int numInputChannels,
[[maybe_unused]] float* const* outputChannelData,
[[maybe_unused]] int numOutputChannels,
[[maybe_unused]] int numSamples,
[[maybe_unused]] const AudioIODeviceCallbackContext& context) {}
//==============================================================================
AudioIODevice::AudioIODevice (const String& deviceName, const String& deviceTypeName) AudioIODevice::AudioIODevice (const String& deviceName, const String& deviceTypeName)
: name (deviceName), typeName (deviceTypeName) : name (deviceName), typeName (deviceTypeName)
{ {


+ 1
- 5
modules/juce_audio_devices/audio_io/juce_AudioIODevice.h View File

@@ -98,10 +98,7 @@ public:
float* const* outputChannelData, float* const* outputChannelData,
int numOutputChannels, int numOutputChannels,
int numSamples, int numSamples,
const AudioIODeviceCallbackContext& context)
{
ignoreUnused (inputChannelData, numInputChannels, outputChannelData, numOutputChannels, numSamples, context);
}
const AudioIODeviceCallbackContext& context);
/** Called to indicate that the device is about to start calling back. /** Called to indicate that the device is about to start calling back.
@@ -129,7 +126,6 @@ public:
virtual void audioDeviceError (const String& errorMessage); virtual void audioDeviceError (const String& errorMessage);
}; };
//============================================================================== //==============================================================================
/** /**
Base class for an audio device with synchronised input and output channels. Base class for an audio device with synchronised input and output channels.


+ 6
- 0
modules/juce_audio_devices/midi_io/juce_MidiDevices.cpp View File

@@ -23,6 +23,12 @@
namespace juce namespace juce
{ {
void MidiInputCallback::handlePartialSysexMessage ([[maybe_unused]] MidiInput* source,
[[maybe_unused]] const uint8* messageData,
[[maybe_unused]] int numBytesSoFar,
[[maybe_unused]] double timestamp) {}
//==============================================================================
MidiOutput::MidiOutput (const String& deviceName, const String& deviceIdentifier) MidiOutput::MidiOutput (const String& deviceName, const String& deviceIdentifier)
: Thread ("midi out"), deviceInfo (deviceName, deviceIdentifier) : Thread ("midi out"), deviceInfo (deviceName, deviceIdentifier)
{ {


+ 1
- 4
modules/juce_audio_devices/midi_io/juce_MidiDevices.h View File

@@ -225,10 +225,7 @@ public:
virtual void handlePartialSysexMessage (MidiInput* source, virtual void handlePartialSysexMessage (MidiInput* source,
const uint8* messageData, const uint8* messageData,
int numBytesSoFar, int numBytesSoFar,
double timestamp)
{
ignoreUnused (source, messageData, numBytesSoFar, timestamp);
}
double timestamp);
}; };
//============================================================================== //==============================================================================


+ 14
- 24
modules/juce_audio_devices/native/juce_android_Oboe.cpp View File

@@ -596,8 +596,7 @@ private:
{ {
if (stream != nullptr) if (stream != nullptr)
{ {
oboe::Result result = stream->close();
ignoreUnused (result);
[[maybe_unused]] oboe::Result result = stream->close();
JUCE_OBOE_LOG ("Requested Oboe stream close with result: " + getOboeString (result)); JUCE_OBOE_LOG ("Requested Oboe stream close with result: " + getOboeString (result));
} }
} }
@@ -693,14 +692,15 @@ private:
} }
// Not strictly required as these should not change, but recommended by Google anyway // Not strictly required as these should not change, but recommended by Google anyway
void checkStreamSetup (OboeStream* stream, int deviceId, int numChannels, int expectedSampleRate,
int expectedBufferSize, oboe::AudioFormat format)
void checkStreamSetup (OboeStream* stream,
[[maybe_unused]] int deviceId,
[[maybe_unused]] int numChannels,
[[maybe_unused]] int expectedSampleRate,
[[maybe_unused]] int expectedBufferSize,
oboe::AudioFormat format)
{ {
if (auto* nativeStream = stream != nullptr ? stream->getNativeStream() : nullptr)
if ([[maybe_unused]] auto* nativeStream = stream != nullptr ? stream->getNativeStream() : nullptr)
{ {
ignoreUnused (deviceId, numChannels, sampleRate, expectedBufferSize);
ignoreUnused (streamFormat, bitDepth);
jassert (numChannels == 0 || numChannels == nativeStream->getChannelCount()); jassert (numChannels == 0 || numChannels == nativeStream->getChannelCount());
jassert (expectedSampleRate == 0 || expectedSampleRate == nativeStream->getSampleRate()); jassert (expectedSampleRate == 0 || expectedSampleRate == nativeStream->getSampleRate());
jassert (format == nativeStream->getFormat()); jassert (format == nativeStream->getFormat());
@@ -860,10 +860,8 @@ private:
return oboe::DataCallbackResult::Continue; return oboe::DataCallbackResult::Continue;
} }
void printStreamDebugInfo (oboe::AudioStream* stream)
void printStreamDebugInfo ([[maybe_unused]] oboe::AudioStream* stream)
{ {
ignoreUnused (stream);
JUCE_OBOE_LOG ("\nUses AAudio = " + (stream != nullptr ? String ((int) stream->usesAAudio()) : String ("?")) JUCE_OBOE_LOG ("\nUses AAudio = " + (stream != nullptr ? String ((int) stream->usesAAudio()) : String ("?"))
+ "\nDirection = " + (stream != nullptr ? getOboeString (stream->getDirection()) : String ("?")) + "\nDirection = " + (stream != nullptr ? getOboeString (stream->getDirection()) : String ("?"))
+ "\nSharingMode = " + (stream != nullptr ? getOboeString (stream->getSharingMode()) : String ("?")) + "\nSharingMode = " + (stream != nullptr ? getOboeString (stream->getSharingMode()) : String ("?"))
@@ -928,10 +926,8 @@ private:
return time.tv_sec * oboe::kNanosPerSecond + time.tv_nsec; return time.tv_sec * oboe::kNanosPerSecond + time.tv_nsec;
} }
void onErrorBeforeClose (oboe::AudioStream* stream, oboe::Result error) override
void onErrorBeforeClose (oboe::AudioStream* stream, [[maybe_unused]] oboe::Result error) override
{ {
ignoreUnused (error);
// only output stream should be the master stream receiving callbacks // only output stream should be the master stream receiving callbacks
jassert (stream->getDirection() == oboe::Direction::Output); jassert (stream->getDirection() == oboe::Direction::Output);
@@ -1167,10 +1163,8 @@ public:
JUCE_OBOE_LOG ("-----InputDevices:"); JUCE_OBOE_LOG ("-----InputDevices:");
for (auto& device : inputDevices)
for ([[maybe_unused]] auto& device : inputDevices)
{ {
ignoreUnused (device);
JUCE_OBOE_LOG ("name = " << device.name); JUCE_OBOE_LOG ("name = " << device.name);
JUCE_OBOE_LOG ("id = " << String (device.id)); JUCE_OBOE_LOG ("id = " << String (device.id));
JUCE_OBOE_LOG ("sample rates size = " << String (device.sampleRates.size())); JUCE_OBOE_LOG ("sample rates size = " << String (device.sampleRates.size()));
@@ -1179,10 +1173,8 @@ public:
JUCE_OBOE_LOG ("-----OutputDevices:"); JUCE_OBOE_LOG ("-----OutputDevices:");
for (auto& device : outputDevices)
for ([[maybe_unused]] auto& device : outputDevices)
{ {
ignoreUnused (device);
JUCE_OBOE_LOG ("name = " << device.name); JUCE_OBOE_LOG ("name = " << device.name);
JUCE_OBOE_LOG ("id = " << String (device.id)); JUCE_OBOE_LOG ("id = " << String (device.id));
JUCE_OBOE_LOG ("sample rates size = " << String (device.sampleRates.size())); JUCE_OBOE_LOG ("sample rates size = " << String (device.sampleRates.size()));
@@ -1392,17 +1384,15 @@ public:
return oboe::DataCallbackResult::Continue; return oboe::DataCallbackResult::Continue;
} }
void onErrorBeforeClose (oboe::AudioStream*, oboe::Result error) override
void onErrorBeforeClose (oboe::AudioStream*, [[maybe_unused]] oboe::Result error) override
{ {
JUCE_OBOE_LOG ("OboeRealtimeThread: Oboe stream onErrorBeforeClose(): " + getOboeString (error)); JUCE_OBOE_LOG ("OboeRealtimeThread: Oboe stream onErrorBeforeClose(): " + getOboeString (error));
ignoreUnused (error);
jassertfalse; // Should never get here! jassertfalse; // Should never get here!
} }
void onErrorAfterClose (oboe::AudioStream*, oboe::Result error) override
void onErrorAfterClose (oboe::AudioStream*, [[maybe_unused]] oboe::Result error) override
{ {
JUCE_OBOE_LOG ("OboeRealtimeThread: Oboe stream onErrorAfterClose(): " + getOboeString (error)); JUCE_OBOE_LOG ("OboeRealtimeThread: Oboe stream onErrorAfterClose(): " + getOboeString (error));
ignoreUnused (error);
jassertfalse; // Should never get here! jassertfalse; // Should never get here!
} }


+ 28
- 35
modules/juce_audio_devices/native/juce_ios_Audio.cpp View File

@@ -579,16 +579,15 @@ struct iOSAudioIODevice::Pimpl : public AsyncUpdater
impl.fillHostCallbackInfo (callbackInfo); impl.fillHostCallbackInfo (callbackInfo);
Boolean hostIsPlaying = NO; Boolean hostIsPlaying = NO;
OSStatus err = callbackInfo.transportStateProc2 (callbackInfo.hostUserData,
&hostIsPlaying,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr);
[[maybe_unused]] OSStatus err = callbackInfo.transportStateProc2 (callbackInfo.hostUserData,
&hostIsPlaying,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr);
ignoreUnused (err);
jassert (err == noErr); jassert (err == noErr);
if (hostIsPlaying != shouldSartPlaying) if (hostIsPlaying != shouldSartPlaying)
@@ -604,15 +603,14 @@ struct iOSAudioIODevice::Pimpl : public AsyncUpdater
impl.fillHostCallbackInfo (callbackInfo); impl.fillHostCallbackInfo (callbackInfo);
Boolean hostIsRecording = NO; Boolean hostIsRecording = NO;
OSStatus err = callbackInfo.transportStateProc2 (callbackInfo.hostUserData,
nullptr,
&hostIsRecording,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr);
ignoreUnused (err);
[[maybe_unused]] OSStatus err = callbackInfo.transportStateProc2 (callbackInfo.hostUserData,
nullptr,
&hostIsRecording,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr);
jassert (err == noErr); jassert (err == noErr);
if (hostIsRecording != shouldStartRecording) if (hostIsRecording != shouldStartRecording)
@@ -808,11 +806,9 @@ struct iOSAudioIODevice::Pimpl : public AsyncUpdater
void handleAudioUnitPropertyChange (AudioUnit, void handleAudioUnitPropertyChange (AudioUnit,
AudioUnitPropertyID propertyID, AudioUnitPropertyID propertyID,
AudioUnitScope scope,
AudioUnitElement element)
[[maybe_unused]] AudioUnitScope scope,
[[maybe_unused]] AudioUnitElement element)
{ {
ignoreUnused (scope);
ignoreUnused (element);
JUCE_IOS_AUDIO_LOG ("handleAudioUnitPropertyChange: propertyID: " << String (propertyID) JUCE_IOS_AUDIO_LOG ("handleAudioUnitPropertyChange: propertyID: " << String (propertyID)
<< " scope: " << String (scope) << " scope: " << String (scope)
<< " element: " << String (element)); << " element: " << String (element));
@@ -834,9 +830,8 @@ struct iOSAudioIODevice::Pimpl : public AsyncUpdater
{ {
UInt32 connected; UInt32 connected;
UInt32 dataSize = sizeof (connected); UInt32 dataSize = sizeof (connected);
OSStatus err = AudioUnitGetProperty (audioUnit, kAudioUnitProperty_IsInterAppConnected,
kAudioUnitScope_Global, 0, &connected, &dataSize);
ignoreUnused (err);
[[maybe_unused]] OSStatus err = AudioUnitGetProperty (audioUnit, kAudioUnitProperty_IsInterAppConnected,
kAudioUnitScope_Global, 0, &connected, &dataSize);
jassert (err == noErr); jassert (err == noErr);
JUCE_IOS_AUDIO_LOG ("handleInterAppAudioConnectionChange: " << (connected ? "connected" JUCE_IOS_AUDIO_LOG ("handleInterAppAudioConnectionChange: " << (connected ? "connected"
@@ -1078,21 +1073,19 @@ struct iOSAudioIODevice::Pimpl : public AsyncUpdater
{ {
zerostruct (callbackInfo); zerostruct (callbackInfo);
UInt32 dataSize = sizeof (HostCallbackInfo); UInt32 dataSize = sizeof (HostCallbackInfo);
OSStatus err = AudioUnitGetProperty (audioUnit,
kAudioUnitProperty_HostCallbacks,
kAudioUnitScope_Global,
0,
&callbackInfo,
&dataSize);
ignoreUnused (err);
[[maybe_unused]] OSStatus err = AudioUnitGetProperty (audioUnit,
kAudioUnitProperty_HostCallbacks,
kAudioUnitScope_Global,
0,
&callbackInfo,
&dataSize);
jassert (err == noErr); jassert (err == noErr);
} }
void handleAudioTransportEvent (AudioUnitRemoteControlEvent event) void handleAudioTransportEvent (AudioUnitRemoteControlEvent event)
{ {
OSStatus err = AudioUnitSetProperty (audioUnit, kAudioOutputUnitProperty_RemoteControlToHost,
kAudioUnitScope_Global, 0, &event, sizeof (event));
ignoreUnused (err);
[[maybe_unused]] OSStatus err = AudioUnitSetProperty (audioUnit, kAudioOutputUnitProperty_RemoteControlToHost,
kAudioUnitScope_Global, 0, &event, sizeof (event));
jassert (err == noErr); jassert (err == noErr);
} }


+ 2
- 4
modules/juce_audio_devices/native/juce_linux_JackAudio.cpp View File

@@ -544,21 +544,19 @@ private:
} }
} }
static void infoShutdownCallback (jack_status_t code, const char* reason, void* arg)
static void infoShutdownCallback (jack_status_t code, [[maybe_unused]] const char* reason, void* arg)
{ {
jassertquiet (code == 0); jassertquiet (code == 0);
JUCE_JACK_LOG ("Shutting down with message:"); JUCE_JACK_LOG ("Shutting down with message:");
JUCE_JACK_LOG (reason); JUCE_JACK_LOG (reason);
ignoreUnused (reason);
shutdownCallback (arg); shutdownCallback (arg);
} }
static void errorCallback (const char* msg)
static void errorCallback ([[maybe_unused]] const char* msg)
{ {
JUCE_JACK_LOG ("JackAudioIODevice::errorCallback " + String (msg)); JUCE_JACK_LOG ("JackAudioIODevice::errorCallback " + String (msg));
ignoreUnused (msg);
} }
bool deviceIsOpen = false; bool deviceIsOpen = false;


+ 1
- 2
modules/juce_audio_devices/native/juce_mac_CoreMidi.mm View File

@@ -29,7 +29,7 @@ namespace juce
namespace CoreMidiHelpers namespace CoreMidiHelpers
{ {
static bool checkError (OSStatus err, int lineNum)
static bool checkError (OSStatus err, [[maybe_unused]] int lineNum)
{ {
if (err == noErr) if (err == noErr)
return true; return true;
@@ -38,7 +38,6 @@ namespace CoreMidiHelpers
Logger::writeToLog ("CoreMIDI error: " + String (lineNum) + " - " + String::toHexString ((int) err)); Logger::writeToLog ("CoreMIDI error: " + String (lineNum) + " - " + String::toHexString ((int) err));
#endif #endif
ignoreUnused (lineNum);
return false; return false;
} }


+ 4
- 4
modules/juce_audio_devices/native/juce_win32_DirectSound.cpp View File

@@ -251,8 +251,8 @@ public:
if (pOutputBuffer != nullptr) if (pOutputBuffer != nullptr)
{ {
JUCE_DS_LOG ("closing output: " + name); JUCE_DS_LOG ("closing output: " + name);
HRESULT hr = pOutputBuffer->Stop();
JUCE_DS_LOG_ERROR (hr); ignoreUnused (hr);
[[maybe_unused]] HRESULT hr = pOutputBuffer->Stop();
JUCE_DS_LOG_ERROR (hr);
pOutputBuffer->Release(); pOutputBuffer->Release();
pOutputBuffer = nullptr; pOutputBuffer = nullptr;
@@ -555,8 +555,8 @@ public:
if (pInputBuffer != nullptr) if (pInputBuffer != nullptr)
{ {
JUCE_DS_LOG ("closing input: " + name); JUCE_DS_LOG ("closing input: " + name);
HRESULT hr = pInputBuffer->Stop();
JUCE_DS_LOG_ERROR (hr); ignoreUnused (hr);
[[maybe_unused]] HRESULT hr = pInputBuffer->Stop();
JUCE_DS_LOG_ERROR (hr);
pInputBuffer->Release(); pInputBuffer->Release();
pInputBuffer = nullptr; pInputBuffer = nullptr;


+ 1
- 2
modules/juce_audio_devices/native/juce_win32_WASAPI.cpp View File

@@ -33,9 +33,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wlanguage-extension-token")
namespace WasapiClasses namespace WasapiClasses
{ {
static void logFailure (HRESULT hr)
static void logFailure ([[maybe_unused]] HRESULT hr)
{ {
ignoreUnused (hr);
jassert (hr != (HRESULT) 0x800401f0); // If you hit this, it means you're trying to call from jassert (hr != (HRESULT) 0x800401f0); // If you hit this, it means you're trying to call from
// a thread which hasn't been initialised with CoInitialize(). // a thread which hasn't been initialised with CoInitialize().


+ 1
- 3
modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp View File

@@ -61,10 +61,8 @@ void AudioSourcePlayer::audioDeviceIOCallbackWithContext (const float* const* in
float* const* outputChannelData, float* const* outputChannelData,
int totalNumOutputChannels, int totalNumOutputChannels,
int numSamples, int numSamples,
const AudioIODeviceCallbackContext& context)
[[maybe_unused]] const AudioIODeviceCallbackContext& context)
{ {
ignoreUnused (context);
// these should have been prepared by audioDeviceAboutToStart()... // these should have been prepared by audioDeviceAboutToStart()...
jassert (sampleRate > 0 && bufferSize > 0); jassert (sampleRate > 0 && bufferSize > 0);


+ 1
- 2
modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp View File

@@ -721,8 +721,7 @@ private:
{ {
using namespace AiffFileHelpers; using namespace AiffFileHelpers;
const bool couldSeekOk = output->setPosition (headerPosition);
ignoreUnused (couldSeekOk);
[[maybe_unused]] const bool couldSeekOk = output->setPosition (headerPosition);
// if this fails, you've given it an output stream that can't seek! It needs // if this fails, you've given it an output stream that can't seek! It needs
// to be able to seek back to write the header // to be able to seek back to write the header


+ 1
- 2
modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp View File

@@ -496,8 +496,7 @@ public:
packUint32 ((FLAC__uint32) info.total_samples, buffer + 14, 4); packUint32 ((FLAC__uint32) info.total_samples, buffer + 14, 4);
memcpy (buffer + 18, info.md5sum, 16); memcpy (buffer + 18, info.md5sum, 16);
const bool seekOk = output->setPosition (streamStartPos + 4);
ignoreUnused (seekOk);
[[maybe_unused]] const bool seekOk = output->setPosition (streamStartPos + 4);
// if this fails, you've given it an output stream that can't seek! It needs // if this fails, you've given it an output stream that can't seek! It needs
// to be able to seek back to write the header // to be able to seek back to write the header


+ 2
- 2
modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp View File

@@ -112,8 +112,8 @@ private:
if (cp.start (processArgs)) if (cp.start (processArgs))
{ {
auto childOutput = cp.readAllProcessOutput();
DBG (childOutput); ignoreUnused (childOutput);
[[maybe_unused]] auto childOutput = cp.readAllProcessOutput();
DBG (childOutput);
cp.waitForProcessToFinish (10000); cp.waitForProcessToFinish (10000);
return tempMP3.getFile().getSize() > 0; return tempMP3.getFile().getSize() > 0;


+ 1
- 1
modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp View File

@@ -262,7 +262,7 @@ private:
void checkCoInitialiseCalled() void checkCoInitialiseCalled()
{ {
ignoreUnused (CoInitialize (nullptr));
[[maybe_unused]] const auto result = CoInitialize (nullptr);
} }
void scanFileForDetails() void scanFileForDetails()


+ 2
- 4
modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp View File

@@ -1499,11 +1499,10 @@ namespace AAXClasses
friend void AAX_CALLBACK AAXClasses::algorithmProcessCallback (JUCEAlgorithmContext* const instancesBegin[], const void* const instancesEnd); friend void AAX_CALLBACK AAXClasses::algorithmProcessCallback (JUCEAlgorithmContext* const instancesBegin[], const void* const instancesEnd);
void process (float* const* channels, const int numChans, const int bufferSize, void process (float* const* channels, const int numChans, const int bufferSize,
const bool bypass, AAX_IMIDINode* midiNodeIn, AAX_IMIDINode* midiNodesOut)
const bool bypass, [[maybe_unused]] AAX_IMIDINode* midiNodeIn, [[maybe_unused]] AAX_IMIDINode* midiNodesOut)
{ {
AudioBuffer<float> buffer (channels, numChans, bufferSize); AudioBuffer<float> buffer (channels, numChans, bufferSize);
midiBuffer.clear(); midiBuffer.clear();
ignoreUnused (midiNodeIn, midiNodesOut);
#if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect #if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect
{ {
@@ -2391,7 +2390,7 @@ namespace AAXClasses
return (AAX_STEM_FORMAT_INDEX (stemFormat) <= 12); return (AAX_STEM_FORMAT_INDEX (stemFormat) <= 12);
} }
static void getPlugInDescription (AAX_IEffectDescriptor& descriptor, const AAX_IFeatureInfo* featureInfo)
static void getPlugInDescription (AAX_IEffectDescriptor& descriptor, [[maybe_unused]] const AAX_IFeatureInfo* featureInfo)
{ {
PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_AAX; PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_AAX;
std::unique_ptr<AudioProcessor> plugin (createPluginFilterOfType (AudioProcessor::wrapperType_AAX)); std::unique_ptr<AudioProcessor> plugin (createPluginFilterOfType (AudioProcessor::wrapperType_AAX));
@@ -2424,7 +2423,6 @@ namespace AAXClasses
#if JucePlugin_IsMidiEffect #if JucePlugin_IsMidiEffect
// MIDI effect plug-ins do not support any audio channels // MIDI effect plug-ins do not support any audio channels
jassert (numInputBuses == 0 && numOutputBuses == 0); jassert (numInputBuses == 0 && numOutputBuses == 0);
ignoreUnused (featureInfo);
if (auto* desc = descriptor.NewComponentDescriptor()) if (auto* desc = descriptor.NewComponentDescriptor())
{ {


+ 11
- 17
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -242,11 +242,9 @@ public:
} }
//============================================================================== //==============================================================================
bool BusCountWritable (AudioUnitScope scope) override
bool BusCountWritable ([[maybe_unused]] AudioUnitScope scope) override
{ {
#ifdef JucePlugin_PreferredChannelConfigurations #ifdef JucePlugin_PreferredChannelConfigurations
ignoreUnused (scope);
return false; return false;
#else #else
bool isInput; bool isInput;
@@ -774,11 +772,9 @@ public:
} }
//============================================================================== //==============================================================================
bool busIgnoresLayout (bool isInput, int busNr) const
bool busIgnoresLayout ([[maybe_unused]] bool isInput, [[maybe_unused]] int busNr) const
{ {
#ifdef JucePlugin_PreferredChannelConfigurations #ifdef JucePlugin_PreferredChannelConfigurations
ignoreUnused (isInput, busNr);
return true; return true;
#else #else
if (const AudioProcessor::Bus* bus = juceFilter->getBus (isInput, busNr)) if (const AudioProcessor::Bus* bus = juceFilter->getBus (isInput, busNr))
@@ -878,10 +874,9 @@ public:
//============================================================================== //==============================================================================
// When parameters are discrete we need to use integer values. // When parameters are discrete we need to use integer values.
float getMaximumParameterValue (AudioProcessorParameter* juceParam)
float getMaximumParameterValue ([[maybe_unused]] AudioProcessorParameter* juceParam)
{ {
#if JUCE_FORCE_LEGACY_PARAMETER_AUTOMATION_TYPE #if JUCE_FORCE_LEGACY_PARAMETER_AUTOMATION_TYPE
ignoreUnused (juceParam);
return 1.0f; return 1.0f;
#else #else
return juceParam->isDiscrete() ? (float) (juceParam->getNumSteps() - 1) : 1.0f; return juceParam->isDiscrete() ? (float) (juceParam->getNumSteps() - 1) : 1.0f;
@@ -1234,7 +1229,7 @@ public:
if (newNumChannels == oldNumChannels) if (newNumChannels == oldNumChannels)
return true; return true;
if (AudioProcessor::Bus* bus = juceFilter->getBus (info.isInput, info.busNr))
if ([[maybe_unused]] AudioProcessor::Bus* bus = juceFilter->getBus (info.isInput, info.busNr))
{ {
if (! MusicDeviceBase::ValidFormat (inScope, inElement, inNewFormat)) if (! MusicDeviceBase::ValidFormat (inScope, inElement, inNewFormat))
return false; return false;
@@ -1242,7 +1237,6 @@ public:
#ifdef JucePlugin_PreferredChannelConfigurations #ifdef JucePlugin_PreferredChannelConfigurations
short configs[][2] = {JucePlugin_PreferredChannelConfigurations}; short configs[][2] = {JucePlugin_PreferredChannelConfigurations};
ignoreUnused (bus);
return AudioUnitHelpers::isLayoutSupported (*juceFilter, info.isInput, info.busNr, newNumChannels, configs); return AudioUnitHelpers::isLayoutSupported (*juceFilter, info.isInput, info.busNr, newNumChannels, configs);
#else #else
return bus->isNumberOfChannelsSupported (newNumChannels); return bus->isNumberOfChannelsSupported (newNumChannels);
@@ -1395,7 +1389,11 @@ public:
ComponentResult StopNote (MusicDeviceGroupID, NoteInstanceID, UInt32) override { return noErr; } ComponentResult StopNote (MusicDeviceGroupID, NoteInstanceID, UInt32) override { return noErr; }
//============================================================================== //==============================================================================
OSStatus HandleMIDIEvent (UInt8 inStatus, UInt8 inChannel, UInt8 inData1, UInt8 inData2, UInt32 inStartFrame) override
OSStatus HandleMIDIEvent ([[maybe_unused]] UInt8 inStatus,
[[maybe_unused]] UInt8 inChannel,
[[maybe_unused]] UInt8 inData1,
[[maybe_unused]] UInt8 inData2,
[[maybe_unused]] UInt32 inStartFrame) override
{ {
#if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect #if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect
const juce::uint8 data[] = { (juce::uint8) (inStatus | inChannel), const juce::uint8 data[] = { (juce::uint8) (inStatus | inChannel),
@@ -1406,20 +1404,17 @@ public:
incomingEvents.addEvent (data, 3, (int) inStartFrame); incomingEvents.addEvent (data, 3, (int) inStartFrame);
return noErr; return noErr;
#else #else
ignoreUnused (inStatus, inChannel, inData1);
ignoreUnused (inData2, inStartFrame);
return kAudioUnitErr_PropertyNotInUse; return kAudioUnitErr_PropertyNotInUse;
#endif #endif
} }
OSStatus HandleSysEx (const UInt8* inData, UInt32 inLength) override
OSStatus HandleSysEx ([[maybe_unused]] const UInt8* inData, [[maybe_unused]] UInt32 inLength) override
{ {
#if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect #if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect
const ScopedLock sl (incomingMidiLock); const ScopedLock sl (incomingMidiLock);
incomingEvents.addEvent (inData, (int) inLength, 0); incomingEvents.addEvent (inData, (int) inLength, 0);
return noErr; return noErr;
#else #else
ignoreUnused (inData, inLength);
return kAudioUnitErr_PropertyNotInUse; return kAudioUnitErr_PropertyNotInUse;
#endif #endif
} }
@@ -1950,7 +1945,7 @@ private:
} }
} }
void pushMidiOutput (UInt32 nFrames) noexcept
void pushMidiOutput ([[maybe_unused]] UInt32 nFrames) noexcept
{ {
MIDIPacket* end = nullptr; MIDIPacket* end = nullptr;
@@ -1979,7 +1974,6 @@ private:
for (const auto metadata : midiEvents) for (const auto metadata : midiEvents)
{ {
jassert (isPositiveAndBelow (metadata.samplePosition, nFrames)); jassert (isPositiveAndBelow (metadata.samplePosition, nFrames));
ignoreUnused (nFrames);
add (metadata); add (metadata);


+ 4
- 11
modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm View File

@@ -359,11 +359,9 @@ public:
AudioProcessor& processor = getAudioProcessor(); AudioProcessor& processor = getAudioProcessor();
if (AudioProcessor::Bus* bus = processor.getBus (isInput, busIdx))
if ([[maybe_unused]] AudioProcessor::Bus* bus = processor.getBus (isInput, busIdx))
{ {
#ifdef JucePlugin_PreferredChannelConfigurations #ifdef JucePlugin_PreferredChannelConfigurations
ignoreUnused (bus);
short configs[][2] = {JucePlugin_PreferredChannelConfigurations}; short configs[][2] = {JucePlugin_PreferredChannelConfigurations};
if (! AudioUnitHelpers::isLayoutSupported (processor, isInput, busIdx, newNumChannels, configs)) if (! AudioUnitHelpers::isLayoutSupported (processor, isInput, busIdx, newNumChannels, configs))
@@ -603,10 +601,8 @@ public:
}; };
//============================================================================== //==============================================================================
void audioProcessorChanged (AudioProcessor* processor, const ChangeDetails& details) override
void audioProcessorChanged ([[maybe_unused]] AudioProcessor* processor, const ChangeDetails& details) override
{ {
ignoreUnused (processor);
if (! details.programChanged) if (! details.programChanged)
return; return;
@@ -1109,10 +1105,9 @@ private:
} }
// When parameters are discrete we need to use integer values. // When parameters are discrete we need to use integer values.
float getMaximumParameterValue (AudioProcessorParameter* juceParam) const
float getMaximumParameterValue ([[maybe_unused]] AudioProcessorParameter* juceParam) const
{ {
#if JUCE_FORCE_LEGACY_PARAMETER_AUTOMATION_TYPE #if JUCE_FORCE_LEGACY_PARAMETER_AUTOMATION_TYPE
ignoreUnused (juceParam);
return 1.0f; return 1.0f;
#else #else
return juceParam->isDiscrete() ? (float) (juceParam->getNumSteps() - 1) : 1.0f; return juceParam->isDiscrete() ? (float) (juceParam->getNumSteps() - 1) : 1.0f;
@@ -1355,10 +1350,8 @@ private:
} }
//============================================================================== //==============================================================================
void processEvents (const AURenderEvent *__nullable realtimeEventListHead, int numParams, AUEventSampleTime startTime)
void processEvents (const AURenderEvent *__nullable realtimeEventListHead, [[maybe_unused]] int numParams, AUEventSampleTime startTime)
{ {
ignoreUnused (numParams);
for (const AURenderEvent* event = realtimeEventListHead; event != nullptr; event = event->head.next) for (const AURenderEvent* event = realtimeEventListHead; event != nullptr; event = event->head.next)
{ {
switch (event->head.eventType) switch (event->head.eventType)


+ 1
- 2
modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h View File

@@ -386,13 +386,12 @@ public:
return false; return false;
} }
Image getIAAHostIcon (int size)
Image getIAAHostIcon ([[maybe_unused]] int size)
{ {
#if JUCE_IOS && JucePlugin_Enable_IAA #if JUCE_IOS && JucePlugin_Enable_IAA
if (auto device = dynamic_cast<iOSAudioIODevice*> (deviceManager.getCurrentAudioDevice())) if (auto device = dynamic_cast<iOSAudioIODevice*> (deviceManager.getCurrentAudioDevice()))
return device->getIcon (size); return device->getIcon (size);
#else #else
ignoreUnused (size);
#endif #endif
return {}; return {};


+ 1
- 4
modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp View File

@@ -158,10 +158,8 @@ private:
return std::make_unique<LowLevelGraphicsSoftwareRenderer> (Image (this)); return std::make_unique<LowLevelGraphicsSoftwareRenderer> (Image (this));
} }
void initialiseBitmapData (Image::BitmapData& bitmap, int x, int y, Image::BitmapData::ReadWriteMode mode) override
void initialiseBitmapData (Image::BitmapData& bitmap, int x, int y, [[maybe_unused]] Image::BitmapData::ReadWriteMode mode) override
{ {
ignoreUnused (mode);
const auto offset = (size_t) x * (size_t) pixelStride + (size_t) y * (size_t) lineStride; const auto offset = (size_t) x * (size_t) pixelStride + (size_t) y * (size_t) lineStride;
bitmap.data = imageData + offset; bitmap.data = imageData + offset;
bitmap.size = (size_t) (lineStride * height) - offset; bitmap.size = (size_t) (lineStride * height) - offset;
@@ -568,7 +566,6 @@ static UnityAudioEffectDefinition getEffectDefinition()
result.setPosition = [] (UnityAudioEffectState* state, unsigned int pos) result.setPosition = [] (UnityAudioEffectState* state, unsigned int pos)
{ {
ignoreUnused (state, pos); ignoreUnused (state, pos);
return 0; return 0;
}; };


+ 3
- 9
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp View File

@@ -962,14 +962,12 @@ public:
, public Timer , public Timer
#endif #endif
{ {
EditorCompWrapper (JuceVSTWrapper& w, AudioProcessorEditor& editor, float initialScale)
EditorCompWrapper (JuceVSTWrapper& w, AudioProcessorEditor& editor, [[maybe_unused]] float initialScale)
: wrapper (w) : wrapper (w)
{ {
editor.setOpaque (true); editor.setOpaque (true);
#if ! JUCE_MAC #if ! JUCE_MAC
editor.setScaleFactor (initialScale); editor.setScaleFactor (initialScale);
#else
ignoreUnused (initialScale);
#endif #endif
addAndMakeVisible (editor); addAndMakeVisible (editor);
@@ -1714,13 +1712,12 @@ private:
return 0; return 0;
} }
pointer_sized_int handlePreAudioProcessingEvents (VstOpCodeArguments args)
pointer_sized_int handlePreAudioProcessingEvents ([[maybe_unused]] VstOpCodeArguments args)
{ {
#if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect #if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect
VSTMidiEventList::addEventsToMidiBuffer ((Vst2::VstEvents*) args.ptr, midiEvents); VSTMidiEventList::addEventsToMidiBuffer ((Vst2::VstEvents*) args.ptr, midiEvents);
return 1; return 1;
#else #else
ignoreUnused (args);
return 0; return 0;
#endif #endif
} }
@@ -2013,7 +2010,7 @@ private:
return 0; return 0;
} }
pointer_sized_int handleSetContentScaleFactor (float scale, bool force = false)
pointer_sized_int handleSetContentScaleFactor ([[maybe_unused]] float scale, [[maybe_unused]] bool force = false)
{ {
checkWhetherMessageThreadIsCorrect(); checkWhetherMessageThreadIsCorrect();
#if JUCE_LINUX || JUCE_BSD #if JUCE_LINUX || JUCE_BSD
@@ -2030,9 +2027,6 @@ private:
if (editorComp != nullptr) if (editorComp != nullptr)
editorComp->setContentScaleFactor (editorScaleFactor); editorComp->setContentScaleFactor (editorScaleFactor);
} }
#else
ignoreUnused (scale, force);
#endif #endif
return 1; return 1;


+ 7
- 12
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm View File

@@ -80,7 +80,7 @@ void initialiseMacVST()
} }
JUCE_API void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView, bool isNSView); JUCE_API void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView, bool isNSView);
void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView, bool isNSView)
void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView, [[maybe_unused]] bool isNSView)
{ {
JUCE_AUTORELEASEPOOL JUCE_AUTORELEASEPOOL
{ {
@@ -161,7 +161,6 @@ void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView,
} }
#endif #endif
ignoreUnused (isNSView);
NSView* parentView = [(NSView*) parentWindowOrView retain]; NSView* parentView = [(NSView*) parentWindowOrView retain];
#if JucePlugin_EditorRequiresKeyboardFocus #if JucePlugin_EditorRequiresKeyboardFocus
@@ -183,7 +182,7 @@ void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView,
} }
JUCE_API void detachComponentFromWindowRefVST (Component* comp, void* window, bool isNSView); JUCE_API void detachComponentFromWindowRefVST (Component* comp, void* window, bool isNSView);
void detachComponentFromWindowRefVST (Component* comp, void* window, bool isNSView)
void detachComponentFromWindowRefVST (Component* comp, void* window, [[maybe_unused]] bool isNSView)
{ {
JUCE_AUTORELEASEPOOL JUCE_AUTORELEASEPOOL
{ {
@@ -232,14 +231,13 @@ void detachComponentFromWindowRefVST (Component* comp, void* window, bool isNSVi
} }
#endif #endif
ignoreUnused (isNSView);
comp->removeFromDesktop(); comp->removeFromDesktop();
[(id) window release]; [(id) window release];
} }
} }
JUCE_API void setNativeHostWindowSizeVST (void* window, Component* component, int newWidth, int newHeight, bool isNSView); JUCE_API void setNativeHostWindowSizeVST (void* window, Component* component, int newWidth, int newHeight, bool isNSView);
void setNativeHostWindowSizeVST (void* window, Component* component, int newWidth, int newHeight, bool isNSView)
void setNativeHostWindowSizeVST (void* window, Component* component, int newWidth, int newHeight, [[maybe_unused]] bool isNSView)
{ {
JUCE_AUTORELEASEPOOL JUCE_AUTORELEASEPOOL
{ {
@@ -260,8 +258,6 @@ void setNativeHostWindowSizeVST (void* window, Component* component, int newWidt
} }
#endif #endif
ignoreUnused (isNSView);
if (NSView* hostView = (NSView*) window) if (NSView* hostView = (NSView*) window)
{ {
const int dx = newWidth - component->getWidth(); const int dx = newWidth - component->getWidth();
@@ -277,10 +273,10 @@ void setNativeHostWindowSizeVST (void* window, Component* component, int newWidt
} }
JUCE_API void checkWindowVisibilityVST (void* window, Component* comp, bool isNSView); JUCE_API void checkWindowVisibilityVST (void* window, Component* comp, bool isNSView);
void checkWindowVisibilityVST (void* window, Component* comp, bool isNSView)
void checkWindowVisibilityVST ([[maybe_unused]] void* window,
[[maybe_unused]] Component* comp,
[[maybe_unused]] bool isNSView)
{ {
ignoreUnused (window, comp, isNSView);
#if ! JUCE_64BIT #if ! JUCE_64BIT
if (! isNSView) if (! isNSView)
comp->setVisible ([((NSWindow*) window) isVisible]); comp->setVisible ([((NSWindow*) window) isVisible]);
@@ -288,7 +284,7 @@ void checkWindowVisibilityVST (void* window, Component* comp, bool isNSView)
} }
JUCE_API bool forwardCurrentKeyEventToHostVST (Component* comp, bool isNSView); JUCE_API bool forwardCurrentKeyEventToHostVST (Component* comp, bool isNSView);
bool forwardCurrentKeyEventToHostVST (Component* comp, bool isNSView)
bool forwardCurrentKeyEventToHostVST ([[maybe_unused]] Component* comp, [[maybe_unused]] bool isNSView)
{ {
#if ! JUCE_64BIT #if ! JUCE_64BIT
if (! isNSView) if (! isNSView)
@@ -300,7 +296,6 @@ bool forwardCurrentKeyEventToHostVST (Component* comp, bool isNSView)
} }
#endif #endif
ignoreUnused (comp, isNSView);
return false; return false;
} }


+ 6
- 7
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -1075,14 +1075,15 @@ public:
} }
//============================================================================== //==============================================================================
tresult PLUGIN_API getMidiControllerAssignment (Steinberg::int32 /*busIndex*/, Steinberg::int16 channel,
Vst::CtrlNumber midiControllerNumber, Vst::ParamID& resultID) override
tresult PLUGIN_API getMidiControllerAssignment ([[maybe_unused]] Steinberg::int32 busIndex,
[[maybe_unused]] Steinberg::int16 channel,
[[maybe_unused]] Vst::CtrlNumber midiControllerNumber,
[[maybe_unused]] Vst::ParamID& resultID) override
{ {
#if JUCE_VST3_EMULATE_MIDI_CC_WITH_PARAMETERS #if JUCE_VST3_EMULATE_MIDI_CC_WITH_PARAMETERS
resultID = midiControllerToParameter[channel][midiControllerNumber]; resultID = midiControllerToParameter[channel][midiControllerNumber];
return kResultTrue; // Returning false makes some hosts stop asking for further MIDI Controller Assignments return kResultTrue; // Returning false makes some hosts stop asking for further MIDI Controller Assignments
#else #else
ignoreUnused (channel, midiControllerNumber, resultID);
return kResultFalse; return kResultFalse;
#endif #endif
} }
@@ -1991,7 +1992,7 @@ private:
return kResultFalse; return kResultFalse;
} }
tresult PLUGIN_API setContentScaleFactor (const Steinberg::IPlugViewContentScaleSupport::ScaleFactor factor) override
tresult PLUGIN_API setContentScaleFactor ([[maybe_unused]] const Steinberg::IPlugViewContentScaleSupport::ScaleFactor factor) override
{ {
#if ! JUCE_MAC #if ! JUCE_MAC
const auto scaleToApply = [&] const auto scaleToApply = [&]
@@ -2016,7 +2017,6 @@ private:
return kResultTrue; return kResultTrue;
#else #else
ignoreUnused (factor);
return kResultFalse; return kResultFalse;
#endif #endif
} }
@@ -2427,9 +2427,8 @@ public:
#ifdef JucePlugin_PreferredChannelConfigurations #ifdef JucePlugin_PreferredChannelConfigurations
short configs[][2] = { JucePlugin_PreferredChannelConfigurations }; short configs[][2] = { JucePlugin_PreferredChannelConfigurations };
const int numConfigs = numElementsInArray (configs);
[[maybe_unused]] const int numConfigs = numElementsInArray (configs);
ignoreUnused (numConfigs);
jassert (numConfigs > 0 && (configs[0][0] > 0 || configs[0][1] > 0)); jassert (numConfigs > 0 && (configs[0][0] > 0 || configs[0][1] > 0));
pluginInstance->setPlayConfigDetails (configs[0][0], configs[0][1], 44100.0, 1024); pluginInstance->setPlayConfigDetails (configs[0][0], configs[0][1], 44100.0, 1024);


+ 4
- 3
modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp View File

@@ -134,7 +134,10 @@ namespace juce
#if JucePlugin_Build_VST #if JucePlugin_Build_VST
bool JUCE_API handleManufacturerSpecificVST2Opcode (int32 index, pointer_sized_int value, void* ptr, float); bool JUCE_API handleManufacturerSpecificVST2Opcode (int32 index, pointer_sized_int value, void* ptr, float);
bool JUCE_API handleManufacturerSpecificVST2Opcode (int32 index, pointer_sized_int value, void* ptr, float)
bool JUCE_API handleManufacturerSpecificVST2Opcode ([[maybe_unused]] int32 index,
[[maybe_unused]] pointer_sized_int value,
[[maybe_unused]] void* ptr,
float)
{ {
#if VST3_REPLACEMENT_AVAILABLE #if VST3_REPLACEMENT_AVAILABLE
if ((index == (int32) ByteOrder::bigEndianInt ("stCA") || index == (int32) ByteOrder::bigEndianInt ("stCa")) if ((index == (int32) ByteOrder::bigEndianInt ("stCA") || index == (int32) ByteOrder::bigEndianInt ("stCa"))
@@ -145,8 +148,6 @@ namespace juce
::memcpy (ptr, fuid, 16); ::memcpy (ptr, fuid, 16);
return true; return true;
} }
#else
ignoreUnused (index, value, ptr);
#endif #endif
return false; return false;
} }


+ 1
- 3
modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp View File

@@ -64,10 +64,8 @@ void AudioPluginFormatManager::addDefaultFormats()
#if JUCE_DEBUG #if JUCE_DEBUG
// you should only call this method once! // you should only call this method once!
for (auto* format : formats)
for (auto* format [[maybe_unused]] : formats)
{ {
ignoreUnused (format);
#if HAS_VST #if HAS_VST
jassert (dynamic_cast<VSTPluginFormat*> (format) == nullptr); jassert (dynamic_cast<VSTPluginFormat*> (format) == nullptr);
#endif #endif


+ 9
- 15
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm View File

@@ -179,14 +179,15 @@ namespace AudioUnitFormatHelpers
return false; return false;
} }
static bool getComponentDescFromFile (const String& fileOrIdentifier, AudioComponentDescription& desc,
String& name, String& version, String& manufacturer)
static bool getComponentDescFromFile ([[maybe_unused]] const String& fileOrIdentifier,
[[maybe_unused]] AudioComponentDescription& desc,
[[maybe_unused]] String& name,
[[maybe_unused]] String& version,
[[maybe_unused]] String& manufacturer)
{ {
zerostruct (desc); zerostruct (desc);
#if JUCE_IOS #if JUCE_IOS
ignoreUnused (fileOrIdentifier, name, version, manufacturer);
return false; return false;
#else #else
const File file (fileOrIdentifier); const File file (fileOrIdentifier);
@@ -434,7 +435,7 @@ namespace AudioUnitFormatHelpers
} }
} }
static bool hasARAExtension (AudioUnit audioUnit)
static bool hasARAExtension ([[maybe_unused]] AudioUnit audioUnit)
{ {
#if JUCE_PLUGINHOST_ARA #if JUCE_PLUGINHOST_ARA
UInt32 propertySize = sizeof (ARA::ARAAudioUnitFactory); UInt32 propertySize = sizeof (ARA::ARAAudioUnitFactory);
@@ -449,8 +450,6 @@ static bool hasARAExtension (AudioUnit audioUnit)
if ((status == noErr) && (propertySize == sizeof (ARA::ARAAudioUnitFactory)) && ! isWriteable) if ((status == noErr) && (propertySize == sizeof (ARA::ARAAudioUnitFactory)) && ! isWriteable)
return true; return true;
#else
ignoreUnused (audioUnit);
#endif #endif
return false; return false;
@@ -465,7 +464,7 @@ using AudioUnitUniquePtr = std::unique_ptr<std::remove_pointer_t<AudioUnit>, Aud
using AudioUnitSharedPtr = std::shared_ptr<std::remove_pointer_t<AudioUnit>>; using AudioUnitSharedPtr = std::shared_ptr<std::remove_pointer_t<AudioUnit>>;
using AudioUnitWeakPtr = std::weak_ptr<std::remove_pointer_t<AudioUnit>>; using AudioUnitWeakPtr = std::weak_ptr<std::remove_pointer_t<AudioUnit>>;
static std::shared_ptr<const ARA::ARAFactory> getARAFactory (AudioUnitSharedPtr audioUnit)
static std::shared_ptr<const ARA::ARAFactory> getARAFactory ([[maybe_unused]] AudioUnitSharedPtr audioUnit)
{ {
#if JUCE_PLUGINHOST_ARA #if JUCE_PLUGINHOST_ARA
jassert (audioUnit != nullptr); jassert (audioUnit != nullptr);
@@ -491,8 +490,6 @@ static std::shared_ptr<const ARA::ARAFactory> getARAFactory (AudioUnitSharedPtr
[owningAuPtr = std::move (audioUnit)]() {}); [owningAuPtr = std::move (audioUnit)]() {});
} }
} }
#else
ignoreUnused (audioUnit);
#endif #endif
return {}; return {};
@@ -2640,13 +2637,12 @@ public:
} }
} }
void embedViewController (JUCE_IOS_MAC_VIEW* pluginView, const CGSize& size)
void embedViewController (JUCE_IOS_MAC_VIEW* pluginView, [[maybe_unused]] const CGSize& size)
{ {
wrapper.setView (pluginView); wrapper.setView (pluginView);
waitingForViewCallback = false; waitingForViewCallback = false;
#if JUCE_MAC #if JUCE_MAC
ignoreUnused (size);
if (pluginView != nil) if (pluginView != nil)
wrapper.resizeToFitView(); wrapper.resizeToFitView();
#else #else
@@ -2682,7 +2678,7 @@ private:
bool waitingForViewCallback = false; bool waitingForViewCallback = false;
bool createView (bool createGenericViewIfNeeded)
bool createView ([[maybe_unused]] bool createGenericViewIfNeeded)
{ {
JUCE_IOS_MAC_VIEW* pluginView = nil; JUCE_IOS_MAC_VIEW* pluginView = nil;
UInt32 dataSize = 0; UInt32 dataSize = 0;
@@ -2756,8 +2752,6 @@ private:
pluginView = [[AUGenericView alloc] initWithAudioUnit: plugin.audioUnit]; pluginView = [[AUGenericView alloc] initWithAudioUnit: plugin.audioUnit];
} }
#else
ignoreUnused (createGenericViewIfNeeded);
#endif #endif
wrapper.setView (pluginView); wrapper.setView (pluginView);


+ 1
- 3
modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp View File

@@ -384,10 +384,8 @@ public:
void getCurrentProgramStateInformation (MemoryBlock& destData) override { getStateInformation (destData); } void getCurrentProgramStateInformation (MemoryBlock& destData) override { getStateInformation (destData); }
void setCurrentProgramStateInformation (const void* data, int sizeInBytes) override { setStateInformation (data, sizeInBytes); } void setCurrentProgramStateInformation (const void* data, int sizeInBytes) override { setStateInformation (data, sizeInBytes); }
void setStateInformation (const void* data, int sizeInBytes) override
void setStateInformation (const void* data, [[maybe_unused]] int sizeInBytes) override
{ {
ignoreUnused (sizeInBytes);
auto* p = static_cast<const float*> (data); auto* p = static_cast<const float*> (data);
for (int i = 0; i < getParameters().size(); ++i) for (int i = 0; i < getParameters().size(); ++i)


+ 3
- 8
modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp View File

@@ -1278,10 +1278,8 @@ private:
LV2_Options_Option* options, LV2_Options_Option* options,
LV2_Worker_Schedule* schedule, LV2_Worker_Schedule* schedule,
LV2_Resize_Port_Resize* resize, LV2_Resize_Port_Resize* resize,
LV2_Log_Log* log)
[[maybe_unused]] LV2_Log_Log* log)
{ {
ignoreUnused (log);
return { LV2_Feature { LV2_STATE__loadDefaultState, nullptr }, return { LV2_Feature { LV2_STATE__loadDefaultState, nullptr },
LV2_Feature { LV2_BUF_SIZE__boundedBlockLength, nullptr }, LV2_Feature { LV2_BUF_SIZE__boundedBlockLength, nullptr },
LV2_Feature { LV2_URID__map, map }, LV2_Feature { LV2_URID__map, map },
@@ -2873,11 +2871,10 @@ private:
ports.forEachPort ([&] (const PortHeader& header) ports.forEachPort ([&] (const PortHeader& header)
{ {
const auto emplaced = result.emplace (header.symbol, header.index);
[[maybe_unused]] const auto emplaced = result.emplace (header.symbol, header.index);
// This will complain if there are duplicate port symbols. // This will complain if there are duplicate port symbols.
jassert (emplaced.second); jassert (emplaced.second);
ignoreUnused (emplaced);
}); });
return result; return result;
@@ -4884,10 +4881,8 @@ private:
: freeWheelingPort->info.min; : freeWheelingPort->info.min;
} }
void pushMessage (MessageHeader header, uint32_t size, const void* data)
void pushMessage (MessageHeader header, [[maybe_unused]] uint32_t size, const void* data)
{ {
ignoreUnused (size);
if (header.protocol == 0 || header.protocol == instance->urids.mLV2_UI__floatProtocol) if (header.protocol == 0 || header.protocol == instance->urids.mLV2_UI__floatProtocol)
{ {
const auto value = readUnaligned<float> (data); const auto value = readUnaligned<float> (data);


+ 11
- 17
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -375,9 +375,8 @@ struct VST3HostContext : public Vst::IComponentHandler, // From VST V3.0.0
tresult PLUGIN_API setDirty (TBool) override; tresult PLUGIN_API setDirty (TBool) override;
//============================================================================== //==============================================================================
tresult PLUGIN_API requestOpenEditor (FIDString name) override
tresult PLUGIN_API requestOpenEditor ([[maybe_unused]] FIDString name) override
{ {
ignoreUnused (name);
jassertfalse; jassertfalse;
return kResultFalse; return kResultFalse;
} }
@@ -1388,7 +1387,7 @@ static int compareWithString (Type (&charArray)[N], const String& str)
} }
template <typename Callback> template <typename Callback>
static void forEachARAFactory (IPluginFactory* pluginFactory, Callback&& cb)
static void forEachARAFactory ([[maybe_unused]] IPluginFactory* pluginFactory, [[maybe_unused]] Callback&& cb)
{ {
#if JUCE_PLUGINHOST_ARA && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) #if JUCE_PLUGINHOST_ARA && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)
const auto numClasses = pluginFactory->countClasses(); const auto numClasses = pluginFactory->countClasses();
@@ -1404,12 +1403,11 @@ static void forEachARAFactory (IPluginFactory* pluginFactory, Callback&& cb)
break; break;
} }
} }
#else
ignoreUnused (pluginFactory, cb);
#endif #endif
} }
static std::shared_ptr<const ARA::ARAFactory> getARAFactory (Steinberg::IPluginFactory* pluginFactory, const String& pluginName)
static std::shared_ptr<const ARA::ARAFactory> getARAFactory ([[maybe_unused]] Steinberg::IPluginFactory* pluginFactory,
[[maybe_unused]] const String& pluginName)
{ {
std::shared_ptr<const ARA::ARAFactory> factory; std::shared_ptr<const ARA::ARAFactory> factory;
@@ -1432,8 +1430,6 @@ static std::shared_ptr<const ARA::ARAFactory> getARAFactory (Steinberg::IPluginF
return true; return true;
}); });
#else
ignoreUnused (pluginFactory, pluginName);
#endif #endif
return factory; return factory;
@@ -1667,8 +1663,8 @@ private:
return; return;
} }
const auto attachedResult = view->attached ((void*) pluginHandle, defaultVST3WindowType);
ignoreUnused (warnOnFailure (attachedResult));
[[maybe_unused]] const auto attachedResult = view->attached ((void*) pluginHandle, defaultVST3WindowType);
[[maybe_unused]] const auto warning = warnOnFailure (attachedResult);
if (attachedResult == kResultOk) if (attachedResult == kResultOk)
attachedCalled = true; attachedCalled = true;
@@ -1689,11 +1685,10 @@ private:
{ {
if (scaleInterface != nullptr) if (scaleInterface != nullptr)
{ {
const auto result = scaleInterface->setContentScaleFactor ((Steinberg::IPlugViewContentScaleSupport::ScaleFactor) getEffectiveScale());
ignoreUnused (result);
[[maybe_unused]] const auto result = scaleInterface->setContentScaleFactor ((Steinberg::IPlugViewContentScaleSupport::ScaleFactor) getEffectiveScale());
#if ! JUCE_MAC #if ! JUCE_MAC
ignoreUnused (warnOnFailure (result));
[[maybe_unused]] const auto warning = warnOnFailure (result);
#endif #endif
} }
} }
@@ -1885,8 +1880,7 @@ struct VST3ComponentHolder
if (classIdx >= 0) if (classIdx >= 0)
{ {
PClassInfo info; PClassInfo info;
bool success = (factory->getClassInfo (classIdx, &info) == kResultOk);
ignoreUnused (success);
[[maybe_unused]] bool success = (factory->getClassInfo (classIdx, &info) == kResultOk);
jassert (success); jassert (success);
VSTComSmartPtr<IPluginFactory2> pf2; VSTComSmartPtr<IPluginFactory2> pf2;
@@ -3091,9 +3085,9 @@ public:
} }
/** @note Not applicable to VST3 */ /** @note Not applicable to VST3 */
void setCurrentProgramStateInformation (const void* data, int sizeInBytes) override
void setCurrentProgramStateInformation ([[maybe_unused]] const void* data,
[[maybe_unused]] int sizeInBytes) override
{ {
ignoreUnused (data, sizeInBytes);
} }
private: private:


+ 1
- 3
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -3028,10 +3028,8 @@ public:
} }
//============================================================================== //==============================================================================
void mouseDown (const MouseEvent& e) override
void mouseDown ([[maybe_unused]] const MouseEvent& e) override
{ {
ignoreUnused (e);
#if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD
toFront (true); toFront (true);
#endif #endif


+ 1
- 0
modules/juce_audio_processors/juce_audio_processors.cpp View File

@@ -220,6 +220,7 @@ private:
#include "utilities/juce_AudioProcessorValueTreeState.cpp" #include "utilities/juce_AudioProcessorValueTreeState.cpp"
#include "utilities/juce_PluginHostType.cpp" #include "utilities/juce_PluginHostType.cpp"
#include "utilities/juce_NativeScaleFactorNotifier.cpp" #include "utilities/juce_NativeScaleFactorNotifier.cpp"
#include "utilities/juce_VSTCallbackHandler.cpp"
#include "utilities/ARA/juce_ARA_utils.cpp" #include "utilities/ARA/juce_ARA_utils.cpp"
#include "format_types/juce_LV2PluginFormat.cpp" #include "format_types/juce_LV2PluginFormat.cpp"


+ 9
- 14
modules/juce_audio_processors/processors/juce_AudioProcessor.cpp View File

@@ -340,7 +340,7 @@ void AudioProcessor::removeListener (AudioProcessorListener* listenerToRemove)
void AudioProcessor::setPlayConfigDetails (int newNumIns, int newNumOuts, double newSampleRate, int newBlockSize) void AudioProcessor::setPlayConfigDetails (int newNumIns, int newNumOuts, double newSampleRate, int newBlockSize)
{ {
bool success = true;
[[maybe_unused]] bool success = true;
if (getTotalNumInputChannels() != newNumIns) if (getTotalNumInputChannels() != newNumIns)
success &= setChannelLayoutOfBus (true, 0, AudioChannelSet::canonicalChannelSet (newNumIns)); success &= setChannelLayoutOfBus (true, 0, AudioChannelSet::canonicalChannelSet (newNumIns));
@@ -362,7 +362,6 @@ void AudioProcessor::setPlayConfigDetails (int newNumIns, int newNumOuts, double
jassert (success && newNumIns == getTotalNumInputChannels() && newNumOuts == getTotalNumOutputChannels()); jassert (success && newNumIns == getTotalNumInputChannels() && newNumOuts == getTotalNumOutputChannels());
setRateAndBufferSizeDetails (newSampleRate, newBlockSize); setRateAndBufferSizeDetails (newSampleRate, newBlockSize);
ignoreUnused (success);
} }
void AudioProcessor::setRateAndBufferSizeDetails (double newSampleRate, int newBlockSize) noexcept void AudioProcessor::setRateAndBufferSizeDetails (double newSampleRate, int newBlockSize) noexcept
@@ -442,10 +441,8 @@ void AudioProcessor::validateParameter (AudioProcessorParameter* param)
#endif #endif
} }
void AudioProcessor::checkForDuplicateTrimmedParamID (AudioProcessorParameter* param)
void AudioProcessor::checkForDuplicateTrimmedParamID ([[maybe_unused]] AudioProcessorParameter* param)
{ {
ignoreUnused (param);
#if JUCE_DEBUG && ! JUCE_DISABLE_CAUTIOUS_PARAMETER_ID_CHECKING #if JUCE_DEBUG && ! JUCE_DISABLE_CAUTIOUS_PARAMETER_ID_CHECKING
if (auto* withID = dynamic_cast<AudioProcessorParameterWithID*> (param)) if (auto* withID = dynamic_cast<AudioProcessorParameterWithID*> (param))
{ {
@@ -476,10 +473,8 @@ void AudioProcessor::checkForDuplicateTrimmedParamID (AudioProcessorParameter* p
#endif #endif
} }
void AudioProcessor::checkForDuplicateParamID (AudioProcessorParameter* param)
void AudioProcessor::checkForDuplicateParamID ([[maybe_unused]] AudioProcessorParameter* param)
{ {
ignoreUnused (param);
#if JUCE_DEBUG #if JUCE_DEBUG
if (auto* withID = dynamic_cast<AudioProcessorParameterWithID*> (param)) if (auto* withID = dynamic_cast<AudioProcessorParameterWithID*> (param))
{ {
@@ -491,10 +486,8 @@ void AudioProcessor::checkForDuplicateParamID (AudioProcessorParameter* param)
#endif #endif
} }
void AudioProcessor::checkForDuplicateGroupIDs (const AudioProcessorParameterGroup& newGroup)
void AudioProcessor::checkForDuplicateGroupIDs ([[maybe_unused]] const AudioProcessorParameterGroup& newGroup)
{ {
ignoreUnused (newGroup);
#if JUCE_DEBUG #if JUCE_DEBUG
auto groups = newGroup.getSubgroups (true); auto groups = newGroup.getSubgroups (true);
groups.add (&newGroup); groups.add (&newGroup);
@@ -598,10 +591,9 @@ void AudioProcessor::processBypassed (AudioBuffer<floatType>& buffer, MidiBuffer
void AudioProcessor::processBlockBypassed (AudioBuffer<float>& buffer, MidiBuffer& midi) { processBypassed (buffer, midi); } void AudioProcessor::processBlockBypassed (AudioBuffer<float>& buffer, MidiBuffer& midi) { processBypassed (buffer, midi); }
void AudioProcessor::processBlockBypassed (AudioBuffer<double>& buffer, MidiBuffer& midi) { processBypassed (buffer, midi); } void AudioProcessor::processBlockBypassed (AudioBuffer<double>& buffer, MidiBuffer& midi) { processBypassed (buffer, midi); }
void AudioProcessor::processBlock (AudioBuffer<double>& buffer, MidiBuffer& midiMessages)
void AudioProcessor::processBlock ([[maybe_unused]] AudioBuffer<double>& buffer,
[[maybe_unused]] MidiBuffer& midiMessages)
{ {
ignoreUnused (buffer, midiMessages);
// If you hit this assertion then either the caller called the double // If you hit this assertion then either the caller called the double
// precision version of processBlock on a processor which does not support it // precision version of processBlock on a processor which does not support it
// (i.e. supportsDoublePrecisionProcessing() returns false), or the implementation // (i.e. supportsDoublePrecisionProcessing() returns false), or the implementation
@@ -1493,6 +1485,9 @@ AudioProcessorParameter* AudioProcessor::getParamChecked (int index) const
return p; return p;
} }
bool AudioProcessor::canAddBus ([[maybe_unused]] bool isInput) const { return false; }
bool AudioProcessor::canRemoveBus ([[maybe_unused]] bool isInput) const { return false; }
JUCE_END_IGNORE_WARNINGS_GCC_LIKE JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC JUCE_END_IGNORE_WARNINGS_MSVC


+ 2
- 2
modules/juce_audio_processors/processors/juce_AudioProcessor.h View File

@@ -524,7 +524,7 @@ public:
@see addBus @see addBus
*/ */
virtual bool canAddBus (bool isInput) const { ignoreUnused (isInput); return false; }
virtual bool canAddBus (bool isInput) const;
/** Callback to query if the last bus can currently be removed. /** Callback to query if the last bus can currently be removed.
@@ -537,7 +537,7 @@ public:
The default implementation will always return false. The default implementation will always return false.
*/ */
virtual bool canRemoveBus (bool isInput) const { ignoreUnused (isInput); return false; }
virtual bool canRemoveBus (bool isInput) const;
/** Dynamically request an additional bus. /** Dynamically request an additional bus.


+ 2
- 4
modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp View File

@@ -216,13 +216,11 @@ void AudioProcessorEditor::setScaleFactor (float newScale)
typedef ComponentPeer* (*createUnityPeerFunctionType) (Component&); typedef ComponentPeer* (*createUnityPeerFunctionType) (Component&);
createUnityPeerFunctionType juce_createUnityPeerFn = nullptr; createUnityPeerFunctionType juce_createUnityPeerFn = nullptr;
ComponentPeer* AudioProcessorEditor::createNewPeer (int styleFlags, void* nativeWindow)
ComponentPeer* AudioProcessorEditor::createNewPeer ([[maybe_unused]] int styleFlags,
[[maybe_unused]] void* nativeWindow)
{ {
if (juce_createUnityPeerFn != nullptr) if (juce_createUnityPeerFn != nullptr)
{
ignoreUnused (styleFlags, nativeWindow);
return juce_createUnityPeerFn (*this); return juce_createUnityPeerFn (*this);
}
return Component::createNewPeer (styleFlags, nativeWindow); return Component::createNewPeer (styleFlags, nativeWindow);
} }


+ 30
- 46
modules/juce_audio_processors/utilities/ARA/juce_ARADocumentController.cpp View File

@@ -834,138 +834,122 @@ ARAEditorView* ARADocumentControllerSpecialisation::doCreateEditorView()
return new ARAEditorView (getDocumentController()); return new ARAEditorView (getDocumentController());
} }
bool ARADocumentControllerSpecialisation::doIsAudioSourceContentAvailable (const ARA::PlugIn::AudioSource* audioSource,
ARA::ARAContentType type)
bool ARADocumentControllerSpecialisation::doIsAudioSourceContentAvailable ([[maybe_unused]] const ARA::PlugIn::AudioSource* audioSource,
[[maybe_unused]] ARA::ARAContentType type)
{ {
juce::ignoreUnused (audioSource, type);
return false; return false;
} }
ARA::ARAContentGrade ARADocumentControllerSpecialisation::doGetAudioSourceContentGrade (const ARA::PlugIn::AudioSource* audioSource,
ARA::ARAContentType type)
ARA::ARAContentGrade ARADocumentControllerSpecialisation::doGetAudioSourceContentGrade ([[maybe_unused]] const ARA::PlugIn::AudioSource* audioSource,
[[maybe_unused]] ARA::ARAContentType type)
{ {
// Overriding doIsAudioSourceContentAvailable() requires overriding // Overriding doIsAudioSourceContentAvailable() requires overriding
// doGetAudioSourceContentGrade() accordingly! // doGetAudioSourceContentGrade() accordingly!
jassertfalse; jassertfalse;
juce::ignoreUnused (audioSource, type);
return ARA::kARAContentGradeInitial; return ARA::kARAContentGradeInitial;
} }
ARA::PlugIn::ContentReader* ARADocumentControllerSpecialisation::doCreateAudioSourceContentReader (ARA::PlugIn::AudioSource* audioSource,
ARA::ARAContentType type,
const ARA::ARAContentTimeRange* range)
ARA::PlugIn::ContentReader* ARADocumentControllerSpecialisation::doCreateAudioSourceContentReader ([[maybe_unused]] ARA::PlugIn::AudioSource* audioSource,
[[maybe_unused]] ARA::ARAContentType type,
[[maybe_unused]] const ARA::ARAContentTimeRange* range)
{ {
// Overriding doIsAudioSourceContentAvailable() requires overriding // Overriding doIsAudioSourceContentAvailable() requires overriding
// doCreateAudioSourceContentReader() accordingly! // doCreateAudioSourceContentReader() accordingly!
jassertfalse; jassertfalse;
juce::ignoreUnused (audioSource, type, range);
return nullptr; return nullptr;
} }
bool ARADocumentControllerSpecialisation::doIsAudioModificationContentAvailable (const ARA::PlugIn::AudioModification* audioModification,
ARA::ARAContentType type)
bool ARADocumentControllerSpecialisation::doIsAudioModificationContentAvailable ([[maybe_unused]] const ARA::PlugIn::AudioModification* audioModification,
[[maybe_unused]] ARA::ARAContentType type)
{ {
juce::ignoreUnused (audioModification, type);
return false; return false;
} }
ARA::ARAContentGrade ARADocumentControllerSpecialisation::doGetAudioModificationContentGrade (const ARA::PlugIn::AudioModification* audioModification,
ARA::ARAContentType type)
ARA::ARAContentGrade ARADocumentControllerSpecialisation::doGetAudioModificationContentGrade ([[maybe_unused]] const ARA::PlugIn::AudioModification* audioModification,
[[maybe_unused]] ARA::ARAContentType type)
{ {
// Overriding doIsAudioModificationContentAvailable() requires overriding // Overriding doIsAudioModificationContentAvailable() requires overriding
// doGetAudioModificationContentGrade() accordingly! // doGetAudioModificationContentGrade() accordingly!
jassertfalse; jassertfalse;
juce::ignoreUnused (audioModification, type);
return ARA::kARAContentGradeInitial; return ARA::kARAContentGradeInitial;
} }
ARA::PlugIn::ContentReader* ARADocumentControllerSpecialisation::doCreateAudioModificationContentReader (ARA::PlugIn::AudioModification* audioModification,
ARA::ARAContentType type,
const ARA::ARAContentTimeRange* range)
ARA::PlugIn::ContentReader* ARADocumentControllerSpecialisation::doCreateAudioModificationContentReader ([[maybe_unused]] ARA::PlugIn::AudioModification* audioModification,
[[maybe_unused]] ARA::ARAContentType type,
[[maybe_unused]] const ARA::ARAContentTimeRange* range)
{ {
// Overriding doIsAudioModificationContentAvailable() requires overriding // Overriding doIsAudioModificationContentAvailable() requires overriding
// doCreateAudioModificationContentReader() accordingly! // doCreateAudioModificationContentReader() accordingly!
jassertfalse; jassertfalse;
juce::ignoreUnused (audioModification, type, range);
return nullptr; return nullptr;
} }
bool ARADocumentControllerSpecialisation::doIsPlaybackRegionContentAvailable (const ARA::PlugIn::PlaybackRegion* playbackRegion,
ARA::ARAContentType type)
bool ARADocumentControllerSpecialisation::doIsPlaybackRegionContentAvailable ([[maybe_unused]] const ARA::PlugIn::PlaybackRegion* playbackRegion,
[[maybe_unused]] ARA::ARAContentType type)
{ {
juce::ignoreUnused (playbackRegion, type);
return false; return false;
} }
ARA::ARAContentGrade ARADocumentControllerSpecialisation::doGetPlaybackRegionContentGrade (const ARA::PlugIn::PlaybackRegion* playbackRegion,
ARA::ARAContentType type)
ARA::ARAContentGrade ARADocumentControllerSpecialisation::doGetPlaybackRegionContentGrade ([[maybe_unused]] const ARA::PlugIn::PlaybackRegion* playbackRegion,
[[maybe_unused]] ARA::ARAContentType type)
{ {
// Overriding doIsPlaybackRegionContentAvailable() requires overriding // Overriding doIsPlaybackRegionContentAvailable() requires overriding
// doGetPlaybackRegionContentGrade() accordingly! // doGetPlaybackRegionContentGrade() accordingly!
jassertfalse; jassertfalse;
juce::ignoreUnused (playbackRegion, type);
return ARA::kARAContentGradeInitial; return ARA::kARAContentGradeInitial;
} }
ARA::PlugIn::ContentReader* ARADocumentControllerSpecialisation::doCreatePlaybackRegionContentReader (ARA::PlugIn::PlaybackRegion* playbackRegion,
ARA::ARAContentType type,
const ARA::ARAContentTimeRange* range)
ARA::PlugIn::ContentReader* ARADocumentControllerSpecialisation::doCreatePlaybackRegionContentReader ([[maybe_unused]] ARA::PlugIn::PlaybackRegion* playbackRegion,
[[maybe_unused]] ARA::ARAContentType type,
[[maybe_unused]] const ARA::ARAContentTimeRange* range)
{ {
// Overriding doIsPlaybackRegionContentAvailable() requires overriding // Overriding doIsPlaybackRegionContentAvailable() requires overriding
// doCreatePlaybackRegionContentReader() accordingly! // doCreatePlaybackRegionContentReader() accordingly!
jassertfalse; jassertfalse;
juce::ignoreUnused (playbackRegion, type, range);
return nullptr; return nullptr;
} }
bool ARADocumentControllerSpecialisation::doIsAudioSourceContentAnalysisIncomplete (const ARA::PlugIn::AudioSource* audioSource,
ARA::ARAContentType type)
bool ARADocumentControllerSpecialisation::doIsAudioSourceContentAnalysisIncomplete ([[maybe_unused]] const ARA::PlugIn::AudioSource* audioSource,
[[maybe_unused]] ARA::ARAContentType type)
{ {
juce::ignoreUnused (audioSource, type);
return false; return false;
} }
void ARADocumentControllerSpecialisation::doRequestAudioSourceContentAnalysis (ARA::PlugIn::AudioSource* audioSource,
std::vector<ARA::ARAContentType> const& contentTypes)
void ARADocumentControllerSpecialisation::doRequestAudioSourceContentAnalysis ([[maybe_unused]] ARA::PlugIn::AudioSource* audioSource,
[[maybe_unused]] std::vector<ARA::ARAContentType> const& contentTypes)
{ {
juce::ignoreUnused (audioSource, contentTypes);
} }
ARA::ARAInt32 ARADocumentControllerSpecialisation::doGetProcessingAlgorithmsCount() { return 0; } ARA::ARAInt32 ARADocumentControllerSpecialisation::doGetProcessingAlgorithmsCount() { return 0; }
const ARA::ARAProcessingAlgorithmProperties* const ARA::ARAProcessingAlgorithmProperties*
ARADocumentControllerSpecialisation::doGetProcessingAlgorithmProperties (ARA::ARAInt32 algorithmIndex)
ARADocumentControllerSpecialisation::doGetProcessingAlgorithmProperties ([[maybe_unused]] ARA::ARAInt32 algorithmIndex)
{ {
juce::ignoreUnused (algorithmIndex);
return nullptr; return nullptr;
} }
ARA::ARAInt32 ARADocumentControllerSpecialisation::doGetProcessingAlgorithmForAudioSource (const ARA::PlugIn::AudioSource* audioSource)
ARA::ARAInt32 ARADocumentControllerSpecialisation::doGetProcessingAlgorithmForAudioSource ([[maybe_unused]] const ARA::PlugIn::AudioSource* audioSource)
{ {
// doGetProcessingAlgorithmForAudioSource() must be implemented if the supported // doGetProcessingAlgorithmForAudioSource() must be implemented if the supported
// algorithm count is greater than zero. // algorithm count is greater than zero.
if (getDocumentController()->getProcessingAlgorithmsCount() > 0) if (getDocumentController()->getProcessingAlgorithmsCount() > 0)
jassertfalse; jassertfalse;
juce::ignoreUnused (audioSource);
return 0; return 0;
} }
void ARADocumentControllerSpecialisation::doRequestProcessingAlgorithmForAudioSource (ARA::PlugIn::AudioSource* audioSource,
ARA::ARAInt32 algorithmIndex)
void ARADocumentControllerSpecialisation::doRequestProcessingAlgorithmForAudioSource ([[maybe_unused]] ARA::PlugIn::AudioSource* audioSource,
[[maybe_unused]] ARA::ARAInt32 algorithmIndex)
{ {
// doRequestProcessingAlgorithmForAudioSource() must be implemented if the supported // doRequestProcessingAlgorithmForAudioSource() must be implemented if the supported
// algorithm count is greater than zero. // algorithm count is greater than zero.
if (getDocumentController()->getProcessingAlgorithmsCount() > 0)
jassertfalse;
juce::ignoreUnused (audioSource, algorithmIndex);
jassert (getDocumentController()->getProcessingAlgorithmsCount() <= 0);
} }
} // namespace juce } // namespace juce

+ 94
- 0
modules/juce_audio_processors/utilities/ARA/juce_ARAModelObjects.cpp View File

@@ -196,4 +196,98 @@ void ARAPlaybackRegion::notifyContentChanged (ARAContentUpdateScopes scopeFlags,
notifyARAHost); notifyARAHost);
} }
//==============================================================================
void ARADocumentListener::willBeginEditing ([[maybe_unused]] ARADocument* document) {}
void ARADocumentListener::didEndEditing ([[maybe_unused]] ARADocument* document) {}
void ARADocumentListener::willNotifyModelUpdates ([[maybe_unused]] ARADocument* document) {}
void ARADocumentListener::didNotifyModelUpdates ([[maybe_unused]] ARADocument* document) {}
void ARADocumentListener::willUpdateDocumentProperties ([[maybe_unused]] ARADocument* document,
[[maybe_unused]] ARA::PlugIn::PropertiesPtr<ARA::ARADocumentProperties> newProperties) {}
void ARADocumentListener::didUpdateDocumentProperties ([[maybe_unused]] ARADocument* document) {}
void ARADocumentListener::didAddMusicalContextToDocument ([[maybe_unused]] ARADocument* document,
[[maybe_unused]] ARAMusicalContext* musicalContext) {}
void ARADocumentListener::willRemoveMusicalContextFromDocument ([[maybe_unused]] ARADocument* document,
[[maybe_unused]] ARAMusicalContext* musicalContext) {}
void ARADocumentListener::didReorderMusicalContextsInDocument ([[maybe_unused]] ARADocument* document) {}
void ARADocumentListener::didAddRegionSequenceToDocument ([[maybe_unused]] ARADocument* document,
[[maybe_unused]] ARARegionSequence* regionSequence) {}
void ARADocumentListener::willRemoveRegionSequenceFromDocument ([[maybe_unused]] ARADocument* document,
[[maybe_unused]] ARARegionSequence* regionSequence) {}
void ARADocumentListener::didReorderRegionSequencesInDocument ([[maybe_unused]] ARADocument* document) {}
void ARADocumentListener::didAddAudioSourceToDocument ([[maybe_unused]] ARADocument* document,
[[maybe_unused]] ARAAudioSource* audioSource) {}
void ARADocumentListener::willRemoveAudioSourceFromDocument ([[maybe_unused]] ARADocument* document,
[[maybe_unused]] ARAAudioSource* audioSource) {}
void ARADocumentListener::willDestroyDocument ([[maybe_unused]] ARADocument* document) {}
//==============================================================================
void ARAMusicalContextListener::willUpdateMusicalContextProperties ([[maybe_unused]] ARAMusicalContext* musicalContext,
[[maybe_unused]] ARA::PlugIn::PropertiesPtr<ARA::ARAMusicalContextProperties> newProperties) {}
void ARAMusicalContextListener::didUpdateMusicalContextProperties ([[maybe_unused]] ARAMusicalContext* musicalContext) {}
void ARAMusicalContextListener::doUpdateMusicalContextContent ([[maybe_unused]] ARAMusicalContext* musicalContext,
[[maybe_unused]] ARAContentUpdateScopes scopeFlags) {}
void ARAMusicalContextListener::didAddRegionSequenceToMusicalContext ([[maybe_unused]] ARAMusicalContext* musicalContext,
[[maybe_unused]] ARARegionSequence* regionSequence) {}
void ARAMusicalContextListener::willRemoveRegionSequenceFromMusicalContext ([[maybe_unused]] ARAMusicalContext* musicalContext,
[[maybe_unused]] ARARegionSequence* regionSequence) {}
void ARAMusicalContextListener::didReorderRegionSequencesInMusicalContext ([[maybe_unused]] ARAMusicalContext* musicalContext) {}
void ARAMusicalContextListener::willDestroyMusicalContext ([[maybe_unused]] ARAMusicalContext* musicalContext) {}
//==============================================================================
void ARAPlaybackRegionListener::willUpdatePlaybackRegionProperties ([[maybe_unused]] ARAPlaybackRegion* playbackRegion,
[[maybe_unused]] ARA::PlugIn::PropertiesPtr<ARA::ARAPlaybackRegionProperties> newProperties) {}
void ARAPlaybackRegionListener::didUpdatePlaybackRegionProperties ([[maybe_unused]] ARAPlaybackRegion* playbackRegion) {}
void ARAPlaybackRegionListener::didUpdatePlaybackRegionContent ([[maybe_unused]] ARAPlaybackRegion* playbackRegion,
[[maybe_unused]] ARAContentUpdateScopes scopeFlags) {}
void ARAPlaybackRegionListener::willDestroyPlaybackRegion ([[maybe_unused]] ARAPlaybackRegion* playbackRegion) {}
//==============================================================================
void ARARegionSequenceListener::willUpdateRegionSequenceProperties ([[maybe_unused]] ARARegionSequence* regionSequence,
[[maybe_unused]] ARA::PlugIn::PropertiesPtr<ARA::ARARegionSequenceProperties> newProperties) {}
void ARARegionSequenceListener::didUpdateRegionSequenceProperties ([[maybe_unused]] ARARegionSequence* regionSequence) {}
void ARARegionSequenceListener::willRemovePlaybackRegionFromRegionSequence ([[maybe_unused]] ARARegionSequence* regionSequence,
[[maybe_unused]] ARAPlaybackRegion* playbackRegion) {}
void ARARegionSequenceListener::didAddPlaybackRegionToRegionSequence ([[maybe_unused]] ARARegionSequence* regionSequence,
[[maybe_unused]] ARAPlaybackRegion* playbackRegion) {}
void ARARegionSequenceListener::willDestroyRegionSequence ([[maybe_unused]] ARARegionSequence* regionSequence) {}
//==============================================================================
void ARAAudioSourceListener::willUpdateAudioSourceProperties ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] ARA::PlugIn::PropertiesPtr<ARA::ARAAudioSourceProperties> newProperties) {}
void ARAAudioSourceListener::didUpdateAudioSourceProperties ([[maybe_unused]] ARAAudioSource* audioSource) {}
void ARAAudioSourceListener::doUpdateAudioSourceContent ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] ARAContentUpdateScopes scopeFlags) {}
void ARAAudioSourceListener::didUpdateAudioSourceAnalysisProgress ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] ARA::ARAAnalysisProgressState state,
[[maybe_unused]] float progress) {}
void ARAAudioSourceListener::willEnableAudioSourceSamplesAccess ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] bool enable) {}
void ARAAudioSourceListener::didEnableAudioSourceSamplesAccess ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] bool enable) {}
void ARAAudioSourceListener::willDeactivateAudioSourceForUndoHistory ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] bool deactivate) {}
void ARAAudioSourceListener::didDeactivateAudioSourceForUndoHistory ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] bool deactivate) {}
void ARAAudioSourceListener::didAddAudioModificationToAudioSource ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] ARAAudioModification* audioModification) {}
void ARAAudioSourceListener::willRemoveAudioModificationFromAudioSource ([[maybe_unused]] ARAAudioSource* audioSource,
[[maybe_unused]] ARAAudioModification* audioModification) {}
void ARAAudioSourceListener::willDestroyAudioSource ([[maybe_unused]] ARAAudioSource* audioSource) {}
//==============================================================================
void ARAAudioModificationListener::willUpdateAudioModificationProperties ([[maybe_unused]] ARAAudioModification* audioModification,
[[maybe_unused]] ARA::PlugIn::PropertiesPtr<ARA::ARAAudioModificationProperties> newProperties) {}
void ARAAudioModificationListener::didUpdateAudioModificationProperties ([[maybe_unused]] ARAAudioModification* audioModification) {}
void ARAAudioModificationListener::didUpdateAudioModificationContent ([[maybe_unused]] ARAAudioModification* audioModification,
[[maybe_unused]] ARAContentUpdateScopes scopeFlags) {}
void ARAAudioModificationListener::willDeactivateAudioModificationForUndoHistory ([[maybe_unused]] ARAAudioModification* audioModification,
[[maybe_unused]] bool deactivate) {}
void ARAAudioModificationListener::didDeactivateAudioModificationForUndoHistory ([[maybe_unused]] ARAAudioModification* audioModification,
[[maybe_unused]] bool deactivate) {}
void ARAAudioModificationListener::didAddPlaybackRegionToAudioModification ([[maybe_unused]] ARAAudioModification* audioModification,
[[maybe_unused]] ARAPlaybackRegion* playbackRegion) {}
void ARAAudioModificationListener::willRemovePlaybackRegionFromAudioModification ([[maybe_unused]] ARAAudioModification* audioModification,
[[maybe_unused]] ARAPlaybackRegion* playbackRegion) {}
void ARAAudioModificationListener::willDestroyAudioModification ([[maybe_unused]] ARAAudioModification* audioModification) {}
} // namespace juce } // namespace juce

+ 57
- 228
modules/juce_audio_processors/utilities/ARA/juce_ARAModelObjects.h View File

@@ -181,76 +181,49 @@ public:
/** Destructor */ /** Destructor */
virtual ~ARADocumentListener() = default; virtual ~ARADocumentListener() = default;
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_BEGIN
/** Called before the document enters an editing state. /** Called before the document enters an editing state.
@param document The document about to enter an editing state. @param document The document about to enter an editing state.
*/ */
virtual void willBeginEditing (ARADocument* document)
{
ignoreUnused (document);
}
virtual void willBeginEditing (ARADocument* document);
/** Called after the document exits an editing state. /** Called after the document exits an editing state.
@param document The document about exit an editing state. @param document The document about exit an editing state.
*/ */
virtual void didEndEditing (ARADocument* document)
{
ignoreUnused (document);
}
virtual void didEndEditing (ARADocument* document);
/** Called before sending model updates do the host. /** Called before sending model updates do the host.
@param document The document whose model updates are about to be sent. @param document The document whose model updates are about to be sent.
*/ */
virtual void willNotifyModelUpdates (ARADocument* document)
{
ignoreUnused (document);
}
virtual void willNotifyModelUpdates (ARADocument* document);
/** Called after sending model updates do the host. /** Called after sending model updates do the host.
@param document The document whose model updates have just been sent. @param document The document whose model updates have just been sent.
*/ */
virtual void didNotifyModelUpdates (ARADocument* document)
{
ignoreUnused (document);
}
virtual void didNotifyModelUpdates (ARADocument* document);
/** Called before the document's properties are updated. /** Called before the document's properties are updated.
@param document The document whose properties will be updated. @param document The document whose properties will be updated.
@param newProperties The document properties that will be assigned to \p document. @param newProperties The document properties that will be assigned to \p document.
*/ */
virtual void willUpdateDocumentProperties (ARADocument* document, virtual void willUpdateDocumentProperties (ARADocument* document,
ARA::PlugIn::PropertiesPtr<ARA::ARADocumentProperties> newProperties)
{
ignoreUnused (document, newProperties);
}
ARA::PlugIn::PropertiesPtr<ARA::ARADocumentProperties> newProperties);
/** Called after the document's properties are updated. /** Called after the document's properties are updated.
@param document The document whose properties were updated. @param document The document whose properties were updated.
*/ */
virtual void didUpdateDocumentProperties (ARADocument* document)
{
ignoreUnused (document);
}
virtual void didUpdateDocumentProperties (ARADocument* document);
/** Called after a musical context is added to the document. /** Called after a musical context is added to the document.
@param document The document that \p musicalContext was added to. @param document The document that \p musicalContext was added to.
@param musicalContext The musical context that was added to \p document. @param musicalContext The musical context that was added to \p document.
*/ */
virtual void didAddMusicalContextToDocument (ARADocument* document, ARAMusicalContext* musicalContext)
{
ignoreUnused (document, musicalContext);
}
virtual void didAddMusicalContextToDocument (ARADocument* document, ARAMusicalContext* musicalContext);
/** Called before a musical context is removed from the document. /** Called before a musical context is removed from the document.
@param document The document that \p musicalContext will be removed from. @param document The document that \p musicalContext will be removed from.
@param musicalContext The musical context that will be removed from \p document. @param musicalContext The musical context that will be removed from \p document.
*/ */
virtual void willRemoveMusicalContextFromDocument (ARADocument* document,
ARAMusicalContext* musicalContext)
{
ignoreUnused (document, musicalContext);
}
virtual void willRemoveMusicalContextFromDocument (ARADocument* document, ARAMusicalContext* musicalContext);
/** Called after the musical contexts are reordered in an ARA document /** Called after the musical contexts are reordered in an ARA document
@@ -259,29 +232,19 @@ public:
@param document The document with reordered musical contexts. @param document The document with reordered musical contexts.
*/ */
virtual void didReorderMusicalContextsInDocument (ARADocument* document)
{
ignoreUnused (document);
}
virtual void didReorderMusicalContextsInDocument (ARADocument* document);
/** Called after a region sequence is added to the document. /** Called after a region sequence is added to the document.
@param document The document that \p regionSequence was added to. @param document The document that \p regionSequence was added to.
@param regionSequence The region sequence that was added to \p document. @param regionSequence The region sequence that was added to \p document.
*/ */
virtual void didAddRegionSequenceToDocument (ARADocument* document, ARARegionSequence* regionSequence)
{
ignoreUnused (document, regionSequence);
}
virtual void didAddRegionSequenceToDocument (ARADocument* document, ARARegionSequence* regionSequence);
/** Called before a region sequence is removed from the document. /** Called before a region sequence is removed from the document.
@param document The document that \p regionSequence will be removed from. @param document The document that \p regionSequence will be removed from.
@param regionSequence The region sequence that will be removed from \p document. @param regionSequence The region sequence that will be removed from \p document.
*/ */
virtual void willRemoveRegionSequenceFromDocument (ARADocument* document,
ARARegionSequence* regionSequence)
{
ignoreUnused (document, regionSequence);
}
virtual void willRemoveRegionSequenceFromDocument (ARADocument* document, ARARegionSequence* regionSequence);
/** Called after the region sequences are reordered in an ARA document /** Called after the region sequences are reordered in an ARA document
@@ -290,38 +253,24 @@ public:
@param document The document with reordered region sequences. @param document The document with reordered region sequences.
*/ */
virtual void didReorderRegionSequencesInDocument (ARADocument* document)
{
ignoreUnused (document);
}
virtual void didReorderRegionSequencesInDocument (ARADocument* document);
/** Called after an audio source is added to the document. /** Called after an audio source is added to the document.
@param document The document that \p audioSource was added to. @param document The document that \p audioSource was added to.
@param audioSource The audio source that was added to \p document. @param audioSource The audio source that was added to \p document.
*/ */
virtual void didAddAudioSourceToDocument (ARADocument* document, ARAAudioSource* audioSource)
{
ignoreUnused (document, audioSource);
}
virtual void didAddAudioSourceToDocument (ARADocument* document, ARAAudioSource* audioSource);
/** Called before an audio source is removed from the document. /** Called before an audio source is removed from the document.
@param document The document that \p audioSource will be removed from . @param document The document that \p audioSource will be removed from .
@param audioSource The audio source that will be removed from \p document. @param audioSource The audio source that will be removed from \p document.
*/ */
virtual void willRemoveAudioSourceFromDocument (ARADocument* document, ARAAudioSource* audioSource)
{
ignoreUnused (document, audioSource);
}
virtual void willRemoveAudioSourceFromDocument (ARADocument* document, ARAAudioSource* audioSource);
/** Called before the document is destroyed by the ARA host. /** Called before the document is destroyed by the ARA host.
@param document The document that will be destroyed. @param document The document that will be destroyed.
*/ */
virtual void willDestroyDocument (ARADocument* document)
{
ignoreUnused (document);
}
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_END
virtual void willDestroyDocument (ARADocument* document);
}; };
//============================================================================== //==============================================================================
@@ -395,55 +344,36 @@ class JUCE_API ARAMusicalContextListener
public: public:
virtual ~ARAMusicalContextListener() = default; virtual ~ARAMusicalContextListener() = default;
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_BEGIN
/** Called before the musical context's properties are updated. /** Called before the musical context's properties are updated.
@param musicalContext The musical context whose properties will be updated. @param musicalContext The musical context whose properties will be updated.
@param newProperties The musical context properties that will be assigned to \p musicalContext. @param newProperties The musical context properties that will be assigned to \p musicalContext.
*/ */
virtual void willUpdateMusicalContextProperties (ARAMusicalContext* musicalContext, virtual void willUpdateMusicalContextProperties (ARAMusicalContext* musicalContext,
ARA::PlugIn::PropertiesPtr<ARA::ARAMusicalContextProperties> newProperties)
{
ignoreUnused (musicalContext, newProperties);
}
ARA::PlugIn::PropertiesPtr<ARA::ARAMusicalContextProperties> newProperties);
/** Called after the musical context's properties are updated by the host. /** Called after the musical context's properties are updated by the host.
@param musicalContext The musical context whose properties were updated. @param musicalContext The musical context whose properties were updated.
*/ */
virtual void didUpdateMusicalContextProperties (ARAMusicalContext* musicalContext)
{
ignoreUnused (musicalContext);
}
virtual void didUpdateMusicalContextProperties (ARAMusicalContext* musicalContext);
/** Called when the musical context's content (i.e tempo entries or chords) changes. /** Called when the musical context's content (i.e tempo entries or chords) changes.
@param musicalContext The musical context with updated content. @param musicalContext The musical context with updated content.
@param scopeFlags The scope of the content update indicating what has changed. @param scopeFlags The scope of the content update indicating what has changed.
*/ */
virtual void doUpdateMusicalContextContent (ARAMusicalContext* musicalContext,
ARAContentUpdateScopes scopeFlags)
{
ignoreUnused (musicalContext, scopeFlags);
}
virtual void doUpdateMusicalContextContent (ARAMusicalContext* musicalContext, ARAContentUpdateScopes scopeFlags);
/** Called after a region sequence is added to the musical context. /** Called after a region sequence is added to the musical context.
@param musicalContext The musical context that \p regionSequence was added to. @param musicalContext The musical context that \p regionSequence was added to.
@param regionSequence The region sequence that was added to \p musicalContext. @param regionSequence The region sequence that was added to \p musicalContext.
*/ */
virtual void didAddRegionSequenceToMusicalContext (ARAMusicalContext* musicalContext,
ARARegionSequence* regionSequence)
{
ignoreUnused (musicalContext, regionSequence);
}
virtual void didAddRegionSequenceToMusicalContext (ARAMusicalContext* musicalContext, ARARegionSequence* regionSequence);
/** Called before a region sequence is removed from the musical context. /** Called before a region sequence is removed from the musical context.
@param musicalContext The musical context that \p regionSequence will be removed from. @param musicalContext The musical context that \p regionSequence will be removed from.
@param regionSequence The region sequence that will be removed from \p musicalContext. @param regionSequence The region sequence that will be removed from \p musicalContext.
*/ */
virtual void willRemoveRegionSequenceFromMusicalContext (ARAMusicalContext* musicalContext, virtual void willRemoveRegionSequenceFromMusicalContext (ARAMusicalContext* musicalContext,
ARARegionSequence* regionSequence)
{
ignoreUnused (musicalContext, regionSequence);
}
ARARegionSequence* regionSequence);
/** Called after the region sequences are reordered in an ARA MusicalContext /** Called after the region sequences are reordered in an ARA MusicalContext
@@ -452,20 +382,12 @@ public:
@param musicalContext The musical context with reordered region sequences. @param musicalContext The musical context with reordered region sequences.
*/ */
virtual void didReorderRegionSequencesInMusicalContext (ARAMusicalContext* musicalContext)
{
ignoreUnused (musicalContext);
}
virtual void didReorderRegionSequencesInMusicalContext (ARAMusicalContext* musicalContext);
/** Called before the musical context is destroyed. /** Called before the musical context is destroyed.
@param musicalContext The musical context that will be destroyed. @param musicalContext The musical context that will be destroyed.
*/ */
virtual void willDestroyMusicalContext (ARAMusicalContext* musicalContext)
{
ignoreUnused (musicalContext);
}
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_END
virtual void willDestroyMusicalContext (ARAMusicalContext* musicalContext);
}; };
//============================================================================== //==============================================================================
@@ -528,45 +450,29 @@ public:
/** Destructor. */ /** Destructor. */
virtual ~ARAPlaybackRegionListener() = default; virtual ~ARAPlaybackRegionListener() = default;
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_BEGIN
/** Called before the playback region's properties are updated. /** Called before the playback region's properties are updated.
@param playbackRegion The playback region whose properties will be updated. @param playbackRegion The playback region whose properties will be updated.
@param newProperties The playback region properties that will be assigned to \p playbackRegion. @param newProperties The playback region properties that will be assigned to \p playbackRegion.
*/ */
virtual void willUpdatePlaybackRegionProperties (ARAPlaybackRegion* playbackRegion, virtual void willUpdatePlaybackRegionProperties (ARAPlaybackRegion* playbackRegion,
ARA::PlugIn::PropertiesPtr<ARA::ARAPlaybackRegionProperties> newProperties)
{
ignoreUnused (playbackRegion, newProperties);
}
ARA::PlugIn::PropertiesPtr<ARA::ARAPlaybackRegionProperties> newProperties);
/** Called after the playback region's properties are updated. /** Called after the playback region's properties are updated.
@param playbackRegion The playback region whose properties were updated. @param playbackRegion The playback region whose properties were updated.
*/ */
virtual void didUpdatePlaybackRegionProperties (ARAPlaybackRegion* playbackRegion)
{
ignoreUnused (playbackRegion);
}
virtual void didUpdatePlaybackRegionProperties (ARAPlaybackRegion* playbackRegion);
/** Called when the playback region's content (i.e. samples or notes) changes. /** Called when the playback region's content (i.e. samples or notes) changes.
@param playbackRegion The playback region with updated content. @param playbackRegion The playback region with updated content.
@param scopeFlags The scope of the content update. @param scopeFlags The scope of the content update.
*/ */
virtual void didUpdatePlaybackRegionContent (ARAPlaybackRegion* playbackRegion, virtual void didUpdatePlaybackRegionContent (ARAPlaybackRegion* playbackRegion,
ARAContentUpdateScopes scopeFlags)
{
ignoreUnused (playbackRegion, scopeFlags);
}
ARAContentUpdateScopes scopeFlags);
/** Called before the playback region is destroyed. /** Called before the playback region is destroyed.
@param playbackRegion The playback region that will be destroyed. @param playbackRegion The playback region that will be destroyed.
*/ */
virtual void willDestroyPlaybackRegion (ARAPlaybackRegion* playbackRegion)
{
ignoreUnused (playbackRegion);
}
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_END
virtual void willDestroyPlaybackRegion (ARAPlaybackRegion* playbackRegion);
}; };
//============================================================================== //==============================================================================
@@ -665,55 +571,36 @@ public:
/** Destructor. */ /** Destructor. */
virtual ~ARARegionSequenceListener() = default; virtual ~ARARegionSequenceListener() = default;
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_BEGIN
/** Called before the region sequence's properties are updated. /** Called before the region sequence's properties are updated.
@param regionSequence The region sequence whose properties will be updated. @param regionSequence The region sequence whose properties will be updated.
@param newProperties The region sequence properties that will be assigned to \p regionSequence. @param newProperties The region sequence properties that will be assigned to \p regionSequence.
*/ */
virtual void willUpdateRegionSequenceProperties (ARARegionSequence* regionSequence, virtual void willUpdateRegionSequenceProperties (ARARegionSequence* regionSequence,
ARA::PlugIn::PropertiesPtr<ARA::ARARegionSequenceProperties> newProperties)
{
ignoreUnused (regionSequence, newProperties);
}
ARA::PlugIn::PropertiesPtr<ARA::ARARegionSequenceProperties> newProperties);
/** Called after the region sequence's properties are updated. /** Called after the region sequence's properties are updated.
@param regionSequence The region sequence whose properties were updated. @param regionSequence The region sequence whose properties were updated.
*/ */
virtual void didUpdateRegionSequenceProperties (ARARegionSequence* regionSequence)
{
ignoreUnused (regionSequence);
}
virtual void didUpdateRegionSequenceProperties (ARARegionSequence* regionSequence);
/** Called before a playback region is removed from the region sequence. /** Called before a playback region is removed from the region sequence.
@param regionSequence The region sequence that \p playbackRegion will be removed from. @param regionSequence The region sequence that \p playbackRegion will be removed from.
@param playbackRegion The playback region that will be removed from \p regionSequence. @param playbackRegion The playback region that will be removed from \p regionSequence.
*/ */
virtual void willRemovePlaybackRegionFromRegionSequence (ARARegionSequence* regionSequence, virtual void willRemovePlaybackRegionFromRegionSequence (ARARegionSequence* regionSequence,
ARAPlaybackRegion* playbackRegion)
{
ignoreUnused (regionSequence, playbackRegion);
}
ARAPlaybackRegion* playbackRegion);
/** Called after a playback region is added to the region sequence. /** Called after a playback region is added to the region sequence.
@param regionSequence The region sequence that \p playbackRegion was added to. @param regionSequence The region sequence that \p playbackRegion was added to.
@param playbackRegion The playback region that was added to \p regionSequence. @param playbackRegion The playback region that was added to \p regionSequence.
*/ */
virtual void didAddPlaybackRegionToRegionSequence (ARARegionSequence* regionSequence, virtual void didAddPlaybackRegionToRegionSequence (ARARegionSequence* regionSequence,
ARAPlaybackRegion* playbackRegion)
{
ignoreUnused (regionSequence, playbackRegion);
}
ARAPlaybackRegion* playbackRegion);
/** Called before the region sequence is destroyed. /** Called before the region sequence is destroyed.
@param regionSequence The region sequence that will be destroyed. @param regionSequence The region sequence that will be destroyed.
*/ */
virtual void willDestroyRegionSequence (ARARegionSequence* regionSequence)
{
ignoreUnused (regionSequence);
}
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_END
virtual void willDestroyRegionSequence (ARARegionSequence* regionSequence);
}; };
//============================================================================== //==============================================================================
@@ -800,34 +687,23 @@ public:
/** Destructor. */ /** Destructor. */
virtual ~ARAAudioSourceListener() = default; virtual ~ARAAudioSourceListener() = default;
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_BEGIN
/** Called before the audio source's properties are updated. /** Called before the audio source's properties are updated.
@param audioSource The audio source whose properties will be updated. @param audioSource The audio source whose properties will be updated.
@param newProperties The audio source properties that will be assigned to \p audioSource. @param newProperties The audio source properties that will be assigned to \p audioSource.
*/ */
virtual void willUpdateAudioSourceProperties (ARAAudioSource* audioSource, virtual void willUpdateAudioSourceProperties (ARAAudioSource* audioSource,
ARA::PlugIn::PropertiesPtr<ARA::ARAAudioSourceProperties> newProperties)
{
ignoreUnused (audioSource, newProperties);
}
ARA::PlugIn::PropertiesPtr<ARA::ARAAudioSourceProperties> newProperties);
/** Called after the audio source's properties are updated. /** Called after the audio source's properties are updated.
@param audioSource The audio source whose properties were updated. @param audioSource The audio source whose properties were updated.
*/ */
virtual void didUpdateAudioSourceProperties (ARAAudioSource* audioSource)
{
ignoreUnused (audioSource);
}
virtual void didUpdateAudioSourceProperties (ARAAudioSource* audioSource);
/** Called when the audio source's content (i.e. samples or notes) changes. /** Called when the audio source's content (i.e. samples or notes) changes.
@param audioSource The audio source with updated content. @param audioSource The audio source with updated content.
@param scopeFlags The scope of the content update. @param scopeFlags The scope of the content update.
*/ */
virtual void doUpdateAudioSourceContent (ARAAudioSource* audioSource, ARAContentUpdateScopes scopeFlags)
{
ignoreUnused (audioSource, scopeFlags);
}
virtual void doUpdateAudioSourceContent (ARAAudioSource* audioSource, ARAContentUpdateScopes scopeFlags);
/** Called to notify progress when an audio source is being analyzed. /** Called to notify progress when an audio source is being analyzed.
@param audioSource The audio source being analyzed. @param audioSource The audio source being analyzed.
@@ -836,76 +712,54 @@ public:
*/ */
virtual void didUpdateAudioSourceAnalysisProgress (ARAAudioSource* audioSource, virtual void didUpdateAudioSourceAnalysisProgress (ARAAudioSource* audioSource,
ARA::ARAAnalysisProgressState state, ARA::ARAAnalysisProgressState state,
float progress)
{
ignoreUnused (audioSource, state, progress);
}
float progress);
/** Called before access to an audio source's samples is enabled or disabled. /** Called before access to an audio source's samples is enabled or disabled.
@param audioSource The audio source whose sample access state will be changed. @param audioSource The audio source whose sample access state will be changed.
@param enable A bool indicating whether or not sample access will be enabled or disabled. @param enable A bool indicating whether or not sample access will be enabled or disabled.
*/ */
virtual void willEnableAudioSourceSamplesAccess (ARAAudioSource* audioSource, bool enable)
{
ignoreUnused (audioSource, enable);
}
virtual void willEnableAudioSourceSamplesAccess (ARAAudioSource* audioSource,
bool enable);
/** Called after access to an audio source's samples is enabled or disabled. /** Called after access to an audio source's samples is enabled or disabled.
@param audioSource The audio source whose sample access state was changed. @param audioSource The audio source whose sample access state was changed.
@param enable A bool indicating whether or not sample access was enabled or disabled. @param enable A bool indicating whether or not sample access was enabled or disabled.
*/ */
virtual void didEnableAudioSourceSamplesAccess (ARAAudioSource* audioSource, bool enable)
{
ignoreUnused (audioSource, enable);
}
virtual void didEnableAudioSourceSamplesAccess (ARAAudioSource* audioSource,
bool enable);
/** Called before an audio source is activated or deactivated when being removed / added from the host's undo history. /** Called before an audio source is activated or deactivated when being removed / added from the host's undo history.
@param audioSource The audio source that will be activated or deactivated @param audioSource The audio source that will be activated or deactivated
@param deactivate A bool indicating whether \p audioSource was deactivated or activated. @param deactivate A bool indicating whether \p audioSource was deactivated or activated.
*/ */
virtual void willDeactivateAudioSourceForUndoHistory (ARAAudioSource* audioSource, bool deactivate)
{
ignoreUnused (audioSource, deactivate);
}
virtual void willDeactivateAudioSourceForUndoHistory (ARAAudioSource* audioSource,
bool deactivate);
/** Called after an audio source is activated or deactivated when being removed / added from the host's undo history. /** Called after an audio source is activated or deactivated when being removed / added from the host's undo history.
@param audioSource The audio source that was activated or deactivated @param audioSource The audio source that was activated or deactivated
@param deactivate A bool indicating whether \p audioSource was deactivated or activated. @param deactivate A bool indicating whether \p audioSource was deactivated or activated.
*/ */
virtual void didDeactivateAudioSourceForUndoHistory (ARAAudioSource* audioSource, bool deactivate)
{
ignoreUnused (audioSource, deactivate);
}
virtual void didDeactivateAudioSourceForUndoHistory (ARAAudioSource* audioSource,
bool deactivate);
/** Called after an audio modification is added to the audio source. /** Called after an audio modification is added to the audio source.
@param audioSource The region sequence that \p audioModification was added to. @param audioSource The region sequence that \p audioModification was added to.
@param audioModification The playback region that was added to \p audioSource. @param audioModification The playback region that was added to \p audioSource.
*/ */
virtual void didAddAudioModificationToAudioSource (ARAAudioSource* audioSource, virtual void didAddAudioModificationToAudioSource (ARAAudioSource* audioSource,
ARAAudioModification* audioModification)
{
ignoreUnused (audioSource, audioModification);
}
ARAAudioModification* audioModification);
/** Called before an audio modification is removed from the audio source. /** Called before an audio modification is removed from the audio source.
@param audioSource The audio source that \p audioModification will be removed from. @param audioSource The audio source that \p audioModification will be removed from.
@param audioModification The audio modification that will be removed from \p audioSource. @param audioModification The audio modification that will be removed from \p audioSource.
*/ */
virtual void willRemoveAudioModificationFromAudioSource (ARAAudioSource* audioSource, virtual void willRemoveAudioModificationFromAudioSource (ARAAudioSource* audioSource,
ARAAudioModification* audioModification)
{
ignoreUnused (audioSource, audioModification);
}
ARAAudioModification* audioModification);
/** Called before the audio source is destroyed. /** Called before the audio source is destroyed.
@param audioSource The audio source that will be destroyed. @param audioSource The audio source that will be destroyed.
*/ */
virtual void willDestroyAudioSource (ARAAudioSource* audioSource)
{
ignoreUnused (audioSource);
}
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_END
virtual void willDestroyAudioSource (ARAAudioSource* audioSource);
}; };
//============================================================================== //==============================================================================
@@ -1004,82 +858,57 @@ public:
/** Destructor. */ /** Destructor. */
virtual ~ARAAudioModificationListener() = default; virtual ~ARAAudioModificationListener() = default;
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_BEGIN
/** Called before the audio modification's properties are updated. /** Called before the audio modification's properties are updated.
@param audioModification The audio modification whose properties will be updated. @param audioModification The audio modification whose properties will be updated.
@param newProperties The audio modification properties that will be assigned to \p audioModification. @param newProperties The audio modification properties that will be assigned to \p audioModification.
*/ */
virtual void willUpdateAudioModificationProperties (ARAAudioModification* audioModification, virtual void willUpdateAudioModificationProperties (ARAAudioModification* audioModification,
ARA::PlugIn::PropertiesPtr<ARA::ARAAudioModificationProperties> newProperties)
{
ignoreUnused (audioModification, newProperties);
}
ARA::PlugIn::PropertiesPtr<ARA::ARAAudioModificationProperties> newProperties);
/** Called after the audio modification's properties are updated. /** Called after the audio modification's properties are updated.
@param audioModification The audio modification whose properties were updated. @param audioModification The audio modification whose properties were updated.
*/ */
virtual void didUpdateAudioModificationProperties (ARAAudioModification* audioModification)
{
ignoreUnused (audioModification);
}
virtual void didUpdateAudioModificationProperties (ARAAudioModification* audioModification);
/** Called when the audio modification's content (i.e. samples or notes) changes. /** Called when the audio modification's content (i.e. samples or notes) changes.
@param audioModification The audio modification with updated content. @param audioModification The audio modification with updated content.
@param scopeFlags The scope of the content update. @param scopeFlags The scope of the content update.
*/ */
virtual void didUpdateAudioModificationContent (ARAAudioModification* audioModification, ARAContentUpdateScopes scopeFlags)
{
ignoreUnused (audioModification, scopeFlags);
}
virtual void didUpdateAudioModificationContent (ARAAudioModification* audioModification,
ARAContentUpdateScopes scopeFlags);
/** Called before an audio modification is activated or deactivated when being removed / added from the host's undo history. /** Called before an audio modification is activated or deactivated when being removed / added from the host's undo history.
@param audioModification The audio modification that was activated or deactivated @param audioModification The audio modification that was activated or deactivated
@param deactivate A bool indicating whether \p audioModification was deactivated or activated. @param deactivate A bool indicating whether \p audioModification was deactivated or activated.
*/ */
virtual void willDeactivateAudioModificationForUndoHistory (ARAAudioModification* audioModification, bool deactivate)
{
ignoreUnused (audioModification, deactivate);
}
virtual void willDeactivateAudioModificationForUndoHistory (ARAAudioModification* audioModification,
bool deactivate);
/** Called after an audio modification is activated or deactivated when being removed / added from the host's undo history. /** Called after an audio modification is activated or deactivated when being removed / added from the host's undo history.
@param audioModification The audio modification that was activated or deactivated @param audioModification The audio modification that was activated or deactivated
@param deactivate A bool indicating whether \p audioModification was deactivated or activated. @param deactivate A bool indicating whether \p audioModification was deactivated or activated.
*/ */
virtual void didDeactivateAudioModificationForUndoHistory (ARAAudioModification* audioModification, bool deactivate)
{
ignoreUnused (audioModification, deactivate);
}
virtual void didDeactivateAudioModificationForUndoHistory (ARAAudioModification* audioModification,
bool deactivate);
/** Called after a playback region is added to the audio modification. /** Called after a playback region is added to the audio modification.
@param audioModification The audio modification that \p playbackRegion was added to. @param audioModification The audio modification that \p playbackRegion was added to.
@param playbackRegion The playback region that was added to \p audioModification. @param playbackRegion The playback region that was added to \p audioModification.
*/ */
virtual void didAddPlaybackRegionToAudioModification (ARAAudioModification* audioModification, virtual void didAddPlaybackRegionToAudioModification (ARAAudioModification* audioModification,
ARAPlaybackRegion* playbackRegion)
{
ignoreUnused (audioModification, playbackRegion);
}
ARAPlaybackRegion* playbackRegion);
/** Called before a playback region is removed from the audio modification. /** Called before a playback region is removed from the audio modification.
@param audioModification The audio modification that \p playbackRegion will be removed from. @param audioModification The audio modification that \p playbackRegion will be removed from.
@param playbackRegion The playback region that will be removed from \p audioModification. @param playbackRegion The playback region that will be removed from \p audioModification.
*/ */
virtual void willRemovePlaybackRegionFromAudioModification (ARAAudioModification* audioModification, virtual void willRemovePlaybackRegionFromAudioModification (ARAAudioModification* audioModification,
ARAPlaybackRegion* playbackRegion)
{
ignoreUnused (audioModification, playbackRegion);
}
ARAPlaybackRegion* playbackRegion);
/** Called before the audio modification is destroyed. /** Called before the audio modification is destroyed.
@param audioModification The audio modification that will be destroyed. @param audioModification The audio modification that will be destroyed.
*/ */
virtual void willDestroyAudioModification (ARAAudioModification* audioModification)
{
ignoreUnused (audioModification);
}
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_END
virtual void willDestroyAudioModification (ARAAudioModification* audioModification);
}; };
//============================================================================== //==============================================================================


+ 27
- 5
modules/juce_audio_processors/utilities/ARA/juce_ARAPlugInInstanceRoles.cpp View File

@@ -28,12 +28,10 @@
namespace juce namespace juce
{ {
bool ARARenderer::processBlock (AudioBuffer<double>& buffer,
AudioProcessor::Realtime realtime,
const AudioPlayHead::PositionInfo& positionInfo) noexcept
bool ARARenderer::processBlock ([[maybe_unused]] AudioBuffer<double>& buffer,
[[maybe_unused]] AudioProcessor::Realtime realtime,
[[maybe_unused]] const AudioPlayHead::PositionInfo& positionInfo) noexcept
{ {
ignoreUnused (buffer, realtime, positionInfo);
// If you hit this assertion then either the caller called the double // If you hit this assertion then either the caller called the double
// precision version of processBlock on a processor which does not support it // precision version of processBlock on a processor which does not support it
// (i.e. supportsDoublePrecisionProcessing() returns false), or the implementation // (i.e. supportsDoublePrecisionProcessing() returns false), or the implementation
@@ -43,6 +41,12 @@ bool ARARenderer::processBlock (AudioBuffer<double>& buffer,
return false; return false;
} }
void ARARenderer::prepareToPlay ([[maybe_unused]] double sampleRate,
[[maybe_unused]] int maximumSamplesPerBlock,
[[maybe_unused]] int numChannels,
[[maybe_unused]] AudioProcessor::ProcessingPrecision precision,
[[maybe_unused]] AlwaysNonRealtime alwaysNonRealtime) {}
//============================================================================== //==============================================================================
#if ARA_VALIDATE_API_CALLS #if ARA_VALIDATE_API_CALLS
void ARAPlaybackRenderer::addPlaybackRegion (ARA::ARAPlaybackRegionRef playbackRegionRef) noexcept void ARAPlaybackRenderer::addPlaybackRegion (ARA::ARAPlaybackRegionRef playbackRegionRef) noexcept
@@ -62,6 +66,21 @@ void ARAPlaybackRenderer::removePlaybackRegion (ARA::ARAPlaybackRegionRef playba
} }
#endif #endif
bool ARAPlaybackRenderer::processBlock ([[maybe_unused]] AudioBuffer<float>& buffer,
[[maybe_unused]] AudioProcessor::Realtime realtime,
[[maybe_unused]] const AudioPlayHead::PositionInfo& positionInfo) noexcept
{
return false;
}
//==============================================================================
bool ARAEditorRenderer::processBlock ([[maybe_unused]] AudioBuffer<float>& buffer,
[[maybe_unused]] AudioProcessor::Realtime isNonRealtime,
[[maybe_unused]] const AudioPlayHead::PositionInfo& positionInfo) noexcept
{
return true;
}
//============================================================================== //==============================================================================
void ARAEditorView::doNotifySelection (const ARA::PlugIn::ViewSelection* viewSelection) noexcept void ARAEditorView::doNotifySelection (const ARA::PlugIn::ViewSelection* viewSelection) noexcept
{ {
@@ -89,4 +108,7 @@ void ARAEditorView::removeListener (Listener* l)
listeners.remove (l); listeners.remove (l);
} }
void ARAEditorView::Listener::onNewSelection ([[maybe_unused]] const ARAViewSelection& viewSelection) {}
void ARAEditorView::Listener::onHideRegionSequences ([[maybe_unused]] const std::vector<ARARegionSequence*>& regionSequences) {}
} // namespace juce } // namespace juce

+ 7
- 28
modules/juce_audio_processors/utilities/ARA/juce_ARAPlugInInstanceRoles.h View File

@@ -59,10 +59,7 @@ public:
int maximumSamplesPerBlock, int maximumSamplesPerBlock,
int numChannels, int numChannels,
AudioProcessor::ProcessingPrecision precision, AudioProcessor::ProcessingPrecision precision,
AlwaysNonRealtime alwaysNonRealtime = AlwaysNonRealtime::no)
{
ignoreUnused (sampleRate, maximumSamplesPerBlock, numChannels, precision, alwaysNonRealtime);
}
AlwaysNonRealtime alwaysNonRealtime = AlwaysNonRealtime::no);
/** Frees render resources allocated in prepareToPlay(). */ /** Frees render resources allocated in prepareToPlay(). */
virtual void releaseResources() {} virtual void releaseResources() {}
@@ -128,11 +125,7 @@ public:
bool processBlock (AudioBuffer<float>& buffer, bool processBlock (AudioBuffer<float>& buffer,
AudioProcessor::Realtime realtime, AudioProcessor::Realtime realtime,
const AudioPlayHead::PositionInfo& positionInfo) noexcept override
{
ignoreUnused (buffer, realtime, positionInfo);
return false;
}
const AudioPlayHead::PositionInfo& positionInfo) noexcept override;
using ARARenderer::processBlock; using ARARenderer::processBlock;
@@ -191,11 +184,7 @@ public:
// isNonRealtime of the process context - typically preview is limited to realtime. // isNonRealtime of the process context - typically preview is limited to realtime.
bool processBlock (AudioBuffer<float>& buffer, bool processBlock (AudioBuffer<float>& buffer,
AudioProcessor::Realtime isNonRealtime, AudioProcessor::Realtime isNonRealtime,
const AudioPlayHead::PositionInfo& positionInfo) noexcept override
{
ignoreUnused (buffer, isNonRealtime, positionInfo);
return true;
}
const AudioPlayHead::PositionInfo& positionInfo) noexcept override;
using ARARenderer::processBlock; using ARARenderer::processBlock;
@@ -218,7 +207,7 @@ public:
// Shadowing templated getters to default to JUCE versions of the returned classes // Shadowing templated getters to default to JUCE versions of the returned classes
template <typename RegionSequence_t = ARARegionSequence> template <typename RegionSequence_t = ARARegionSequence>
std::vector<RegionSequence_t*> const& getHiddenRegionSequences() const noexcept
const std::vector<RegionSequence_t*>& getHiddenRegionSequences() const noexcept
{ {
return ARA::PlugIn::EditorView::getHiddenRegionSequences<RegionSequence_t>(); return ARA::PlugIn::EditorView::getHiddenRegionSequences<RegionSequence_t>();
} }
@@ -227,7 +216,7 @@ public:
void doNotifySelection (const ARA::PlugIn::ViewSelection* currentSelection) noexcept override; void doNotifySelection (const ARA::PlugIn::ViewSelection* currentSelection) noexcept override;
// Base class implementation must be called if overridden // Base class implementation must be called if overridden
void doNotifyHideRegionSequences (std::vector<ARA::PlugIn::RegionSequence*> const& regionSequences) noexcept override;
void doNotifyHideRegionSequences (const std::vector<ARA::PlugIn::RegionSequence*>& regionSequences) noexcept override;
/** A base class for listeners that want to know about changes to an ARAEditorView object. /** A base class for listeners that want to know about changes to an ARAEditorView object.
@@ -239,25 +228,15 @@ public:
/** Destructor. */ /** Destructor. */
virtual ~Listener() = default; virtual ~Listener() = default;
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_BEGIN
/** Called when the editor view's selection changes. /** Called when the editor view's selection changes.
@param viewSelection The current selection state @param viewSelection The current selection state
*/ */
virtual void onNewSelection (const ARAViewSelection& viewSelection)
{
ignoreUnused (viewSelection);
}
virtual void onNewSelection (const ARAViewSelection& viewSelection);
/** Called when region sequences are flagged as hidden in the host UI. /** Called when region sequences are flagged as hidden in the host UI.
@param regionSequences A vector containing all hidden region sequences. @param regionSequences A vector containing all hidden region sequences.
*/ */
virtual void onHideRegionSequences (std::vector<ARARegionSequence*> const& regionSequences)
{
ignoreUnused (regionSequences);
}
ARA_DISABLE_UNREFERENCED_PARAMETER_WARNING_END
virtual void onHideRegionSequences (const std::vector<ARARegionSequence*>& regionSequences);
}; };
/** \copydoc ARAListenableModelClass::addListener */ /** \copydoc ARAListenableModelClass::addListener */


+ 6
- 14
modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h View File

@@ -135,12 +135,7 @@ public:
void add (std::unique_ptr<Items>... items) void add (std::unique_ptr<Items>... items)
{ {
parameters.reserve (parameters.size() + sizeof... (items)); parameters.reserve (parameters.size() + sizeof... (items));
// We can replace this with some nicer code once generic lambdas become available. A
// sequential context like an array initialiser is required to ensure we get the correct
// order from the parameter pack.
int unused[] { (parameters.emplace_back (MakeContents() (std::move (items))), 0)... };
ignoreUnused (unused);
(parameters.push_back (makeParameterStorage (std::move (items))), ...);
} }
template <typename It, typename = ValidIfIterator<It>> template <typename It, typename = ValidIfIterator<It>>
@@ -150,7 +145,7 @@ public:
std::transform (std::make_move_iterator (begin), std::transform (std::make_move_iterator (begin),
std::make_move_iterator (end), std::make_move_iterator (end),
std::back_inserter (parameters), std::back_inserter (parameters),
MakeContents());
[] (auto item) { return makeParameterStorage (std::move (item)); });
} }
ParameterLayout (const ParameterLayout& other) = delete; ParameterLayout (const ParameterLayout& other) = delete;
@@ -191,14 +186,11 @@ public:
std::unique_ptr<Contents> contents; std::unique_ptr<Contents> contents;
}; };
struct MakeContents final
template <typename Contents>
static std::unique_ptr<ParameterStorage<Contents>> makeParameterStorage (std::unique_ptr<Contents> contents)
{ {
template <typename Item>
std::unique_ptr<ParameterStorageBase> operator() (std::unique_ptr<Item> item) const
{
return std::unique_ptr<ParameterStorageBase> (new ParameterStorage<Item> (std::move (item)));
}
};
return std::make_unique<ParameterStorage<Contents>> (std::move (contents));
}
void add() {} void add() {}


+ 2
- 5
modules/juce_audio_processors/utilities/juce_PluginHostType.cpp View File

@@ -56,7 +56,7 @@ void PluginHostType::switchToHostApplication() const
#endif #endif
} }
bool PluginHostType::isInAAXAudioSuite (AudioProcessor& processor)
bool PluginHostType::isInAAXAudioSuite ([[maybe_unused]] AudioProcessor& processor)
{ {
#if JucePlugin_Build_AAX #if JucePlugin_Build_AAX
if (PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_AAX if (PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_AAX
@@ -66,14 +66,11 @@ bool PluginHostType::isInAAXAudioSuite (AudioProcessor& processor)
} }
#endif #endif
ignoreUnused (processor);
return false; return false;
} }
Image PluginHostType::getHostIcon (int size) const
Image PluginHostType::getHostIcon ([[maybe_unused]] int size) const
{ {
ignoreUnused (size);
#if JucePlugin_Enable_IAA && JucePlugin_Build_Standalone && JUCE_IOS && (! JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP) #if JucePlugin_Enable_IAA && JucePlugin_Build_Standalone && JUCE_IOS && (! JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP)
if (isInterAppAudioConnected()) if (isInterAppAudioConnected())
return juce_getIAAHostIcon (size); return juce_getIAAHostIcon (size);


+ 39
- 0
modules/juce_audio_processors/utilities/juce_VSTCallbackHandler.cpp View File

@@ -0,0 +1,39 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
Agreement and JUCE Privacy Policy.
End User License Agreement: www.juce.com/juce-7-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
pointer_sized_int VSTCallbackHandler::handleVstPluginCanDo ([[maybe_unused]] int32 index,
[[maybe_unused]] pointer_sized_int value,
[[maybe_unused]] void* ptr,
[[maybe_unused]] float opt)
{
return 0;
}
void VSTCallbackHandler::handleVstHostCallbackAvailable ([[maybe_unused]] std::function<VstHostCallbackType>&& callback) {}
} // namespace juce

+ 2
- 9
modules/juce_audio_processors/utilities/juce_VSTCallbackHandler.h View File

@@ -46,11 +46,7 @@ struct VSTCallbackHandler
virtual pointer_sized_int handleVstPluginCanDo (int32 index, virtual pointer_sized_int handleVstPluginCanDo (int32 index,
pointer_sized_int value, pointer_sized_int value,
void* ptr, void* ptr,
float opt)
{
ignoreUnused (index, value, ptr, opt);
return 0;
}
float opt);
/** This is called by the VST plug-in wrapper when it receives unhandled /** This is called by the VST plug-in wrapper when it receives unhandled
vendor specific calls from the host. vendor specific calls from the host.
@@ -71,10 +67,7 @@ struct VSTCallbackHandler
/** This is called once by the VST plug-in wrapper after its constructor. /** This is called once by the VST plug-in wrapper after its constructor.
You can use the supplied function to query the VST host. You can use the supplied function to query the VST host.
*/ */
virtual void handleVstHostCallbackAvailable (std::function<VstHostCallbackType>&& callback)
{
ignoreUnused (callback);
}
virtual void handleVstHostCallbackAvailable (std::function<VstHostCallbackType>&& callback);
}; };
} // namespace juce } // namespace juce

+ 5
- 0
modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp View File

@@ -478,4 +478,9 @@ void MidiKeyboardComponent::handleNoteOff (MidiKeyboardState*, int /*midiChannel
noPendingUpdates.store (false); noPendingUpdates.store (false);
} }
//==============================================================================
bool MidiKeyboardComponent::mouseDownOnKey ([[maybe_unused]] int midiNoteNumber, [[maybe_unused]] const MouseEvent& e) { return true; }
bool MidiKeyboardComponent::mouseDraggedToKey ([[maybe_unused]] int midiNoteNumber, [[maybe_unused]] const MouseEvent& e) { return true; }
void MidiKeyboardComponent::mouseUpOnKey ([[maybe_unused]] int midiNoteNumber, [[maybe_unused]] const MouseEvent& e) {}
} // namespace juce } // namespace juce

+ 3
- 3
modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h View File

@@ -193,7 +193,7 @@ public:
@see mouseDraggedToKey @see mouseDraggedToKey
*/ */
virtual bool mouseDownOnKey (int midiNoteNumber, const MouseEvent& e) { ignoreUnused (midiNoteNumber, e); return true; }
virtual bool mouseDownOnKey (int midiNoteNumber, const MouseEvent& e);
/** Callback when the mouse is dragged from one key onto another. /** Callback when the mouse is dragged from one key onto another.
@@ -202,13 +202,13 @@ public:
@see mouseDownOnKey @see mouseDownOnKey
*/ */
virtual bool mouseDraggedToKey (int midiNoteNumber, const MouseEvent& e) { ignoreUnused (midiNoteNumber, e); return true; }
virtual bool mouseDraggedToKey (int midiNoteNumber, const MouseEvent& e);
/** Callback when the mouse is released from a key. /** Callback when the mouse is released from a key.
@see mouseDownOnKey @see mouseDownOnKey
*/ */
virtual void mouseUpOnKey (int midiNoteNumber, const MouseEvent& e) { ignoreUnused (midiNoteNumber, e); }
virtual void mouseUpOnKey (int midiNoteNumber, const MouseEvent& e);
/** Allows text to be drawn on the white notes. /** Allows text to be drawn on the white notes.


+ 1
- 2
modules/juce_audio_utils/native/juce_mac_AudioCDReader.mm View File

@@ -171,8 +171,7 @@ void AudioCDReader::refreshTrackLengths()
if (toc.exists()) if (toc.exists())
{ {
XmlDocument doc (toc); XmlDocument doc (toc);
const char* error = CDReaderHelpers::getTrackOffsets (doc, trackStartSamples);
ignoreUnused (error); // could be logged..
[[maybe_unused]] const char* error = CDReaderHelpers::getTrackOffsets (doc, trackStartSamples);
lengthInSamples = trackStartSamples.getLast() - trackStartSamples.getFirst(); lengthInSamples = trackStartSamples.getLast() - trackStartSamples.getFirst();
} }


+ 41
- 34
modules/juce_core/containers/juce_Array.h View File

@@ -727,32 +727,7 @@ public:
@see addSorted, sort @see addSorted, sort
*/ */
template <typename ElementComparator, typename TargetValueType> template <typename ElementComparator, typename TargetValueType>
int indexOfSorted (ElementComparator& comparator, TargetValueType elementToLookFor) const
{
ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
const ScopedLockType lock (getLock());
for (int s = 0, e = values.size();;)
{
if (s >= e)
return -1;
if (comparator.compareElements (elementToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
return -1;
if (comparator.compareElements (elementToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
}
int indexOfSorted (ElementComparator& comparator, TargetValueType elementToLookFor) const;
//============================================================================== //==============================================================================
/** Removes an element from the array. /** Removes an element from the array.
@@ -1106,14 +1081,7 @@ public:
@see addSorted, indexOfSorted, sortArray @see addSorted, indexOfSorted, sortArray
*/ */
template <class ElementComparator> template <class ElementComparator>
void sort (ElementComparator& comparator,
bool retainOrderOfEquivalentItems = false)
{
const ScopedLockType lock (getLock());
ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
sortArray (comparator, values.begin(), 0, size() - 1, retainOrderOfEquivalentItems);
}
void sort (ElementComparator& comparator, bool retainOrderOfEquivalentItems = false);
//============================================================================== //==============================================================================
/** Returns the CriticalSection that locks this array. /** Returns the CriticalSection that locks this array.
@@ -1150,4 +1118,43 @@ private:
} }
}; };
//==============================================================================
template <typename ElementType, typename TypeOfCriticalSectionToUse, int minimumAllocatedSize>
template <typename ElementComparator, typename TargetValueType>
int Array<ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize>::indexOfSorted (
[[maybe_unused]] ElementComparator& comparator,
TargetValueType elementToLookFor) const
{
const ScopedLockType lock (getLock());
for (int s = 0, e = values.size();;)
{
if (s >= e)
return -1;
if (comparator.compareElements (elementToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
return -1;
if (comparator.compareElements (elementToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
}
template <typename ElementType, typename TypeOfCriticalSectionToUse, int minimumAllocatedSize>
template <class ElementComparator>
void Array<ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize>::sort (
[[maybe_unused]] ElementComparator& comparator,
bool retainOrderOfEquivalentItems)
{
const ScopedLockType lock (getLock());
sortArray (comparator, values.begin(), 0, size() - 1, retainOrderOfEquivalentItems);
}
} // namespace juce } // namespace juce

+ 2
- 2
modules/juce_core/containers/juce_ArrayBase.h View File

@@ -542,7 +542,7 @@ private:
template <typename... Elements> template <typename... Elements>
void addImpl (Elements&&... toAdd) void addImpl (Elements&&... toAdd)
{ {
ignoreUnused (std::initializer_list<int> { (((void) checkSourceIsNotAMember (toAdd)), 0)... });
(checkSourceIsNotAMember (toAdd), ...);
ensureAllocatedSize (numUsed + (int) sizeof... (toAdd)); ensureAllocatedSize (numUsed + (int) sizeof... (toAdd));
addAssumingCapacityIsReady (std::forward<Elements> (toAdd)...); addAssumingCapacityIsReady (std::forward<Elements> (toAdd)...);
} }
@@ -550,7 +550,7 @@ private:
template <typename... Elements> template <typename... Elements>
void addAssumingCapacityIsReady (Elements&&... toAdd) void addAssumingCapacityIsReady (Elements&&... toAdd)
{ {
ignoreUnused (std::initializer_list<int> { ((void) (new (elements + numUsed++) ElementType (std::forward<Elements> (toAdd))), 0)... });
(new (elements + numUsed++) ElementType (std::forward<Elements> (toAdd)), ...);
} }
//============================================================================== //==============================================================================


+ 1
- 4
modules/juce_core/containers/juce_ElementComparator.h View File

@@ -123,7 +123,7 @@ static void sortArray (ElementComparator& comparator,
@param lastElement the index of the last element in the range (this is non-inclusive) @param lastElement the index of the last element in the range (this is non-inclusive)
*/ */
template <class ElementType, class ElementComparator> template <class ElementType, class ElementComparator>
static int findInsertIndexInSortedArray (ElementComparator& comparator,
static int findInsertIndexInSortedArray ([[maybe_unused]] ElementComparator& comparator,
ElementType* const array, ElementType* const array,
const ElementType newElement, const ElementType newElement,
int firstElement, int firstElement,
@@ -131,9 +131,6 @@ static int findInsertIndexInSortedArray (ElementComparator& comparator,
{ {
jassert (firstElement <= lastElement); jassert (firstElement <= lastElement);
ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
while (firstElement < lastElement) while (firstElement < lastElement)
{ {
if (comparator.compareElements (newElement, array [firstElement]) == 0) if (comparator.compareElements (newElement, array [firstElement]) == 0)


+ 56
- 51
modules/juce_core/containers/juce_OwnedArray.h View File

@@ -46,7 +46,6 @@ namespace juce
*/ */
template <class ObjectClass, template <class ObjectClass,
class TypeOfCriticalSectionToUse = DummyCriticalSection> class TypeOfCriticalSectionToUse = DummyCriticalSection>
class OwnedArray class OwnedArray
{ {
public: public:
@@ -531,17 +530,7 @@ public:
@see add, sort, indexOfSorted @see add, sort, indexOfSorted
*/ */
template <class ElementComparator> template <class ElementComparator>
int addSorted (ElementComparator& comparator, ObjectClass* newObject) noexcept
{
// If you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
auto index = findInsertIndexInSortedArray (comparator, values.begin(), newObject, 0, values.size());
insert (index, newObject);
return index;
}
int addSorted (ElementComparator& comparator, ObjectClass* newObject) noexcept;
/** Finds the index of an object in the array, assuming that the array is sorted. /** Finds the index of an object in the array, assuming that the array is sorted.
@@ -556,33 +545,7 @@ public:
@see addSorted, sort @see addSorted, sort
*/ */
template <typename ElementComparator> template <typename ElementComparator>
int indexOfSorted (ElementComparator& comparator, const ObjectClass* objectToLookFor) const noexcept
{
// If you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
int s = 0, e = values.size();
while (s < e)
{
if (comparator.compareElements (objectToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
break;
if (comparator.compareElements (objectToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
return -1;
}
int indexOfSorted (ElementComparator& comparator, const ObjectClass* objectToLookFor) const noexcept;
//============================================================================== //==============================================================================
/** Removes an object from the array. /** Removes an object from the array.
@@ -818,18 +781,7 @@ public:
@see sortArray, indexOfSorted @see sortArray, indexOfSorted
*/ */
template <class ElementComparator> template <class ElementComparator>
void sort (ElementComparator& comparator,
bool retainOrderOfEquivalentItems = false) noexcept
{
// If you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
if (size() > 1)
sortArray (comparator, values.begin(), 0, size() - 1, retainOrderOfEquivalentItems);
}
void sort (ElementComparator& comparator, bool retainOrderOfEquivalentItems = false) noexcept;
//============================================================================== //==============================================================================
/** Returns the CriticalSection that locks this array. /** Returns the CriticalSection that locks this array.
@@ -870,4 +822,57 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OwnedArray) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OwnedArray)
}; };
//==============================================================================
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <class ElementComparator>
int OwnedArray<ObjectClass, TypeOfCriticalSectionToUse>::addSorted (
[[maybe_unused]] ElementComparator& comparator,
ObjectClass* newObject) noexcept
{
const ScopedLockType lock (getLock());
auto index = findInsertIndexInSortedArray (comparator, values.begin(), newObject, 0, values.size());
insert (index, newObject);
return index;
}
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <typename ElementComparator>
int OwnedArray<ObjectClass, TypeOfCriticalSectionToUse>::indexOfSorted (
[[maybe_unused]] ElementComparator& comparator,
const ObjectClass* objectToLookFor) const noexcept
{
const ScopedLockType lock (getLock());
int s = 0, e = values.size();
while (s < e)
{
if (comparator.compareElements (objectToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
break;
if (comparator.compareElements (objectToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
return -1;
}
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <typename ElementComparator>
void OwnedArray<ObjectClass, TypeOfCriticalSectionToUse>::sort (
[[maybe_unused]] ElementComparator& comparator,
bool retainOrderOfEquivalentItems) noexcept
{
const ScopedLockType lock (getLock());
if (size() > 1)
sortArray (comparator, values.begin(), 0, size() - 1, retainOrderOfEquivalentItems);
}
} // namespace juce } // namespace juce

+ 41
- 35
modules/juce_core/containers/juce_ReferenceCountedArray.h View File

@@ -563,31 +563,7 @@ public:
@see addSorted, sort @see addSorted, sort
*/ */
template <class ElementComparator> template <class ElementComparator>
int indexOfSorted (ElementComparator& comparator,
const ObjectClass* objectToLookFor) const noexcept
{
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
int s = 0, e = values.size();
while (s < e)
{
if (comparator.compareElements (objectToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
break;
if (comparator.compareElements (objectToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
return -1;
}
int indexOfSorted (ElementComparator& comparator, const ObjectClass* objectToLookFor) const noexcept;
//============================================================================== //==============================================================================
/** Removes an object from the array. /** Removes an object from the array.
@@ -828,16 +804,7 @@ public:
@see sortArray @see sortArray
*/ */
template <class ElementComparator> template <class ElementComparator>
void sort (ElementComparator& comparator,
bool retainOrderOfEquivalentItems = false) noexcept
{
// If you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
sortArray (comparator, values.begin(), 0, values.size() - 1, retainOrderOfEquivalentItems);
}
void sort (ElementComparator& comparator, bool retainOrderOfEquivalentItems = false) noexcept;
//============================================================================== //==============================================================================
/** Reduces the amount of storage being used by the array. /** Reduces the amount of storage being used by the array.
@@ -904,4 +871,43 @@ private:
} }
}; };
//==============================================================================
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <class ElementComparator>
int ReferenceCountedArray<ObjectClass, TypeOfCriticalSectionToUse>::indexOfSorted (
[[maybe_unused]] ElementComparator& comparator,
const ObjectClass* objectToLookFor) const noexcept
{
const ScopedLockType lock (getLock());
int s = 0, e = values.size();
while (s < e)
{
if (comparator.compareElements (objectToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
break;
if (comparator.compareElements (objectToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
return -1;
}
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <class ElementComparator>
void ReferenceCountedArray<ObjectClass, TypeOfCriticalSectionToUse>::sort (
[[maybe_unused]] ElementComparator& comparator,
bool retainOrderOfEquivalentItems) noexcept
{
const ScopedLockType lock (getLock());
sortArray (comparator, values.begin(), 0, values.size() - 1, retainOrderOfEquivalentItems);
}
} // namespace juce } // namespace juce

+ 1
- 2
modules/juce_core/files/juce_File.cpp View File

@@ -953,7 +953,7 @@ File File::createTempFile (StringRef fileNameEnding)
} }
bool File::createSymbolicLink (const File& linkFileToCreate, bool File::createSymbolicLink (const File& linkFileToCreate,
const String& nativePathOfTarget,
[[maybe_unused]] const String& nativePathOfTarget,
bool overwriteExisting) bool overwriteExisting)
{ {
if (linkFileToCreate.exists()) if (linkFileToCreate.exists())
@@ -986,7 +986,6 @@ bool File::createSymbolicLink (const File& linkFileToCreate,
nativePathOfTarget.toWideCharPointer(), nativePathOfTarget.toWideCharPointer(),
targetFile.isDirectory() ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0) != FALSE; targetFile.isDirectory() ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0) != FALSE;
#else #else
ignoreUnused (nativePathOfTarget);
jassertfalse; // symbolic links not supported on this platform! jassertfalse; // symbolic links not supported on this platform!
return false; return false;
#endif #endif


+ 3
- 3
modules/juce_core/javascript/juce_Javascript.cpp View File

@@ -1539,9 +1539,9 @@ struct JavascriptEngine::RootObject : public DynamicObject
setMethod ("clone", cloneFn); setMethod ("clone", cloneFn);
} }
static Identifier getClassName() { static const Identifier i ("Object"); return i; }
static var dump (Args a) { DBG (JSON::toString (a.thisObject)); ignoreUnused (a); return var::undefined(); }
static var cloneFn (Args a) { return a.thisObject.clone(); }
static Identifier getClassName() { static const Identifier i ("Object"); return i; }
static var dump ([[maybe_unused]] Args a) { DBG (JSON::toString (a.thisObject)); return var::undefined(); }
static var cloneFn (Args a) { return a.thisObject.clone(); }
}; };
//============================================================================== //==============================================================================


+ 1
- 2
modules/juce_core/maths/juce_Expression.cpp View File

@@ -424,9 +424,8 @@ struct Expression::Helpers
String getName() const { return "-"; } String getName() const { return "-"; }
TermPtr negated() { return input; } TermPtr negated() { return input; }
TermPtr createTermToEvaluateInput (const Scope& scope, const Term* t, double overallTarget, Term* topLevelTerm) const
TermPtr createTermToEvaluateInput (const Scope& scope, [[maybe_unused]] const Term* t, double overallTarget, Term* topLevelTerm) const
{ {
ignoreUnused (t);
jassert (t == input); jassert (t == input);
const Term* const dest = findDestinationFor (topLevelTerm, this); const Term* const dest = findDestinationFor (topLevelTerm, this);


+ 1
- 1
modules/juce_core/memory/juce_ContainerDeletePolicy.h View File

@@ -49,7 +49,7 @@ struct ContainerDeletePolicy
// implementation of all methods trying to use the OwnedArray (e.g. the destructor // implementation of all methods trying to use the OwnedArray (e.g. the destructor
// of the class owning it) into cpp files where they can see to the definition // of the class owning it) into cpp files where they can see to the definition
// of ObjectType. This should fix the error. // of ObjectType. This should fix the error.
ignoreUnused (sizeof (ObjectType));
[[maybe_unused]] constexpr auto size = sizeof (ObjectType);
delete object; delete object;
} }


+ 5
- 12
modules/juce_core/native/juce_android_AndroidDocument.cpp View File

@@ -101,8 +101,7 @@ struct AndroidDocumentDetail
auto* env = getEnv(); auto* env = getEnv();
LocalRef<jobjectArray> array { env->NewObjectArray (sizeof... (args), JavaString, nullptr) }; LocalRef<jobjectArray> array { env->NewObjectArray (sizeof... (args), JavaString, nullptr) };
int unused[] { (env->SetObjectArrayElement (array.get(), Ix, args.get()), 0)... };
ignoreUnused (unused);
(env->SetObjectArrayElement (array.get(), Ix, args.get()), ...);
return array; return array;
} }
@@ -745,21 +744,17 @@ struct AndroidDocument::Utils
}; };
//============================================================================== //==============================================================================
void AndroidDocumentPermission::takePersistentReadWriteAccess (const URL& url)
void AndroidDocumentPermission::takePersistentReadWriteAccess ([[maybe_unused]] const URL& url)
{ {
#if JUCE_ANDROID #if JUCE_ANDROID
AndroidDocumentDetail::setPermissions (url, ContentResolver19.takePersistableUriPermission); AndroidDocumentDetail::setPermissions (url, ContentResolver19.takePersistableUriPermission);
#else
ignoreUnused (url);
#endif #endif
} }
void AndroidDocumentPermission::releasePersistentReadWriteAccess (const URL& url)
void AndroidDocumentPermission::releasePersistentReadWriteAccess ([[maybe_unused]] const URL& url)
{ {
#if JUCE_ANDROID #if JUCE_ANDROID
AndroidDocumentDetail::setPermissions (url, ContentResolver19.releasePersistableUriPermission); AndroidDocumentDetail::setPermissions (url, ContentResolver19.releasePersistableUriPermission);
#else
ignoreUnused (url);
#endif #endif
} }
@@ -817,7 +812,7 @@ AndroidDocument AndroidDocument::fromFile (const File& filePath)
: nullptr }; : nullptr };
} }
AndroidDocument AndroidDocument::fromDocument (const URL& documentUrl)
AndroidDocument AndroidDocument::fromDocument ([[maybe_unused]] const URL& documentUrl)
{ {
#if JUCE_ANDROID #if JUCE_ANDROID
if (getAndroidSDKVersion() < 19) if (getAndroidSDKVersion() < 19)
@@ -839,12 +834,11 @@ AndroidDocument AndroidDocument::fromDocument (const URL& documentUrl)
return AndroidDocument { Utils::createPimplForSdk (javaUri) }; return AndroidDocument { Utils::createPimplForSdk (javaUri) };
#else #else
ignoreUnused (documentUrl);
return AndroidDocument{}; return AndroidDocument{};
#endif #endif
} }
AndroidDocument AndroidDocument::fromTree (const URL& treeUrl)
AndroidDocument AndroidDocument::fromTree ([[maybe_unused]] const URL& treeUrl)
{ {
#if JUCE_ANDROID #if JUCE_ANDROID
if (getAndroidSDKVersion() < 21) if (getAndroidSDKVersion() < 21)
@@ -874,7 +868,6 @@ AndroidDocument AndroidDocument::fromTree (const URL& treeUrl)
return AndroidDocument { Utils::createPimplForSdk (documentUri) }; return AndroidDocument { Utils::createPimplForSdk (documentUri) };
#else #else
ignoreUnused (treeUrl);
return AndroidDocument{}; return AndroidDocument{};
#endif #endif
} }


+ 1
- 3
modules/juce_core/native/juce_mac_Files.mm View File

@@ -397,7 +397,7 @@ bool DirectoryIterator::NativeIterator::next (String& filenameFound,
//============================================================================== //==============================================================================
bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String& parameters)
bool JUCE_CALLTYPE Process::openDocument (const String& fileName, [[maybe_unused]] const String& parameters)
{ {
JUCE_AUTORELEASEPOOL JUCE_AUTORELEASEPOOL
{ {
@@ -406,8 +406,6 @@ bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String&
: [NSURL URLWithString: fileNameAsNS]; : [NSURL URLWithString: fileNameAsNS];
#if JUCE_IOS #if JUCE_IOS
ignoreUnused (parameters);
if (@available (iOS 10.0, *)) if (@available (iOS 10.0, *))
{ {
[[UIApplication sharedApplication] openURL: filenameAsURL [[UIApplication sharedApplication] openURL: filenameAsURL


+ 7
- 11
modules/juce_core/native/juce_mac_Network.mm View File

@@ -58,14 +58,12 @@ void MACAddress::findAllAddresses (Array<MACAddress>& result)
} }
//============================================================================== //==============================================================================
bool JUCE_CALLTYPE Process::openEmailWithAttachments (const String& targetEmailAddress,
const String& emailSubject,
const String& bodyText,
const StringArray& filesToAttach)
bool JUCE_CALLTYPE Process::openEmailWithAttachments ([[maybe_unused]] const String& targetEmailAddress,
[[maybe_unused]] const String& emailSubject,
[[maybe_unused]] const String& bodyText,
[[maybe_unused]] const StringArray& filesToAttach)
{ {
#if JUCE_IOS #if JUCE_IOS
ignoreUnused (targetEmailAddress, emailSubject, bodyText, filesToAttach);
//xxx probably need to use MFMailComposeViewController //xxx probably need to use MFMailComposeViewController
jassertfalse; jassertfalse;
return false; return false;
@@ -282,9 +280,9 @@ public:
return newRequest; return newRequest;
} }
void didFailWithError (NSError* error)
void didFailWithError ([[maybe_unused]] NSError* error)
{ {
DBG (nsStringToJuce ([error description])); ignoreUnused (error);
DBG (nsStringToJuce ([error description]));
nsUrlErrorCode = [error code]; nsUrlErrorCode = [error code];
hasFailed = true; hasFailed = true;
initialised = true; initialised = true;
@@ -951,10 +949,8 @@ public:
connection.reset(); connection.reset();
} }
bool connect (WebInputStream::Listener* webInputListener, int numRetries = 0)
bool connect (WebInputStream::Listener* webInputListener, [[maybe_unused]] int numRetries = 0)
{ {
ignoreUnused (numRetries);
{ {
const ScopedLock lock (createConnectionLock); const ScopedLock lock (createConnectionLock);


+ 4
- 4
modules/juce_core/native/juce_mac_ObjCHelpers.h View File

@@ -391,8 +391,8 @@ struct ObjCClass
template <typename Type> template <typename Type>
void addIvar (const char* name) void addIvar (const char* name)
{ {
BOOL b = class_addIvar (cls, name, sizeof (Type), (uint8_t) rint (log2 (sizeof (Type))), @encode (Type));
jassert (b); ignoreUnused (b);
[[maybe_unused]] BOOL b = class_addIvar (cls, name, sizeof (Type), (uint8_t) rint (log2 (sizeof (Type))), @encode (Type));
jassert (b);
} }
template <typename Fn> template <typename Fn>
@@ -408,8 +408,8 @@ struct ObjCClass
void addProtocol (Protocol* protocol) void addProtocol (Protocol* protocol)
{ {
BOOL b = class_addProtocol (cls, protocol);
jassert (b); ignoreUnused (b);
[[maybe_unused]] BOOL b = class_addProtocol (cls, protocol);
jassert (b);
} }
template <typename ReturnType, typename... Params> template <typename ReturnType, typename... Params>


+ 1
- 2
modules/juce_core/native/juce_posix_NamedPipe.cpp View File

@@ -254,8 +254,7 @@ void NamedPipe::close()
pimpl->stopReadOperation = true; pimpl->stopReadOperation = true;
const char buffer[] { 0 }; const char buffer[] { 0 };
const auto done = ::write (pimpl->pipeIn.get(), buffer, numElementsInArray (buffer));
ignoreUnused (done);
[[maybe_unused]] const auto done = ::write (pimpl->pipeIn.get(), buffer, numElementsInArray (buffer));
} }
} }


+ 3
- 6
modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -140,10 +140,9 @@ bool File::setAsCurrentWorkingDirectory() const
//============================================================================== //==============================================================================
// The unix siginterrupt function is deprecated - this does the same job. // The unix siginterrupt function is deprecated - this does the same job.
int juce_siginterrupt (int sig, int flag)
int juce_siginterrupt ([[maybe_unused]] int sig, [[maybe_unused]] int flag)
{ {
#if JUCE_WASM #if JUCE_WASM
ignoreUnused (sig, flag);
return 0; return 0;
#else #else
#if JUCE_ANDROID #if JUCE_ANDROID
@@ -693,8 +692,7 @@ int File::getVolumeSerialNumber() const
void juce_runSystemCommand (const String&); void juce_runSystemCommand (const String&);
void juce_runSystemCommand (const String& command) void juce_runSystemCommand (const String& command)
{ {
int result = system (command.toUTF8());
ignoreUnused (result);
[[maybe_unused]] int result = system (command.toUTF8());
} }
String juce_getOutputFromCommand (const String&); String juce_getOutputFromCommand (const String&);
@@ -1015,7 +1013,7 @@ void JUCE_CALLTYPE Thread::yield()
#define SUPPORT_AFFINITIES 1 #define SUPPORT_AFFINITIES 1
#endif #endif
void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask (uint32 affinityMask)
void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask ([[maybe_unused]] uint32 affinityMask)
{ {
#if SUPPORT_AFFINITIES #if SUPPORT_AFFINITIES
cpu_set_t affinity; cpu_set_t affinity;
@@ -1042,7 +1040,6 @@ void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask (uint32 affinityMask)
// affinities aren't supported because either the appropriate header files weren't found, // affinities aren't supported because either the appropriate header files weren't found,
// or the SUPPORT_AFFINITIES macro was turned off // or the SUPPORT_AFFINITIES macro was turned off
jassertfalse; jassertfalse;
ignoreUnused (affinityMask);
#endif #endif
} }


+ 1
- 1
modules/juce_core/native/juce_win32_Files.cpp View File

@@ -960,7 +960,7 @@ bool File::createShortcut (const String& description, const File& linkFileToCrea
ComSmartPtr<IShellLink> shellLink; ComSmartPtr<IShellLink> shellLink;
ComSmartPtr<IPersistFile> persistFile; ComSmartPtr<IPersistFile> persistFile;
ignoreUnused (CoInitialize (nullptr));
[[maybe_unused]] const auto result = CoInitialize (nullptr);
return SUCCEEDED (shellLink.CoCreateInstance (CLSID_ShellLink)) return SUCCEEDED (shellLink.CoCreateInstance (CLSID_ShellLink))
&& SUCCEEDED (shellLink->SetPath (getFullPathName().toWideCharPointer())) && SUCCEEDED (shellLink->SetPath (getFullPathName().toWideCharPointer()))


+ 1
- 2
modules/juce_core/native/juce_win32_SystemStats.cpp View File

@@ -457,8 +457,7 @@ public:
#endif #endif
#if JUCE_WIN32_TIMER_PERIOD > 0 #if JUCE_WIN32_TIMER_PERIOD > 0
auto res = timeBeginPeriod (JUCE_WIN32_TIMER_PERIOD);
ignoreUnused (res);
[[maybe_unused]] auto res = timeBeginPeriod (JUCE_WIN32_TIMER_PERIOD);
jassert (res == TIMERR_NOERROR); jassert (res == TIMERR_NOERROR);
#endif #endif


+ 1
- 3
modules/juce_core/native/juce_win32_Threads.cpp View File

@@ -134,7 +134,7 @@ void Thread::killThread()
} }
} }
void JUCE_CALLTYPE Thread::setCurrentThreadName (const String& name)
void JUCE_CALLTYPE Thread::setCurrentThreadName ([[maybe_unused]] const String& name)
{ {
#if JUCE_DEBUG && JUCE_MSVC #if JUCE_DEBUG && JUCE_MSVC
struct struct
@@ -159,8 +159,6 @@ void JUCE_CALLTYPE Thread::setCurrentThreadName (const String& name)
{ {
OutputDebugStringA ("** Warning - Encountered noncontinuable exception **\n"); OutputDebugStringA ("** Warning - Encountered noncontinuable exception **\n");
} }
#else
ignoreUnused (name);
#endif #endif
} }


+ 7
- 8
modules/juce_core/network/juce_Socket.cpp View File

@@ -91,15 +91,16 @@ namespace SocketHelpers
: setOption (handle, IPPROTO_TCP, TCP_NODELAY, (int) 1)); : setOption (handle, IPPROTO_TCP, TCP_NODELAY, (int) 1));
} }
static void closeSocket (std::atomic<int>& handle, CriticalSection& readLock,
bool isListener, int portNumber, std::atomic<bool>& connected) noexcept
static void closeSocket (std::atomic<int>& handle,
[[maybe_unused]] CriticalSection& readLock,
[[maybe_unused]] bool isListener,
[[maybe_unused]] int portNumber,
std::atomic<bool>& connected) noexcept
{ {
const auto h = (SocketHandle) handle.load(); const auto h = (SocketHandle) handle.load();
handle = -1; handle = -1;
#if JUCE_WINDOWS #if JUCE_WINDOWS
ignoreUnused (portNumber, isListener, readLock);
if (h != invalidSocket || connected) if (h != invalidSocket || connected)
closesocket (h); closesocket (h);
@@ -771,11 +772,9 @@ bool DatagramSocket::setMulticastLoopbackEnabled (bool enable)
return SocketHelpers::setOption<bool> ((SocketHandle) handle.load(), IPPROTO_IP, IP_MULTICAST_LOOP, enable); return SocketHelpers::setOption<bool> ((SocketHandle) handle.load(), IPPROTO_IP, IP_MULTICAST_LOOP, enable);
} }
bool DatagramSocket::setEnablePortReuse (bool enabled)
bool DatagramSocket::setEnablePortReuse ([[maybe_unused]] bool enabled)
{ {
#if JUCE_ANDROID
ignoreUnused (enabled);
#else
#if ! JUCE_ANDROID
if (handle >= 0) if (handle >= 0)
return SocketHelpers::setOption ((SocketHandle) handle.load(), return SocketHelpers::setOption ((SocketHandle) handle.load(),
#if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD


+ 2
- 4
modules/juce_core/network/juce_URL.cpp View File

@@ -630,8 +630,7 @@ public:
} }
else else
{ {
auto desc = [error localizedDescription];
ignoreUnused (desc);
[[maybe_unused]] auto desc = [error localizedDescription];
jassertfalse; jassertfalse;
} }
} }
@@ -664,8 +663,7 @@ private:
return urlToUse.getLocalFile(); return urlToUse.getLocalFile();
} }
auto desc = [error localizedDescription];
ignoreUnused (desc);
[[maybe_unused]] auto desc = [error localizedDescription];
jassertfalse; jassertfalse;
} }


+ 7
- 0
modules/juce_core/network/juce_WebInputStream.cpp View File

@@ -96,4 +96,11 @@ void WebInputStream::createHeadersAndPostData (const URL& aURL,
aURL.createHeadersAndPostData (headers, data, addParametersToBody); aURL.createHeadersAndPostData (headers, data, addParametersToBody);
} }
bool WebInputStream::Listener::postDataSendProgress ([[maybe_unused]] WebInputStream& request,
[[maybe_unused]] int bytesSent,
[[maybe_unused]] int totalBytes)
{
return true;
}
} // namespace juce } // namespace juce

+ 1
- 5
modules/juce_core/network/juce_WebInputStream.h View File

@@ -107,11 +107,7 @@ class JUCE_API WebInputStream : public InputStream
@returns true to continue or false to cancel the upload @returns true to continue or false to cancel the upload
*/ */
virtual bool postDataSendProgress (WebInputStream& request, int bytesSent, int totalBytes)
{
ignoreUnused (request, bytesSent, totalBytes);
return true;
}
virtual bool postDataSendProgress (WebInputStream& request, int bytesSent, int totalBytes);
}; };
/** Wait until the first byte is ready for reading. /** Wait until the first byte is ready for reading.


+ 1
- 2
modules/juce_core/system/juce_StandardHeader.h View File

@@ -43,8 +43,7 @@
#if ! DOXYGEN #if ! DOXYGEN
#define JUCE_VERSION_ID \ #define JUCE_VERSION_ID \
volatile auto juceVersionId = "juce_version_" JUCE_STRINGIFY(JUCE_MAJOR_VERSION) "_" JUCE_STRINGIFY(JUCE_MINOR_VERSION) "_" JUCE_STRINGIFY(JUCE_BUILDNUMBER); \
ignoreUnused (juceVersionId);
[[maybe_unused]] volatile auto juceVersionId = "juce_version_" JUCE_STRINGIFY(JUCE_MAJOR_VERSION) "_" JUCE_STRINGIFY(JUCE_MINOR_VERSION) "_" JUCE_STRINGIFY(JUCE_BUILDNUMBER);
#endif #endif
//============================================================================== //==============================================================================


+ 1
- 2
modules/juce_cryptography/encryption/juce_BlowFish.cpp View File

@@ -280,9 +280,8 @@ void BlowFish::encrypt (MemoryBlock& data) const
auto size = data.getSize(); auto size = data.getSize();
data.setSize (size + (8u - (size % 8u))); data.setSize (size + (8u - (size % 8u)));
auto success = encrypt (data.getData(), size, data.getSize());
[[maybe_unused]] auto success = encrypt (data.getData(), size, data.getSize());
ignoreUnused (success);
jassert (success >= 0); jassert (success >= 0);
} }


+ 1
- 0
modules/juce_data_structures/juce_data_structures.cpp View File

@@ -39,6 +39,7 @@
#include "values/juce_ValueTreeSynchroniser.cpp" #include "values/juce_ValueTreeSynchroniser.cpp"
#include "values/juce_CachedValue.cpp" #include "values/juce_CachedValue.cpp"
#include "undomanager/juce_UndoManager.cpp" #include "undomanager/juce_UndoManager.cpp"
#include "undomanager/juce_UndoableAction.cpp"
#include "app_properties/juce_ApplicationProperties.cpp" #include "app_properties/juce_ApplicationProperties.cpp"
#include "app_properties/juce_PropertiesFile.cpp" #include "app_properties/juce_PropertiesFile.cpp"


+ 31
- 0
modules/juce_data_structures/undomanager/juce_UndoableAction.cpp View File

@@ -0,0 +1,31 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
Agreement and JUCE Privacy Policy.
End User License Agreement: www.juce.com/juce-7-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
UndoableAction* UndoableAction::createCoalescedAction ([[maybe_unused]] UndoableAction* nextAction) { return nullptr; }
} // namespace juce

+ 1
- 1
modules/juce_data_structures/undomanager/juce_UndoableAction.h View File

@@ -94,7 +94,7 @@ public:
If it's not possible to merge the two actions, the method should return a nullptr. If it's not possible to merge the two actions, the method should return a nullptr.
*/ */
virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { ignoreUnused (nextAction); return nullptr; }
virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction);
}; };
} // namespace juce } // namespace juce

+ 2
- 3
modules/juce_dsp/containers/juce_FixedSizeFunction.h View File

@@ -70,10 +70,9 @@ namespace detail
template <typename Fn> template <typename Fn>
void clear (void* s) void clear (void* s)
{ {
auto& fn = *reinterpret_cast<Fn*> (s);
fn.~Fn();
// I know this looks insane, for some reason MSVC 14 sometimes thinks fn is unreferenced // I know this looks insane, for some reason MSVC 14 sometimes thinks fn is unreferenced
ignoreUnused (fn);
[[maybe_unused]] auto& fn = *reinterpret_cast<Fn*> (s);
fn.~Fn();
} }
template <typename Fn, typename Ret, typename... Args> template <typename Fn, typename Ret, typename... Args>


+ 2
- 2
modules/juce_dsp/containers/juce_FixedSizeFunction_test.cpp View File

@@ -334,8 +334,8 @@ public:
bool smallCalled = false; bool smallCalled = false;
bool largeCalled = false; bool largeCalled = false;
SmallFn small = [&smallCalled, a = std::array<char, 8>{}] { smallCalled = true; juce::ignoreUnused (a); };
LargeFn large = [&largeCalled, a = std::array<char, 8>{}] { largeCalled = true; juce::ignoreUnused (a); };
SmallFn small = [&smallCalled, a = std::array<char, 8>{}] { smallCalled = true; ignoreUnused (a); };
LargeFn large = [&largeCalled, a = std::array<char, 8>{}] { largeCalled = true; ignoreUnused (a); };
large = std::move (small); large = std::move (small);


+ 3
- 3
modules/juce_dsp/juce_dsp.h View File

@@ -208,10 +208,10 @@ namespace juce
inline void snapToZero (long double& x) noexcept { JUCE_SNAP_TO_ZERO (x); } inline void snapToZero (long double& x) noexcept { JUCE_SNAP_TO_ZERO (x); }
#endif #endif
#else #else
inline void snapToZero (float& x) noexcept { ignoreUnused (x); }
inline void snapToZero ([[maybe_unused]] float& x) noexcept {}
#ifndef DOXYGEN #ifndef DOXYGEN
inline void snapToZero (double& x) noexcept { ignoreUnused (x); }
inline void snapToZero (long double& x) noexcept { ignoreUnused (x); }
inline void snapToZero ([[maybe_unused]] double& x) noexcept {}
inline void snapToZero ([[maybe_unused]] long double& x) noexcept {}
#endif #endif
#endif #endif
} }


+ 2
- 4
modules/juce_events/native/juce_linux_Messaging.cpp View File

@@ -68,8 +68,7 @@ public:
ScopedUnlock ul (lock); ScopedUnlock ul (lock);
unsigned char x = 0xff; unsigned char x = 0xff;
auto numBytes = write (getWriteHandle(), &x, 1);
ignoreUnused (numBytes);
[[maybe_unused]] auto numBytes = write (getWriteHandle(), &x, 1);
} }
} }
@@ -97,8 +96,7 @@ private:
ScopedUnlock ul (lock); ScopedUnlock ul (lock);
unsigned char x; unsigned char x;
auto numBytes = read (fd, &x, 1);
ignoreUnused (numBytes);
[[maybe_unused]] auto numBytes = read (fd, &x, 1);
} }
return queue.removeAndReturn (0); return queue.removeAndReturn (0);


+ 1
- 1
modules/juce_events/native/juce_win32_Messaging.cpp View File

@@ -288,7 +288,7 @@ void MessageManager::broadcastMessage (const String& value)
//============================================================================== //==============================================================================
void MessageManager::doPlatformSpecificInitialisation() void MessageManager::doPlatformSpecificInitialisation()
{ {
ignoreUnused (OleInitialize (nullptr));
[[maybe_unused]] const auto result = OleInitialize (nullptr);
InternalMessageQueue::getInstance(); InternalMessageQueue::getInstance();
} }


+ 2
- 2
modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp View File

@@ -528,8 +528,8 @@ Direct2DLowLevelGraphicsContext::Direct2DLowLevelGraphicsContext (HWND hwnd_)
if (pimpl->factories->d2dFactory != nullptr) if (pimpl->factories->d2dFactory != nullptr)
{ {
auto hr = pimpl->factories->d2dFactory->CreateHwndRenderTarget ({}, { hwnd, size }, pimpl->renderingTarget.resetAndGetPointerAddress());
jassert (SUCCEEDED (hr)); ignoreUnused (hr);
[[maybe_unused]] auto hr = pimpl->factories->d2dFactory->CreateHwndRenderTarget ({}, { hwnd, size }, pimpl->renderingTarget.resetAndGetPointerAddress());
jassert (SUCCEEDED (hr));
hr = pimpl->renderingTarget->CreateSolidColorBrush (D2D1::ColorF::ColorF (0.0f, 0.0f, 0.0f, 1.0f), pimpl->colourBrush.resetAndGetPointerAddress()); hr = pimpl->renderingTarget->CreateSolidColorBrush (D2D1::ColorF::ColorF (0.0f, 0.0f, 0.0f, 1.0f), pimpl->colourBrush.resetAndGetPointerAddress());
} }
} }


+ 4
- 9
modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp View File

@@ -200,8 +200,7 @@ namespace DirectWriteTypeLayout
} }
ComSmartPtr<IDWriteFont> dwFont; ComSmartPtr<IDWriteFont> dwFont;
auto hr = fontCollection.GetFontFromFontFace (glyphRun.fontFace, dwFont.resetAndGetPointerAddress());
ignoreUnused (hr);
[[maybe_unused]] auto hr = fontCollection.GetFontFromFontFace (glyphRun.fontFace, dwFont.resetAndGetPointerAddress());
jassert (dwFont != nullptr); jassert (dwFont != nullptr);
ComSmartPtr<IDWriteFontFamily> dwFontFamily; ComSmartPtr<IDWriteFontFamily> dwFontFamily;
@@ -299,8 +298,7 @@ namespace DirectWriteTypeLayout
fontIndex = 0; fontIndex = 0;
ComSmartPtr<IDWriteFontFamily> fontFamily; ComSmartPtr<IDWriteFontFamily> fontFamily;
auto hr = fontCollection.GetFontFamily (fontIndex, fontFamily.resetAndGetPointerAddress());
ignoreUnused (hr);
[[maybe_unused]] auto hr = fontCollection.GetFontFamily (fontIndex, fontFamily.resetAndGetPointerAddress());
ComSmartPtr<IDWriteFont> dwFont; ComSmartPtr<IDWriteFont> dwFont;
uint32 fontFacesCount = 0; uint32 fontFacesCount = 0;
@@ -420,8 +418,7 @@ namespace DirectWriteTypeLayout
return; return;
UINT32 actualLineCount = 0; UINT32 actualLineCount = 0;
auto hr = dwTextLayout->GetLineMetrics (nullptr, 0, &actualLineCount);
ignoreUnused (hr);
[[maybe_unused]] auto hr = dwTextLayout->GetLineMetrics (nullptr, 0, &actualLineCount);
layout.ensureStorageAllocated ((int) actualLineCount); layout.ensureStorageAllocated ((int) actualLineCount);
@@ -486,7 +483,7 @@ static bool canAllTypefacesAndFontsBeUsedInLayout (const AttributedString& text)
#endif #endif
bool TextLayout::createNativeLayout (const AttributedString& text)
bool TextLayout::createNativeLayout ([[maybe_unused]] const AttributedString& text)
{ {
#if JUCE_USE_DIRECTWRITE #if JUCE_USE_DIRECTWRITE
if (! canAllTypefacesAndFontsBeUsedInLayout (text)) if (! canAllTypefacesAndFontsBeUsedInLayout (text))
@@ -506,8 +503,6 @@ bool TextLayout::createNativeLayout (const AttributedString& text)
return true; return true;
} }
#else
ignoreUnused (text);
#endif #endif
return false; return false;


+ 2
- 4
modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp View File

@@ -35,8 +35,7 @@ namespace
uint32 index = 0; uint32 index = 0;
BOOL exists = false; BOOL exists = false;
auto hr = names->FindLocaleName (L"en-us", &index, &exists);
ignoreUnused (hr);
[[maybe_unused]] auto hr = names->FindLocaleName (L"en-us", &index, &exists);
if (! exists) if (! exists)
index = 0; index = 0;
@@ -152,8 +151,7 @@ public:
jassert (fontCollection != nullptr); jassert (fontCollection != nullptr);
uint32 fontIndex = 0; uint32 fontIndex = 0;
auto hr = fontCollection->FindFamilyName (font.getTypefaceName().toWideCharPointer(), &fontIndex, &fontFound);
ignoreUnused (hr);
[[maybe_unused]] auto hr = fontCollection->FindFamilyName (font.getTypefaceName().toWideCharPointer(), &fontIndex, &fontFound);
if (! fontFound) if (! fontFound)
fontIndex = 0; fontIndex = 0;


+ 1
- 2
modules/juce_graphics/native/juce_win32_Fonts.cpp View File

@@ -234,8 +234,7 @@ StringArray Font::findAllTypefaceStyles (const String& family)
{ {
BOOL fontFound = false; BOOL fontFound = false;
uint32 fontIndex = 0; uint32 fontIndex = 0;
auto hr = factories->systemFonts->FindFamilyName (family.toWideCharPointer(), &fontIndex, &fontFound);
ignoreUnused (hr);
[[maybe_unused]] auto hr = factories->systemFonts->FindFamilyName (family.toWideCharPointer(), &fontIndex, &fontFound);
if (! fontFound) if (! fontFound)
fontIndex = 0; fontIndex = 0;


+ 5
- 13
modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp View File

@@ -150,15 +150,13 @@ JUCE_IMPLEMENT_SINGLETON (ContentSharer)
ContentSharer::ContentSharer() {} ContentSharer::ContentSharer() {}
ContentSharer::~ContentSharer() { clearSingletonInstance(); } ContentSharer::~ContentSharer() { clearSingletonInstance(); }
void ContentSharer::shareFiles (const Array<URL>& files,
void ContentSharer::shareFiles ([[maybe_unused]] const Array<URL>& files,
std::function<void (bool, const String&)> callbackToUse) std::function<void (bool, const String&)> callbackToUse)
{ {
#if JUCE_CONTENT_SHARING #if JUCE_CONTENT_SHARING
startNewShare (callbackToUse); startNewShare (callbackToUse);
pimpl->shareFiles (files); pimpl->shareFiles (files);
#else #else
ignoreUnused (files);
// Content sharing is not available on this platform! // Content sharing is not available on this platform!
jassertfalse; jassertfalse;
@@ -188,15 +186,13 @@ void ContentSharer::startNewShare (std::function<void (bool, const String&)> cal
} }
#endif #endif
void ContentSharer::shareText (const String& text,
void ContentSharer::shareText ([[maybe_unused]] const String& text,
std::function<void (bool, const String&)> callbackToUse) std::function<void (bool, const String&)> callbackToUse)
{ {
#if JUCE_CONTENT_SHARING #if JUCE_CONTENT_SHARING
startNewShare (callbackToUse); startNewShare (callbackToUse);
pimpl->shareText (text); pimpl->shareText (text);
#else #else
ignoreUnused (text);
// Content sharing is not available on this platform! // Content sharing is not available on this platform!
jassertfalse; jassertfalse;
@@ -205,16 +201,14 @@ void ContentSharer::shareText (const String& text,
#endif #endif
} }
void ContentSharer::shareImages (const Array<Image>& images,
void ContentSharer::shareImages ([[maybe_unused]] const Array<Image>& images,
std::function<void (bool, const String&)> callbackToUse, std::function<void (bool, const String&)> callbackToUse,
ImageFileFormat* imageFileFormatToUse)
[[maybe_unused]] ImageFileFormat* imageFileFormatToUse)
{ {
#if JUCE_CONTENT_SHARING #if JUCE_CONTENT_SHARING
startNewShare (callbackToUse); startNewShare (callbackToUse);
prepareImagesThread.reset (new PrepareImagesThread (*this, images, imageFileFormatToUse)); prepareImagesThread.reset (new PrepareImagesThread (*this, images, imageFileFormatToUse));
#else #else
ignoreUnused (images, imageFileFormatToUse);
// Content sharing is not available on this platform! // Content sharing is not available on this platform!
jassertfalse; jassertfalse;
@@ -238,15 +232,13 @@ void ContentSharer::filesToSharePrepared()
} }
#endif #endif
void ContentSharer::shareData (const MemoryBlock& mb,
void ContentSharer::shareData ([[maybe_unused]] const MemoryBlock& mb,
std::function<void (bool, const String&)> callbackToUse) std::function<void (bool, const String&)> callbackToUse)
{ {
#if JUCE_CONTENT_SHARING #if JUCE_CONTENT_SHARING
startNewShare (callbackToUse); startNewShare (callbackToUse);
prepareDataThread.reset (new PrepareDataThread (*this, mb)); prepareDataThread.reset (new PrepareDataThread (*this, mb));
#else #else
ignoreUnused (mb);
if (callbackToUse) if (callbackToUse)
callbackToUse (false, "Content sharing not available on this platform!"); callbackToUse (false, "Content sharing not available on this platform!");
#endif #endif


+ 1
- 2
modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp View File

@@ -440,7 +440,7 @@ void FileBrowserComponent::fileDoubleClicked (const File& f)
void FileBrowserComponent::browserRootChanged (const File&) {} void FileBrowserComponent::browserRootChanged (const File&) {}
bool FileBrowserComponent::keyPressed (const KeyPress& key)
bool FileBrowserComponent::keyPressed ([[maybe_unused]] const KeyPress& key)
{ {
#if JUCE_LINUX || JUCE_BSD || JUCE_WINDOWS #if JUCE_LINUX || JUCE_BSD || JUCE_WINDOWS
if (key.getModifiers().isCommandDown() if (key.getModifiers().isCommandDown()
@@ -452,7 +452,6 @@ bool FileBrowserComponent::keyPressed (const KeyPress& key)
} }
#endif #endif
ignoreUnused (key);
return false; return false;
} }


+ 1
- 3
modules/juce_gui_basics/layout/juce_SidePanel.cpp View File

@@ -242,10 +242,8 @@ void SidePanel::lookAndFeelChanged()
titleLabel.setJustificationType (lf.getSidePanelTitleJustification (*this)); titleLabel.setJustificationType (lf.getSidePanelTitleJustification (*this));
} }
void SidePanel::componentMovedOrResized (Component& component, bool wasMoved, bool wasResized)
void SidePanel::componentMovedOrResized (Component& component, [[maybe_unused]] bool wasMoved, bool wasResized)
{ {
ignoreUnused (wasMoved);
if (wasResized && (&component == parent)) if (wasResized && (&component == parent))
setBounds (calculateBoundsInParent (component)); setBounds (calculateBoundsInParent (component));
} }


+ 1
- 2
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp View File

@@ -464,10 +464,9 @@ void LookAndFeel_V3::drawLinearSliderBackground (Graphics& g, int x, int y, int
g.strokePath (indent, PathStrokeType (0.5f)); g.strokePath (indent, PathStrokeType (0.5f));
} }
void LookAndFeel_V3::drawPopupMenuBackground (Graphics& g, int width, int height)
void LookAndFeel_V3::drawPopupMenuBackground (Graphics& g, [[maybe_unused]] int width, [[maybe_unused]] int height)
{ {
g.fillAll (findColour (PopupMenu::backgroundColourId)); g.fillAll (findColour (PopupMenu::backgroundColourId));
ignoreUnused (width, height);
#if ! JUCE_MAC #if ! JUCE_MAC
g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.6f)); g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.6f));


+ 5
- 11
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp View File

@@ -353,12 +353,10 @@ void LookAndFeel_V4::drawToggleButton (Graphics& g, ToggleButton& button,
void LookAndFeel_V4::drawTickBox (Graphics& g, Component& component, void LookAndFeel_V4::drawTickBox (Graphics& g, Component& component,
float x, float y, float w, float h, float x, float y, float w, float h,
const bool ticked, const bool ticked,
const bool isEnabled,
const bool shouldDrawButtonAsHighlighted,
const bool shouldDrawButtonAsDown)
[[maybe_unused]] const bool isEnabled,
[[maybe_unused]] const bool shouldDrawButtonAsHighlighted,
[[maybe_unused]] const bool shouldDrawButtonAsDown)
{ {
ignoreUnused (isEnabled, shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown);
Rectangle<float> tickBounds (x, y, w, h); Rectangle<float> tickBounds (x, y, w, h);
g.setColour (component.findColour (ToggleButton::tickDisabledColourId)); g.setColour (component.findColour (ToggleButton::tickDisabledColourId));
@@ -619,10 +617,8 @@ int LookAndFeel_V4::getDefaultScrollbarWidth()
} }
void LookAndFeel_V4::drawScrollbar (Graphics& g, ScrollBar& scrollbar, int x, int y, int width, int height, void LookAndFeel_V4::drawScrollbar (Graphics& g, ScrollBar& scrollbar, int x, int y, int width, int height,
bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown)
bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool isMouseOver, [[maybe_unused]] bool isMouseDown)
{ {
ignoreUnused (isMouseDown);
Rectangle<int> thumbBounds; Rectangle<int> thumbBounds;
if (isScrollbarVertical) if (isScrollbarVertical)
@@ -1253,10 +1249,8 @@ void LookAndFeel_V4::drawPropertyComponentBackground (Graphics& g, int width, in
g.fillRect (0, 0, width, height - 1); g.fillRect (0, 0, width, height - 1);
} }
void LookAndFeel_V4::drawPropertyComponentLabel (Graphics& g, int width, int height, PropertyComponent& component)
void LookAndFeel_V4::drawPropertyComponentLabel (Graphics& g, [[maybe_unused]] int width, int height, PropertyComponent& component)
{ {
ignoreUnused (width);
auto indent = getPropertyComponentIndent (component); auto indent = getPropertyComponentIndent (component);
g.setColour (component.findColour (PropertyComponent::labelTextColourId) g.setColour (component.findColour (PropertyComponent::labelTextColourId)


+ 1
- 2
modules/juce_gui_basics/menus/juce_PopupMenu.cpp View File

@@ -2098,7 +2098,7 @@ struct PopupMenuCompletionCallback : public ModalComponentManager::Callback
int PopupMenu::showWithOptionalCallback (const Options& options, int PopupMenu::showWithOptionalCallback (const Options& options,
ModalComponentManager::Callback* userCallback, ModalComponentManager::Callback* userCallback,
bool canBeModal)
[[maybe_unused]] bool canBeModal)
{ {
std::unique_ptr<ModalComponentManager::Callback> userCallbackDeleter (userCallback); std::unique_ptr<ModalComponentManager::Callback> userCallbackDeleter (userCallback);
std::unique_ptr<PopupMenuCompletionCallback> callback (new PopupMenuCompletionCallback()); std::unique_ptr<PopupMenuCompletionCallback> callback (new PopupMenuCompletionCallback());
@@ -2120,7 +2120,6 @@ int PopupMenu::showWithOptionalCallback (const Options& options,
if (userCallback == nullptr && canBeModal) if (userCallback == nullptr && canBeModal)
return window->runModalLoop(); return window->runModalLoop();
#else #else
ignoreUnused (canBeModal);
jassert (! (userCallback == nullptr && canBeModal)); jassert (! (userCallback == nullptr && canBeModal));
#endif #endif
} }


+ 1
- 3
modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp View File

@@ -62,10 +62,8 @@ static Rectangle<float> getLogoArea (Rectangle<float> parentRect)
} }
//============================================================================== //==============================================================================
JUCESplashScreen::JUCESplashScreen (Component& parent)
JUCESplashScreen::JUCESplashScreen ([[maybe_unused]] Component& parent)
{ {
ignoreUnused (parent);
#if JUCE_DISPLAY_SPLASH_SCREEN #if JUCE_DISPLAY_SPLASH_SCREEN
if (splashDisplayTime == 0 if (splashDisplayTime == 0
|| Time::getMillisecondCounter() < splashDisplayTime + (uint32) millisecondsToDisplaySplash) || Time::getMillisecondCounter() < splashDisplayTime + (uint32) millisecondsToDisplaySplash)


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save