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

Minor whitespace tidying

This commit is contained in:
ed 2019-03-14 16:28:51 +00:00
parent b6f0b2d0aa
commit 1a46fb3a5f
42 changed files with 106 additions and 106 deletions

View file

@ -174,11 +174,11 @@ void AudioPluginFormat::createPluginInstanceAsync (const PluginDescription& desc
void AudioPluginFormat::createPluginInstanceAsync (const PluginDescription& description, void AudioPluginFormat::createPluginInstanceAsync (const PluginDescription& description,
double initialSampleRate, double initialSampleRate,
int initialBufferSize, int initialBufferSize,
std::function<void (AudioPluginInstance*, const String&)> f) std::function<void(AudioPluginInstance*, const String&)> f)
{ {
struct CallbackInvoker : public AudioPluginFormat::InstantiationCompletionCallback struct CallbackInvoker : public AudioPluginFormat::InstantiationCompletionCallback
{ {
CallbackInvoker (std::function<void (AudioPluginInstance*, const String&)> inCompletion) CallbackInvoker (std::function<void(AudioPluginInstance*, const String&)> inCompletion)
: completion (inCompletion) : completion (inCompletion)
{} {}
@ -187,7 +187,7 @@ void AudioPluginFormat::createPluginInstanceAsync (const PluginDescription& desc
completion (instance, error); completion (instance, error);
} }
std::function<void (AudioPluginInstance*, const String&)> completion; std::function<void(AudioPluginInstance*, const String&)> completion;
}; };
createPluginInstanceAsync (description, initialSampleRate, initialBufferSize, new CallbackInvoker (f)); createPluginInstanceAsync (description, initialSampleRate, initialBufferSize, new CallbackInvoker (f));

View file

@ -98,7 +98,7 @@ public:
void createPluginInstanceAsync (const PluginDescription& description, void createPluginInstanceAsync (const PluginDescription& description,
double initialSampleRate, double initialSampleRate,
int initialBufferSize, int initialBufferSize,
std::function<void (AudioPluginInstance*, const String&)> completionCallback); std::function<void(AudioPluginInstance*, const String&)> completionCallback);
/** Should do a quick check to see if this file or directory might be a plugin of /** Should do a quick check to see if this file or directory might be a plugin of
this format. this format.

View file

@ -46,7 +46,7 @@ namespace PluginFormatManagerHelpers
struct ErrorLambdaOnMessageThread : public CallbackMessage struct ErrorLambdaOnMessageThread : public CallbackMessage
{ {
ErrorLambdaOnMessageThread (const String& inError, ErrorLambdaOnMessageThread (const String& inError,
std::function<void (AudioPluginInstance*, const String&)> f) std::function<void(AudioPluginInstance*, const String&)> f)
: error (inError), lambda (f) : error (inError), lambda (f)
{ {
} }
@ -54,7 +54,7 @@ namespace PluginFormatManagerHelpers
void messageCallback() override { lambda (nullptr, error); } void messageCallback() override { lambda (nullptr, error); }
String error; String error;
std::function<void (AudioPluginInstance*, const String&)> lambda; std::function<void(AudioPluginInstance*, const String&)> lambda;
}; };
} }
@ -145,7 +145,7 @@ void AudioPluginFormatManager::createPluginInstanceAsync (const PluginDescriptio
void AudioPluginFormatManager::createPluginInstanceAsync (const PluginDescription& description, void AudioPluginFormatManager::createPluginInstanceAsync (const PluginDescription& description,
double initialSampleRate, double initialSampleRate,
int initialBufferSize, int initialBufferSize,
std::function<void (AudioPluginInstance*, const String&)> f) std::function<void(AudioPluginInstance*, const String&)> f)
{ {
String error; String error;

View file

@ -119,7 +119,7 @@ public:
void createPluginInstanceAsync (const PluginDescription& description, void createPluginInstanceAsync (const PluginDescription& description,
double initialSampleRate, double initialSampleRate,
int initialBufferSize, int initialBufferSize,
std::function<void (AudioPluginInstance*, const String&)> completionCallback); std::function<void(AudioPluginInstance*, const String&)> completionCallback);
/** Checks that the file or component for this plugin actually still exists. /** Checks that the file or component for this plugin actually still exists.

View file

@ -1367,8 +1367,8 @@ public:
Unknown = -1 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 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. // For some curve types, your plug-in may already measure the current input and output values.
// An host can use to indicate where on the curve the current signal is (for example // An host can use to indicate where on the curve the current signal is (for example

View file

@ -29,8 +29,8 @@ namespace juce
AudioParameterBool::AudioParameterBool (const String& idToUse, const String& nameToUse, AudioParameterBool::AudioParameterBool (const String& idToUse, const String& nameToUse,
bool def, const String& labelToUse, bool def, const String& labelToUse,
std::function<String (bool, int)> stringFromBool, std::function<String(bool, int)> stringFromBool,
std::function<bool (const String&)> boolFromString) std::function<bool(const String&)> boolFromString)
: RangedAudioParameter (idToUse, nameToUse, labelToUse), : RangedAudioParameter (idToUse, nameToUse, labelToUse),
value (def ? 1.0f : 0.0f), value (def ? 1.0f : 0.0f),
defaultValue (value), defaultValue (value),

View file

@ -52,8 +52,8 @@ public:
*/ */
AudioParameterBool (const String& parameterID, const String& name, bool defaultValue, AudioParameterBool (const String& parameterID, const String& name, bool defaultValue,
const String& label = String(), const String& label = String(),
std::function<String (bool value, int maximumStringLength)> stringFromBool = nullptr, std::function<String(bool value, int maximumStringLength)> stringFromBool = nullptr,
std::function<bool (const String& text)> boolFromString = nullptr); std::function<bool(const String& text)> boolFromString = nullptr);
/** Destructor. */ /** Destructor. */
~AudioParameterBool() override; ~AudioParameterBool() override;
@ -90,8 +90,8 @@ private:
const NormalisableRange<float> range { 0.0f, 1.0f, 1.0f }; const NormalisableRange<float> range { 0.0f, 1.0f, 1.0f };
float value; float value;
const float defaultValue; const float defaultValue;
std::function<String (bool, int)> stringFromBoolFunction; std::function<String(bool, int)> stringFromBoolFunction;
std::function<bool (const String&)> boolFromStringFunction; std::function<bool(const String&)> boolFromStringFunction;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterBool) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterBool)
}; };

