Signed-off-by: falkTX <falktx@falktx.com>tags/v2.2.0-RC1
@@ -25,7 +25,7 @@ | |||
The block below describes the properties of this module, and is read by | |||
the Projucer to automatically generate project code that uses it. | |||
For details about the syntax and how to create or use a module, see the | |||
JUCE Module Format.txt file. | |||
JUCE Module Format.md file. | |||
BEGIN_JUCE_MODULE_DECLARATION | |||
@@ -30,6 +30,8 @@ namespace juce | |||
Instances of this class do *not* own the midi data bytes that they point to. | |||
Instead, they expect the midi data to live in a separate buffer that outlives | |||
the MidiMessageMetadata instance. | |||
@tags{Audio} | |||
*/ | |||
struct MidiMessageMetadata final | |||
{ | |||
@@ -70,6 +72,8 @@ struct MidiMessageMetadata final | |||
Logger::writeToLog (metadata.getMessage().getDescription()); | |||
} | |||
@endcode | |||
@tags{Audio} | |||
*/ | |||
class JUCE_API MidiBufferIterator | |||
{ | |||
@@ -92,7 +96,7 @@ public: | |||
using value_type = MidiMessageMetadata; | |||
using reference = MidiMessageMetadata; | |||
using pointer = void; | |||
using iterator_category = std::bidirectional_iterator_tag; | |||
using iterator_category = std::input_iterator_tag; | |||
/** Make this iterator point to the next message in the buffer. */ | |||
MidiBufferIterator& operator++() noexcept; | |||
@@ -76,9 +76,7 @@ void MidiKeyboardState::noteOnInternal (const int midiChannel, const int midiNo | |||
if (isPositiveAndBelow (midiNoteNumber, 128)) | |||
{ | |||
noteStates[midiNoteNumber] = static_cast<uint16> (noteStates[midiNoteNumber] | (1 << (midiChannel - 1))); | |||
for (int i = listeners.size(); --i >= 0;) | |||
listeners.getUnchecked(i)->handleNoteOn (this, midiChannel, midiNoteNumber, velocity); | |||
listeners.call ([&] (Listener& l) { l.handleNoteOn (this, midiChannel, midiNoteNumber, velocity); }); | |||
} | |||
} | |||
@@ -101,9 +99,7 @@ void MidiKeyboardState::noteOffInternal (const int midiChannel, const int midiN | |||
if (isNoteOn (midiChannel, midiNoteNumber)) | |||
{ | |||
noteStates[midiNoteNumber] = static_cast<uint16> (noteStates[midiNoteNumber] & ~(1 << (midiChannel - 1))); | |||
for (int i = listeners.size(); --i >= 0;) | |||
listeners.getUnchecked(i)->handleNoteOff (this, midiChannel, midiNoteNumber, velocity); | |||
listeners.call ([&] (Listener& l) { l.handleNoteOff (this, midiChannel, midiNoteNumber, velocity); }); | |||
} | |||
} | |||
@@ -166,16 +162,16 @@ void MidiKeyboardState::processNextMidiBuffer (MidiBuffer& buffer, | |||
} | |||
//============================================================================== | |||
void MidiKeyboardState::addListener (MidiKeyboardStateListener* const listener) | |||
void MidiKeyboardState::addListener (Listener* listener) | |||
{ | |||
const ScopedLock sl (lock); | |||
listeners.addIfNotAlreadyThere (listener); | |||
listeners.add (listener); | |||
} | |||
void MidiKeyboardState::removeListener (MidiKeyboardStateListener* const listener) | |||
void MidiKeyboardState::removeListener (Listener* listener) | |||
{ | |||
const ScopedLock sl (lock); | |||
listeners.removeFirstMatchingValue (listener); | |||
listeners.remove (listener); | |||
} | |||
} // namespace juce |
@@ -23,51 +23,6 @@ | |||
namespace juce | |||
{ | |||
class MidiKeyboardState; | |||
//============================================================================== | |||
/** | |||
Receives events from a MidiKeyboardState object. | |||
@see MidiKeyboardState | |||
@tags{Audio} | |||
*/ | |||
class JUCE_API MidiKeyboardStateListener | |||
{ | |||
public: | |||
//============================================================================== | |||
MidiKeyboardStateListener() = default; | |||
virtual ~MidiKeyboardStateListener() = default; | |||
//============================================================================== | |||
/** Called when one of the MidiKeyboardState's keys is pressed. | |||
This will be called synchronously when the state is either processing a | |||
buffer in its MidiKeyboardState::processNextMidiBuffer() method, or | |||
when a note is being played with its MidiKeyboardState::noteOn() method. | |||
Note that this callback could happen from an audio callback thread, so be | |||
careful not to block, and avoid any UI activity in the callback. | |||
*/ | |||
virtual void handleNoteOn (MidiKeyboardState* source, | |||
int midiChannel, int midiNoteNumber, float velocity) = 0; | |||
/** Called when one of the MidiKeyboardState's keys is released. | |||
This will be called synchronously when the state is either processing a | |||
buffer in its MidiKeyboardState::processNextMidiBuffer() method, or | |||
when a note is being played with its MidiKeyboardState::noteOff() method. | |||
Note that this callback could happen from an audio callback thread, so be | |||
careful not to block, and avoid any UI activity in the callback. | |||
*/ | |||
virtual void handleNoteOff (MidiKeyboardState* source, | |||
int midiChannel, int midiNoteNumber, float velocity) = 0; | |||
}; | |||
//============================================================================== | |||
/** | |||
Represents a piano keyboard, keeping track of which keys are currently pressed. | |||
@@ -180,27 +135,62 @@ public: | |||
bool injectIndirectEvents); | |||
//============================================================================== | |||
/** Receives events from a MidiKeyboardState object. */ | |||
class Listener | |||
{ | |||
public: | |||
//============================================================================== | |||
virtual ~Listener() = default; | |||
//============================================================================== | |||
/** Called when one of the MidiKeyboardState's keys is pressed. | |||
This will be called synchronously when the state is either processing a | |||
buffer in its MidiKeyboardState::processNextMidiBuffer() method, or | |||
when a note is being played with its MidiKeyboardState::noteOn() method. | |||
Note that this callback could happen from an audio callback thread, so be | |||
careful not to block, and avoid any UI activity in the callback. | |||
*/ | |||
virtual void handleNoteOn (MidiKeyboardState* source, | |||
int midiChannel, int midiNoteNumber, float velocity) = 0; | |||
/** Called when one of the MidiKeyboardState's keys is released. | |||
This will be called synchronously when the state is either processing a | |||
buffer in its MidiKeyboardState::processNextMidiBuffer() method, or | |||
when a note is being played with its MidiKeyboardState::noteOff() method. | |||
Note that this callback could happen from an audio callback thread, so be | |||
careful not to block, and avoid any UI activity in the callback. | |||
*/ | |||
virtual void handleNoteOff (MidiKeyboardState* source, | |||
int midiChannel, int midiNoteNumber, float velocity) = 0; | |||
}; | |||
/** Registers a listener for callbacks when keys go up or down. | |||
@see removeListener | |||
*/ | |||
void addListener (MidiKeyboardStateListener* listener); | |||
void addListener (Listener* listener); | |||
/** Deregisters a listener. | |||
@see addListener | |||
*/ | |||
void removeListener (MidiKeyboardStateListener* listener); | |||
void removeListener (Listener* listener); | |||
private: | |||
//============================================================================== | |||
CriticalSection lock; | |||
uint16 noteStates[128]; | |||
std::atomic<uint16> noteStates[128]; | |||
MidiBuffer eventsToAdd; | |||
Array <MidiKeyboardStateListener*> listeners; | |||
ListenerList<Listener> listeners; | |||
void noteOnInternal (int midiChannel, int midiNoteNumber, float velocity); | |||
void noteOnInternal (int midiChannel, int midiNoteNumber, float velocity); | |||
void noteOffInternal (int midiChannel, int midiNoteNumber, float velocity); | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiKeyboardState) | |||
}; | |||
using MidiKeyboardStateListener = MidiKeyboardState::Listener; | |||
} // namespace juce |
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -33,7 +40,7 @@ private: | |||
template<typename InterpolatorType> | |||
void runInterplatorTests (const String& interpolatorName) | |||
{ | |||
auto createGaussian = [](std::vector<float>& destination, float scale, float centreInSamples, float width) | |||
auto createGaussian = [] (std::vector<float>& destination, float scale, float centreInSamples, float width) | |||
{ | |||
for (size_t i = 0; i < destination.size(); ++i) | |||
{ | |||
@@ -44,7 +51,7 @@ private: | |||
FloatVectorOperations::multiply (destination.data(), scale, (int) destination.size()); | |||
}; | |||
auto findGaussianPeak = [](const std::vector<float>& input) -> float | |||
auto findGaussianPeak = [] (const std::vector<float>& input) -> float | |||
{ | |||
auto max = std::max_element (std::begin (input), std::end (input)); | |||
auto maxPrev = max - 1; | |||
@@ -55,7 +62,7 @@ private: | |||
return quadraticMaxLoc + (float) std::distance (std::begin (input), max); | |||
}; | |||
auto expectAllElementsWithin = [this](const std::vector<float>& v1, const std::vector<float>& v2, float tolerance) | |||
auto expectAllElementsWithin = [this] (const std::vector<float>& v1, const std::vector<float>& v2, float tolerance) | |||
{ | |||
expectEquals ((int) v1.size(), (int) v2.size()); | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -19,6 +26,14 @@ | |||
namespace juce | |||
{ | |||
/** | |||
A collection of different interpolators for resampling streams of floats. | |||
@see GenericInterpolator, WindowedSincInterpolator, LagrangeInterpolator, | |||
CatmullRomInterpolator, LinearInterpolator, ZeroOrderHoldInterpolator | |||
@tags{Audio} | |||
*/ | |||
class Interpolators | |||
{ | |||
private: | |||
@@ -522,8 +522,8 @@ public: | |||
return result; | |||
}; | |||
auto compareData = [this](const AudioBuffer<float>& test, | |||
const AudioBuffer<float>& reference) | |||
auto compareData = [this] (const AudioBuffer<float>& test, | |||
const AudioBuffer<float>& reference) | |||
{ | |||
for (int i = 0; i < test.getNumSamples(); ++i) | |||
expectWithinAbsoluteError (test.getSample (0, i), | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -517,7 +517,7 @@ AudioIODeviceType* AudioDeviceManager::getCurrentDeviceTypeObject() const | |||
static void updateSetupChannels (AudioDeviceManager::AudioDeviceSetup& setup, int defaultNumIns, int defaultNumOuts) | |||
{ | |||
auto updateChannels = [](const String& deviceName, BigInteger& channels, int defaultNumChannels) | |||
auto updateChannels = [] (const String& deviceName, BigInteger& channels, int defaultNumChannels) | |||
{ | |||
if (deviceName.isEmpty()) | |||
{ | |||
@@ -25,7 +25,7 @@ | |||
The block below describes the properties of this module, and is read by | |||
the Projucer to automatically generate project code that uses it. | |||
For details about the syntax and how to create or use a module, see the | |||
JUCE Module Format.txt file. | |||
JUCE Module Format.md file. | |||
BEGIN_JUCE_MODULE_DECLARATION | |||
@@ -337,6 +337,11 @@ public: | |||
*/ | |||
void stopBackgroundThread(); | |||
/** Returns true if the background thread used to send blocks of data is running. | |||
@see startBackgroundThread, stopBackgroundThread | |||
*/ | |||
bool isBackgroundThreadRunning() const noexcept { return isThreadRunning(); } | |||
//============================================================================== | |||
/** Deprecated. */ | |||
static StringArray getDevices(); | |||
@@ -128,6 +128,11 @@ void MidiMessageCollector::removeNextBlockOfMessages (MidiBuffer& destBuffer, | |||
} | |||
} | |||
void MidiMessageCollector::ensureStorageAllocated (size_t bytes) | |||
{ | |||
incomingMessages.ensureSize (bytes); | |||
} | |||
//============================================================================== | |||
void MidiMessageCollector::handleNoteOn (MidiKeyboardState*, int midiChannel, int midiNoteNumber, float velocity) | |||
{ | |||
@@ -28,14 +28,14 @@ namespace juce | |||
Collects incoming realtime MIDI messages and turns them into blocks suitable for | |||
processing by a block-based audio callback. | |||
The class can also be used as either a MidiKeyboardStateListener or a MidiInputCallback | |||
The class can also be used as either a MidiKeyboardState::Listener or a MidiInputCallback | |||
so it can easily use a midi input or keyboard component as its source. | |||
@see MidiMessage, MidiInput | |||
@tags{Audio} | |||
*/ | |||
class JUCE_API MidiMessageCollector : public MidiKeyboardStateListener, | |||
class JUCE_API MidiMessageCollector : public MidiKeyboardState::Listener, | |||
public MidiInputCallback | |||
{ | |||
public: | |||
@@ -80,6 +80,14 @@ public: | |||
*/ | |||
void removeNextBlockOfMessages (MidiBuffer& destBuffer, int numSamples); | |||
/** Preallocates storage for collected messages. | |||
This can be called before audio processing begins to ensure that there | |||
is sufficient space for the expected MIDI messages, in order to avoid | |||
allocations within the audio callback. | |||
*/ | |||
void ensureStorageAllocated (size_t bytes); | |||
//============================================================================== | |||
/** @internal */ | |||
@@ -91,33 +91,43 @@ struct OboeAudioIODeviceBufferHelpers<float> | |||
static void convertFromOboe (const float* srcInterleaved, AudioBuffer<float>& audioBuffer, int numSamples) | |||
{ | |||
// No need to convert, we instructed the buffer to point to the src data directly already | |||
jassert (audioBuffer.getWritePointer (0) != srcInterleaved); | |||
auto numChannels = audioBuffer.getNumChannels(); | |||
for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
if (numChannels > 0) | |||
{ | |||
using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>; | |||
using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::Const>; | |||
// No need to convert, we instructed the buffer to point to the src data directly already | |||
jassert (audioBuffer.getWritePointer (0) != srcInterleaved); | |||
DstSampleType dstData (audioBuffer.getWritePointer (i)); | |||
SrcSampleType srcData (srcInterleaved + i, audioBuffer.getNumChannels()); | |||
dstData.convertSamples (srcData, numSamples); | |||
for (int i = 0; i < numChannels; ++i) | |||
{ | |||
using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>; | |||
using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::Const>; | |||
DstSampleType dstData (audioBuffer.getWritePointer (i)); | |||
SrcSampleType srcData (srcInterleaved + i, audioBuffer.getNumChannels()); | |||
dstData.convertSamples (srcData, numSamples); | |||
} | |||
} | |||
} | |||
static void convertToOboe (const AudioBuffer<float>& audioBuffer, float* dstInterleaved, int numSamples) | |||
{ | |||
// No need to convert, we instructed the buffer to point to the src data directly already | |||
jassert (audioBuffer.getReadPointer (0) != dstInterleaved); | |||
auto numChannels = audioBuffer.getNumChannels(); | |||
for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
if (numChannels > 0) | |||
{ | |||
using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::NonConst>; | |||
using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const>; | |||
// No need to convert, we instructed the buffer to point to the src data directly already | |||
jassert (audioBuffer.getReadPointer (0) != dstInterleaved); | |||
DstSampleType dstData (dstInterleaved + i, audioBuffer.getNumChannels()); | |||
SrcSampleType srcData (audioBuffer.getReadPointer (i)); | |||
dstData.convertSamples (srcData, numSamples); | |||
for (int i = 0; i < numChannels; ++i) | |||
{ | |||
using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::NonConst>; | |||
using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const>; | |||
DstSampleType dstData (dstInterleaved + i, audioBuffer.getNumChannels()); | |||
SrcSampleType srcData (audioBuffer.getReadPointer (i)); | |||
dstData.convertSamples (srcData, numSamples); | |||
} | |||
} | |||
} | |||
}; | |||
@@ -148,8 +158,6 @@ public: | |||
supportedOutputSampleRates (supportedOutputSampleRatesToUse), | |||
maxNumOutputChannels (maxNumOutputChannelsToUse) | |||
{ | |||
// At least an input or an output has to be supported by the device! | |||
jassert (inputDeviceId != -1 || outputDeviceId != -1); | |||
} | |||
~OboeAudioIODevice() override | |||
@@ -380,7 +388,7 @@ private: | |||
// We initially try to open a stream with a buffer size returned from | |||
// android.media.property.OUTPUT_FRAMES_PER_BUFFER property, but then we verify the actual | |||
// size after the stream is open. | |||
OboeAudioIODevice::OboeStream tempStream (-1, | |||
OboeAudioIODevice::OboeStream tempStream (oboe::kUnspecified, | |||
oboe::Direction::Output, | |||
oboe::SharingMode::Exclusive, | |||
2, | |||
@@ -695,7 +703,7 @@ private: | |||
ignoreUnused (deviceId, numChannels, sampleRate, expectedBufferSize); | |||
ignoreUnused (streamFormat, bitDepth); | |||
jassert (numChannels == nativeStream->getChannelCount()); | |||
jassert (numChannels == 0 || numChannels == nativeStream->getChannelCount()); | |||
jassert (expectedSampleRate == 0 || expectedSampleRate == nativeStream->getSampleRate()); | |||
jassert (format == nativeStream->getFormat()); | |||
} | |||
@@ -951,7 +959,7 @@ private: | |||
Thread::sleep (1); | |||
outputStream = nullptr; | |||
outputStream.reset (new OboeStream (-1, | |||
outputStream.reset (new OboeStream (oboe::kUnspecified, | |||
oboe::Direction::Output, | |||
oboe::SharingMode::Exclusive, | |||
numOutputChannels, | |||
@@ -1058,9 +1066,6 @@ public: | |||
StringArray getDeviceNames (bool wantInputNames) const override | |||
{ | |||
if (inputDevices.isEmpty() && outputDevices.isEmpty()) | |||
return StringArray (OboeAudioIODevice::oboeTypeName); | |||
StringArray names; | |||
for (auto& device : wantInputNames ? inputDevices : outputDevices) | |||
@@ -1069,36 +1074,8 @@ public: | |||
return names; | |||
} | |||
int getDefaultDeviceIndex (bool forInput) const override | |||
int getDefaultDeviceIndex (bool) const override | |||
{ | |||
// No need to create a stream when only one default device is created. | |||
if (! supportsDevicesInfo()) | |||
return 0; | |||
if (forInput && (! RuntimePermissions::isGranted (RuntimePermissions::recordAudio))) | |||
return 0; | |||
// Create stream with a default device ID and query the stream for its device ID | |||
using OboeStream = OboeAudioIODevice::OboeStream; | |||
OboeStream tempStream (-1, | |||
forInput ? oboe::Direction::Input : oboe::Direction::Output, | |||
oboe::SharingMode::Shared, | |||
forInput ? 1 : 2, | |||
getAndroidSDKVersion() >= 21 ? oboe::AudioFormat::Float : oboe::AudioFormat::I16, | |||
(int) AndroidHighPerformanceAudioHelpers::getNativeSampleRate(), | |||
AndroidHighPerformanceAudioHelpers::getNativeBufferSizeHint(), | |||
nullptr); | |||
if (auto* nativeStream = tempStream.getNativeStream()) | |||
{ | |||
auto& devices = forInput ? inputDevices : outputDevices; | |||
for (int i = 0; i < devices.size(); ++i) | |||
if (devices.getReference (i).id == nativeStream->getDeviceId()) | |||
return i; | |||
} | |||
return 0; | |||
} | |||
@@ -1127,12 +1104,8 @@ public: | |||
auto outputDeviceInfo = getDeviceInfoForName (outputDeviceName, false); | |||
auto inputDeviceInfo = getDeviceInfoForName (inputDeviceName, true); | |||
if (outputDeviceInfo.name.isEmpty() && inputDeviceInfo.name.isEmpty()) | |||
{ | |||
// Invalid device name passed. It must be one of the names returned by getDeviceNames(). | |||
jassertfalse; | |||
if (outputDeviceInfo.id < 0 && inputDeviceInfo.id < 0) | |||
return nullptr; | |||
} | |||
auto& name = outputDeviceInfo.name.isNotEmpty() ? outputDeviceInfo.name | |||
: inputDeviceInfo.name; | |||
@@ -1156,15 +1129,13 @@ public: | |||
private: | |||
void checkAvailableDevices() | |||
{ | |||
if (! supportsDevicesInfo()) | |||
{ | |||
auto sampleRates = OboeAudioIODevice::getDefaultSampleRates(); | |||
auto sampleRates = OboeAudioIODevice::getDefaultSampleRates(); | |||
inputDevices .add ({ OboeAudioIODevice::oboeTypeName, -1, sampleRates, 1 }); | |||
outputDevices.add ({ OboeAudioIODevice::oboeTypeName, -1, sampleRates, 2 }); | |||
inputDevices .add ({ "System Default (Input)", oboe::kUnspecified, sampleRates, 1 }); | |||
outputDevices.add ({ "System Default (Output)", oboe::kUnspecified, sampleRates, 2 }); | |||
if (! supportsDevicesInfo()) | |||
return; | |||
} | |||
auto* env = getEnv(); | |||
@@ -1309,19 +1280,21 @@ public: | |||
struct DeviceInfo | |||
{ | |||
String name; | |||
int id; | |||
int id = -1; | |||
Array<int> sampleRates; | |||
int numChannels; | |||
}; | |||
DeviceInfo getDeviceInfoForName (const String& name, bool isInput) | |||
{ | |||
if (name.isEmpty()) | |||
return {}; | |||
for (auto& device : isInput ? inputDevices : outputDevices) | |||
if (device.name == name) | |||
return device; | |||
if (name.isNotEmpty()) | |||
{ | |||
for (auto& device : isInput ? inputDevices : outputDevices) | |||
{ | |||
if (device.name == name) | |||
return device; | |||
} | |||
} | |||
return {}; | |||
} | |||
@@ -1349,7 +1322,7 @@ class OboeRealtimeThread : private oboe::AudioStreamCallback | |||
public: | |||
OboeRealtimeThread() | |||
: testStream (new OboeStream (-1, | |||
: testStream (new OboeStream (oboe::kUnspecified, | |||
oboe::Direction::Output, | |||
oboe::SharingMode::Exclusive, | |||
1, | |||
@@ -1362,7 +1335,7 @@ public: | |||
// Fallback to I16 stream format if Float has not worked | |||
if (! testStream->openedOk()) | |||
{ | |||
testStream.reset (new OboeStream (-1, | |||
testStream.reset (new OboeStream (oboe::kUnspecified, | |||
oboe::Direction::Output, | |||
oboe::SharingMode::Exclusive, | |||
1, | |||
@@ -1415,7 +1388,7 @@ public: | |||
threadEntryProc (threadUserPtr); | |||
threadEntryProc = nullptr; | |||
MessageManager::callAsync ([this] () { delete this; }); | |||
MessageManager::callAsync ([this]() { delete this; }); | |||
return oboe::DataCallbackResult::Stop; | |||
} | |||
@@ -1260,7 +1260,7 @@ public: | |||
threadEntryProc = nullptr; | |||
(*player)->SetPlayState (player, SL_PLAYSTATE_STOPPED); | |||
MessageManager::callAsync ([this] () { delete this; }); | |||
MessageManager::callAsync ([this]() { delete this; }); | |||
} | |||
} | |||
@@ -990,19 +990,19 @@ private: | |||
watcher->add_Added ( | |||
Callback<ITypedEventHandler<DeviceWatcher*, DeviceInformation*>> ( | |||
[handlerPtr](IDeviceWatcher*, IDeviceInformation* info) { return handlerPtr->addDevice (info); } | |||
[handlerPtr] (IDeviceWatcher*, IDeviceInformation* info) { return handlerPtr->addDevice (info); } | |||
).Get(), | |||
&deviceAddedToken); | |||
watcher->add_Removed ( | |||
Callback<ITypedEventHandler<DeviceWatcher*, DeviceInformationUpdate*>> ( | |||
[handlerPtr](IDeviceWatcher*, IDeviceInformationUpdate* infoUpdate) { return handlerPtr->removeDevice (infoUpdate); } | |||
[handlerPtr] (IDeviceWatcher*, IDeviceInformationUpdate* infoUpdate) { return handlerPtr->removeDevice (infoUpdate); } | |||
).Get(), | |||
&deviceRemovedToken); | |||
watcher->add_Updated ( | |||
Callback<ITypedEventHandler<DeviceWatcher*, DeviceInformationUpdate*>> ( | |||
[handlerPtr](IDeviceWatcher*, IDeviceInformationUpdate* infoUpdate) { return handlerPtr->updateDevice (infoUpdate); } | |||
[handlerPtr] (IDeviceWatcher*, IDeviceInformationUpdate* infoUpdate) { return handlerPtr->updateDevice (infoUpdate); } | |||
).Get(), | |||
&deviceUpdatedToken); | |||
@@ -1118,7 +1118,7 @@ private: | |||
if (devices.contains (removedDeviceId)) | |||
{ | |||
auto& info = devices.getReference (removedDeviceId); | |||
listeners.call ([&info](Listener& l) { l.bleDeviceDisconnected (info.containerID); }); | |||
listeners.call ([&info] (Listener& l) { l.bleDeviceDisconnected (info.containerID); }); | |||
devices.remove (removedDeviceId); | |||
JUCE_WINRT_MIDI_LOG ("Removed BLE device: " << removedDeviceId); | |||
} | |||
@@ -1165,7 +1165,7 @@ private: | |||
if (info.isConnected && ! isConnected) | |||
{ | |||
JUCE_WINRT_MIDI_LOG ("BLE device connection status change: " << updatedDeviceId << " " << info.containerID << " " << (isConnected ? "connected" : "disconnected")); | |||
listeners.call ([&info](Listener& l) { l.bleDeviceDisconnected (info.containerID); }); | |||
listeners.call ([&info] (Listener& l) { l.bleDeviceDisconnected (info.containerID); }); | |||
} | |||
info.isConnected = isConnected; | |||
@@ -1580,7 +1580,7 @@ private: | |||
auto hr = midiPort->add_MessageReceived ( | |||
Callback<ITypedEventHandler<MidiInPort*, MidiMessageReceivedEventArgs*>> ( | |||
[this](IMidiInPort*, IMidiMessageReceivedEventArgs* args) { return midiInMessageReceived (args); } | |||
[this] (IMidiInPort*, IMidiMessageReceivedEventArgs* args) { return midiInMessageReceived (args); } | |||
).Get(), | |||
&midiInMessageToken); | |||
@@ -1430,7 +1430,7 @@ private: | |||
closeDevices(); | |||
initialise(); | |||
auto changedSampleRate = [this, sampleRateChangedByInput] () | |||
auto changedSampleRate = [this, sampleRateChangedByInput]() | |||
{ | |||
if (inputDevice != nullptr && sampleRateChangedByInput) | |||
return inputDevice->defaultSampleRate; | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -67,7 +74,7 @@ public: | |||
String& errorMessage); | |||
/** A callback lambda that is passed to createPluginInstanceAsync() */ | |||
using PluginCreationCallback = std::function<void(std::unique_ptr<AudioPluginInstance>, const String&)>; | |||
using PluginCreationCallback = std::function<void (std::unique_ptr<AudioPluginInstance>, const String&)>; | |||
/** Tries to recreate a type from a previously generated PluginDescription. | |||
When the plugin has been created, it will be passed to the caller via an | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1439,7 +1446,7 @@ public: | |||
|| info.unit == kAudioUnitParameterUnit_Boolean); | |||
bool isBoolean = info.unit == kAudioUnitParameterUnit_Boolean; | |||
auto label = [info] () -> String | |||
auto label = [info]() -> String | |||
{ | |||
if (info.unit == kAudioUnitParameterUnit_Percent) return "%"; | |||
if (info.unit == kAudioUnitParameterUnit_Seconds) return "s"; | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -2788,7 +2795,7 @@ private: | |||
bypassParam = param; | |||
std::function<AudioProcessorParameterGroup*(Vst::UnitID)> findOrCreateGroup; | |||
findOrCreateGroup = [&groupMap, &infoMap, &findOrCreateGroup](Vst::UnitID groupID) | |||
findOrCreateGroup = [&groupMap, &infoMap, &findOrCreateGroup] (Vst::UnitID groupID) | |||
{ | |||
auto existingGroup = groupMap.find (groupID); | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -21,7 +28,7 @@ | |||
The block below describes the properties of this module, and is read by | |||
the Projucer to automatically generate project code that uses it. | |||
For details about the syntax and how to create or use a module, see the | |||
JUCE Module Format.txt file. | |||
JUCE Module Format.md file. | |||
BEGIN_JUCE_MODULE_DECLARATION | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -775,7 +782,7 @@ void AudioProcessor::audioIOChanged (bool busNumberChanged, bool channelNumChang | |||
bus->updateChannelCount(); | |||
} | |||
auto countTotalChannels = [](const OwnedArray<AudioProcessor::Bus>& buses) noexcept | |||
auto countTotalChannels = [] (const OwnedArray<AudioProcessor::Bus>& buses) noexcept | |||
{ | |||
int n = 0; | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1174,7 +1181,7 @@ public: | |||
Unknown = -1 | |||
}; | |||
std::function<float(float)> curve; // a function which represents your curve (such as an eq) | |||
std::function<float (float)> curve; // a function which represents your curve (such as an eq) | |||
Range<float> xRange, yRange; // the data range of your curve | |||
// For some curve types, your plug-in may already measure the current input and output values. | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -961,7 +968,7 @@ AudioProcessorGraph::Node::Ptr AudioProcessorGraph::addNode (std::unique_ptr<Aud | |||
return n; | |||
} | |||
std::unique_ptr<AudioProcessor> AudioProcessorGraph::removeNode (NodeID nodeId) | |||
AudioProcessorGraph::Node::Ptr AudioProcessorGraph::removeNode (NodeID nodeId) | |||
{ | |||
const ScopedLock sl (getCallbackLock()); | |||
@@ -970,23 +977,22 @@ std::unique_ptr<AudioProcessor> AudioProcessorGraph::removeNode (NodeID nodeId) | |||
if (nodes.getUnchecked (i)->nodeID == nodeId) | |||
{ | |||
disconnectNode (nodeId); | |||
auto internalProcessor = nodes[i] != nullptr ? std::move (nodes[i]->processor) : nullptr; | |||
nodes.remove (i); | |||
auto node = nodes.removeAndReturn (i); | |||
topologyChanged(); | |||
return internalProcessor; | |||
return node; | |||
} | |||
} | |||
return nullptr; | |||
return {}; | |||
} | |||
std::unique_ptr<AudioProcessor> AudioProcessorGraph::removeNode (Node* node) | |||
AudioProcessorGraph::Node::Ptr AudioProcessorGraph::removeNode (Node* node) | |||
{ | |||
if (node != nullptr) | |||
return removeNode (node->nodeID); | |||
jassertfalse; | |||
return nullptr; | |||
return {}; | |||
} | |||
//============================================================================== | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -231,12 +238,12 @@ public: | |||
/** Deletes a node within the graph which has the specified ID. | |||
This will also delete any connections that are attached to this node. | |||
*/ | |||
std::unique_ptr<AudioProcessor> removeNode (NodeID); | |||
Node::Ptr removeNode (NodeID); | |||
/** Deletes a node within the graph. | |||
This will also delete any connections that are attached to this node. | |||
*/ | |||
std::unique_ptr<AudioProcessor> removeNode (Node*); | |||
Node::Ptr removeNode (Node*); | |||
/** Returns the list of connections in the graph. */ | |||
std::vector<Connection> getConnections() const; | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -21,8 +28,8 @@ namespace juce | |||
AudioParameterBool::AudioParameterBool (const String& idToUse, const String& nameToUse, | |||
bool def, const String& labelToUse, | |||
std::function<String(bool, int)> stringFromBool, | |||
std::function<bool(const String&)> boolFromString) | |||
std::function<String (bool, int)> stringFromBool, | |||
std::function<bool (const String&)> boolFromString) | |||
: RangedAudioParameter (idToUse, nameToUse, labelToUse), | |||
value (def ? 1.0f : 0.0f), | |||
defaultValue (value), | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -44,8 +51,8 @@ public: | |||
*/ | |||
AudioParameterBool (const String& parameterID, const String& parameterName, bool defaultValue, | |||
const String& parameterLabel = String(), | |||
std::function<String(bool value, int maximumStringLength)> stringFromBool = nullptr, | |||
std::function<bool(const String& text)> boolFromString = nullptr); | |||
std::function<String (bool value, int maximumStringLength)> stringFromBool = nullptr, | |||
std::function<bool (const String& text)> boolFromString = nullptr); | |||
/** Destructor. */ | |||
~AudioParameterBool() override; | |||
@@ -82,8 +89,8 @@ private: | |||
const NormalisableRange<float> range { 0.0f, 1.0f, 1.0f }; | |||
std::atomic<float> value; | |||
const float defaultValue; | |||
std::function<String(bool, int)> stringFromBoolFunction; | |||
std::function<bool(const String&)> boolFromStringFunction; | |||
std::function<String (bool, int)> stringFromBoolFunction; | |||
std::function<bool (const String&)> boolFromStringFunction; | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterBool) | |||
}; | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -21,15 +28,15 @@ namespace juce | |||
AudioParameterChoice::AudioParameterChoice (const String& idToUse, const String& nameToUse, | |||
const StringArray& c, int def, const String& labelToUse, | |||
std::function<String(int, int)> stringFromIndex, | |||
std::function<int(const String&)> indexFromString) | |||
std::function<String (int, int)> stringFromIndex, | |||
std::function<int (const String&)> indexFromString) | |||
: RangedAudioParameter (idToUse, nameToUse, labelToUse), choices (c), | |||
range ([this] | |||
{ | |||
NormalisableRange<float> rangeWithInterval { 0.0f, choices.size() - 1.0f, | |||
[](float, float end, float v) { return jlimit (0.0f, end, v * end); }, | |||
[](float, float end, float v) { return jlimit (0.0f, 1.0f, v / end); }, | |||
[](float start, float end, float v) { return (float) roundToInt (juce::jlimit (start, end, v)); } }; | |||
[] (float, float end, float v) { return jlimit (0.0f, end, v * end); }, | |||
[] (float, float end, float v) { return jlimit (0.0f, 1.0f, v / end); }, | |||
[] (float start, float end, float v) { return (float) roundToInt (juce::jlimit (start, end, v)); } }; | |||
rangeWithInterval.interval = 1.0f; | |||
return rangeWithInterval; | |||
}()), | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -48,8 +55,8 @@ public: | |||
const StringArray& choices, | |||
int defaultItemIndex, | |||
const String& parameterLabel = String(), | |||
std::function<String(int index, int maximumStringLength)> stringFromIndex = nullptr, | |||
std::function<int(const String& text)> indexFromString = nullptr); | |||
std::function<String (int index, int maximumStringLength)> stringFromIndex = nullptr, | |||
std::function<int (const String& text)> indexFromString = nullptr); | |||
/** Destructor. */ | |||
~AudioParameterChoice() override; | |||
@@ -94,8 +101,8 @@ private: | |||
const NormalisableRange<float> range; | |||
std::atomic<float> value; | |||
const float defaultValue; | |||
std::function<String(int, int)> stringFromIndexFunction; | |||
std::function<int(const String&)> indexFromStringFunction; | |||
std::function<String (int, int)> stringFromIndexFunction; | |||
std::function<int (const String&)> indexFromStringFunction; | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterChoice) | |||
}; | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -22,8 +29,8 @@ namespace juce | |||
AudioParameterFloat::AudioParameterFloat (const String& idToUse, const String& nameToUse, | |||
NormalisableRange<float> r, float def, | |||
const String& labelToUse, Category categoryToUse, | |||
std::function<String(float, int)> stringFromValue, | |||
std::function<float(const String&)> valueFromString) | |||
std::function<String (float, int)> stringFromValue, | |||
std::function<float (const String&)> valueFromString) | |||
: RangedAudioParameter (idToUse, nameToUse, labelToUse, categoryToUse), | |||
range (r), value (def), defaultValue (def), | |||
stringFromValueFunction (stringFromValue), | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -51,8 +58,8 @@ public: | |||
float defaultValue, | |||
const String& parameterLabel = String(), | |||
Category parameterCategory = AudioProcessorParameter::genericParameter, | |||
std::function<String(float value, int maximumStringLength)> stringFromValue = nullptr, | |||
std::function<float(const String& text)> valueFromString = nullptr); | |||
std::function<String (float value, int maximumStringLength)> stringFromValue = nullptr, | |||
std::function<float (const String& text)> valueFromString = nullptr); | |||
/** Creates a AudioParameterFloat with an ID, name, and range. | |||
On creation, its value is set to the default value. | |||
@@ -100,8 +107,8 @@ private: | |||
std::atomic<float> value; | |||
const float defaultValue; | |||
std::function<String(float, int)> stringFromValueFunction; | |||
std::function<float(const String&)> valueFromStringFunction; | |||
std::function<String (float, int)> stringFromValueFunction; | |||
std::function<float (const String&)> valueFromStringFunction; | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterFloat) | |||
}; | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -22,15 +29,15 @@ namespace juce | |||
AudioParameterInt::AudioParameterInt (const String& idToUse, const String& nameToUse, | |||
int minValue, int maxValue, int def, | |||
const String& labelToUse, | |||
std::function<String(int, int)> stringFromInt, | |||
std::function<int(const String&)> intFromString) | |||
std::function<String (int, int)> stringFromInt, | |||
std::function<int (const String&)> intFromString) | |||
: RangedAudioParameter (idToUse, nameToUse, labelToUse), | |||
range ([minValue, maxValue] | |||
{ | |||
NormalisableRange<float> rangeWithInterval { (float) minValue, (float) maxValue, | |||
[](float start, float end, float v) { return jlimit (start, end, v * (end - start) + start); }, | |||
[](float start, float end, float v) { return jlimit (0.0f, 1.0f, (v - start) / (end - start)); }, | |||
[](float start, float end, float v) { return (float) roundToInt (juce::jlimit (start, end, v)); } }; | |||
[] (float start, float end, float v) { return jlimit (start, end, v * (end - start) + start); }, | |||
[] (float start, float end, float v) { return jlimit (0.0f, 1.0f, (v - start) / (end - start)); }, | |||
[] (float start, float end, float v) { return (float) roundToInt (juce::jlimit (start, end, v)); } }; | |||
rangeWithInterval.interval = 1.0f; | |||
return rangeWithInterval; | |||
}()), | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -49,8 +56,8 @@ public: | |||
int minValue, int maxValue, | |||
int defaultValue, | |||
const String& parameterLabel = String(), | |||
std::function<String(int value, int maximumStringLength)> stringFromInt = nullptr, | |||
std::function<int(const String& text)> intFromString = nullptr); | |||
std::function<String (int value, int maximumStringLength)> stringFromInt = nullptr, | |||
std::function<int (const String& text)> intFromString = nullptr); | |||
/** Destructor. */ | |||
~AudioParameterInt() override; | |||
@@ -90,8 +97,8 @@ private: | |||
const NormalisableRange<float> range; | |||
std::atomic<float> value; | |||
const float defaultValue; | |||
std::function<String(int, int)> stringFromIntFunction; | |||
std::function<int(const String&)> intFromStringFunction; | |||
std::function<String (int, int)> stringFromIntFunction; | |||
std::function<int (const String&)> intFromStringFunction; | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterInt) | |||
}; | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -25,8 +32,8 @@ AudioProcessorValueTreeState::Parameter::Parameter (const String& parameterID, | |||
const String& labelText, | |||
NormalisableRange<float> valueRange, | |||
float defaultParameterValue, | |||
std::function<String(float)> valueToTextFunction, | |||
std::function<float(const String&)> textToValueFunction, | |||
std::function<String (float)> valueToTextFunction, | |||
std::function<float (const String&)> textToValueFunction, | |||
bool isMetaParameter, | |||
bool isAutomatableParameter, | |||
bool isDiscrete, | |||
@@ -38,8 +45,8 @@ AudioProcessorValueTreeState::Parameter::Parameter (const String& parameterID, | |||
defaultParameterValue, | |||
labelText, | |||
parameterCategory, | |||
valueToTextFunction == nullptr ? std::function<String(float v, int)>() | |||
: [valueToTextFunction](float v, int) { return valueToTextFunction (v); }, | |||
valueToTextFunction == nullptr ? std::function<String (float v, int)>() | |||
: [valueToTextFunction] (float v, int) { return valueToTextFunction (v); }, | |||
std::move (textToValueFunction)), | |||
unsnappedDefault (valueRange.convertTo0to1 (defaultParameterValue)), | |||
metaParameter (isMetaParameter), | |||
@@ -155,7 +162,7 @@ private: | |||
return; | |||
unnormalisedValue = newValue; | |||
listeners.call ([=](Listener& l) { l.parameterChanged (parameter.paramID, unnormalisedValue); }); | |||
listeners.call ([=] (Listener& l) { l.parameterChanged (parameter.paramID, unnormalisedValue); }); | |||
listenersNeedCalling = false; | |||
needsUpdate = true; | |||
} | |||
@@ -178,8 +185,35 @@ private: | |||
parameter.setValueNotifyingHost (value); | |||
} | |||
class LockedListeners | |||
{ | |||
public: | |||
template <typename Fn> | |||
void call (Fn&& fn) | |||
{ | |||
const CriticalSection::ScopedLockType lock (mutex); | |||
listeners.call (std::forward<Fn> (fn)); | |||
} | |||
void add (Listener* l) | |||
{ | |||
const CriticalSection::ScopedLockType lock (mutex); | |||
listeners.add (l); | |||
} | |||
void remove (Listener* l) | |||
{ | |||
const CriticalSection::ScopedLockType lock (mutex); | |||
listeners.remove (l); | |||
} | |||
private: | |||
CriticalSection mutex; | |||
ListenerList<Listener> listeners; | |||
}; | |||
RangedAudioParameter& parameter; | |||
ListenerList<Listener> listeners; | |||
LockedListeners listeners; | |||
std::atomic<float> unnormalisedValue { 0.0f }; | |||
std::atomic<bool> needsUpdate { true }, listenersNeedCalling { true }; | |||
bool ignoreParameterChangedCallbacks { false }; | |||
@@ -261,8 +295,8 @@ RangedAudioParameter* AudioProcessorValueTreeState::createAndAddParameter (const | |||
const String& labelText, | |||
NormalisableRange<float> range, | |||
float defaultVal, | |||
std::function<String(float)> valueToTextFunction, | |||
std::function<float(const String&)> textToValueFunction, | |||
std::function<String (float)> valueToTextFunction, | |||
std::function<float (const String&)> textToValueFunction, | |||
bool isMetaParameter, | |||
bool isAutomatableParameter, | |||
bool isDiscreteParameter, | |||
@@ -512,7 +546,7 @@ struct ParameterAdapterTests : public UnitTest | |||
beginTest ("Denormalised parameter values can be retrieved"); | |||
{ | |||
const auto test = [&](NormalisableRange<float> range, float value) | |||
const auto test = [&] (NormalisableRange<float> range, float value) | |||
{ | |||
AudioParameterFloat param ({}, {}, range, {}, {}); | |||
AudioProcessorValueTreeState::ParameterAdapter adapter (param); | |||
@@ -529,7 +563,7 @@ struct ParameterAdapterTests : public UnitTest | |||
beginTest ("Floats can be converted to text"); | |||
{ | |||
const auto test = [&](NormalisableRange<float> range, float value, String expected) | |||
const auto test = [&] (NormalisableRange<float> range, float value, String expected) | |||
{ | |||
AudioParameterFloat param ({}, {}, range, {}, {}); | |||
AudioProcessorValueTreeState::ParameterAdapter adapter (param); | |||
@@ -545,7 +579,7 @@ struct ParameterAdapterTests : public UnitTest | |||
beginTest ("Text can be converted to floats"); | |||
{ | |||
const auto test = [&](NormalisableRange<float> range, String text, float expected) | |||
const auto test = [&] (NormalisableRange<float> range, String text, float expected) | |||
{ | |||
AudioParameterFloat param ({}, {}, range, {}, {}); | |||
AudioProcessorValueTreeState::ParameterAdapter adapter (param); | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -254,8 +261,8 @@ public: | |||
const String& labelText, | |||
NormalisableRange<float> valueRange, | |||
float defaultValue, | |||
std::function<String(float)> valueToTextFunction, | |||
std::function<float(const String&)> textToValueFunction, | |||
std::function<String (float)> valueToTextFunction, | |||
std::function<float (const String&)> textToValueFunction, | |||
bool isMetaParameter = false, | |||
bool isAutomatableParameter = true, | |||
bool isDiscrete = false, | |||
@@ -394,8 +401,8 @@ public: | |||
const String& labelText, | |||
NormalisableRange<float> valueRange, | |||
float defaultValue, | |||
std::function<String(float)> valueToTextFunction, | |||
std::function<float(const String&)> textToValueFunction, | |||
std::function<String (float)> valueToTextFunction, | |||
std::function<float (const String&)> textToValueFunction, | |||
bool isMetaParameter = false, | |||
bool isAutomatableParameter = true, | |||
bool isDiscrete = false, | |||
@@ -514,7 +521,7 @@ private: | |||
@endcode | |||
*/ | |||
JUCE_DEPRECATED (std::unique_ptr<RangedAudioParameter> createParameter (const String&, const String&, const String&, NormalisableRange<float>, | |||
float, std::function<String(float)>, std::function<float(const String&)>, | |||
float, std::function<String (float)>, std::function<float (const String&)>, | |||
bool, bool, bool, AudioProcessorParameter::Category, bool)); | |||
//============================================================================== | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -33,6 +40,8 @@ namespace juce | |||
Make sure to call `sendInitialUpdate` at the end of your new attachment's | |||
constructor, so that the UI immediately reflects the state of the parameter. | |||
@tags{Audio} | |||
*/ | |||
class ParameterAttachment : private AudioProcessorParameter::Listener, | |||
private AsyncUpdater | |||
@@ -49,7 +58,7 @@ public: | |||
requests a parameter change. | |||
*/ | |||
ParameterAttachment (RangedAudioParameter& parameter, | |||
std::function<void(float)> parameterChangedCallback, | |||
std::function<void (float)> parameterChangedCallback, | |||
UndoManager* undoManager = nullptr); | |||
/** Destructor. */ | |||
@@ -105,7 +114,7 @@ private: | |||
RangedAudioParameter& parameter; | |||
std::atomic<float> lastValue { 0.0f }; | |||
UndoManager* undoManager = nullptr; | |||
std::function<void(float)> setValue; | |||
std::function<void (float)> setValue; | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ParameterAttachment) | |||
}; | |||
@@ -118,6 +127,8 @@ private: | |||
it easy to connect a slider to a parameter. When this object is deleted, the | |||
connection is broken. Make sure that your parameter and Slider are not | |||
deleted before this object! | |||
@tags{Audio} | |||
*/ | |||
class SliderParameterAttachment : private Slider::Listener | |||
{ | |||
@@ -164,6 +175,8 @@ private: | |||
easy to connect a combo box to a parameter. When this object is deleted, the | |||
connection is broken. Make sure that your parameter and ComboBox are not deleted | |||
before this object! | |||
@tags{Audio} | |||
*/ | |||
class ComboBoxParameterAttachment : private ComboBox::Listener | |||
{ | |||
@@ -202,6 +215,8 @@ private: | |||
easy to connect a button to a parameter. When this object is deleted, the | |||
connection is broken. Make sure that your parameter and Button are not deleted | |||
before this object! | |||
@tags{Audio} | |||
*/ | |||
class ButtonParameterAttachment : private Button::Listener | |||
{ | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -54,7 +54,7 @@ public: | |||
int numArguments; | |||
}; | |||
using NativeFunction = std::function<var(const NativeFunctionArgs&)>; | |||
using NativeFunction = std::function<var (const NativeFunctionArgs&)>; | |||
//============================================================================== | |||
/** Creates a void variant. */ | |||
@@ -24,7 +24,11 @@ namespace juce | |||
{ | |||
//============================================================================== | |||
/** Describes the attributes of a file or folder. */ | |||
/** | |||
Describes the attributes of a file or folder. | |||
@tags{Core} | |||
*/ | |||
class DirectoryEntry final | |||
{ | |||
public: | |||
@@ -80,6 +84,8 @@ inline const DirectoryEntry& operator* (const DirectoryEntry& e) noexcept { retu | |||
if (entry.isHidden()) | |||
hiddenFiles.push_back (entry.getFile()); | |||
@endcode | |||
@tags{Core} | |||
*/ | |||
class RangedDirectoryIterator final | |||
{ | |||
@@ -25,7 +25,7 @@ | |||
The block below describes the properties of this module, and is read by | |||
the Projucer to automatically generate project code that uses it. | |||
For details about the syntax and how to create or use a module, see the | |||
JUCE Module Format.txt file. | |||
JUCE Module Format.md file. | |||
BEGIN_JUCE_MODULE_DECLARATION | |||
@@ -1,13 +1,17 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
The code included in this file is provided under the terms of the ISC license | |||
http://www.isc.org/downloads/software-support-policy/isc-license. Permission | |||
To use, copy, modify, and/or distribute this software for any purpose with or | |||
without fee is hereby granted provided that the above copyright notice and | |||
this permission notice appear in all copies. | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,17 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
The code included in this file is provided under the terms of the ISC license | |||
http://www.isc.org/downloads/software-support-policy/isc-license. Permission | |||
To use, copy, modify, and/or distribute this software for any purpose with or | |||
without fee is hereby granted provided that the above copyright notice and | |||
this permission notice appear in all copies. | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -264,7 +264,7 @@ struct ConsoleApplication | |||
String longDescription; | |||
/** The actual command that should be invoked to perform this action. */ | |||
std::function<void(const ArgumentList&)> command; | |||
std::function<void (const ArgumentList&)> command; | |||
}; | |||
//============================================================================== | |||
@@ -91,7 +91,7 @@ public: | |||
//============================================================================== | |||
/** Function type of runtime permission request callbacks. */ | |||
using Callback = std::function<void(bool)>; | |||
using Callback = std::function<void (bool)>; | |||
//============================================================================== | |||
/** Call this method to request a runtime permission. | |||
@@ -620,7 +620,7 @@ class ActivityLauncher : public FragmentOverlay | |||
public: | |||
ActivityLauncher (const LocalRef<jobject>& intentToUse, | |||
int requestCodeToUse, | |||
std::function<void(int, int, LocalRef<jobject>)> && callbackToUse) | |||
std::function<void (int, int, LocalRef<jobject>)> && callbackToUse) | |||
: intent (intentToUse), requestCode (requestCodeToUse), callback (std::move (callbackToUse)) | |||
{} | |||
@@ -642,11 +642,11 @@ public: | |||
private: | |||
GlobalRef intent; | |||
int requestCode; | |||
std::function<void(int, int, LocalRef<jobject>)> callback; | |||
std::function<void (int, int, LocalRef<jobject>)> callback; | |||
}; | |||
void startAndroidActivityForResult (const LocalRef<jobject>& intent, int requestCode, | |||
std::function<void(int, int, LocalRef<jobject>)> && callback) | |||
std::function<void (int, int, LocalRef<jobject>)> && callback) | |||
{ | |||
auto* activityLauncher = new ActivityLauncher (intent, requestCode, std::move (callback)); | |||
activityLauncher->open(); | |||
@@ -983,7 +983,7 @@ public: | |||
//============================================================================== | |||
// Allows you to start an activity without requiring to have an activity | |||
void startAndroidActivityForResult (const LocalRef<jobject>& intent, int requestCode, | |||
std::function<void(int, int, LocalRef<jobject>)> && callback); | |||
std::function<void (int, int, LocalRef<jobject>)> && callback); | |||
//============================================================================== | |||
bool androidHasSystemFeature (const String& property); | |||
@@ -280,7 +280,7 @@ namespace SocketHelpers | |||
if (! lock.isLocked()) | |||
return -1; | |||
auto hasErrorOccurred = [&handle] () -> bool | |||
auto hasErrorOccurred = [&handle]() -> bool | |||
{ | |||
auto h = (SocketHandle) handle.load(); | |||
@@ -343,7 +343,7 @@ public: | |||
c = *text; | |||
auto writeExponentDigits = [](int exponent, char* destination) | |||
auto writeExponentDigits = [] (int exponent, char* destination) | |||
{ | |||
auto exponentDivisor = 100; | |||
@@ -812,9 +812,10 @@ namespace StringHelpers | |||
} | |||
} | |||
String& String::operator+= (const int number) { return StringHelpers::operationAddAssign<int> (*this, number); } | |||
String& String::operator+= (const int64 number) { return StringHelpers::operationAddAssign<int64> (*this, number); } | |||
String& String::operator+= (const uint64 number) { return StringHelpers::operationAddAssign<uint64> (*this, number); } | |||
String& String::operator+= (const int number) { return StringHelpers::operationAddAssign<int> (*this, number); } | |||
String& String::operator+= (const long number) { return StringHelpers::operationAddAssign<long> (*this, number); } | |||
String& String::operator+= (const int64 number) { return StringHelpers::operationAddAssign<int64> (*this, number); } | |||
String& String::operator+= (const uint64 number) { return StringHelpers::operationAddAssign<uint64> (*this, number); } | |||
//============================================================================== | |||
JUCE_API String JUCE_CALLTYPE operator+ (const char* s1, const String& s2) { String s (s1); return s += s2; } | |||
@@ -199,15 +199,11 @@ void UnitTestRunner::beginNewTest (UnitTest* const test, const String& subCatego | |||
endTest(); | |||
currentTest = test; | |||
auto* r = new TestResult(); | |||
results.add (r); | |||
r->unitTestName = test->getName(); | |||
r->subcategoryName = subCategory; | |||
r->passes = 0; | |||
r->failures = 0; | |||
auto testName = test->getName(); | |||
results.add (new TestResult (testName, subCategory)); | |||
logMessage ("-----------------------------------------------------------------"); | |||
logMessage ("Starting test: " + r->unitTestName + " / " + subCategory + "..."); | |||
logMessage ("Starting test: " + testName + " / " + subCategory + "..."); | |||
resultsUpdated(); | |||
} | |||
@@ -216,6 +212,8 @@ void UnitTestRunner::endTest() | |||
{ | |||
if (auto* r = results.getLast()) | |||
{ | |||
r->endTime = Time::getCurrentTime(); | |||
if (r->failures > 0) | |||
{ | |||
String m ("FAILED!! "); | |||
@@ -376,18 +376,31 @@ public: | |||
*/ | |||
struct TestResult | |||
{ | |||
TestResult() = default; | |||
explicit TestResult (const String& name, const String& subCategory) | |||
: unitTestName (name), | |||
subcategoryName (subCategory) | |||
{ | |||
} | |||
/** The main name of this test (i.e. the name of the UnitTest object being run). */ | |||
String unitTestName; | |||
/** The name of the current subcategory (i.e. the name that was set when UnitTest::beginTest() was called). */ | |||
String subcategoryName; | |||
/** The number of UnitTest::expect() calls that succeeded. */ | |||
int passes; | |||
int passes = 0; | |||
/** The number of UnitTest::expect() calls that failed. */ | |||
int failures; | |||
int failures = 0; | |||
/** A list of messages describing the failed tests. */ | |||
StringArray messages; | |||
/** The time at which this test was started. */ | |||
Time startTime = Time::getCurrentTime(); | |||
/** The time at which this test ended. */ | |||
Time endTime; | |||
}; | |||
/** Returns the number of TestResult objects that have been performed. | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -21,7 +28,7 @@ | |||
The block below describes the properties of this module, and is read by | |||
the Projucer to automatically generate project code that uses it. | |||
For details about the syntax and how to create or use a module, see the | |||
JUCE Module Format.txt file. | |||
JUCE Module Format.md file. | |||
BEGIN_JUCE_MODULE_DECLARATION | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||
@@ -1,13 +1,20 @@ | |||
/* | |||
============================================================================== | |||
This file is part of the JUCE 6 technical preview. | |||
This file is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited | |||
You may use this code under the terms of the GPL v3 | |||
(see www.gnu.org/licenses). | |||
JUCE is an open source library subject to commercial or open-source | |||
licensing. | |||
For this technical preview, this file is not subject to commercial licensing. | |||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License | |||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). | |||
End User License Agreement: www.juce.com/juce-6-licence | |||
Privacy Policy: www.juce.com/juce-privacy-policy | |||
Or: You may also use this code under the terms of the GPL v3 (see | |||
www.gnu.org/licenses). | |||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER | |||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE | |||