1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Update code to use C++14 [[deprecated]] attribute

This commit removes the various compiler-specific JUCE_DEPRECATED macros and replaces them with C++14's deprecated attribute. It also removes the JUCE_CATCH_DEPRECATED_CODE_MISUSE flag as we can rely on the override specifier catching usage of these old virtual methods, and tidies up the DOXYGEN preprocessor checks as they were inconsistent across the codebase.
This commit is contained in:
ed 2021-08-25 10:08:55 +01:00
parent a435026b24
commit b9542ccc4c
104 changed files with 579 additions and 587 deletions

View file

@ -418,7 +418,7 @@ public:
#endif
{
if (newReader == nullptr)
newReader = formatManager.createReaderFor (fileToPlay.createInputStream (false));
newReader = formatManager.createReaderFor (fileToPlay.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)));
}
reader.reset (newReader);

View file

@ -456,7 +456,7 @@ private:
#endif
{
if (reader == nullptr)
reader = formatManager.createReaderFor (audioURL.createInputStream (false));
reader = formatManager.createReaderFor (audioURL.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)));
}
if (reader != nullptr)

View file

@ -80,26 +80,26 @@ struct SIMDRegisterDemoDSP
auto& input = context.getInputBlock();
auto& output = context.getOutputBlock();
auto n = input.getNumSamples();
auto n = (int) input.getNumSamples();
auto* inout = channelPointers.getData();
for (size_t ch = 0; ch < SIMDRegister<float>::size(); ++ch)
inout[ch] = (ch < input.getNumChannels() ? const_cast<float*> (input.getChannelPointer (ch)) : zero.getChannelPointer (ch));
AudioDataConverters::interleaveSamples (inout, reinterpret_cast<float*> (interleaved.getChannelPointer (0)),
static_cast<int> (n), static_cast<int> (SIMDRegister<float>::size()));
using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::NonConst>;
using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>;
DstSampleType dstData (interleaved.getChannelPointer (0), (int) interleaved.getNumChannels());
SrcSampleType srcData (inout);
dstData.convertSamples (srcData, n);
iir->process (ProcessContextReplacing<SIMDRegister<float>> (interleaved));
for (size_t ch = 0; ch < input.getNumChannels(); ++ch)
inout[ch] = output.getChannelPointer (ch);
AudioDataConverters::deinterleaveSamples (reinterpret_cast<float*> (interleaved.getChannelPointer (0)),
const_cast<float**> (inout),
static_cast<int> (n), static_cast<int> (SIMDRegister<float>::size()));
srcData.convertSamples (dstData, n);
}
void reset()

View file

@ -103,9 +103,10 @@ public:
StringPairArray responseHeaders;
int statusCode = 0;
if (auto stream = std::unique_ptr<InputStream> (url.createInputStream (false, nullptr, nullptr, {},
10000, // timeout in millisecs
&responseHeaders, &statusCode)))
if (auto stream = url.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)
.withConnectionTimeoutMs(10000)
.withResponseHeaders (&responseHeaders)
.withStatusCode (&statusCode)))
{
return (statusCode != 0 ? "Status code: " + String (statusCode) + newLine : String())
+ "Response headers: " + newLine

View file

@ -232,7 +232,7 @@ private:
double cyclesPerSecond = MidiMessage::getMidiNoteInHertz (midiNoteNumber);
double cyclesPerSample = cyclesPerSecond / getSampleRate();
angleDelta = cyclesPerSample * 2.0 * double_Pi;
angleDelta = cyclesPerSample * 2.0 * MathConstants<double>::pi;
}
void stopNote (float /*velocity*/, bool allowTailOff) override

View file

@ -23,6 +23,9 @@
namespace juce
{
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{
auto maxVal = (double) 0x7fff;
@ -595,4 +598,7 @@ static AudioConversionTests audioConversionUnitTests;
#endif
JUCE_END_IGNORE_WARNINGS_MSVC
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
} // namespace juce

View file

@ -644,6 +644,8 @@ public:
//==============================================================================
#ifndef DOXYGEN
/**
A set of routines to convert buffers of 32-bit floating point data to and from
various integer formats.
@ -653,7 +655,7 @@ public:
@tags{Audio}
*/
class JUCE_API AudioDataConverters
class [[deprecated]] JUCE_API AudioDataConverters
{
public:
//==============================================================================
@ -710,7 +712,8 @@ public:
private:
AudioDataConverters();
JUCE_DECLARE_NON_COPYABLE (AudioDataConverters)
};
#endif
} // namespace juce

View file

@ -209,13 +209,14 @@ MidiBufferIterator MidiBuffer::findNextSamplePosition (int samplePosition) const
}
//==============================================================================
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
MidiBuffer::Iterator::Iterator (const MidiBuffer& b) noexcept
: buffer (b), iterator (b.data.begin())
{
}
MidiBuffer::Iterator::~Iterator() noexcept {}
void MidiBuffer::Iterator::setNextSamplePosition (int samplePosition) noexcept
{
iterator = buffer.findNextSamplePosition (samplePosition);
@ -244,6 +245,9 @@ bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePositio
return true;
}
JUCE_END_IGNORE_WARNINGS_MSVC
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
//==============================================================================
//==============================================================================
#if JUCE_UNIT_TESTS

View file

@ -273,7 +273,9 @@ public:
MidiBufferIterator findNextSamplePosition (int samplePosition) const noexcept;
//==============================================================================
/**
#ifndef DOXYGEN
/** This class is now deprecated in favour of MidiBufferIterator.
Used to iterate through the events in a MidiBuffer.
Note that altering the buffer while an iterator is using it will produce
@ -281,20 +283,12 @@ public:
@see MidiBuffer
*/
class JUCE_API Iterator
class [[deprecated]] JUCE_API Iterator
{
public:
//==============================================================================
/** Creates an Iterator for this MidiBuffer.
This class has been deprecated in favour of MidiBufferIterator.
*/
JUCE_DEPRECATED (Iterator (const MidiBuffer&) noexcept);
/** Creates a copy of an iterator. */
Iterator (const Iterator&) = default;
/** Destructor. */
~Iterator() noexcept;
/** Creates an Iterator for this MidiBuffer. */
Iterator (const MidiBuffer& b) noexcept;
//==============================================================================
/** Repositions the iterator so that the next event retrieved will be the first
@ -336,6 +330,7 @@ public:
const MidiBuffer& buffer;
MidiBufferIterator iterator;
};
#endif
/** The raw data holding this buffer.
Obviously access to this data is provided at your own risk. Its internal format could

View file

@ -857,17 +857,16 @@ public:
//==============================================================================
#ifndef DOXYGEN
/** Reads a midi variable-length integer.
This signature has been deprecated in favour of the safer
readVariableLengthValue.
The `data` argument indicates the data to read the number from,
and `numBytesUsed` is used as an out-parameter to indicate the number
of bytes that were read.
*/
JUCE_DEPRECATED (static int readVariableLengthVal (const uint8* data,
int& numBytesUsed) noexcept);
[[deprecated ("This signature has been deprecated in favour of the safer readVariableLengthValue.")]]
static int readVariableLengthVal (const uint8* data, int& numBytesUsed) noexcept;
#endif
/** Holds information about a variable-length value which was parsed
from a stream of bytes.

View file

@ -23,7 +23,7 @@
namespace juce
{
#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS)
#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS)
struct CoreAudioLayouts
{

View file

@ -631,14 +631,6 @@ private:
template <typename floatType>
void processNextBlock (AudioBuffer<floatType>&, const MidiBuffer&, int startSample, int numSamples);
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// Note the new parameters for these methods.
virtual int findFreeVoice (const bool) const { return 0; }
virtual int noteOff (int, int, int) { return 0; }
virtual int findFreeVoice (SynthesiserSound*, const bool) { return 0; }
virtual int findVoiceToSteal (SynthesiserSound*) const { return 0; }
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Synthesiser)
};

View file

@ -330,9 +330,8 @@ public:
}
//==============================================================================
/** THIS FUNCTION IS DEPRECATED.
Use `setTargetValue (float)` and `setCurrentAndTargetValue()` instead:
#ifndef DOXYGEN
/** Using the new methods:
lsv.setValue (x, false); -> lsv.setTargetValue (x);
lsv.setValue (x, true); -> lsv.setCurrentAndTargetValue (x);
@ -340,7 +339,8 @@ public:
@param newValue The new target value
@param force If true, the value will be set immediately, bypassing the ramp
*/
JUCE_DEPRECATED_WITH_BODY (void setValue (FloatType newValue, bool force = false) noexcept,
[[deprecated ("Use setTargetValue and setCurrentAndTargetValue instead.")]]
void setValue (FloatType newValue, bool force = false) noexcept
{
if (force)
{
@ -349,7 +349,8 @@ public:
}
setTargetValue (newValue);
})
}
#endif
private:
//==============================================================================

View file

@ -471,18 +471,20 @@ public:
int getXRunCount() const noexcept;
//==============================================================================
/** Deprecated. */
#ifndef DOXYGEN
[[deprecated ("Use setMidiInputDeviceEnabled instead.")]]
void setMidiInputEnabled (const String&, bool);
/** Deprecated. */
[[deprecated ("Use isMidiInputDeviceEnabled instead.")]]
bool isMidiInputEnabled (const String&) const;
/** Deprecated. */
[[deprecated ("Use addMidiInputDeviceCallback instead.")]]
void addMidiInputCallback (const String&, MidiInputCallback*);
/** Deprecated. */
[[deprecated ("Use removeMidiInputDeviceCallback instead.")]]
void removeMidiInputCallback (const String&, MidiInputCallback*);
/** Deprecated. */
[[deprecated ("Use setDefaultMidiOutputDevice instead.")]]
void setDefaultMidiOutput (const String&);
/** Deprecated. */
[[deprecated ("Use getDefaultMidiOutputIdentifier instead.")]]
const String& getDefaultMidiOutputName() const noexcept { return defaultMidiOutputDeviceInfo.name; }
#endif
private:
//==============================================================================

View file

@ -167,8 +167,10 @@ public:
/** Creates a Bela device type if it's available on this platform, or returns null. */
static AudioIODeviceType* createAudioIODeviceType_Bela();
/** This method has been deprecated. You should call the method which takes a WASAPIDeviceMode instead. */
JUCE_DEPRECATED (static AudioIODeviceType* createAudioIODeviceType_WASAPI (bool exclusiveMode));
#ifndef DOXYGEN
[[deprecated ("You should call the method which takes a WASAPIDeviceMode instead.")]]
static AudioIODeviceType* createAudioIODeviceType_WASAPI (bool exclusiveMode);
#endif
protected:
explicit AudioIODeviceType (const String& typeName);

View file

@ -157,12 +157,14 @@ public:
void setName (const String& newName) noexcept { deviceInfo.name = newName; }
//==============================================================================
/** Deprecated. */
#ifndef DOXYGEN
[[deprecated ("Use getAvailableDevices instead.")]]
static StringArray getDevices();
/** Deprecated. */
[[deprecated ("Use getDefaultDevice instead.")]]
static int getDefaultDeviceIndex();
/** Deprecated. */
[[deprecated ("Use openDevice that takes a device identifier instead.")]]
static std::unique_ptr<MidiInput> openDevice (int, MidiInputCallback*);
#endif
/** @internal */
class Pimpl;
@ -347,12 +349,14 @@ public:
bool isBackgroundThreadRunning() const noexcept { return isThreadRunning(); }
//==============================================================================
/** Deprecated. */
#ifndef DOXYGEN
[[deprecated ("Use getAvailableDevices instead.")]]
static StringArray getDevices();
/** Deprecated. */
[[deprecated ("Use getDefaultDevice instead.")]]
static int getDefaultDeviceIndex();
/** Deprecated. */
[[deprecated ("Use openDevice that takes a device identifier instead.")]]
static std::unique_ptr<MidiOutput> openDevice (int);
#endif
/** @internal */
class Pimpl;

View file

@ -26,7 +26,7 @@
namespace juce
{
#if JUCE_USE_FLAC || defined (DOXYGEN)
#if JUCE_USE_FLAC || DOXYGEN
//==============================================================================
/**

View file

@ -26,7 +26,7 @@
namespace juce
{
#if JUCE_USE_LAME_AUDIO_FORMAT || defined (DOXYGEN)
#if JUCE_USE_LAME_AUDIO_FORMAT || DOXYGEN
//==============================================================================
/**

View file

@ -26,7 +26,7 @@
namespace juce
{
#if JUCE_USE_OGGVORBIS || defined (DOXYGEN)
#if JUCE_USE_OGGVORBIS || DOXYGEN
//==============================================================================
/**

View file

@ -162,15 +162,15 @@ class JucePlugInProcess : public CEffectProcessMIDI,
{
public:
//==============================================================================
// RTAS builds will be removed from JUCE in the next release
JUCE_DEPRECATED_WITH_BODY (JucePlugInProcess(),
[[deprecated ("RTAS builds will be removed from JUCE in the next release.")]]
JucePlugInProcess()
{
juceFilter.reset (createPluginFilterOfType (AudioProcessor::wrapperType_RTAS));
AddChunk (juceChunkType, "Juce Audio Plugin Data");
++numInstances;
})
}
~JucePlugInProcess()
{

View file

@ -549,6 +549,6 @@ struct AudioUnitHelpers
}
};
#endif // ! DOXYGEN
#endif
} // namespace juce

View file

@ -23,7 +23,7 @@
==============================================================================
*/
#if ! DOXYGEN
#ifndef DOXYGEN
namespace juce
{
@ -1225,4 +1225,4 @@ JUCE_END_NO_SANITIZE
} // namespace juce
#endif // ! DOXYGEN
#endif

View file

@ -43,16 +43,17 @@ public:
~VST3PluginFormat() override;
//==============================================================================
/** Instead of using this function, use AudioPluginInstance::getExtensions()
to visit the ExtensionsVisitor::VST3 struct for the instance, if it exists.
Then, call ExtensionsVisitor::VST3::setPreset() to set the state using the
contents of a vstpreset file.
Attempts to reload a VST3 plugin's state from some preset file data.
#ifndef DOXYGEN
/** Attempts to reload a VST3 plugin's state from some preset file data.
@see VSTPluginFormat::loadFromFXBFile
*/
JUCE_DEPRECATED (static bool setStateFromVSTPresetFile (AudioPluginInstance*, const MemoryBlock&));
[[deprecated ("Instead of using this function, use AudioPluginInstance::getExtensions() "
"to visit the ExtensionsVisitor::VST3 struct for the instance, if it exists. "
"Then, call ExtensionsVisitor::VST3::setPreset() to set the state using the "
"contents of a vstpreset file.")]]
static bool setStateFromVSTPresetFile (AudioPluginInstance*, const MemoryBlock&);
#endif
//==============================================================================
static String getFormatName() { return "VST3"; }

View file

@ -125,13 +125,15 @@ public:
*/
HostedParameter* getHostedParameter (int index) const;
#ifndef DOXYGEN
/** Use the new typesafe visitor-based interface rather than this function.
Returns a pointer to some kind of platform-specific data about the plugin.
E.g. For a VST, this value can be cast to an AEffect*. For an AudioUnit, it can be
cast to an AudioUnit handle.
*/
JUCE_DEPRECATED (virtual void* getPlatformSpecificData());
[[deprecated ("Use the new typesafe visitor-based interface rather than this function.")]]
virtual void* getPlatformSpecificData();
// Rather than using these methods you should call the corresponding methods
// on the AudioProcessorParameter objects returned from getParameters().
@ -140,21 +142,22 @@ public:
//
// In addition to being marked as deprecated these methods will assert on
// the first call.
JUCE_DEPRECATED (String getParameterID (int index) override);
JUCE_DEPRECATED (float getParameter (int parameterIndex) override);
JUCE_DEPRECATED (void setParameter (int parameterIndex, float newValue) override);
JUCE_DEPRECATED (const String getParameterName (int parameterIndex) override);
JUCE_DEPRECATED (String getParameterName (int parameterIndex, int maximumStringLength) override);
JUCE_DEPRECATED (const String getParameterText (int parameterIndex) override);
JUCE_DEPRECATED (String getParameterText (int parameterIndex, int maximumStringLength) override);
JUCE_DEPRECATED (int getParameterNumSteps (int parameterIndex) override);
JUCE_DEPRECATED (bool isParameterDiscrete (int parameterIndex) const override);
JUCE_DEPRECATED (bool isParameterAutomatable (int parameterIndex) const override);
JUCE_DEPRECATED (float getParameterDefaultValue (int parameterIndex) override);
JUCE_DEPRECATED (String getParameterLabel (int parameterIndex) const override);
JUCE_DEPRECATED (bool isParameterOrientationInverted (int parameterIndex) const override);
JUCE_DEPRECATED (bool isMetaParameter (int parameterIndex) const override);
JUCE_DEPRECATED (AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const override);
[[deprecated]] String getParameterID (int index) override;
[[deprecated]] float getParameter (int parameterIndex) override;
[[deprecated]] void setParameter (int parameterIndex, float newValue) override;
[[deprecated]] const String getParameterName (int parameterIndex) override;
[[deprecated]] String getParameterName (int parameterIndex, int maximumStringLength) override;
[[deprecated]] const String getParameterText (int parameterIndex) override;
[[deprecated]] String getParameterText (int parameterIndex, int maximumStringLength) override;
[[deprecated]] int getParameterNumSteps (int parameterIndex) override;
[[deprecated]] bool isParameterDiscrete (int parameterIndex) const override;
[[deprecated]] bool isParameterAutomatable (int parameterIndex) const override;
[[deprecated]] float getParameterDefaultValue (int parameterIndex) override;
[[deprecated]] String getParameterLabel (int parameterIndex) const override;
[[deprecated]] bool isParameterOrientationInverted (int parameterIndex) const override;
[[deprecated]] bool isMetaParameter (int parameterIndex) const override;
[[deprecated]] AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const override;
#endif
protected:
//==============================================================================

View file

@ -1378,41 +1378,40 @@ protected:
/** @internal */
void sendParamChangeMessageToListeners (int parameterIndex, float newValue);
//==============================================================================
#ifndef DOXYGEN
public:
#ifndef DOXYGEN
// These methods are all deprecated in favour of using AudioProcessorParameter
// and AudioProcessorParameterGroup
JUCE_DEPRECATED (virtual int getNumParameters());
JUCE_DEPRECATED (virtual const String getParameterName (int parameterIndex));
JUCE_DEPRECATED (virtual String getParameterID (int index));
JUCE_DEPRECATED (virtual float getParameter (int parameterIndex));
JUCE_DEPRECATED (virtual String getParameterName (int parameterIndex, int maximumStringLength));
JUCE_DEPRECATED (virtual const String getParameterText (int parameterIndex));
JUCE_DEPRECATED (virtual String getParameterText (int parameterIndex, int maximumStringLength));
JUCE_DEPRECATED (virtual int getParameterNumSteps (int parameterIndex));
JUCE_DEPRECATED (virtual bool isParameterDiscrete (int parameterIndex) const);
JUCE_DEPRECATED (virtual float getParameterDefaultValue (int parameterIndex));
JUCE_DEPRECATED (virtual String getParameterLabel (int index) const);
JUCE_DEPRECATED (virtual bool isParameterOrientationInverted (int index) const);
JUCE_DEPRECATED (virtual void setParameter (int parameterIndex, float newValue));
JUCE_DEPRECATED (virtual bool isParameterAutomatable (int parameterIndex) const);
JUCE_DEPRECATED (virtual bool isMetaParameter (int parameterIndex) const);
JUCE_DEPRECATED (virtual AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const);
JUCE_DEPRECATED (void beginParameterChangeGesture (int parameterIndex));
JUCE_DEPRECATED (void endParameterChangeGesture (int parameterIndex));
JUCE_DEPRECATED (void setParameterNotifyingHost (int parameterIndex, float newValue));
[[deprecated]] virtual int getNumParameters();
[[deprecated]] virtual const String getParameterName (int parameterIndex);
[[deprecated]] virtual String getParameterID (int index);
[[deprecated]] virtual float getParameter (int parameterIndex);
[[deprecated]] virtual String getParameterName (int parameterIndex, int maximumStringLength);
[[deprecated]] virtual const String getParameterText (int parameterIndex);
[[deprecated]] virtual String getParameterText (int parameterIndex, int maximumStringLength);
[[deprecated]] virtual int getParameterNumSteps (int parameterIndex);
[[deprecated]] virtual bool isParameterDiscrete (int parameterIndex) const;
[[deprecated]] virtual float getParameterDefaultValue (int parameterIndex);
[[deprecated]] virtual String getParameterLabel (int index) const;
[[deprecated]] virtual bool isParameterOrientationInverted (int index) const;
[[deprecated]] virtual void setParameter (int parameterIndex, float newValue);
[[deprecated]] virtual bool isParameterAutomatable (int parameterIndex) const;
[[deprecated]] virtual bool isMetaParameter (int parameterIndex) const;
[[deprecated]] virtual AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const;
[[deprecated]] void beginParameterChangeGesture (int parameterIndex);
[[deprecated]] void endParameterChangeGesture (int parameterIndex);
[[deprecated]] void setParameterNotifyingHost (int parameterIndex, float newValue);
// These functions are deprecated: your audio processor can inform the host
// on its bus and channel layouts and names using the AudioChannelSet and various bus classes.
JUCE_DEPRECATED_WITH_BODY (int getNumInputChannels() const noexcept, { return getTotalNumInputChannels(); })
JUCE_DEPRECATED_WITH_BODY (int getNumOutputChannels() const noexcept, { return getTotalNumOutputChannels(); })
JUCE_DEPRECATED_WITH_BODY (const String getInputSpeakerArrangement() const noexcept, { return cachedInputSpeakerArrString; })
JUCE_DEPRECATED_WITH_BODY (const String getOutputSpeakerArrangement() const noexcept, { return cachedOutputSpeakerArrString; })
JUCE_DEPRECATED (virtual const String getInputChannelName (int channelIndex) const);
JUCE_DEPRECATED (virtual const String getOutputChannelName (int channelIndex) const);
JUCE_DEPRECATED (virtual bool isInputChannelStereoPair (int index) const);
JUCE_DEPRECATED (virtual bool isOutputChannelStereoPair (int index) const);
[[deprecated]] int getNumInputChannels() const noexcept { return getTotalNumInputChannels(); }
[[deprecated]] int getNumOutputChannels() const noexcept { return getTotalNumOutputChannels(); }
[[deprecated]] const String getInputSpeakerArrangement() const noexcept { return cachedInputSpeakerArrString; }
[[deprecated]] const String getOutputSpeakerArrangement() const noexcept { return cachedOutputSpeakerArrString; }
[[deprecated]] virtual const String getInputChannelName (int channelIndex) const;
[[deprecated]] virtual const String getOutputChannelName (int channelIndex) const;
[[deprecated]] virtual bool isInputChannelStereoPair (int index) const;
[[deprecated]] virtual bool isOutputChannelStereoPair (int index) const;
#endif
private:
@ -1511,8 +1510,8 @@ private:
friend class AudioProcessorParameter;
friend class LADSPAPluginInstance;
// This method is no longer used - you can delete it from your AudioProcessor classes.
JUCE_DEPRECATED_WITH_BODY (virtual bool silenceInProducesSilenceOut() const, { return false; })
[[deprecated ("This method is no longer used - you can delete it from your AudioProcessor classes.")]]
virtual bool silenceInProducesSilenceOut() const { return false; }
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessor)
};

View file

@ -227,11 +227,11 @@ public:
}
#ifndef DOXYGEN
// This class now has a move operator, so if you're trying to move them around, you
// should use that, or if you really need to swap two groups, just call std::swap.
// However, remember that swapping a group that's already owned by an AudioProcessor
// will most likely crash the host, so don't do that.
JUCE_DEPRECATED_WITH_BODY (void swapWith (AudioProcessorParameterGroup& other), { std::swap (*this, other); })
[[deprecated ("This class now has a move operator, so if you're trying to move them around, you "
"should use that, or if you really need to swap two groups, just call std::swap. "
"However, remember that swapping a group that's already owned by an AudioProcessor "
"will most likely crash the host, so don't do that.")]]
void swapWith (AudioProcessorParameterGroup& other) { std::swap (*this, other); }
#endif
private:

View file

@ -49,8 +49,10 @@ public:
void paint (Graphics&) override;
void resized() override;
// This constructor has been changed to take a reference instead of a pointer
JUCE_DEPRECATED_WITH_BODY (GenericAudioProcessorEditor (AudioProcessor* p), : GenericAudioProcessorEditor (*p) {})
#ifndef DOXYGEN
[[deprecated ("This constructor has been changed to take a reference instead of a pointer.")]]
GenericAudioProcessorEditor (AudioProcessor* p) : GenericAudioProcessorEditor (*p) {}
#endif
private:
//==============================================================================

View file

@ -209,21 +209,23 @@ public:
void setCustomScanner (std::unique_ptr<CustomScanner> newScanner);
//==============================================================================
#ifndef DOXYGEN
// These methods have been deprecated! When getting the list of plugin types you should instead use
// the getTypes() method which returns a copy of the internal PluginDescription array and can be accessed
// in a thread-safe way.
JUCE_DEPRECATED_WITH_BODY (PluginDescription* getType (int index) noexcept, { return &types.getReference (index); })
JUCE_DEPRECATED_WITH_BODY (const PluginDescription* getType (int index) const noexcept, { return &types.getReference (index); })
JUCE_DEPRECATED_WITH_BODY (PluginDescription** begin() noexcept, { jassertfalse; return nullptr; })
JUCE_DEPRECATED_WITH_BODY (PluginDescription* const* begin() const noexcept, { jassertfalse; return nullptr; })
JUCE_DEPRECATED_WITH_BODY (PluginDescription** end() noexcept, { jassertfalse; return nullptr; })
JUCE_DEPRECATED_WITH_BODY (PluginDescription* const* end() const noexcept, { jassertfalse; return nullptr; })
[[deprecated]] PluginDescription* getType (int index) noexcept { return &types.getReference (index); }
[[deprecated]] const PluginDescription* getType (int index) const noexcept { return &types.getReference (index); }
[[deprecated]] PluginDescription** begin() noexcept { jassertfalse; return nullptr; }
[[deprecated]] PluginDescription* const* begin() const noexcept { jassertfalse; return nullptr; }
[[deprecated]] PluginDescription** end() noexcept { jassertfalse; return nullptr; }
[[deprecated]] PluginDescription* const* end() const noexcept { jassertfalse; return nullptr; }
// These methods have been deprecated in favour of their static counterparts. You should call getTypes()
// to store the plug-in list at a point in time and use it when calling these methods.
JUCE_DEPRECATED (void addToMenu (PopupMenu& menu, SortMethod sortMethod, const String& currentlyTickedPluginID = {}) const);
JUCE_DEPRECATED (int getIndexChosenByMenu (int menuResultCode) const);
JUCE_DEPRECATED (std::unique_ptr<PluginTree> createTree (const SortMethod sortMethod) const);
[[deprecated]] void addToMenu (PopupMenu& menu, SortMethod sortMethod, const String& currentlyTickedPluginID = {}) const;
[[deprecated]] int getIndexChosenByMenu (int menuResultCode) const;
[[deprecated]] std::unique_ptr<PluginTree> createTree (const SortMethod sortMethod) const;
#endif
private:
//==============================================================================

View file

@ -222,9 +222,8 @@ public:
~AudioProcessorValueTreeState() override;
//==============================================================================
/** This function is deprecated and will be removed in a future version of JUCE!
Previous calls to
#ifndef DOXYGEN
/** Previous calls to
@code
createAndAddParameter (paramID1, paramName1, ...);
@ -256,7 +255,9 @@ public:
Calling this will create and add a special type of AudioProcessorParameter to the
AudioProcessor to which this state is attached.
*/
JUCE_DEPRECATED (RangedAudioParameter* createAndAddParameter (const String& parameterID,
[[deprecated ("This function is deprecated and will be removed in a future version of JUCE! "
"See the method docs for a code example of the replacement methods.")]]
RangedAudioParameter* createAndAddParameter (const String& parameterID,
const String& parameterName,
const String& labelText,
NormalisableRange<float> valueRange,
@ -267,7 +268,8 @@ public:
bool isAutomatableParameter = true,
bool isDiscrete = false,
AudioProcessorParameter::Category parameterCategory = AudioProcessorParameter::genericParameter,
bool isBoolean = false));
bool isBoolean = false);
#endif
/** This function adds a parameter to the attached AudioProcessor and that parameter will
be managed by this AudioProcessorValueTreeState object.
@ -499,18 +501,18 @@ public:
private:
//==============================================================================
/** This method was introduced to allow you to use AudioProcessorValueTreeState parameters in
an AudioProcessorParameterGroup, but there is now a much nicer way to achieve this.
/** Code that looks like this:
Code that looks like this
@code
auto paramA = apvts.createParameter ("a", "Parameter A", {}, { -100, 100 }, ...);
auto paramB = apvts.createParameter ("b", "Parameter B", {}, { 0, 5 }, ...);
addParameterGroup (std::make_unique<AudioProcessorParameterGroup> ("g1", "Group 1", " | ", std::move (paramA), std::move (paramB)));
apvts.state = ValueTree (Identifier ("PARAMETERS"));
@endcode
can instead create the APVTS like this, avoiding the two-step initialization process and leveraging one of JUCE's
pre-built parameter types (or your own custom type derived from RangedAudioParameter)
pre-built parameter types (or your own custom type derived from RangedAudioParameter):
@code
using Parameter = AudioProcessorValueTreeState::Parameter;
YourAudioProcessor()
@ -520,9 +522,12 @@ private:
std::make_unique<Parameter> ("b", "Parameter B", "", NormalisableRange<float> (0, 5), ...)) })
@endcode
*/
JUCE_DEPRECATED (std::unique_ptr<RangedAudioParameter> createParameter (const String&, const String&, const String&, NormalisableRange<float>,
[[deprecated ("This method was introduced to allow you to use AudioProcessorValueTreeState parameters in "
"an AudioProcessorParameterGroup, but there is now a much nicer way to achieve this. See the "
"method docs for a code example.")]]
std::unique_ptr<RangedAudioParameter> createParameter (const String&, const String&, const String&, NormalisableRange<float>,
float, std::function<String (float)>, std::function<float (const String&)>,
bool, bool, bool, AudioProcessorParameter::Category, bool));
bool, bool, bool, AudioProcessorParameter::Category, bool);
//==============================================================================
#if JUCE_UNIT_TESTS

View file

@ -28,7 +28,6 @@ namespace juce
#if JUCE_USE_CDREADER || DOXYGEN
//==============================================================================
/**
A type of AudioFormatReader that reads from an audio CD.

View file

@ -433,13 +433,6 @@ private:
void repaintNote (int midiNoteNumber);
void setLowestVisibleKeyFloat (float noteNumber);
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// Note that the parameters for these method have changed
virtual int getKeyPosition (int, float, int&, int&) const { return 0; }
virtual int drawWhiteNote (int, Graphics&, int, int, int, int, bool, bool, const Colour&, const Colour&) { return 0; }
virtual int drawBlackNote (int, Graphics&, int, int, int, int, bool, bool, const Colour&) { return 0; }
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiKeyboardComponent)
};

View file

@ -1125,9 +1125,9 @@ public:
//==============================================================================
#ifndef DOXYGEN
// Note that the swapWithArray method has been replaced by a more flexible templated version,
// and renamed "swapWith" to be more consistent with the names used in other classes.
JUCE_DEPRECATED_WITH_BODY (void swapWithArray (Array& other) noexcept, { swapWith (other); })
[[deprecated ("This method has been replaced by a more flexible templated version and renamed "
"to swapWith to be more consistent with the names used in other classes.")]]
void swapWithArray (Array& other) noexcept { swapWith (other); }
#endif
private:

View file

@ -121,11 +121,6 @@ private:
//==============================================================================
NamedValueSet properties;
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This method has been deprecated - use var::invoke instead
virtual void invokeMethod (const Identifier&, const var*, int) {}
#endif
JUCE_LEAK_DETECTOR (DynamicObject)
};

View file

@ -843,9 +843,9 @@ public:
//==============================================================================
#ifndef DOXYGEN
// Note that the swapWithArray method has been replaced by a more flexible templated version,
// and renamed "swapWith" to be more consistent with the names used in other classes.
JUCE_DEPRECATED_WITH_BODY (void swapWithArray (OwnedArray& other) noexcept, { swapWith (other); })
[[deprecated ("This method has been replaced by a more flexible templated version and renamed "
"to swapWith to be more consistent with the names used in other classes.")]]
void swapWithArray (OwnedArray& other) noexcept { swapWith (other); }
#endif
private:

View file

@ -876,9 +876,9 @@ public:
//==============================================================================
#ifndef DOXYGEN
// Note that the swapWithArray method has been replaced by a more flexible templated version,
// and renamed "swapWith" to be more consistent with the names used in other classes.
JUCE_DEPRECATED_WITH_BODY (void swapWithArray (ReferenceCountedArray& other) noexcept, { swapWith (other); })
[[deprecated ("This method has been replaced by a more flexible templated version and renamed "
"to swapWith to be more consistent with the names used in other classes.")]]
void swapWithArray (ReferenceCountedArray& other) noexcept { swapWith (other); }
#endif
private:

View file

@ -510,8 +510,6 @@ var::var() noexcept : type (&Instance::attributesVoid) {}
var::var (const VariantType& t) noexcept : type (&t) {}
var::~var() noexcept { type->cleanUp (value); }
JUCE_DECLARE_DEPRECATED_STATIC (const var var::null;)
//==============================================================================
var::var (const var& valueToCopy) : type (valueToCopy.type)
{
@ -895,4 +893,17 @@ var::NativeFunctionArgs::NativeFunctionArgs (const var& t, const var* args, int
{
}
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
const var var::null;
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
#endif
} // namespace juce

View file

@ -271,15 +271,14 @@ public:
*/
static var readFromStream (InputStream& input);
/* This was a static empty var object, but is now deprecated as it's too easy to accidentally
use it indirectly during a static constructor, leading to hard-to-find order-of-initialisation
problems.
@deprecated If you need a default-constructed var, just use var() or {}.
The only time you might miss having var::null available might be if you need to return an
empty var from a function by reference, but if you need to do that, it's easy enough to use
a function-local static var and return that, avoiding any order-of-initialisation issues.
*/
JUCE_DEPRECATED_STATIC (static const var null;)
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN)
[[deprecated ("This was a static empty var object, but is now deprecated as it's too easy to accidentally "
"use it indirectly during a static constructor leading to hard-to-find order-of-initialisation "
"problems. Use var() or {} instead. For returning an empty var from a function by reference, "
"use a function-local static var and return that.")]]
static const var null;
#endif
private:
//==============================================================================

View file

@ -23,24 +23,6 @@
namespace juce
{
DirectoryIterator::DirectoryIterator (const File& directory, bool recursive,
const String& pattern, int type)
: wildCards (parseWildcards (pattern)),
fileFinder (directory, (recursive || wildCards.size() > 1) ? "*" : pattern),
wildCard (pattern),
path (File::addTrailingSeparator (directory.getFullPathName())),
whatToLookFor (type),
isRecursive (recursive)
{
// you have to specify the type of files you're looking for!
jassert ((type & (File::findFiles | File::findDirectories)) != 0);
jassert (type > 0 && type <= 7);
}
DirectoryIterator::~DirectoryIterator()
{
}
StringArray DirectoryIterator::parseWildcards (const String& pattern)
{
StringArray s;

View file

@ -23,6 +23,8 @@
namespace juce
{
#ifndef DOXYGEN
//==============================================================================
/**
This class is now deprecated in favour of RangedDirectoryIterator.
@ -50,9 +52,7 @@ class JUCE_API DirectoryIterator final
{
public:
//==============================================================================
/** This class is now deprecated in favour of RangedDirectoryIterator.
Creates a DirectoryIterator for a given directory.
/** Creates a DirectoryIterator for a given directory.
After creating one of these, call its next() method to get the
first file - e.g. @code
@ -69,13 +69,22 @@ public:
@see RangedDirectoryIterator
*/
JUCE_DEPRECATED (DirectoryIterator (const File& directory,
bool isRecursive,
const String& wildCard = "*",
int whatToLookFor = File::findFiles));
/** Destructor. */
~DirectoryIterator();
[[deprecated ("This class is now deprecated in favour of RangedDirectoryIterator.")]]
DirectoryIterator (const File& directory,
bool recursive,
const String& pattern = "*",
int type = File::findFiles)
: wildCards (parseWildcards (pattern)),
fileFinder (directory, (recursive || wildCards.size() > 1) ? "*" : pattern),
wildCard (pattern),
path (File::addTrailingSeparator (directory.getFullPathName())),
whatToLookFor (type),
isRecursive (recursive)
{
// you have to specify the type of files you're looking for!
jassert ((whatToLookFor & (File::findFiles | File::findDirectories)) != 0);
jassert (whatToLookFor > 0 && whatToLookFor <= 7);
}
/** Moves the iterator along to the next file.
@ -150,4 +159,6 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryIterator)
};
#endif
} // namespace juce

View file

@ -63,8 +63,6 @@ File& File::operator= (File&& other) noexcept
return *this;
}
JUCE_DECLARE_DEPRECATED_STATIC (const File File::nonexistent{};)
//==============================================================================
static String removeEllipsis (const String& path)
{
@ -1009,6 +1007,19 @@ File File::getLinkedTarget() const
}
#endif
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
const File File::nonexistent{};
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
#endif
//==============================================================================
MemoryMappedFile::MemoryMappedFile (const File& file, MemoryMappedFile::AccessMode mode, bool exclusive)
: range (0, file.getSize())

View file

@ -20,7 +20,7 @@
==============================================================================
*/
#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS)
#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS)
#if __LP64__
using OSType = unsigned int;
#else
@ -1106,14 +1106,16 @@ public:
bool foldersFirst;
};
#if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN)
/* These static objects are deprecated because it's too easy to accidentally use them indirectly
during a static constructor, which leads to very obscure order-of-initialisation bugs.
Use File::getSeparatorChar() and File::getSeparatorString(), and instead of File::nonexistent,
just use File() or {}.
*/
JUCE_DEPRECATED_STATIC (static const juce_wchar separator;)
JUCE_DEPRECATED_STATIC (static const StringRef separatorString;)
JUCE_DEPRECATED_STATIC (static const File nonexistent;)
[[deprecated]] static const juce_wchar separator;
[[deprecated]] static const StringRef separatorString;
[[deprecated]] static const File nonexistent;
#endif
private:
//==============================================================================

View file

@ -23,6 +23,9 @@
namespace juce
{
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
float DirectoryEntry::getEstimatedProgress() const
{
if (auto it = iterator.lock())
@ -31,9 +34,6 @@ float DirectoryEntry::getEstimatedProgress() const
return 0.0f;
}
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
// We implement this in terms of the deprecated DirectoryIterator,
// but the old DirectoryIterator might go away in the future!
RangedDirectoryIterator::RangedDirectoryIterator (const File& directory,
@ -49,9 +49,6 @@ RangedDirectoryIterator::RangedDirectoryIterator (const File& directory,
increment();
}
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
bool RangedDirectoryIterator::next()
{
const auto result = iterator->next (&entry.directory,
@ -74,4 +71,7 @@ void RangedDirectoryIterator::increment()
iterator = nullptr;
}
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
} // namespace juce

View file

@ -24,6 +24,9 @@ namespace juce
{
//==============================================================================
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
/**
Describes the attributes of a file or folder.
@ -178,4 +181,8 @@ inline RangedDirectoryIterator begin (const RangedDirectoryIterator& it) { retur
*/
inline RangedDirectoryIterator end (const RangedDirectoryIterator&) { return {}; }
JUCE_END_IGNORE_WARNINGS_MSVC
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
} // namespace juce

View file

@ -395,18 +395,12 @@ struct MathConstants
};
#ifndef DOXYGEN
/** A double-precision constant for pi.
@deprecated This is deprecated in favour of MathConstants<double>::pi.
The reason is that "double_Pi" was a confusing name, and many people misused it,
wrongly thinking it meant 2 * pi !
*/
/** A double-precision constant for pi. */
[[deprecated ("This is deprecated in favour of MathConstants<double>::pi.")]]
const constexpr double double_Pi = MathConstants<double>::pi;
/** A single-precision constant for pi.
@deprecated This is deprecated in favour of MathConstants<float>::pi.
The reason is that "double_Pi" was a confusing name, and many people misused it,
wrongly thinking it meant 2 * pi !
*/
/** A single-precision constant for pi. */
[[deprecated ("This is deprecated in favour of MathConstants<double>::pi.")]]
const constexpr float float_Pi = MathConstants<float>::pi;
#endif
@ -609,7 +603,7 @@ uint32 readLittleEndianBitsInBuffer (const void* sourceBuffer, uint32 startBit,
//==============================================================================
#if JUCE_INTEL || defined (DOXYGEN)
#if JUCE_INTEL || DOXYGEN
/** This macro can be applied to a float variable to check whether it contains a denormalised
value, and to normalise it if necessary.
On CPUs that aren't vulnerable to denormalisation problems, this will have no effect.
@ -637,7 +631,7 @@ namespace TypeHelpers
*/
template <typename Type> struct ParameterType { using type = const Type&; };
#if ! DOXYGEN
#ifndef DOXYGEN
template <typename Type> struct ParameterType <Type&> { using type = Type&; };
template <typename Type> struct ParameterType <Type*> { using type = Type*; };
template <> struct ParameterType <char> { using type = char; };
@ -662,7 +656,7 @@ namespace TypeHelpers
*/
template <typename Type> struct SmallestFloatType { using type = float; };
#if ! DOXYGEN
#ifndef DOXYGEN
template <> struct SmallestFloatType <double> { using type = double; };
#endif
@ -673,7 +667,7 @@ namespace TypeHelpers
*/
template <int bytes> struct UnsignedTypeWithSize {};
#if ! DOXYGEN
#ifndef DOXYGEN
template <> struct UnsignedTypeWithSize<1> { using type = uint8; };
template <> struct UnsignedTypeWithSize<2> { using type = uint16; };
template <> struct UnsignedTypeWithSize<4> { using type = uint32; };
@ -682,13 +676,10 @@ namespace TypeHelpers
}
//==============================================================================
#if ! DOXYGEN
// These old functions are deprecated: Just use roundToInt instead.
JUCE_DEPRECATED_ATTRIBUTE inline int roundDoubleToInt (double value) noexcept { return roundToInt (value); }
JUCE_DEPRECATED_ATTRIBUTE inline int roundFloatToInt (float value) noexcept { return roundToInt (value); }
// This old function isn't needed - just use std::abs() instead
JUCE_DEPRECATED_ATTRIBUTE inline int64 abs64 (int64 n) noexcept { return std::abs (n); }
#ifndef DOXYGEN
[[deprecated ("Use roundToInt instead.")]] inline int roundDoubleToInt (double value) noexcept { return roundToInt (value); }
[[deprecated ("Use roundToInt instead.")]] inline int roundFloatToInt (float value) noexcept { return roundToInt (value); }
[[deprecated ("Use std::abs() instead.")]] inline int64 abs64 (int64 n) noexcept { return std::abs (n); }
#endif
} // namespace juce

View file

@ -136,10 +136,9 @@ struct Atomic final
//==============================================================================
#ifndef DOXYGEN
/* This method has been deprecated as there is no equivalent method in
std::atomic. Use compareAndSetBool instead.
*/
JUCE_DEPRECATED (Type compareAndSetValue (Type, Type) noexcept);
[[deprecated ("This method has been deprecated as there is no equivalent method in "
"std::atomic. Use compareAndSetBool instead.")]]
Type compareAndSetValue (Type, Type) noexcept;
#endif
};

View file

@ -20,7 +20,7 @@
==============================================================================
*/
#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS)
#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS)
#include <libkern/OSByteOrder.h>
#endif

View file

@ -23,7 +23,7 @@
namespace juce
{
#if ! (defined (DOXYGEN) || JUCE_EXCEPTIONS_DISABLED)
#if ! (DOXYGEN || JUCE_EXCEPTIONS_DISABLED)
namespace HeapBlockHelper
{
template <bool shouldThrow>

View file

@ -269,13 +269,14 @@ public:
bool fromBase64Encoding (StringRef encodedString);
//==============================================================================
// This method has been deprecated in favour of the replaceAll() method which will
// also replace the data when `numBytes == 0`
JUCE_DEPRECATED_WITH_BODY (void replaceWith (const void* srcData, size_t numBytes),
#ifndef DOXYGEN
[[deprecated ("Use the replaceAll method instead, which will also replace the data when numBytes == 0.")]]
void replaceWith (const void* srcData, size_t numBytes)
{
if (numBytes > 0)
replaceAll (srcData, numBytes);
})
}
#endif
private:
//==============================================================================

View file

@ -428,9 +428,10 @@ public:
operator ReferencedType*() const noexcept { return referencedObject; }
#endif
// This old method is deprecated in favour of the shorter and more standard get() method.
JUCE_DEPRECATED_WITH_BODY (ReferencedType* getObject() const, { return get(); })
#ifndef DOXYGEN
[[deprecated ("Use the get method instead.")]]
ReferencedType* getObject() const { return get(); }
#endif
private:
//==============================================================================

View file

@ -30,30 +30,28 @@ namespace juce
This class is deprecated. You should use std::unique_ptr instead.
*/
template <class ObjectType>
class ScopedPointer
class [[deprecated]] ScopedPointer
{
public:
//==============================================================================
// ScopedPointer is deprecated! You should use std::unique_ptr instead.
JUCE_DEPRECATED_ATTRIBUTE inline ScopedPointer() = default;
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
// ScopedPointer is deprecated! You should use std::unique_ptr instead.
JUCE_DEPRECATED_ATTRIBUTE inline ScopedPointer (decltype (nullptr)) noexcept {}
inline ScopedPointer() {}
// ScopedPointer is deprecated! You should use std::unique_ptr instead.
JUCE_DEPRECATED_ATTRIBUTE inline ScopedPointer (ObjectType* objectToTakePossessionOf) noexcept
inline ScopedPointer (decltype (nullptr)) noexcept {}
inline ScopedPointer (ObjectType* objectToTakePossessionOf) noexcept
: object (objectToTakePossessionOf)
{
}
// ScopedPointer is deprecated! You should use std::unique_ptr instead.
ScopedPointer (ScopedPointer& objectToTransferFrom) noexcept
: object (objectToTransferFrom.release())
{
}
// ScopedPointer is deprecated! You should use std::unique_ptr instead.
JUCE_DEPRECATED_ATTRIBUTE inline ~ScopedPointer() { reset(); }
inline ~ScopedPointer() { reset(); }
ScopedPointer& operator= (ScopedPointer& objectToTransferFrom)
{
@ -143,9 +141,15 @@ private:
ScopedPointer (const ScopedPointer&) = delete;
ScopedPointer& operator= (const ScopedPointer&) = delete;
#endif
JUCE_END_IGNORE_WARNINGS_MSVC
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
};
//==============================================================================
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
template <typename ObjectType1, typename ObjectType2>
bool operator== (ObjectType1* pointer1, const ScopedPointer<ObjectType2>& pointer2) noexcept
{
@ -212,6 +216,9 @@ template <typename Type>
void deleteAndZero (ScopedPointer<Type>&) { static_assert (sizeof (Type) == 12345,
"Attempt to call deleteAndZero() on a ScopedPointer"); }
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
} // namespace juce
#endif

View file

@ -136,7 +136,7 @@ private:
} // namespace juce
#if ! DOXYGEN
#ifndef DOXYGEN
namespace std
{
template <> struct hash<juce::Uuid>

View file

@ -123,10 +123,12 @@ public:
bool registerForCurrentUserOnly,
WoW64Mode mode = WoW64_Default);
#ifndef DOXYGEN
// DEPRECATED: use the other methods with a WoW64Mode parameter of WoW64_64bit instead.
JUCE_DEPRECATED (static String getValueWow64 (const String&, const String& defaultValue = String()));
JUCE_DEPRECATED (static bool valueExistsWow64 (const String&));
JUCE_DEPRECATED (static bool keyExistsWow64 (const String&));
[[deprecated]] static String getValueWow64 (const String&, const String& defaultValue = String());
[[deprecated]] static bool valueExistsWow64 (const String&);
[[deprecated]] static bool keyExistsWow64 (const String&);
#endif
private:
WindowsRegistry() = delete;

View file

@ -99,8 +99,16 @@ static MaxNumFileHandlesInitialiser maxNumFileHandlesInitialiser;
#endif
//==============================================================================
JUCE_DECLARE_DEPRECATED_STATIC (const juce_wchar File::separator = '/';)
JUCE_DECLARE_DEPRECATED_STATIC (const StringRef File::separatorString ("/");)
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
const juce_wchar File::separator = '/';
const StringRef File::separatorString ("/");
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#endif
juce_wchar File::getSeparatorChar() { return '/'; }
StringRef File::getSeparatorString() { return "/"; }

View file

@ -162,8 +162,16 @@ namespace WindowsFileHelpers
}
//==============================================================================
JUCE_DECLARE_DEPRECATED_STATIC (const juce_wchar File::separator = '\\';)
JUCE_DECLARE_DEPRECATED_STATIC (const StringRef File::separatorString ("\\");)
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
const juce_wchar File::separator = '\\';
const StringRef File::separatorString ("\\");
JUCE_END_IGNORE_WARNINGS_MSVC
#endif
juce_wchar File::getSeparatorChar() { return '\\'; }
StringRef File::getSeparatorString() { return "\\"; }

View file

@ -659,14 +659,14 @@ public:
static URL createWithoutParsing (const String& url);
//==============================================================================
#ifndef DOXYGEN
using OpenStreamProgressCallback = bool (void* context, int bytesSent, int totalBytes);
/** This method has been deprecated.
New code should use the method which takes an InputStreamOptions argument instead.
@see InputStreamOptions
*/
[[deprecated ("New code should use the method which takes an InputStreamOptions argument instead.")]]
std::unique_ptr<InputStream> createInputStream (bool doPostLikeRequest,
OpenStreamProgressCallback* progressCallback = nullptr,
void* progressCallbackContext = nullptr,
@ -676,6 +676,7 @@ public:
int* statusCode = nullptr,
int numRedirectsToFollow = 5,
String httpRequestCmd = {}) const;
#endif
private:
//==============================================================================

View file

@ -39,7 +39,7 @@ URLInputSource::~URLInputSource()
InputStream* URLInputSource::createInputStream()
{
return u.createInputStream (false).release();
return u.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)).release();
}
InputStream* URLInputSource::createInputStreamFor (const String& relatedItemPath)
@ -48,7 +48,10 @@ InputStream* URLInputSource::createInputStreamFor (const String& relatedItemPath
auto parent = sub.containsChar (L'/') ? sub.upToLastOccurrenceOf ("/", false, false)
: String ();
return u.withNewSubPath (parent).getChildURL (relatedItemPath).createInputStream (false).release();
return u.withNewSubPath (parent)
.getChildURL (relatedItemPath)
.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress))
.release();
}
int64 URLInputSource::hashCode() const

View file

@ -92,7 +92,7 @@
#endif
//==============================================================================
#if ! DOXYGEN
#ifndef DOXYGEN
// These are old flags that are now supported on all compatible build targets
#define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1
#define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1

View file

@ -117,7 +117,7 @@ namespace juce
#endif
//==============================================================================
#if JUCE_MSVC && ! DOXYGEN
#if JUCE_MSVC && ! defined (DOXYGEN)
#define JUCE_BLOCK_WITH_FORCED_SEMICOLON(x) \
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
@ -187,7 +187,7 @@ namespace juce
#endif
//==============================================================================
#if ! DOXYGEN
#ifndef DOXYGEN
#define JUCE_JOIN_MACRO_HELPER(a, b) a ## b
#define JUCE_STRINGIFY_MACRO_HELPER(a) #a
#endif
@ -298,49 +298,7 @@ namespace juce
#endif
//==============================================================================
// Cross-compiler deprecation macros..
#ifdef DOXYGEN
/** This macro can be used to wrap a function which has been deprecated. */
#define JUCE_DEPRECATED(functionDef)
#define JUCE_DEPRECATED_WITH_BODY(functionDef, body)
#elif JUCE_MSVC && ! JUCE_NO_DEPRECATION_WARNINGS
#define JUCE_DEPRECATED_ATTRIBUTE __declspec(deprecated)
#define JUCE_DEPRECATED(functionDef) JUCE_DEPRECATED_ATTRIBUTE functionDef
#define JUCE_DEPRECATED_WITH_BODY(functionDef, body) JUCE_DEPRECATED_ATTRIBUTE functionDef body
#elif (JUCE_GCC || JUCE_CLANG) && ! JUCE_NO_DEPRECATION_WARNINGS
#define JUCE_DEPRECATED_ATTRIBUTE __attribute__ ((deprecated))
#define JUCE_DEPRECATED(functionDef) functionDef JUCE_DEPRECATED_ATTRIBUTE
#define JUCE_DEPRECATED_WITH_BODY(functionDef, body) functionDef JUCE_DEPRECATED_ATTRIBUTE body
#else
#define JUCE_DEPRECATED_ATTRIBUTE
#define JUCE_DEPRECATED(functionDef) functionDef
#define JUCE_DEPRECATED_WITH_BODY(functionDef, body) functionDef body
#endif
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
#if ! (defined (DOXYGEN) || defined (JUCE_GCC) || (JUCE_MSVC && _MSC_VER <= 1900))
#define JUCE_DEPRECATED_STATIC(valueDef) JUCE_DEPRECATED_ATTRIBUTE valueDef
#if JUCE_MSVC
#define JUCE_DECLARE_DEPRECATED_STATIC(valueDef) \
__pragma(warning(push)) \
__pragma(warning(disable:4996)) \
valueDef \
__pragma(warning(pop))
#else
#define JUCE_DECLARE_DEPRECATED_STATIC(valueDef) valueDef
#endif
#else
#define JUCE_DEPRECATED_STATIC(valueDef) valueDef
#define JUCE_DECLARE_DEPRECATED_STATIC(valueDef) valueDef
#endif
#else
#define JUCE_DEPRECATED_STATIC(valueDef)
#define JUCE_DECLARE_DEPRECATED_STATIC(valueDef)
#endif
//==============================================================================
#if JUCE_ANDROID && ! DOXYGEN
#if JUCE_ANDROID && ! defined (DOXYGEN)
#define JUCE_MODAL_LOOPS_PERMITTED 0
#elif ! defined (JUCE_MODAL_LOOPS_PERMITTED)
/** Some operating environments don't provide a modal loop mechanism, so this flag can be
@ -351,7 +309,7 @@ namespace juce
//==============================================================================
#if JUCE_GCC || JUCE_CLANG
#define JUCE_PACKED __attribute__((packed))
#elif ! DOXYGEN
#elif ! defined (DOXYGEN)
#define JUCE_PACKED
#endif

View file

@ -153,13 +153,6 @@ JUCE_END_IGNORE_WARNINGS_MSVC
/** This macro is added to all JUCE public function declarations. */
#define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE
#if (! defined (JUCE_CATCH_DEPRECATED_CODE_MISUSE)) && JUCE_DEBUG && ! DOXYGEN
/** This turns on some non-essential bits of code that should prevent old code from compiling
in cases where method signatures have changed, etc.
*/
#define JUCE_CATCH_DEPRECATED_CODE_MISUSE 1
#endif
#ifndef DOXYGEN
#define JUCE_NAMESPACE juce // This old macro is deprecated: you should just use the juce namespace directly.
#endif

View file

@ -234,8 +234,10 @@ public:
//==============================================================================
// This method was spelt wrong! Please change your code to use getCpuSpeedInMegahertz() instead
JUCE_DEPRECATED_WITH_BODY (static int getCpuSpeedInMegaherz(), { return getCpuSpeedInMegahertz(); })
#ifndef DOXYGEN
[[deprecated ("This method was spelt wrong! Please change your code to use getCpuSpeedInMegahertz instead.")]]
static int getCpuSpeedInMegaherz() { return getCpuSpeedInMegahertz(); }
#endif
private:
SystemStats() = delete; // uses only static methods

View file

@ -344,7 +344,7 @@ public:
return CharacterFunctions::compareIgnoreCaseUpTo (*this, other, maxChars);
}
#if JUCE_MSVC && ! DOXYGEN
#if JUCE_MSVC && ! defined (DOXYGEN)
int compareIgnoreCase (CharPointer_UTF16 other) const noexcept
{
return _wcsicmp (data, other.data);

View file

@ -24,7 +24,7 @@ namespace juce
{
//==============================================================================
#if JUCE_WINDOWS && ! DOXYGEN
#if JUCE_WINDOWS && ! defined (DOXYGEN)
#define JUCE_NATIVE_WCHAR_IS_UTF8 0
#define JUCE_NATIVE_WCHAR_IS_UTF16 1
#define JUCE_NATIVE_WCHAR_IS_UTF32 0
@ -60,7 +60,7 @@ namespace juce
#define T(stringLiteral) JUCE_T(stringLiteral)
#endif
#if ! DOXYGEN
#ifndef DOXYGEN
//==============================================================================
// GNU libstdc++ does not have std::make_unsigned

View file

@ -237,8 +237,6 @@ private:
}
};
JUCE_DECLARE_DEPRECATED_STATIC (const String String::empty;)
//==============================================================================
String::String() noexcept : text (&(emptyString.text))
{
@ -2195,7 +2193,6 @@ StringRef::StringRef (const String& string) noexcept : text (string.getCharPoi
StringRef::StringRef (const std::string& string) : StringRef (string.c_str()) {}
//==============================================================================
static String reduceLengthOfFloatString (const String& input)
{
const auto start = input.getCharPointer();
@ -2309,6 +2306,18 @@ static String serialiseDouble (double input)
return reduceLengthOfFloatString (String (input, numberOfDecimalPlaces));
}
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
const String String::empty;
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
#endif
//==============================================================================
//==============================================================================

View file

@ -20,7 +20,7 @@
==============================================================================
*/
#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS)
#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS)
// Annoyingly we can only forward-declare a typedef by forward-declaring the
// aliased type
#if __has_attribute(objc_bridge)
@ -1326,15 +1326,13 @@ public:
int getReferenceCount() const noexcept;
//==============================================================================
/* This was a static empty string object, but is now deprecated as it's too easy to accidentally
use it indirectly during a static constructor, leading to hard-to-find order-of-initialisation
problems.
@deprecated If you need an empty String object, just use String() or {}.
The only time you might miss having String::empty available might be if you need to return an
empty string from a function by reference, but if you need to do that, it's easy enough to use
a function-local static String object and return that, avoiding any order-of-initialisation issues.
*/
JUCE_DEPRECATED_STATIC (static const String empty;)
#if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN)
[[deprecated ("This was a static empty string object, but is now deprecated as it's too easy to accidentally "
"use it indirectly during a static constructor, leading to hard-to-find order-of-initialisation "
"problems. If you need an empty String object, just use String() or {}. For returning an empty "
"String from a function by reference, use a function-local static String object and return that.")]]
static const String empty;
#endif
private:
//==============================================================================
@ -1349,7 +1347,6 @@ private:
explicit String (const PreallocationBytes&); // This constructor preallocates a certain amount of memory
size_t getByteOffsetOfEnd() const noexcept;
JUCE_DEPRECATED (String (const String&, size_t));
// This private cast operator should prevent strings being accidentally cast
// to bools (this is possible because the compiler can add an implicit cast
@ -1499,7 +1496,7 @@ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, StringRef
} // namespace juce
#if ! DOXYGEN
#ifndef DOXYGEN
namespace std
{
template <> struct hash<juce::String>

View file

@ -106,8 +106,8 @@ public:
const String& bodyText,
const StringArray& filesToAttach);
#if JUCE_WINDOWS || DOXYGEN
//==============================================================================
#if JUCE_WINDOWS || DOXYGEN
/** WINDOWS ONLY - This returns the HINSTANCE of the current module.
The return type is a void* to avoid being dependent on windows.h - just cast
@ -133,14 +133,14 @@ public:
static void JUCE_CALLTYPE setCurrentModuleInstanceHandle (void* newHandle) noexcept;
#endif
#if (JUCE_MAC && JUCE_MODULE_AVAILABLE_juce_gui_basics) || DOXYGEN
//==============================================================================
#if (JUCE_MAC && JUCE_MODULE_AVAILABLE_juce_gui_basics) || DOXYGEN
/** OSX ONLY - Shows or hides the OSX dock icon for this app. */
static void setDockIconVisible (bool isVisible);
#endif
#if JUCE_MAC || JUCE_LINUX || JUCE_BSD || DOXYGEN
//==============================================================================
#if JUCE_MAC || JUCE_LINUX || JUCE_BSD || DOXYGEN
/** UNIX ONLY - Attempts to use setrlimit to change the maximum number of file
handles that the app can open. Pass 0 or less as the parameter to mean
'infinite'. Returns true if it succeeds.

View file

@ -338,7 +338,7 @@ public:
*/
static void JUCE_CALLTYPE setCurrentThreadName (const String& newThreadName);
#if JUCE_ANDROID || defined (DOXYGEN)
#if JUCE_ANDROID || DOXYGEN
//==============================================================================
/** Initialises the JUCE subsystem for projects not created by the Projucer

View file

@ -732,33 +732,31 @@ public:
return Iterator<GetNextElementWithTagName> { getChildByName (name), name };
}
/** This allows us to trigger a warning inside deprecated macros. */
#ifndef DOXYGEN
JUCE_DEPRECATED_WITH_BODY (void macroBasedForLoop() const noexcept, {})
[[deprecated]] void macroBasedForLoop() const noexcept {}
[[deprecated ("This has been deprecated in favour of the toString method.")]]
String createDocument (StringRef dtdToUse,
bool allOnOneLine = false,
bool includeXmlHeader = true,
StringRef encodingType = "UTF-8",
int lineWrapLength = 60) const;
[[deprecated ("This has been deprecated in favour of the writeTo method.")]]
void writeToStream (OutputStream& output,
StringRef dtdToUse,
bool allOnOneLine = false,
bool includeXmlHeader = true,
StringRef encodingType = "UTF-8",
int lineWrapLength = 60) const;
[[deprecated ("This has been deprecated in favour of the writeTo method.")]]
bool writeToFile (const File& destinationFile,
StringRef dtdToUse,
StringRef encodingType = "UTF-8",
int lineWrapLength = 60) const;
#endif
//==============================================================================
/** This has been deprecated in favour of the toString() method. */
JUCE_DEPRECATED (String createDocument (StringRef dtdToUse,
bool allOnOneLine = false,
bool includeXmlHeader = true,
StringRef encodingType = "UTF-8",
int lineWrapLength = 60) const);
/** This has been deprecated in favour of the writeTo() method. */
JUCE_DEPRECATED (void writeToStream (OutputStream& output,
StringRef dtdToUse,
bool allOnOneLine = false,
bool includeXmlHeader = true,
StringRef encodingType = "UTF-8",
int lineWrapLength = 60) const);
/** This has been deprecated in favour of the writeTo() method. */
JUCE_DEPRECATED (bool writeToFile (const File& destinationFile,
StringRef dtdToUse,
StringRef encodingType = "UTF-8",
int lineWrapLength = 60) const);
private:
//==============================================================================
struct XmlAttributeNode
@ -801,6 +799,8 @@ private:
};
//==============================================================================
#ifndef DOXYGEN
/** DEPRECATED: A handy macro to make it easy to iterate all the child elements in an XmlElement.
New code should avoid this macro, and instead use getChildIterator directly.
@ -852,4 +852,6 @@ private:
#define forEachXmlChildElementWithTagName(parentXmlElement, childElementVariableName, requiredTagName) \
for (auto* (childElementVariableName) : ((parentXmlElement).macroBasedForLoop(), (parentXmlElement).getChildWithTagNameIterator ((requiredTagName))))
#endif
} // namespace juce

View file

@ -92,11 +92,6 @@ private:
class GZIPDecompressHelper;
std::unique_ptr<GZIPDecompressHelper> helper;
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// The arguments to this method have changed! Please pass a Format enum instead of the old dontWrap bool.
GZIPDecompressorInputStream (InputStream*, bool, bool, int64 x = -1);
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GZIPDecompressorInputStream)
};

View file

@ -579,8 +579,6 @@ ValueTree::ValueTree() noexcept
{
}
JUCE_DECLARE_DEPRECATED_STATIC (const ValueTree ValueTree::invalid;)
ValueTree::ValueTree (const Identifier& type) : object (new ValueTree::SharedObject (type))
{
jassert (type.toString().isNotEmpty()); // All objects must be given a sensible type name!
@ -1097,6 +1095,18 @@ void ValueTree::Listener::valueTreeChildOrderChanged (ValueTree&, int, int)
void ValueTree::Listener::valueTreeParentChanged (ValueTree&) {}
void ValueTree::Listener::valueTreeRedirected (ValueTree&) {}
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
const ValueTree ValueTree::invalid;
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
#endif
//==============================================================================
//==============================================================================

View file

@ -606,10 +606,11 @@ public:
*/
int getReferenceCount() const noexcept;
/* An invalid ValueTree that can be used if you need to return one as an error condition, etc.
@deprecated If you need an empty ValueTree object, just use ValueTree() or {}.
*/
JUCE_DEPRECATED_STATIC (static const ValueTree invalid;)
#if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN)
/* An invalid ValueTree that can be used if you need to return one as an error condition, etc. */
[[deprecated ("If you need an empty ValueTree object, just use ValueTree() or {}.")]]
static const ValueTree invalid;
#endif
private:
//==============================================================================

View file

@ -70,19 +70,17 @@ namespace StateVariableFilter
using ParametersPtr = typename Parameters<NumericType>::Ptr;
//==============================================================================
/** Creates a filter with default parameters.
#ifndef DOXYGEN
/** Creates a filter with default parameters. */
[[deprecated ("The classes in the StateVariableFilter namespace are deprecated. you should "
"use the equivalent functionality in the StateVariableTPTFilter class.")]]
Filter() : parameters (new Parameters<NumericType>) { reset(); }
The classes in the StateVariableFilter namespace are deprecated. you should
use the equivalent functionality in the StateVariableTPTFilter class.
*/
JUCE_DEPRECATED_WITH_BODY (Filter(), : parameters (new Parameters<NumericType>) { reset(); })
/** Creates a filter using some parameters.
The classes in the StateVariableFilter namespace are deprecated. you should
use the equivalent functionality in the StateVariableTPTFilter class.
*/
JUCE_DEPRECATED_WITH_BODY (Filter (ParametersPtr parametersToUse), : parameters (std::move (parametersToUse)) { reset(); })
/** Creates a filter using some parameters. */
[[deprecated ("The classes in the StateVariableFilter namespace are deprecated. you should "
"use the equivalent functionality in the StateVariableTPTFilter class.")]]
Filter (ParametersPtr parametersToUse) : parameters (std::move (parametersToUse)) { reset(); }
#endif
/** Creates a copy of another filter. */
Filter (const Filter&) = default;

View file

@ -309,7 +309,7 @@ private:
//==============================================================================
#if JUCE_CATCH_UNHANDLED_EXCEPTIONS || defined (DOXYGEN)
#if JUCE_CATCH_UNHANDLED_EXCEPTIONS || DOXYGEN
/** The JUCE_TRY/JUCE_CATCH_EXCEPTION wrappers can be used to pass any uncaught exceptions to
the JUCEApplicationBase::sendUnhandledException() method.

View file

@ -84,7 +84,7 @@ public:
See the JUCEApplication and JUCEApplicationBase class documentation for more details.
*/
#ifdef DOXYGEN
#if DOXYGEN
#define START_JUCE_APPLICATION(AppClass)
#else
#if JUCE_WINDOWS && ! defined (_CONSOLE)

View file

@ -23,7 +23,7 @@
namespace juce
{
#if JUCE_MAC || JUCE_WINDOWS || defined (DOXYGEN)
#if JUCE_MAC || JUCE_WINDOWS || DOXYGEN
//==============================================================================
/**

View file

@ -395,14 +395,15 @@ public:
void getGlyphPositions (const String& text, Array<int>& glyphs, Array<float>& xOffsets) const;
//==============================================================================
/** This is unsafe, use getTypefacePtr() instead.
Returns the typeface used by this font.
#ifndef DOXYGEN
/** Returns the typeface used by this font.
Note that the object returned may go out of scope if this font is deleted
or has its style changed.
*/
JUCE_DEPRECATED (Typeface* getTypeface() const);
[[deprecated ("This method is unsafe, use getTypefacePtr() instead.")]]
Typeface* getTypeface() const;
#endif
/** Returns the typeface used by this font. */
Typeface::Ptr getTypefacePtr() const;

View file

@ -59,7 +59,7 @@ bool AffineTransform::isIdentity() const noexcept
&& mat11 == 1.0f;
}
JUCE_DECLARE_DEPRECATED_STATIC (const AffineTransform AffineTransform::identity (1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);)
const AffineTransform AffineTransform::identity (1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
//==============================================================================
AffineTransform AffineTransform::followedBy (const AffineTransform& other) const noexcept

View file

@ -266,6 +266,8 @@ public:
/** Returns the determinant of the transform. */
float getDeterminant() const noexcept;
//==============================================================================
#ifndef DOXYGEN
/** This method has been deprecated.
You can calculate the scale factor using:
@ -279,12 +281,13 @@ public:
Obviously a length may be scaled by entirely different amounts depending on its
direction, so this is only appropriate as a rough guide.
*/
JUCE_DEPRECATED (float getScaleFactor() const noexcept);
[[deprecated ("This method produces incorrect values for transforms containing rotations. "
"See the method docs for a code example on how to calculate the correct scale factor.")]]
float getScaleFactor() const noexcept;
/* A ready-to-use identity transform - now deprecated.
@deprecated If you need an identity transform, just use AffineTransform() or {}.
*/
JUCE_DEPRECATED_STATIC (static const AffineTransform identity;)
[[deprecated ("If you need an identity transform, just use AffineTransform() or {}.")]]
static const AffineTransform identity;
#endif
//==============================================================================
/* The transform matrix is:

View file

@ -957,8 +957,8 @@ public:
}
#ifndef DOXYGEN
// This has been renamed by transformedBy, in order to match the method names used in the Point class.
JUCE_DEPRECATED_WITH_BODY (Rectangle transformed (const AffineTransform& t) const noexcept, { return transformedBy (t); })
[[deprecated ("This has been renamed to transformedBy in order to match the method names used in the Point class.")]]
Rectangle transformed (const AffineTransform& t) const noexcept { return transformedBy (t); }
#endif
private:

View file

@ -265,8 +265,6 @@ Image::~Image()
{
}
JUCE_DECLARE_DEPRECATED_STATIC (const Image Image::null;)
int Image::getReferenceCount() const noexcept { return image == nullptr ? 0 : image->getSharedCount(); }
int Image::getWidth() const noexcept { return image == nullptr ? 0 : image->width; }
int Image::getHeight() const noexcept { return image == nullptr ? 0 : image->height; }
@ -684,4 +682,17 @@ void Image::moveImageSection (int dx, int dy,
}
}
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
const Image Image::null;
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
#endif
} // namespace juce

View file

@ -413,10 +413,12 @@ public:
/** @internal */
explicit Image (ReferenceCountedObjectPtr<ImagePixelData>) noexcept;
/* A null Image object that can be used when you need to return an invalid image.
@deprecated If you need a default-constructed var, just use Image() or {}.
*/
JUCE_DEPRECATED_STATIC (static const Image null;)
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN)
/* A null Image object that can be used when you need to return an invalid image. */
[[deprecated ("If you need a default-constructed var, just use Image() or {}.")]]
static const Image null;
#endif
private:
//==============================================================================

View file

@ -394,8 +394,11 @@ public:
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) = 0;
};
// This method's parameters have changed - see the new version.
JUCE_DEPRECATED (void setToggleState (bool, bool));
//==============================================================================
#ifndef DOXYGEN
[[deprecated ("This method's parameters have changed.")]]
void setToggleState (bool, bool);
#endif
protected:
//==============================================================================

View file

@ -102,12 +102,7 @@ public:
/** @internal */
void colourChanged() override;
private:
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// Note that this method has been removed - instead, see LookAndFeel::getTextButtonFont()
virtual int getFont() { return 0; }
#endif
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TextButton)
};

View file

@ -312,12 +312,6 @@ private:
void globalFocusChanged (Component*) override;
ApplicationCommandInfo* getMutableCommandForID (CommandID) const noexcept;
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This is just here to cause a compile error in old code that hasn't been changed to use the new
// version of this method.
virtual short getFirstCommandTarget() { return 0; }
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ApplicationCommandManager)
};

View file

@ -2442,13 +2442,15 @@ public:
//==============================================================================
#ifndef DOXYGEN
// This method has been deprecated in favour of the setFocusContainerType() method
// that takes a more descriptive enum.
JUCE_DEPRECATED_WITH_BODY (void setFocusContainer (bool shouldBeFocusContainer) noexcept,
[[deprecated ("Use the setFocusContainerType that takes a more descriptive enum.")]]
void setFocusContainer (bool shouldBeFocusContainer) noexcept
{
setFocusContainerType (shouldBeFocusContainer ? FocusContainerType::keyboardFocusContainer
: FocusContainerType::none);
})
}
[[deprecated ("Use the contains that takes a Point<int>.")]]
void contains (int, int) = delete;
#endif
private:
@ -2584,19 +2586,6 @@ private:
*/
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Component)
//==============================================================================
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This is included here just to cause a compile error if your code is still handling
// drag-and-drop with this method. If so, just update it to use the new FileDragAndDropTarget
// class, which is easy (just make your class inherit from FileDragAndDropTarget, and
// implement its methods instead of this Component method).
virtual void filesDropped (const StringArray&, int, int) {}
// This is included here to cause an error if you use or overload it - it has been deprecated in
// favour of contains (Point<int>)
void contains (int, int) = delete;
#endif
protected:
//==============================================================================
/** @internal */

View file

@ -168,15 +168,16 @@ public:
void refresh();
/** @internal */
~Displays() = default;
// This method has been deprecated - use the getDisplayForPoint() or getDisplayForRect() methods instead
// as they can deal with converting between logical and physical pixels
JUCE_DEPRECATED (const Display& getDisplayContaining (Point<int> position) const noexcept);
[[deprecated ("Use the getDisplayForPoint or getDisplayForRect methods instead "
"as they can deal with converting between logical and physical pixels.")]]
const Display& getDisplayContaining (Point<int> position) const noexcept;
// These methods have been deprecated - use the methods which return a Display* instead as they will return
// nullptr on headless systems with no connected displays
JUCE_DEPRECATED (const Display& findDisplayForRect (Rectangle<int>, bool isPhysical = false) const noexcept);
JUCE_DEPRECATED (const Display& findDisplayForPoint (Point<int>, bool isPhysical = false) const noexcept);
JUCE_DEPRECATED (const Display& getMainDisplay() const noexcept);
[[deprecated]] const Display& findDisplayForRect (Rectangle<int>, bool isPhysical = false) const noexcept;
[[deprecated]] const Display& findDisplayForPoint (Point<int>, bool isPhysical = false) const noexcept;
[[deprecated]] const Display& getMainDisplay() const noexcept;
#endif
private:

View file

@ -1006,6 +1006,12 @@ public:
virtual int getPopupMenuColumnSeparatorWidthWithOptions (const Options&) = 0;
};
//==============================================================================
#ifndef DOXYGEN
[[deprecated ("Use the new method.")]]
int drawPopupMenuItem (Graphics&, int, int, bool, bool, bool, bool, bool, const String&, const String&, Image*, const Colour*) { return 0; }
#endif
private:
//==============================================================================
JUCE_PUBLIC_IN_DLL_BUILD (struct HelperClasses)
@ -1021,11 +1027,6 @@ private:
static void setItem (CustomComponent&, const Item*);
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// These methods have new implementations now - see its new definition
int drawPopupMenuItem (Graphics&, int, int, bool, bool, bool, bool, bool, const String&, const String&, Image*, const Colour*) { return 0; }
#endif
JUCE_LEAK_DETECTOR (PopupMenu)
};

View file

@ -238,13 +238,6 @@ private:
const MouseInputSource* getMouseInputSourceForDrag (Component* sourceComponent, const MouseInputSource* inputSourceCausingDrag);
bool isAlreadyDragging (Component* sourceComponent) const noexcept;
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This is just here to cause a compile error in old code that hasn't been changed to use the new
// version of this method.
virtual int dragOperationStarted() { return 0; }
virtual int dragOperationEnded() { return 0; }
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DragAndDropContainer)
};

View file

@ -241,13 +241,15 @@ public:
*/
static const Point<float> offscreenMousePos;
#if ! DOXYGEN
// This method has been deprecated and replaced with the isLongPressOrDrag() and hasMovedSignificantlySincePressed()
// methods. If you want the same behaviour you should use isLongPressOrDrag() which accounts for the amount of time
// that the input source has been held down for, but if you only want to know whether it has been moved use
// hasMovedSignificantlySincePressed() instead.
JUCE_DEPRECATED (bool hasMouseMovedSignificantlySincePressed() const noexcept);
//==============================================================================
#ifndef DOXYGEN
[[deprecated ("This method has been replaced with the isLongPressOrDrag and hasMovedSignificantlySincePressed "
"methods. If you want the same behaviour you should use isLongPressOrDrag which accounts for the "
"amount of time that the input source has been held down for, but if you only want to know whether "
"it has been moved use hasMovedSignificantlySincePressed instead.")]]
bool hasMouseMovedSignificantlySincePressed() const noexcept;
#endif
private:
//==============================================================================
friend class ComponentPeer;

View file

@ -420,11 +420,14 @@ public:
/** @internal */
void parentHierarchyChanged() override;
//==============================================================================
#ifndef DOXYGEN
// These methods' bool parameters have changed: see their new method signatures.
JUCE_DEPRECATED (void clear (bool));
JUCE_DEPRECATED (void setSelectedId (int, bool));
JUCE_DEPRECATED (void setSelectedItemIndex (int, bool));
JUCE_DEPRECATED (void setText (const String&, bool));
[[deprecated]] void clear (bool);
[[deprecated]] void setSelectedId (int, bool);
[[deprecated]] void setSelectedItemIndex (int, bool);
[[deprecated]] void setText (const String&, bool);
#endif
private:
//==============================================================================

View file

@ -572,6 +572,12 @@ public:
void startDragAndDrop (const MouseEvent&, const SparseSet<int>& rowsToDrag,
const var& dragDescription, bool allowDraggingToOtherWindows);
//==============================================================================
#ifndef DOXYGEN
[[deprecated ("This method's bool parameter has changed: see the new method signature.")]]
void setSelectedRows (const SparseSet<int>&, bool);
#endif
private:
//==============================================================================
JUCE_PUBLIC_IN_DLL_BUILD (class ListViewport)
@ -593,14 +599,6 @@ private:
void selectRowInternal (int rowNumber, bool dontScrollToShowThisRow,
bool deselectOthersFirst, bool isMouseClick);
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This method's bool parameter has changed: see the new method signature.
JUCE_DEPRECATED (void setSelectedRows (const SparseSet<int>&, bool));
// This method has been replaced by the more flexible method createSnapshotOfRows.
// Please call createSnapshotOfRows (getSelectedRows(), x, y) to get the same behaviour.
JUCE_DEPRECATED (virtual void createSnapshotOfSelectedRows (int&, int&)) {}
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ListBox)
};

View file

@ -992,6 +992,21 @@ public:
/** @internal */
void mouseEnter (const MouseEvent&) override;
//==============================================================================
#ifndef DOXYGEN
// These methods' bool parameters have changed: see the new method signature.
[[deprecated]] void setValue (double, bool);
[[deprecated]] void setValue (double, bool, bool);
[[deprecated]] void setMinValue (double, bool, bool, bool);
[[deprecated]] void setMinValue (double, bool, bool);
[[deprecated]] void setMinValue (double, bool);
[[deprecated]] void setMaxValue (double, bool, bool, bool);
[[deprecated]] void setMaxValue (double, bool, bool);
[[deprecated]] void setMaxValue (double, bool);
[[deprecated]] void setMinAndMaxValues (double, double, bool, bool);
[[deprecated]] void setMinAndMaxValues (double, double, bool);
#endif
private:
//==============================================================================
JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl)
@ -1000,20 +1015,6 @@ private:
std::unique_ptr<AccessibilityHandler> createAccessibilityHandler() override;
void init (SliderStyle, TextEntryBoxPosition);
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// These methods' bool parameters have changed: see the new method signature.
JUCE_DEPRECATED (void setValue (double, bool));
JUCE_DEPRECATED (void setValue (double, bool, bool));
JUCE_DEPRECATED (void setMinValue (double, bool, bool, bool));
JUCE_DEPRECATED (void setMinValue (double, bool, bool));
JUCE_DEPRECATED (void setMinValue (double, bool));
JUCE_DEPRECATED (void setMaxValue (double, bool, bool, bool));
JUCE_DEPRECATED (void setMaxValue (double, bool, bool));
JUCE_DEPRECATED (void setMaxValue (double, bool));
JUCE_DEPRECATED (void setMinAndMaxValues (double, double, bool, bool));
JUCE_DEPRECATED (void setMinAndMaxValues (double, double, bool));
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Slider)
};

View file

@ -186,12 +186,6 @@ public:
@see getDragSourceCustomData, DragAndDropContainer::startDragging
*/
virtual var getDragSourceDescription (const SparseSet<int>& currentlySelectedRows);
private:
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This method's signature has changed to take a MouseEvent parameter - please update your code!
JUCE_DEPRECATED_WITH_BODY (virtual int backgroundClicked(), { return 0; })
#endif
};

View file

@ -946,11 +946,6 @@ private:
int indentSize = -1;
bool defaultOpenness = false, rootItemVisible = true, multiSelectEnabled = false, openCloseButtonsVisible = true;
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// this method has been deprecated - see the new version..
virtual int paintOpenCloseButton (Graphics&, int, int, bool) { return 0; }
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TreeView)
};

View file

@ -414,9 +414,7 @@ public:
#endif
//==============================================================================
#if JUCE_MODAL_LOOPS_PERMITTED
// This has been deprecated, use the NativeMessageBox methods instead for more options.
#if JUCE_MODAL_LOOPS_PERMITTED && ! defined (DOXYGEN)
/** Shows an operating-system native dialog box.
@param title the title to use at the top
@ -425,9 +423,10 @@ public:
it'll show a box with just an ok button
@returns true if the ok button was pressed, false if they pressed cancel.
*/
JUCE_DEPRECATED (static bool JUCE_CALLTYPE showNativeDialogBox (const String& title,
[[deprecated ("Use the NativeMessageBox methods instead for more options")]]
static bool JUCE_CALLTYPE showNativeDialogBox (const String& title,
const String& bodyText,
bool isOkCancel));
bool isOkCancel);
#endif

View file

@ -313,10 +313,13 @@ public:
};
//==============================================================================
// Deprecated: use setContentOwned() and setContentNonOwned() instead.
JUCE_DEPRECATED (void setContentComponent (Component* newContentComponent,
#ifndef DOXYGEN
[[deprecated ("use setContentOwned and setContentNonOwned instead.")]]
void setContentComponent (Component* newContentComponent,
bool deleteOldOne = true,
bool resizeToFit = false));
bool resizeToFit = false);
#endif
using TopLevelWindow::addToDesktop;
//==============================================================================
@ -381,6 +384,11 @@ protected:
std::unique_ptr<ResizableCornerComponent> resizableCorner;
std::unique_ptr<ResizableBorderComponent> resizableBorder;
//==============================================================================
// The parameters for these methods have changed - please update your code!
void getBorderThickness (int& left, int& top, int& right, int& bottom);
void getContentComponentBorder (int& left, int& top, int& right, int& bottom);
private:
//==============================================================================
Component::SafePointer<Component> contentComponent, splashScreen;
@ -399,12 +407,6 @@ private:
void setContent (Component*, bool takeOwnership, bool resizeToFit);
void updatePeerConstrainer();
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// The parameters for these methods have changed - please update your code!
JUCE_DEPRECATED (void getBorderThickness (int& left, int& top, int& right, int& bottom));
JUCE_DEPRECATED (void getContentComponentBorder (int& left, int& top, int& right, int& bottom));
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResizableWindow)
};

View file

@ -121,11 +121,6 @@ public:
/** returns the bounds for a tooltip at the given screen coordinate, constrained within the given desktop area. */
virtual Rectangle<int> getTooltipBounds (const String& tipText, Point<int> screenPos, Rectangle<int> parentArea) = 0;
virtual void drawTooltip (Graphics&, const String& text, int width, int height) = 0;
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This method has been replaced by getTooltipBounds()
virtual int getTooltipSize (const String&, int&, int&) { return 0; }
#endif
};
//==============================================================================

View file

@ -162,12 +162,6 @@ private:
void resized() override;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ColourSelector)
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This constructor is here temporarily to prevent old code compiling, because the parameters
// have changed - if you get an error here, update your code to use the new constructor instead..
ColourSelector (bool);
#endif
};
} // namespace juce

View file

@ -26,7 +26,7 @@
namespace juce
{
#if JUCE_ENABLE_LIVE_CONSTANT_EDITOR && ! DOXYGEN
#if JUCE_ENABLE_LIVE_CONSTANT_EDITOR && ! defined (DOXYGEN)
//==============================================================================
/** You can safely ignore all the stuff in this namespace - it's a bunch of boilerplate

View file

@ -28,7 +28,6 @@ namespace juce
#if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_MAC || DOXYGEN
//==============================================================================
/**
This component sits in the taskbar tray as a small icon.
@ -106,14 +105,12 @@ private:
JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl)
std::unique_ptr<Pimpl> pimpl;
// The new setIconImage function signature requires different images for macOS
// and the other platforms
JUCE_DEPRECATED (void setIconImage (const Image& newImage));
[[deprecated ("The new setIconImage function signature requires different images for macOS and the other platforms.")]]
void setIconImage (const Image& newImage);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SystemTrayIconComponent)
};
#endif
} // namespace juce

View file

@ -71,7 +71,7 @@
#include <juce_gui_extra/juce_gui_extra.h>
//==============================================================================
#if JUCE_OPENGL_ES || defined (DOXYGEN)
#if JUCE_OPENGL_ES || DOXYGEN
/** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL.
Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL,
these macros define the various precision keywords only on GLES.

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