View file

@ -29,8 +29,8 @@ namespace juce
AudioParameterChoice::AudioParameterChoice (const String& idToUse, const String& nameToUse, AudioParameterChoice::AudioParameterChoice (const String& idToUse, const String& nameToUse,
const StringArray& c, int def, const String& labelToUse, const StringArray& c, int def, const String& labelToUse,
std::function<String (int, int)> stringFromIndex, std::function<String(int, int)> stringFromIndex,
std::function<int (const String&)> indexFromString) std::function<int(const String&)> indexFromString)
: RangedAudioParameter (idToUse, nameToUse, labelToUse), choices (c), : RangedAudioParameter (idToUse, nameToUse, labelToUse), choices (c),
range (0.0f, choices.size() - 1.0f, range (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, end, v * end); },

View file

@ -56,8 +56,8 @@ public:
const StringArray& choices, const StringArray& choices,
int defaultItemIndex, int defaultItemIndex,
const String& label = String(), const String& label = String(),
std::function<String (int index, int maximumStringLength)> stringFromIndex = nullptr, std::function<String(int index, int maximumStringLength)> stringFromIndex = nullptr,
std::function<int (const String& text)> indexFromString = nullptr); std::function<int(const String& text)> indexFromString = nullptr);
/** Destructor. */ /** Destructor. */
~AudioParameterChoice() override; ~AudioParameterChoice() override;
@ -102,8 +102,8 @@ private:
const NormalisableRange<float> range; const NormalisableRange<float> range;
float value; float value;
const float defaultValue; const float defaultValue;
std::function<String (int, int)> stringFromIndexFunction; std::function<String(int, int)> stringFromIndexFunction;
std::function<int (const String&)> indexFromStringFunction; std::function<int(const String&)> indexFromStringFunction;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterChoice) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterChoice)
}; };

View file

@ -30,8 +30,8 @@ namespace juce
AudioParameterFloat::AudioParameterFloat (const String& idToUse, const String& nameToUse, AudioParameterFloat::AudioParameterFloat (const String& idToUse, const String& nameToUse,
NormalisableRange<float> r, float def, NormalisableRange<float> r, float def,
const String& labelToUse, Category categoryToUse, const String& labelToUse, Category categoryToUse,
std::function<String (float, int)> stringFromValue, std::function<String(float, int)> stringFromValue,
std::function<float (const String&)> valueFromString) std::function<float(const String&)> valueFromString)
: RangedAudioParameter (idToUse, nameToUse, labelToUse, categoryToUse), : RangedAudioParameter (idToUse, nameToUse, labelToUse, categoryToUse),
range (r), value (def), defaultValue (def), range (r), value (def), defaultValue (def),
stringFromValueFunction (stringFromValue), stringFromValueFunction (stringFromValue),

View file

@ -59,8 +59,8 @@ public:
float defaultValue, float defaultValue,
const String& label = String(), const String& label = String(),
Category category = AudioProcessorParameter::genericParameter, Category category = AudioProcessorParameter::genericParameter,
std::function<String (float value, int maximumStringLength)> stringFromValue = nullptr, std::function<String(float value, int maximumStringLength)> stringFromValue = nullptr,
std::function<float (const String& text)> valueFromString = nullptr); std::function<float(const String& text)> valueFromString = nullptr);
/** Creates a AudioParameterFloat with an ID, name, and range. /** Creates a AudioParameterFloat with an ID, name, and range.
On creation, its value is set to the default value. On creation, its value is set to the default value.
@ -108,8 +108,8 @@ private:
float value; float value;
const float defaultValue; const float defaultValue;
std::function<String (float, int)> stringFromValueFunction; std::function<String(float, int)> stringFromValueFunction;
std::function<float (const String&)> valueFromStringFunction; std::function<float(const String&)> valueFromStringFunction;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterFloat) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterFloat)
}; };

View file

@ -30,8 +30,8 @@ namespace juce
AudioParameterInt::AudioParameterInt (const String& idToUse, const String& nameToUse, AudioParameterInt::AudioParameterInt (const String& idToUse, const String& nameToUse,
int minValue, int maxValue, int def, int minValue, int maxValue, int def,
const String& labelToUse, const String& labelToUse,
std::function<String (int, int)> stringFromInt, std::function<String(int, int)> stringFromInt,
std::function<int (const String&)> intFromString) std::function<int(const String&)> intFromString)
: RangedAudioParameter (idToUse, nameToUse, labelToUse), : RangedAudioParameter (idToUse, nameToUse, labelToUse),
range ((float) minValue, (float) maxValue, range ((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 (start, end, v * (end - start) + start); },

View file

@ -57,8 +57,8 @@ public:
int minValue, int maxValue, int minValue, int maxValue,
int defaultValue, int defaultValue,
const String& label = String(), const String& label = String(),
std::function<String (int value, int maximumStringLength)> stringFromInt = nullptr, std::function<String(int value, int maximumStringLength)> stringFromInt = nullptr,
std::function<int (const String& text)> intFromString = nullptr); std::function<int(const String& text)> intFromString = nullptr);
/** Destructor. */ /** Destructor. */
~AudioParameterInt() override; ~AudioParameterInt() override;
@ -98,8 +98,8 @@ private:
const NormalisableRange<float> range; const NormalisableRange<float> range;
float value; float value;
const float defaultValue; const float defaultValue;
std::function<String (int, int)> stringFromIntFunction; std::function<String(int, int)> stringFromIntFunction;
std::function<int (const String&)> intFromStringFunction; std::function<int(const String&)> intFromStringFunction;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterInt) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterInt)
}; };

View file

@ -33,8 +33,8 @@ AudioProcessorValueTreeState::Parameter::Parameter (const String& parameterID,
const String& labelText, const String& labelText,
NormalisableRange<float> valueRange, NormalisableRange<float> valueRange,
float defaultValue, float defaultValue,
std::function<String (float)> valueToTextFunction, std::function<String(float)> valueToTextFunction,
std::function<float (const String&)> textToValueFunction, std::function<float(const String&)> textToValueFunction,
bool isMetaParameter, bool isMetaParameter,
bool isAutomatableParameter, bool isAutomatableParameter,
bool isDiscrete, bool isDiscrete,
@ -46,7 +46,7 @@ AudioProcessorValueTreeState::Parameter::Parameter (const String& parameterID,
defaultValue, defaultValue,
labelText, labelText,
category, category,
valueToTextFunction == nullptr ? std::function<String (float v, int)>() valueToTextFunction == nullptr ? std::function<String(float v, int)>()
: [valueToTextFunction](float v, int) { return valueToTextFunction (v); }, : [valueToTextFunction](float v, int) { return valueToTextFunction (v); },
std::move (textToValueFunction)), std::move (textToValueFunction)),
unsnappedDefault (valueRange.convertTo0to1 (defaultValue)), unsnappedDefault (valueRange.convertTo0to1 (defaultValue)),
@ -252,8 +252,8 @@ RangedAudioParameter* AudioProcessorValueTreeState::createAndAddParameter (const
const String& labelText, const String& labelText,
NormalisableRange<float> range, NormalisableRange<float> range,
float defaultVal, float defaultVal,
std::function<String (float)> valueToTextFunction, std::function<String(float)> valueToTextFunction,
std::function<float (const String&)> textToValueFunction, std::function<float(const String&)> textToValueFunction,
bool isMetaParameter, bool isMetaParameter,
bool isAutomatableParameter, bool isAutomatableParameter,
bool isDiscreteParameter, bool isDiscreteParameter,

View file

@ -262,8 +262,8 @@ public:
const String& labelText, const String& labelText,
NormalisableRange<float> valueRange, NormalisableRange<float> valueRange,
float defaultValue, float defaultValue,
std::function<String (float)> valueToTextFunction, std::function<String(float)> valueToTextFunction,
std::function<float (const String&)> textToValueFunction, std::function<float(const String&)> textToValueFunction,
bool isMetaParameter = false, bool isMetaParameter = false,
bool isAutomatableParameter = true, bool isAutomatableParameter = true,
bool isDiscrete = false, bool isDiscrete = false,
@ -516,7 +516,7 @@ private:
@endcode @endcode
*/ */
JUCE_DEPRECATED (std::unique_ptr<RangedAudioParameter> createParameter (const String&, const String&, const String&, NormalisableRange<float>, 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)); bool, bool, bool, AudioProcessorParameter::Category, bool));
//============================================================================== //==============================================================================

View file

@ -440,7 +440,7 @@ public:
/** Sends a firmware update packet to a block, and waits for a reply. Returns an error code. */ /** Sends a firmware update packet to a block, and waits for a reply. Returns an error code. */
virtual bool sendFirmwareUpdatePacket (const uint8* data, uint8 size, virtual bool sendFirmwareUpdatePacket (const uint8* data, uint8 size,
std::function<void (uint8, uint32)> packetAckCallback) = 0; std::function<void(uint8, uint32)> packetAckCallback) = 0;
/** Provides a callback that will be called when a config changes. */ /** Provides a callback that will be called when a config changes. */
virtual void setConfigChangedCallback (std::function<void(Block&, const ConfigMetaData&, uint32)>) = 0; virtual void setConfigChangedCallback (std::function<void(Block&, const ConfigMetaData&, uint32)>) = 0;

View file

@ -384,7 +384,7 @@ public:
remoteHeap.handleACKFromDevice (*this, packetCounter); remoteHeap.handleACKFromDevice (*this, packetCounter);
} }
bool sendFirmwareUpdatePacket (const uint8* data, uint8 size, std::function<void (uint8, uint32)> callback) override bool sendFirmwareUpdatePacket (const uint8* data, uint8 size, std::function<void(uint8, uint32)> callback) override
{ {
firmwarePacketAckCallback = {}; firmwarePacketAckCallback = {};

View file

@ -62,7 +62,7 @@ public:
virtual ~DeviceConnection(); virtual ~DeviceConnection();
virtual bool sendMessageToDevice (const void* data, size_t dataSize) = 0; virtual bool sendMessageToDevice (const void* data, size_t dataSize) = 0;
std::function<void (const void* data, size_t dataSize)> handleMessageFromDevice; std::function<void(const void* data, size_t dataSize)> handleMessageFromDevice;
}; };
/** For custom transport systems, this represents a connected device */ /** For custom transport systems, this represents a connected device */

View file

@ -57,7 +57,7 @@ public:
int numArguments; int numArguments;
}; };
using NativeFunction = std::function<var (const NativeFunctionArgs&)>; using NativeFunction = std::function<var(const NativeFunctionArgs&)>;
//============================================================================== //==============================================================================
/** Creates a void variant. */ /** Creates a void variant. */

View file

@ -125,9 +125,9 @@ public:
*/ */
NormalisableRange (ValueType rangeStart, NormalisableRange (ValueType rangeStart,
ValueType rangeEnd, ValueType rangeEnd,
std::function<ValueType (ValueType currentRangeStart, ValueType currentRangeEnd, ValueType normalisedValue)> convertFrom0To1Func, std::function<ValueType(ValueType currentRangeStart, ValueType currentRangeEnd, ValueType normalisedValue)> convertFrom0To1Func,
std::function<ValueType (ValueType currentRangeStart, ValueType currentRangeEnd, ValueType mappedValue)> convertTo0To1Func, std::function<ValueType(ValueType currentRangeStart, ValueType currentRangeEnd, ValueType mappedValue)> convertTo0To1Func,
std::function<ValueType (ValueType currentRangeStart, ValueType currentRangeEnd, ValueType valueToSnap)> snapToLegalValueFunc = nullptr) noexcept std::function<ValueType(ValueType currentRangeStart, ValueType currentRangeEnd, ValueType valueToSnap)> snapToLegalValueFunc = nullptr) noexcept
: start (rangeStart), : start (rangeStart),
end (rangeEnd), end (rangeEnd),
convertFrom0To1Function (convertFrom0To1Func), convertFrom0To1Function (convertFrom0To1Func),

View file

