upgrade to JUCE 5.4.3. Remove (probably) unused JUCE modules. Remove VST2 target (it's been end-of-life'd by Steinberg and by JUCE)

This commit is contained in:
Alex Birch
2019-06-22 20:41:38 +01:00
parent d22c2cd4fa
commit 9ee566b251
1140 changed files with 67534 additions and 105952 deletions

View File

@ -52,11 +52,10 @@ void AudioAppComponent::setAudioChannels (int numInputChannels, int numOutputCha
if (usingCustomDeviceManager && xml == nullptr)
{
AudioDeviceManager::AudioDeviceSetup setup;
deviceManager.getAudioDeviceSetup (setup);
auto setup = deviceManager.getAudioDeviceSetup();
if (setup.inputChannels.countNumberOfSetBits() != numInputChannels
|| setup.outputChannels.countNumberOfSetBits() != numOutputChannels)
|| setup.outputChannels.countNumberOfSetBits() != numOutputChannels)
{
setup.inputChannels.clear();
setup.outputChannels.clear();

View File

@ -52,7 +52,7 @@ public:
AudioAppComponent();
AudioAppComponent (AudioDeviceManager&);
~AudioAppComponent();
~AudioAppComponent() override;
/** A subclass should call this from their constructor, to set up the audio. */
void setAudioChannels (int numInputChannels, int numOutputChannels, const XmlElement* const storedSettings = nullptr);
@ -84,7 +84,7 @@ public:
@see releaseResources, getNextAudioBlock
*/
virtual void prepareToPlay (int samplesPerBlockExpected,
double sampleRate) = 0;
double sampleRate) override = 0;
/** Allows the source to release anything it no longer needs after playback has stopped.
@ -98,7 +98,7 @@ public:
@see prepareToPlay, getNextAudioBlock
*/
virtual void releaseResources() = 0;
virtual void releaseResources() override = 0;
/** Called repeatedly to fetch subsequent blocks of audio data.
@ -112,7 +112,7 @@ public:
@see AudioSourceChannelInfo, prepareToPlay, releaseResources
*/
virtual void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) = 0;
virtual void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) override = 0;
/** Shuts down the audio device and clears the audio source.

View File

@ -36,7 +36,7 @@ struct SimpleDeviceManagerInputLevelMeter : public Component,
inputLevelGetter = manager.getInputLevelGetter();
}
~SimpleDeviceManagerInputLevelMeter()
~SimpleDeviceManagerInputLevelMeter() override
{
}
@ -60,8 +60,9 @@ struct SimpleDeviceManagerInputLevelMeter : public Component,
void paint (Graphics& g) override
{
// (add a bit of a skew to make the level more obvious)
getLookAndFeel().drawLevelMeter (g, getWidth(), getHeight(),
(float) std::exp (std::log (level) / 3.0)); // (add a bit of a skew to make the level more obvious)
(float) std::exp (std::log (level) / 3.0));
}
AudioDeviceManager& manager;
@ -145,7 +146,7 @@ public:
if (items.isEmpty())
{
g.setColour (Colours::grey);
g.setFont (13.0f);
g.setFont (0.5f * getRowHeight());
g.drawText (noItemsMessage,
0, 0, getWidth(), getHeight() / 2,
Justification::centred, true);
@ -217,7 +218,7 @@ public:
setup.manager->addChangeListener (this);
}
~AudioDeviceSettingsPanel()
~AudioDeviceSettingsPanel() override
{
setup.manager->removeChangeListener (this);
}
@ -259,6 +260,7 @@ public:
if (outputChanList != nullptr)
{
outputChanList->setRowHeight (jmin (22, h));
outputChanList->setBounds (r.removeFromTop (outputChanList->getBestHeight (maxListBoxHeight)));
outputChanLabel->setBounds (0, outputChanList->getBounds().getCentreY() - h / 2, r.getX(), h);
r.removeFromTop (space);
@ -266,6 +268,7 @@ public:
if (inputChanList != nullptr)
{
inputChanList->setRowHeight (jmin (22, h));
inputChanList->setBounds (r.removeFromTop (inputChanList->getBestHeight (maxListBoxHeight)));
inputChanLabel->setBounds (0, inputChanList->getBounds().getCentreY() - h / 2, r.getX(), h);
r.removeFromTop (space);
@ -330,8 +333,7 @@ public:
void updateConfig (bool updateOutputDevice, bool updateInputDevice, bool updateSampleRate, bool updateBufferSize)
{
AudioDeviceManager::AudioDeviceSetup config;
setup.manager->getAudioDeviceSetup (config);
auto config = setup.manager->getAudioDeviceSetup();
String error;
if (updateOutputDevice || updateInputDevice)
@ -769,9 +771,7 @@ public:
auto item = items[row];
bool enabled = false;
AudioDeviceManager::AudioDeviceSetup config;
setup.manager->getAudioDeviceSetup (config);
auto config = setup.manager->getAudioDeviceSetup();
if (setup.useStereoPairs)
{
@ -825,7 +825,7 @@ public:
if (items.isEmpty())
{
g.setColour (Colours::grey);
g.setFont (13.0f);
g.setFont (0.5f * getRowHeight());
g.drawText (noItemsMessage,
0, 0, getWidth(), getHeight() / 2,
Justification::centred, true);
@ -868,8 +868,7 @@ public:
if (isPositiveAndBelow (row, items.size()))
{
AudioDeviceManager::AudioDeviceSetup config;
setup.manager->getAudioDeviceSetup (config);
auto config = setup.manager->getAudioDeviceSetup();
if (setup.useStereoPairs)
{
@ -908,12 +907,7 @@ public:
}
}
auto error = setup.manager->setAudioDeviceSetup (config, true);
if (error.isNotEmpty())
{
//xxx
}
setup.manager->setAudioDeviceSetup (config, true);
}
}
@ -1068,6 +1062,7 @@ void AudioDeviceSelectorComponent::resized()
if (midiInputsList != nullptr)
{
midiInputsList->setRowHeight (jmin (22, itemHeight));
midiInputsList->setBounds (r.removeFromTop (midiInputsList->getBestHeight (jmin (itemHeight * 8,
getHeight() - r.getY() - space - itemHeight))));
r.removeFromTop (space);

View File

@ -73,7 +73,7 @@ public:
bool hideAdvancedOptionsWithButton);
/** Destructor */
~AudioDeviceSelectorComponent();
~AudioDeviceSelectorComponent() override;
/** The device manager that this component is controlling */
AudioDeviceManager& deviceManager;
@ -95,6 +95,12 @@ public:
private:
//==============================================================================
void handleBluetoothButton();
void updateDeviceType();
void updateMidiOutput();
void changeListenerCallback (ChangeBroadcaster*) override;
void updateAllControls();
std::unique_ptr<ComboBox> deviceTypeDropDown;
std::unique_ptr<Label> deviceTypeDropDownLabel;
std::unique_ptr<Component> audioDeviceSettingsComp;
@ -105,18 +111,11 @@ private:
const bool hideAdvancedOptionsWithButton;
class MidiInputSelectorComponentListBox;
friend struct ContainerDeletePolicy<MidiInputSelectorComponentListBox>;
std::unique_ptr<MidiInputSelectorComponentListBox> midiInputsList;
std::unique_ptr<ComboBox> midiOutputSelector;
std::unique_ptr<Label> midiInputsLabel, midiOutputLabel;
std::unique_ptr<TextButton> bluetoothButton;
void handleBluetoothButton();
void updateDeviceType();
void updateMidiOutput();
void changeListenerCallback (ChangeBroadcaster*) override;
void updateAllControls();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDeviceSelectorComponent)
};