@ -91,7 +91,7 @@ public:
//============================================================================== //==============================================================================
/** Function type of runtime permission request callbacks. */ /** 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. /** Call this method to request a runtime permission.

View file

@ -606,7 +606,7 @@ class ActivityLauncher : public FragmentOverlay
public: public:
ActivityLauncher (const LocalRef<jobject>& intentToUse, ActivityLauncher (const LocalRef<jobject>& intentToUse,
int requestCodeToUse, 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)) : intent (intentToUse), requestCode (requestCodeToUse), callback (std::move (callbackToUse))
{} {}
@ -628,11 +628,11 @@ public:
private: private:
GlobalRef intent; GlobalRef intent;
int requestCode; 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, 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)); auto* activityLauncher = new ActivityLauncher (intent, requestCode, std::move (callback));
activityLauncher->open(); activityLauncher->open();

View file

@ -966,7 +966,7 @@ public:
//============================================================================== //==============================================================================
// Allows you to start an activity without requiring to have an activity // Allows you to start an activity without requiring to have an activity
void startAndroidActivityForResult (const LocalRef<jobject>& intent, int requestCode, 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); bool androidHasSystemFeature (const String& property);

View file

@ -36,7 +36,7 @@ LookupTable<FloatType>::LookupTable()
} }
template <typename FloatType> template <typename FloatType>
LookupTable<FloatType>::LookupTable (const std::function<FloatType (size_t)>& functionToApproximate, LookupTable<FloatType>::LookupTable (const std::function<FloatType(size_t)>& functionToApproximate,
size_t numPointsToUse) size_t numPointsToUse)
{ {
initialise (functionToApproximate, numPointsToUse); initialise (functionToApproximate, numPointsToUse);
@ -44,7 +44,7 @@ LookupTable<FloatType>::LookupTable (const std::function<FloatType (size_t)>& fu
//============================================================================== //==============================================================================
template <typename FloatType> template <typename FloatType>
void LookupTable<FloatType>::initialise (const std::function<FloatType (size_t)>& functionToApproximate, void LookupTable<FloatType>::initialise (const std::function<FloatType(size_t)>& functionToApproximate,
size_t numPointsToUse) size_t numPointsToUse)
{ {
data.resize (static_cast<int> (getRequiredBufferSize (numPointsToUse))); data.resize (static_cast<int> (getRequiredBufferSize (numPointsToUse)));
@ -72,7 +72,7 @@ void LookupTable<FloatType>::prepare() noexcept
} }
template <typename FloatType> template <typename FloatType>
void LookupTableTransform<FloatType>::initialise (const std::function<FloatType (FloatType)>& functionToApproximate, void LookupTableTransform<FloatType>::initialise (const std::function<FloatType(FloatType)>& functionToApproximate,
FloatType minInputValueToUse, FloatType minInputValueToUse,
FloatType maxInputValueToUse, FloatType maxInputValueToUse,
size_t numPoints) size_t numPoints)
@ -98,7 +98,7 @@ void LookupTableTransform<FloatType>::initialise (const std::function<FloatType
//============================================================================== //==============================================================================
template <typename FloatType> template <typename FloatType>
double LookupTableTransform<FloatType>::calculateMaxRelativeError (const std::function<FloatType (FloatType)>& functionToApproximate, double LookupTableTransform<FloatType>::calculateMaxRelativeError (const std::function<FloatType(FloatType)>& functionToApproximate,
FloatType minInputValue, FloatType minInputValue,
FloatType maxInputValue, FloatType maxInputValue,
size_t numPoints, size_t numPoints,

View file

@ -68,7 +68,7 @@ public:
mapping from the integer range [0, numPointsToUse - 1]. mapping from the integer range [0, numPointsToUse - 1].
@param numPointsToUse The number of pre-calculated values stored. @param numPointsToUse The number of pre-calculated values stored.
*/ */
LookupTable (const std::function<FloatType (size_t)>& functionToApproximate, size_t numPointsToUse); LookupTable (const std::function<FloatType(size_t)>& functionToApproximate, size_t numPointsToUse);
/** Initialises or changes the parameters of a LookupTable object. /** Initialises or changes the parameters of a LookupTable object.
@ -80,7 +80,7 @@ public:
mapping from the integer range [0, numPointsToUse - 1]. mapping from the integer range [0, numPointsToUse - 1].
@param numPointsToUse The number of pre-calculated values stored. @param numPointsToUse The number of pre-calculated values stored.
*/ */
void initialise (const std::function<FloatType (size_t)>& functionToApproximate, size_t numPointsToUse); void initialise (const std::function<FloatType(size_t)>& functionToApproximate, size_t numPointsToUse);
//============================================================================== //==============================================================================
/** Calculates the approximated value for the given index without range checking. /** Calculates the approximated value for the given index without range checking.
@ -196,7 +196,7 @@ public:
fail for values higher than this. fail for values higher than this.
@param numPoints The number of pre-calculated values stored. @param numPoints The number of pre-calculated values stored.
*/ */
LookupTableTransform (const std::function<FloatType (FloatType)>& functionToApproximate, LookupTableTransform (const std::function<FloatType(FloatType)>& functionToApproximate,
FloatType minInputValueToUse, FloatType minInputValueToUse,
FloatType maxInputValueToUse, FloatType maxInputValueToUse,
size_t numPoints) size_t numPoints)
@ -215,7 +215,7 @@ public:
fail for values higher than this. fail for values higher than this.
@param numPoints The number of pre-calculated values stored. @param numPoints The number of pre-calculated values stored.
*/ */
void initialise (const std::function<FloatType (FloatType)>& functionToApproximate, void initialise (const std::function<FloatType(FloatType)>& functionToApproximate,
FloatType minInputValueToUse, FloatType minInputValueToUse,
FloatType maxInputValueToUse, FloatType maxInputValueToUse,
size_t numPoints); size_t numPoints);
@ -309,7 +309,7 @@ public:
accuracy of the error calculation. If it's zero accuracy of the error calculation. If it's zero
then 100 * numPoints will be used. then 100 * numPoints will be used.
*/ */
static double calculateMaxRelativeError (const std::function<FloatType (FloatType)>& functionToApproximate, static double calculateMaxRelativeError (const std::function<FloatType(FloatType)>& functionToApproximate,
FloatType minInputValue, FloatType minInputValue,
FloatType maxInputValue, FloatType maxInputValue,
size_t numPoints, size_t numPoints,

View file

@ -51,7 +51,7 @@ public:
If lookup table is not zero, then the function will be approximated If lookup table is not zero, then the function will be approximated
with a lookup table. with a lookup table.
*/ */
Oscillator (const std::function<NumericType (NumericType)>& function, Oscillator (const std::function<NumericType(NumericType)>& function,
size_t lookupTableNumPoints = 0) size_t lookupTableNumPoints = 0)
{ {
initialise (function, lookupTableNumPoints); initialise (function, lookupTableNumPoints);
@ -61,7 +61,7 @@ public:
bool isInitialised() const noexcept { return static_cast<bool> (generator); } bool isInitialised() const noexcept { return static_cast<bool> (generator); }
/** Initialises the oscillator with a waveform. */ /** Initialises the oscillator with a waveform. */
void initialise (const std::function<NumericType (NumericType)>& function, void initialise (const std::function<NumericType(NumericType)>& function,
size_t lookupTableNumPoints = 0) size_t lookupTableNumPoints = 0)
{ {
if (lookupTableNumPoints != 0) if (lookupTableNumPoints != 0)
@ -240,7 +240,7 @@ public:
private: private:
//============================================================================== //==============================================================================
std::function<NumericType (NumericType)> generator; std::function<NumericType(NumericType)> generator;
std::unique_ptr<LookupTableTransform<NumericType>> lookupTable; std::unique_ptr<LookupTableTransform<NumericType>> lookupTable;
Array<NumericType> rampBuffer; Array<NumericType> rampBuffer;
SmoothedValue<NumericType> frequency { static_cast<NumericType> (440.0) }; SmoothedValue<NumericType> frequency { static_cast<NumericType> (440.0) };

View file

@ -152,7 +152,7 @@ ContentSharer::ContentSharer() {}
ContentSharer::~ContentSharer() { clearSingletonInstance(); } ContentSharer::~ContentSharer() { clearSingletonInstance(); }
void ContentSharer::shareFiles (const Array<URL>& files, void ContentSharer::shareFiles (const Array<URL>& files,
std::function<void (bool, const String&)> callbackToUse) std::function<void(bool, const String&)> callbackToUse)
{ {
#if JUCE_IOS || JUCE_ANDROID #if JUCE_IOS || JUCE_ANDROID
startNewShare (callbackToUse); startNewShare (callbackToUse);
@ -169,7 +169,7 @@ void ContentSharer::shareFiles (const Array<URL>& files,
} }
#if JUCE_IOS || JUCE_ANDROID #if JUCE_IOS || JUCE_ANDROID
void ContentSharer::startNewShare (std::function<void (bool, const String&)> callbackToUse) void ContentSharer::startNewShare (std::function<void(bool, const String&)> callbackToUse)
{ {
// You should not start another sharing operation before the previous one is finished. // You should not start another sharing operation before the previous one is finished.
// Forcibly stopping a previous sharing operation is rarely a good idea! // Forcibly stopping a previous sharing operation is rarely a good idea!
@ -190,7 +190,7 @@ void ContentSharer::startNewShare (std::function<void (bool, const String&)> cal
#endif #endif
void ContentSharer::shareText (const String& text, void ContentSharer::shareText (const String& text,
std::function<void (bool, const String&)> callbackToUse) std::function<void(bool, const String&)> callbackToUse)
{ {
#if JUCE_IOS || JUCE_ANDROID #if JUCE_IOS || JUCE_ANDROID
startNewShare (callbackToUse); startNewShare (callbackToUse);
@ -207,7 +207,7 @@ void ContentSharer::shareText (const String& text,
} }
void ContentSharer::shareImages (const Array<Image>& images, void ContentSharer::shareImages (const Array<Image>& images,
std::function<void (bool, const String&)> callbackToUse, std::function<void(bool, const String&)> callbackToUse,
ImageFileFormat* imageFileFormatToUse) ImageFileFormat* imageFileFormatToUse)
{ {
#if JUCE_IOS || JUCE_ANDROID #if JUCE_IOS || JUCE_ANDROID
@ -240,7 +240,7 @@ void ContentSharer::filesToSharePrepared()
#endif #endif
void ContentSharer::shareData (const MemoryBlock& mb, void ContentSharer::shareData (const MemoryBlock& mb,
std::function<void (bool, const String&)> callbackToUse) std::function<void(bool, const String&)> callbackToUse)
{ {
#if JUCE_IOS || JUCE_ANDROID #if JUCE_IOS || JUCE_ANDROID
startNewShare (callbackToUse); startNewShare (callbackToUse);
@ -257,7 +257,7 @@ void ContentSharer::sharingFinished (bool succeeded, const String& errorDescript
{ {
deleteTemporaryFiles(); deleteTemporaryFiles();
std::function<void (bool, String)> cb; std::function<void(bool, String)> cb;
std::swap (cb, callback); std::swap (cb, callback);
String error (errorDescription); String error (errorDescription);

View file

@ -53,7 +53,7 @@ public:
succeeded. Also, the optional error message is always empty on Android. succeeded. Also, the optional error message is always empty on Android.
*/ */
void shareFiles (const Array<URL>& files, void shareFiles (const Array<URL>& files,
std::function<void (bool /*success*/, const String& /*error*/)> callback); std::function<void(bool /*success*/, const String& /*error*/)> callback);
/** Shares the given text. /** Shares the given text.
@ -63,7 +63,7 @@ public:
succeeded. Also, the optional error message is always empty on Android. succeeded. Also, the optional error message is always empty on Android.
*/ */
void shareText (const String& text, void shareText (const String& text,
std::function<void (bool /*success*/, const String& /*error*/)> callback); std::function<void(bool /*success*/, const String& /*error*/)> callback);
/** A convenience function to share an image. This is useful when you have images /** A convenience function to share an image. This is useful when you have images
loaded in memory. The images will be written to temporary files first, so if loaded in memory. The images will be written to temporary files first, so if
@ -87,7 +87,7 @@ public:
succeeded. Also, the optional error message is always empty on Android. succeeded. Also, the optional error message is always empty on Android.
*/ */
void shareImages (const Array<Image>& images, void shareImages (const Array<Image>& images,
std::function<void (bool /*success*/, const String& /*error*/)> callback, std::function<void(bool /*success*/, const String& /*error*/)> callback,
ImageFileFormat* imageFileFormatToUse = nullptr); ImageFileFormat* imageFileFormatToUse = nullptr);
/** A convenience function to share arbitrary data. The data will be written /** A convenience function to share arbitrary data. The data will be written
@ -100,7 +100,7 @@ public:
succeeded. Also, the optional error message is always empty on Android. succeeded. Also, the optional error message is always empty on Android.
*/ */
void shareData (const MemoryBlock& mb, void shareData (const MemoryBlock& mb,
std::function<void (bool /*success*/, const String& /*error*/)> callback); std::function<void(bool /*success*/, const String& /*error*/)> callback);
private: private:
ContentSharer(); ContentSharer();
@ -108,7 +108,7 @@ private:
Array<File> temporaryFiles; Array<File> temporaryFiles;
std::function<void (bool, String)> callback; std::function<void(bool, String)> callback;
#if JUCE_IOS || JUCE_ANDROID #if JUCE_IOS || JUCE_ANDROID
struct Pimpl struct Pimpl
@ -121,7 +121,7 @@ private:
std::unique_ptr<Pimpl> pimpl; std::unique_ptr<Pimpl> pimpl;
Pimpl* createPimpl(); Pimpl* createPimpl();
void startNewShare (std::function<void (bool, const String&)>); void startNewShare (std::function<void(bool, const String&)>);
class ContentSharerNativeImpl; class ContentSharerNativeImpl;
friend class ContentSharerNativeImpl; friend class ContentSharerNativeImpl;

View file

@ -169,7 +169,7 @@ bool FileChooser::showDialog (const int flags, FilePreviewComponent* const previ
} }
#endif #endif
void FileChooser::launchAsync (int flags, std::function<void (const FileChooser&)> callback, void FileChooser::launchAsync (int flags, std::function<void(const FileChooser&)> callback,
FilePreviewComponent* previewComp) FilePreviewComponent* previewComp)
{ {
// You must specify a callback when using launchAsync // You must specify a callback when using launchAsync
@ -254,7 +254,7 @@ URL FileChooser::getURLResult() const
void FileChooser::finished (const Array<URL>& asyncResults) void FileChooser::finished (const Array<URL>& asyncResults)
{ {
std::function<void (const FileChooser&)> callback; std::function<void(const FileChooser&)> callback;
std::swap (callback, asyncCallback); std::swap (callback, asyncCallback);
results = asyncResults; results = asyncResults;

View file

@ -209,7 +209,7 @@ public:
the lifetime of the file-chooser. the lifetime of the file-chooser.
*/ */
void launchAsync (int flags, void launchAsync (int flags,
std::function<void (const FileChooser&)>, std::function<void(const FileChooser&)>,
FilePreviewComponent* previewComponent = nullptr); FilePreviewComponent* previewComponent = nullptr);
//============================================================================== //==============================================================================
@ -310,7 +310,7 @@ private:
Array<URL> results; Array<URL> results;
const bool useNativeDialogBox; const bool useNativeDialogBox;
const bool treatFilePackagesAsDirs; const bool treatFilePackagesAsDirs;
std::function<void (const FileChooser&)> asyncCallback; std::function<void(const FileChooser&)> asyncCallback;
//============================================================================== //==============================================================================
void finished (const Array<URL>&); void finished (const Array<URL>&);

View file

@ -606,10 +606,10 @@ public:
std::function<void()> onDragEnd; std::function<void()> onDragEnd;
/** You can assign a lambda that will be used to convert textual values to the slider's normalised position. */ /** You can assign a lambda that will be used to convert textual values to the slider's normalised position. */
std::function<double (const String&)> valueFromTextFunction; std::function<double(const String&)> valueFromTextFunction;
/** You can assign a lambda that will be used to convert the slider's normalised position to a textual value. */ /** You can assign a lambda that will be used to convert the slider's normalised position to a textual value. */
std::function<String (double)> textFromValueFunction; std::function<String(double)> textFromValueFunction;
//============================================================================== //==============================================================================
/** This lets you choose whether double-clicking or single-clicking with a specified /** This lets you choose whether double-clicking or single-clicking with a specified

View file

@ -203,7 +203,7 @@ public:
The arguments passed are the pointer to and the data of the buffer that The arguments passed are the pointer to and the data of the buffer that
the OSCReceiver has failed to parse. the OSCReceiver has failed to parse.
*/ */
using FormatErrorHandler = std::function<void (const char* data, int dataSize)>; using FormatErrorHandler = std::function<void(const char* data, int dataSize)>;
/** Installs a custom error handler which is called in case the receiver /** Installs a custom error handler which is called in case the receiver
encounters a stream it cannot parse as an OSC bundle or OSC message. encounters a stream it cannot parse as an OSC bundle or OSC message.

View file

@ -159,7 +159,7 @@ Component* CameraDevice::createViewerComponent()
return new ViewerComponent (*this); return new ViewerComponent (*this);
} }
void CameraDevice::takeStillPicture (std::function<void (const Image&)> pictureTakenCallback) void CameraDevice::takeStillPicture (std::function<void(const Image&)> pictureTakenCallback)
{ {
pimpl->takeStillPicture (pictureTakenCallback); pimpl->takeStillPicture (pictureTakenCallback);
} }

View file

@ -73,7 +73,7 @@ public:
int maxWidth = 1024, int maxHeight = 768, int maxWidth = 1024, int maxHeight = 768,
bool highQuality = true); bool highQuality = true);
using OpenCameraResultCallback = std::function<void (CameraDevice*, const String& /*error*/)>; using OpenCameraResultCallback = std::function<void(CameraDevice*, const String& /*error*/)>;
/** Asynchronously opens a camera device on iOS (iOS 7+) or Android (API 21+). /** Asynchronously opens a camera device on iOS (iOS 7+) or Android (API 21+).
On other platforms, the function will simply call openDevice(). Upon completion, On other platforms, the function will simply call openDevice(). Upon completion,
@ -127,7 +127,7 @@ public:
Android does not support simultaneous video recording and still picture capture. Android does not support simultaneous video recording and still picture capture.
*/ */
void takeStillPicture (std::function<void (const Image&)> pictureTakenCallback); void takeStillPicture (std::function<void(const Image&)> pictureTakenCallback);
/** Starts recording video to the specified file. /** Starts recording video to the specified file.
@ -172,7 +172,7 @@ public:
/** Set this callback to be notified whenever an error occurs. You may need to close /** Set this callback to be notified whenever an error occurs. You may need to close
and reopen the device to be able to use it further. */ and reopen the device to be able to use it further. */
std::function<void (const String& /*error*/)> onErrorOccurred; std::function<void(const String& /*error*/)> onErrorOccurred;
//============================================================================== //==============================================================================
/** /**

View file

@ -487,7 +487,7 @@ private:
struct CameraDevice::Pimpl struct CameraDevice::Pimpl
: private ActivityLifecycleCallbacks : private ActivityLifecycleCallbacks
{ {
using InternalOpenCameraResultCallback = std::function<void (const String& /*cameraId*/, const String& /*error*/)>; using InternalOpenCameraResultCallback = std::function<void(const String& /*cameraId*/, const String& /*error*/)>;
Pimpl (CameraDevice& ownerToUse, const String& cameraIdToUse, int /*index*/, Pimpl (CameraDevice& ownerToUse, const String& cameraIdToUse, int /*index*/,
int minWidthToUse, int minHeightToUse, int maxWidthToUse, int maxHeightToUse, int minWidthToUse, int minHeightToUse, int maxWidthToUse, int maxHeightToUse,
@ -563,7 +563,7 @@ struct CameraDevice::Pimpl
bool openedOk() const noexcept { return scopedCameraDevice->openedOk(); } bool openedOk() const noexcept { return scopedCameraDevice->openedOk(); }
void takeStillPicture (std::function<void (const Image&)> pictureTakenCallbackToUse) void takeStillPicture (std::function<void(const Image&)> pictureTakenCallbackToUse)
{ {
if (pictureTakenCallbackToUse == nullptr || currentCaptureSessionMode == nullptr) if (pictureTakenCallbackToUse == nullptr || currentCaptureSessionMode == nullptr)
{ {
@ -2935,7 +2935,7 @@ private:
CriticalSection listenerLock; CriticalSection listenerLock;
ListenerList<Listener> listeners; ListenerList<Listener> listeners;
std::function<void (const Image&)> pictureTakenCallback; std::function<void(const Image&)> pictureTakenCallback;
Time firstRecordedFrameTimeMs; Time firstRecordedFrameTimeMs;
bool notifiedOfCameraOpening = false; bool notifiedOfCameraOpening = false;

View file

@ -401,7 +401,7 @@ struct VideoComponent::Pimpl
} }
} }
void loadAsync (const URL& url, std::function<void (const URL&, Result)> callback) void loadAsync (const URL& url, std::function<void(const URL&, Result)> callback)
{ {
close(); close();
wasOpen = false; wasOpen = false;
@ -1750,7 +1750,7 @@ private:
#endif #endif
GlobalRef surfaceHolderCallback; GlobalRef surfaceHolderCallback;
std::function<void (const URL&, Result)> loadFinishedCallback; std::function<void(const URL&, Result)> loadFinishedCallback;
bool wasOpen = false; bool wasOpen = false;

View file

@ -26,7 +26,7 @@
struct CameraDevice::Pimpl struct CameraDevice::Pimpl
{ {
using InternalOpenCameraResultCallback = std::function<void (const String& /*cameraId*/, const String& /*error*/)>; using InternalOpenCameraResultCallback = std::function<void(const String& /*cameraId*/, const String& /*error*/)>;
Pimpl (CameraDevice& ownerToUse, const String& cameraIdToUse, int /*index*/, Pimpl (CameraDevice& ownerToUse, const String& cameraIdToUse, int /*index*/,
int /*minWidth*/, int /*minHeight*/, int /*maxWidth*/, int /*maxHeight*/, int /*minWidth*/, int /*minHeight*/, int /*maxWidth*/, int /*maxHeight*/,
@ -75,7 +75,7 @@ struct CameraDevice::Pimpl
bool openedOk() const noexcept { return captureSession.openedOk(); } bool openedOk() const noexcept { return captureSession.openedOk(); }
void takeStillPicture (std::function<void (const Image&)> pictureTakenCallbackToUse) void takeStillPicture (std::function<void(const Image&)> pictureTakenCallbackToUse)
{ {
if (pictureTakenCallbackToUse == nullptr) if (pictureTakenCallbackToUse == nullptr)
{ {
@ -1214,7 +1214,7 @@ private:
CriticalSection listenerLock; CriticalSection listenerLock;
ListenerList<Listener> listeners; ListenerList<Listener> listeners;
std::function<void (const Image&)> pictureTakenCallback; std::function<void(const Image&)> pictureTakenCallback;
CaptureSession captureSession; CaptureSession captureSession;

View file

@ -123,7 +123,7 @@ struct CameraDevice::Pimpl
refreshConnections(); refreshConnections();
} }
void takeStillPicture (std::function<void (const Image&)> pictureTakenCallbackToUse) void takeStillPicture (std::function<void(const Image&)> pictureTakenCallbackToUse)
{ {
if (pictureTakenCallbackToUse == nullptr) if (pictureTakenCallbackToUse == nullptr)
{ {
@ -259,7 +259,7 @@ struct CameraDevice::Pimpl
CriticalSection listenerLock; CriticalSection listenerLock;
ListenerList<Listener> listeners; ListenerList<Listener> listeners;
std::function<void (const Image&)> pictureTakenCallback; std::function<void(const Image&)> pictureTakenCallback;
JUCE_DECLARE_WEAK_REFERENCEABLE (Pimpl) JUCE_DECLARE_WEAK_REFERENCEABLE (Pimpl)

View file

@ -82,7 +82,7 @@ struct VideoComponent::Pimpl : public Base
return Result::fail ("Couldn't open movie"); return Result::fail ("Couldn't open movie");
} }
void loadAsync (const URL& url, std::function<void (const URL&, Result)> callback) void loadAsync (const URL& url, std::function<void(const URL&, Result)> callback)
{ {
if (url.isEmpty()) if (url.isEmpty())
{ {
@ -774,7 +774,7 @@ private:
PlayerController playerController; PlayerController playerController;
std::function<void (const URL&, Result)> loadFinishedCallback; std::function<void(const URL&, Result)> loadFinishedCallback;
double playSpeedMult = 1.0; double playSpeedMult = 1.0;

View file

@ -185,7 +185,7 @@ struct CameraDevice::Pimpl : public ChangeBroadcaster
bool openedOk() const noexcept { return openedSuccessfully; } bool openedOk() const noexcept { return openedSuccessfully; }
void takeStillPicture (std::function<void (const Image&)> pictureTakenCallbackToUse) void takeStillPicture (std::function<void(const Image&)> pictureTakenCallbackToUse)
{ {
{ {
const ScopedLock sl (pictureTakenCallbackLock); const ScopedLock sl (pictureTakenCallbackLock);
@ -559,7 +559,7 @@ struct CameraDevice::Pimpl : public ChangeBroadcaster
ListenerList<Listener> listeners; ListenerList<Listener> listeners;
CriticalSection pictureTakenCallbackLock; CriticalSection pictureTakenCallbackLock;
std::function<void (const Image&)> pictureTakenCallback; std::function<void(const Image&)> pictureTakenCallback;
bool isRecording = false, openedSuccessfully = false; bool isRecording = false, openedSuccessfully = false;
int width = 0, height = 0; int width = 0, height = 0;

View file

@ -74,7 +74,7 @@ Result VideoComponent::load (const URL& url)
#endif #endif
} }
void VideoComponent::loadAsync (const URL& url, std::function<void (const URL&, Result)> callback) void VideoComponent::loadAsync (const URL& url, std::function<void(const URL&, Result)> callback)
{ {
if (callback == nullptr) if (callback == nullptr)
{ {

View file

@ -91,7 +91,7 @@ public:
@see load @see load
*/ */
void loadAsync (const URL& url, std::function<void (const URL&, Result)> loadFinishedCallback); void loadAsync (const URL& url, std::function<void(const URL&, Result)> loadFinishedCallback);
/** Closes the video and resets the component. */ /** Closes the video and resets the component. */
void closeVideo(); void closeVideo();
@ -167,7 +167,7 @@ public:
/** Set this callback to be notified whenever an error occurs. Upon error, you /** Set this callback to be notified whenever an error occurs. Upon error, you
may need to load the video again. */ may need to load the video again. */
std::function<void (const String& /*error*/)> onErrorOccurred; std::function<void(const String& /*error*/)> onErrorOccurred;
private: private:
//============================================================================== //==============================================================================