View File

@ -98,7 +98,7 @@ public:
{
}
~LevelDataSource()
~LevelDataSource() override
{
owner.cache.getTimeSliceThread().removeTimeSliceClient (this);
}
@ -642,7 +642,7 @@ void AudioThumbnail::saveTo (OutputStream& output) const
//==============================================================================
bool AudioThumbnail::setDataSource (LevelDataSource* newSource)
{
jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager());
JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED
numSamplesFinished = 0;

View File

@ -68,7 +68,7 @@ public:
AudioThumbnailCache& cacheToUse);
/** Destructor. */
~AudioThumbnail();
~AudioThumbnail() override;
//==============================================================================
/** Clears and resets the thumbnail. */
@ -201,13 +201,6 @@ private:
class ThumbData;
class CachedWindow;
friend class LevelDataSource;
friend class ThumbData;
friend class CachedWindow;
friend struct ContainerDeletePolicy<LevelDataSource>;
friend struct ContainerDeletePolicy<ThumbData>;
friend struct ContainerDeletePolicy<CachedWindow>;
std::unique_ptr<LevelDataSource> source;
std::unique_ptr<CachedWindow> window;
OwnedArray<ThumbData> channels;

View File

@ -46,8 +46,8 @@ class JUCE_API AudioThumbnailBase : public ChangeBroadcaster,
{
public:
//==============================================================================
AudioThumbnailBase() {}
virtual ~AudioThumbnailBase() {}
AudioThumbnailBase() = default;
~AudioThumbnailBase() override = default;
//==============================================================================
/** Clears and resets the thumbnail. */

View File

@ -106,7 +106,6 @@ private:
TimeSliceThread thread;
class ThumbnailCacheEntry;
friend struct ContainerDeletePolicy<ThumbnailCacheEntry>;
OwnedArray<ThumbnailCacheEntry> thumbs;
CriticalSection lock;
int maxNumThumbsToStore;

View File

@ -29,8 +29,7 @@ namespace juce
struct AudioVisualiserComponent::ChannelInfo
{
ChannelInfo (AudioVisualiserComponent& o, int bufferSize)
: owner (o), nextSample (0), subSample (0)
ChannelInfo (AudioVisualiserComponent& o, int bufferSize) : owner (o)
{
setBufferSize (bufferSize);
clear();
@ -38,20 +37,21 @@ struct AudioVisualiserComponent::ChannelInfo
void clear() noexcept
{
for (int i = 0; i < levels.size(); ++i)
levels.getReference(i) = Range<float>();
// VS2013 doesn't like {} here...
for (auto& l : levels)
l = Range<float>();
value = Range<float>();
value = {};
subSample = 0;
}
void pushSamples (const float* inputSamples, const int num) noexcept
void pushSamples (const float* inputSamples, int num) noexcept
{
for (int i = 0; i < num; ++i)
pushSample (inputSamples[i]);
}
void pushSample (const float newSample) noexcept
void pushSample (float newSample) noexcept
{
if (--subSample <= 0)
{
@ -69,7 +69,7 @@ struct AudioVisualiserComponent::ChannelInfo
void setBufferSize (int newSize)
{
levels.removeRange (newSize, levels.size());
levels.insertMultiple (-1, Range<float>(), newSize - levels.size());
levels.insertMultiple (-1, {}, newSize - levels.size());
if (nextSample >= newSize)
nextSample = 0;
@ -78,13 +78,13 @@ struct AudioVisualiserComponent::ChannelInfo
AudioVisualiserComponent& owner;
Array<Range<float>> levels;
Range<float> value;
int nextSample, subSample;
int nextSample = 0, subSample = 0;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChannelInfo)
};
//==============================================================================
AudioVisualiserComponent::AudioVisualiserComponent (const int initialNumChannels)
AudioVisualiserComponent::AudioVisualiserComponent (int initialNumChannels)
: numSamples (1024),
inputSamplesPerBlock (256),
backgroundColour (Colours::black),
@ -99,7 +99,7 @@ AudioVisualiserComponent::~AudioVisualiserComponent()
{
}
void AudioVisualiserComponent::setNumChannels (const int numChannels)
void AudioVisualiserComponent::setNumChannels (int numChannels)
{
channels.clear();
@ -111,14 +111,14 @@ void AudioVisualiserComponent::setBufferSize (int newNumSamples)
{
numSamples = newNumSamples;
for (int i = 0; i < channels.size(); ++i)
channels.getUnchecked(i)->setBufferSize (newNumSamples);
for (auto* c : channels)
c->setBufferSize (newNumSamples);
}
void AudioVisualiserComponent::clear()
{
for (int i = 0; i < channels.size(); ++i)
channels.getUnchecked(i)->clear();
for (auto* c : channels)
c->clear();
}
void AudioVisualiserComponent::pushBuffer (const float** d, int numChannels, int num)
@ -138,7 +138,7 @@ void AudioVisualiserComponent::pushBuffer (const AudioBuffer<float>& buffer)
void AudioVisualiserComponent::pushBuffer (const AudioSourceChannelInfo& buffer)
{
const int numChannels = jmin (buffer.buffer->getNumChannels(), channels.size());
auto numChannels = jmin (buffer.buffer->getNumChannels(), channels.size());
for (int i = 0; i < numChannels; ++i)
channels.getUnchecked(i)->pushSamples (buffer.buffer->getReadPointer (i, buffer.startSample),
@ -179,27 +179,24 @@ void AudioVisualiserComponent::paint (Graphics& g)
{
g.fillAll (backgroundColour);
Rectangle<float> r (getLocalBounds().toFloat());
const float channelHeight = r.getHeight() / channels.size();
auto r = getLocalBounds().toFloat();
auto channelHeight = r.getHeight() / channels.size();
g.setColour (waveformColour);
for (int i = 0; i < channels.size(); ++i)
{
const ChannelInfo& c = *channels.getUnchecked(i);
for (auto* c : channels)
paintChannel (g, r.removeFromTop (channelHeight),
c.levels.begin(), c.levels.size(), c.nextSample);
}
c->levels.begin(), c->levels.size(), c->nextSample);
}
void AudioVisualiserComponent::getChannelAsPath (Path& path, const Range<float>* levels, int numLevels, int nextSample)
void AudioVisualiserComponent::getChannelAsPath (Path& path, const Range<float>* levels,
int numLevels, int nextSample)
{
path.preallocateSpace (4 * numLevels + 8);
for (int i = 0; i < numLevels; ++i)
{
const float level = -(levels[(nextSample + i) % numLevels].getEnd());
auto level = -(levels[(nextSample + i) % numLevels].getEnd());
if (i == 0)
path.startNewSubPath (0.0f, level);

View File

@ -51,7 +51,7 @@ public:
AudioVisualiserComponent (int initialNumChannels);
/** Destructor. */
~AudioVisualiserComponent();
~AudioVisualiserComponent() override;
/** Changes the number of channels that the visualiser stores. */
void setNumChannels (int numChannels);
@ -121,8 +121,6 @@ public:
private:
struct ChannelInfo;
friend struct ChannelInfo;
friend struct ContainerDeletePolicy<ChannelInfo>;
OwnedArray<ChannelInfo> channels;
int numSamples, inputSamplesPerBlock;

View File

@ -50,10 +50,10 @@ struct MidiKeyboardComponent::UpDownButton : public Button
owner.setLowestVisibleKey (note * 12);
}
void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) override
void paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
{
owner.drawUpDownButton (g, getWidth(), getHeight(),
isMouseOverButton, isButtonDown,
shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown,
delta > 0);
}
@ -712,7 +712,7 @@ void MidiKeyboardComponent::updateNoteUnderMouse (Point<float> pos, bool isDown,
auto newNote = xyToNote (pos, mousePositionVelocity);
auto oldNote = mouseOverNotes.getUnchecked (fingerNum);
auto oldNoteDown = mouseDownNotes.getUnchecked (fingerNum);
auto eventVelocity = useMousePositionForVelocity ? mousePositionVelocity * velocity : 1.0f;
auto eventVelocity = useMousePositionForVelocity ? mousePositionVelocity * velocity : velocity;
if (oldNote != newNote)
{

View File

@ -73,7 +73,7 @@ public:
Orientation orientation);
/** Destructor. */
~MidiKeyboardComponent();
~MidiKeyboardComponent() override;
//==============================================================================
/** Changes the velocity used in midi note-on messages that are triggered by clicking