mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Normalised all whitespace before args in std::function
This commit is contained in:
parent
3283f2224a
commit
d510b73cdf
62 changed files with 149 additions and 149 deletions
|
|
@ -93,7 +93,7 @@ struct CodeContent : public Component
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
DemoContentComponent::DemoContentComponent (Component& mainComponent, std::function<void(bool)> callback)
|
DemoContentComponent::DemoContentComponent (Component& mainComponent, std::function<void (bool)> callback)
|
||||||
: TabbedComponent (TabbedButtonBar::Orientation::TabsAtTop),
|
: TabbedComponent (TabbedButtonBar::Orientation::TabsAtTop),
|
||||||
demoChangedCallback (std::move (callback))
|
demoChangedCallback (std::move (callback))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ struct CodeContent;
|
||||||
class DemoContentComponent : public TabbedComponent
|
class DemoContentComponent : public TabbedComponent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DemoContentComponent (Component& mainComponent, std::function<void(bool)> demoChangedCallback);
|
DemoContentComponent (Component& mainComponent, std::function<void (bool)> demoChangedCallback);
|
||||||
~DemoContentComponent() override;
|
~DemoContentComponent() override;
|
||||||
|
|
||||||
void resized() override;
|
void resized() override;
|
||||||
|
|
@ -43,7 +43,7 @@ public:
|
||||||
void setTabBarIndent (int indent) noexcept { tabBarIndent = indent; }
|
void setTabBarIndent (int indent) noexcept { tabBarIndent = indent; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::function<void(bool)> demoChangedCallback;
|
std::function<void (bool)> demoChangedCallback;
|
||||||
|
|
||||||
std::unique_ptr<DemoContent> demoContent;
|
std::unique_ptr<DemoContent> demoContent;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ class TemplateComponent : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TemplateComponent (const NewProjectTemplates::ProjectTemplate& temp,
|
TemplateComponent (const NewProjectTemplates::ProjectTemplate& temp,
|
||||||
std::function<void(std::unique_ptr<Project>)>&& createdCallback)
|
std::function<void (std::unique_ptr<Project>)>&& createdCallback)
|
||||||
: projectTemplate (temp),
|
: projectTemplate (temp),
|
||||||
projectCreatedCallback (std::move (createdCallback)),
|
projectCreatedCallback (std::move (createdCallback)),
|
||||||
header (projectTemplate.displayName, projectTemplate.description, projectTemplate.icon)
|
header (projectTemplate.displayName, projectTemplate.description, projectTemplate.icon)
|
||||||
|
|
@ -143,7 +143,7 @@ public:
|
||||||
private:
|
private:
|
||||||
NewProjectTemplates::ProjectTemplate projectTemplate;
|
NewProjectTemplates::ProjectTemplate projectTemplate;
|
||||||
|
|
||||||
std::function<void(std::unique_ptr<Project>)> projectCreatedCallback;
|
std::function<void (std::unique_ptr<Project>)> projectCreatedCallback;
|
||||||
|
|
||||||
ItemHeader header;
|
ItemHeader header;
|
||||||
TextButton createProjectButton { "Create Project..." };
|
TextButton createProjectButton { "Create Project..." };
|
||||||
|
|
@ -240,7 +240,7 @@ private:
|
||||||
class ExampleComponent : public Component
|
class ExampleComponent : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ExampleComponent (const File& f, std::function<void(const File&)> selectedCallback)
|
ExampleComponent (const File& f, std::function<void (const File&)> selectedCallback)
|
||||||
: exampleFile (f),
|
: exampleFile (f),
|
||||||
metadata (parseJUCEHeaderMetadata (exampleFile)),
|
metadata (parseJUCEHeaderMetadata (exampleFile)),
|
||||||
exampleSelectedCallback (std::move (selectedCallback)),
|
exampleSelectedCallback (std::move (selectedCallback)),
|
||||||
|
|
@ -290,7 +290,7 @@ private:
|
||||||
File exampleFile;
|
File exampleFile;
|
||||||
var metadata;
|
var metadata;
|
||||||
|
|
||||||
std::function<void(const File&)> exampleSelectedCallback;
|
std::function<void (const File&)> exampleSelectedCallback;
|
||||||
|
|
||||||
ItemHeader header;
|
ItemHeader header;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ static File findExampleFile (int dirIndex, int index)
|
||||||
return ProjucerApplication::getSortedExampleFilesInDirectory (dir)[index];
|
return ProjucerApplication::getSortedExampleFilesInDirectory (dir)[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<Component> createExampleProjectsTab (ContentComponent& content, std::function<void(const File&)> cb)
|
static std::unique_ptr<Component> createExampleProjectsTab (ContentComponent& content, std::function<void (const File&)> cb)
|
||||||
{
|
{
|
||||||
StringArray exampleCategories;
|
StringArray exampleCategories;
|
||||||
std::vector<StringArray> examples;
|
std::vector<StringArray> examples;
|
||||||
|
|
@ -120,7 +120,7 @@ static StringArray getAllTemplateNamesForCategory (const String& category)
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<Component> createProjectTemplatesTab (ContentComponent& content,
|
static std::unique_ptr<Component> createProjectTemplatesTab (ContentComponent& content,
|
||||||
std::function<void(std::unique_ptr<Project>&&)>&& cb)
|
std::function<void (std::unique_ptr<Project>&&)>&& cb)
|
||||||
{
|
{
|
||||||
auto categories = getAllTemplateCategoryStrings();
|
auto categories = getAllTemplateCategoryStrings();
|
||||||
|
|
||||||
|
|
@ -150,8 +150,8 @@ static std::unique_ptr<Component> createProjectTemplatesTab (ContentComponent& c
|
||||||
struct ProjectTemplatesAndExamples : public TabbedComponent
|
struct ProjectTemplatesAndExamples : public TabbedComponent
|
||||||
{
|
{
|
||||||
ProjectTemplatesAndExamples (ContentComponent& c,
|
ProjectTemplatesAndExamples (ContentComponent& c,
|
||||||
std::function<void(std::unique_ptr<Project>&&)>&& newProjectCb,
|
std::function<void (std::unique_ptr<Project>&&)>&& newProjectCb,
|
||||||
std::function<void(const File&)>&& exampleCb)
|
std::function<void (const File&)>&& exampleCb)
|
||||||
: TabbedComponent (TabbedButtonBar::Orientation::TabsAtTop),
|
: TabbedComponent (TabbedButtonBar::Orientation::TabsAtTop),
|
||||||
content (c),
|
content (c),
|
||||||
exampleSelectedCallback (std::move (exampleCb))
|
exampleSelectedCallback (std::move (exampleCb))
|
||||||
|
|
@ -222,12 +222,12 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
ContentComponent& content;
|
ContentComponent& content;
|
||||||
std::function<void(const File&)> exampleSelectedCallback;
|
std::function<void (const File&)> exampleSelectedCallback;
|
||||||
};
|
};
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
StartPageComponent::StartPageComponent (std::function<void(std::unique_ptr<Project>&&)>&& newProjectCb,
|
StartPageComponent::StartPageComponent (std::function<void (std::unique_ptr<Project>&&)>&& newProjectCb,
|
||||||
std::function<void(const File&)>&& exampleCb)
|
std::function<void (const File&)>&& exampleCb)
|
||||||
: content (std::make_unique<ContentComponent>()),
|
: content (std::make_unique<ContentComponent>()),
|
||||||
tabs (std::make_unique<ProjectTemplatesAndExamples> (*content, std::move (newProjectCb), std::move (exampleCb)))
|
tabs (std::make_unique<ProjectTemplatesAndExamples> (*content, std::move (newProjectCb), std::move (exampleCb)))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ struct ProjectTemplatesAndExamples;
|
||||||
class StartPageComponent : public Component
|
class StartPageComponent : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StartPageComponent (std::function<void(std::unique_ptr<Project>&&)>&& newProjectCb,
|
StartPageComponent (std::function<void (std::unique_ptr<Project>&&)>&& newProjectCb,
|
||||||
std::function<void(const File&)>&& exampleCb);
|
std::function<void (const File&)>&& exampleCb);
|
||||||
|
|
||||||
void paint (Graphics& g) override;
|
void paint (Graphics& g) override;
|
||||||
void resized() override;
|
void resized() override;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public:
|
||||||
enum class Open { no, yes };
|
enum class Open { no, yes };
|
||||||
|
|
||||||
StartPageTreeHolder (const StringArray& headerNames, const std::vector<StringArray>& itemNames,
|
StartPageTreeHolder (const StringArray& headerNames, const std::vector<StringArray>& itemNames,
|
||||||
std::function<void(int, int)>&& selectedCallback, Open shouldBeOpen)
|
std::function<void (int, int)>&& selectedCallback, Open shouldBeOpen)
|
||||||
: headers (headerNames),
|
: headers (headerNames),
|
||||||
items (itemNames),
|
items (itemNames),
|
||||||
itemSelectedCallback (std::move (selectedCallback))
|
itemSelectedCallback (std::move (selectedCallback))
|
||||||
|
|
@ -160,7 +160,7 @@ private:
|
||||||
StringArray headers;
|
StringArray headers;
|
||||||
std::vector<StringArray> items;
|
std::vector<StringArray> items;
|
||||||
|
|
||||||
std::function<void(int, int)> itemSelectedCallback;
|
std::function<void (int, int)> itemSelectedCallback;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StartPageTreeHolder)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StartPageTreeHolder)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class LicenseQueryThread : public Thread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LicenseQueryThread (const String& userEmail, const String& userPassword,
|
LicenseQueryThread (const String& userEmail, const String& userPassword,
|
||||||
std::function<void(LicenseState, String)>&& cb)
|
std::function<void (LicenseState, String)>&& cb)
|
||||||
: Thread ("LicenseQueryThread"),
|
: Thread ("LicenseQueryThread"),
|
||||||
email (userEmail),
|
email (userEmail),
|
||||||
password (userPassword),
|
password (userPassword),
|
||||||
|
|
@ -266,7 +266,7 @@ private:
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
const String email, password;
|
const String email, password;
|
||||||
const std::function<void(LicenseState, String)> completionCallback;
|
const std::function<void (LicenseState, String)> completionCallback;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
JUCE_DECLARE_WEAK_REFERENCEABLE (LicenseQueryThread)
|
JUCE_DECLARE_WEAK_REFERENCEABLE (LicenseQueryThread)
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace Vst2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if JUCE_LINUX
|
#if JUCE_LINUX
|
||||||
std::vector<std::pair<int, std::function<void(int)>>> getFdReadCallbacks();
|
std::vector<std::pair<int, std::function<void (int)>>> getFdReadCallbacks();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace juce
|
namespace juce
|
||||||
|
|
@ -1587,7 +1587,7 @@ private:
|
||||||
#if JUCE_WINDOWS
|
#if JUCE_WINDOWS
|
||||||
WindowsHooks hooks;
|
WindowsHooks hooks;
|
||||||
#elif JUCE_LINUX
|
#elif JUCE_LINUX
|
||||||
std::unordered_map<int, std::function<void(int)>> fdCallbackMap;
|
std::unordered_map<int, std::function<void (int)>> fdCallbackMap;
|
||||||
|
|
||||||
::Display* display = XWindowSystem::getInstance()->getDisplay();
|
::Display* display = XWindowSystem::getInstance()->getDisplay();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ public:
|
||||||
#ifndef DOXYGEN
|
#ifndef DOXYGEN
|
||||||
// @internal
|
// @internal
|
||||||
static AudioProcessor::WrapperType jucePlugInClientCurrentWrapperType;
|
static AudioProcessor::WrapperType jucePlugInClientCurrentWrapperType;
|
||||||
static std::function<bool(AudioProcessor&)> jucePlugInIsRunningInAudioSuiteFn;
|
static std::function<bool (AudioProcessor&)> jucePlugInIsRunningInAudioSuiteFn;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace juce
|
||||||
{
|
{
|
||||||
|
|
||||||
AudioProcessor::WrapperType PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_Undefined;
|
AudioProcessor::WrapperType PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_Undefined;
|
||||||
std::function<bool(AudioProcessor&)> PluginHostType::jucePlugInIsRunningInAudioSuiteFn = nullptr;
|
std::function<bool (AudioProcessor&)> PluginHostType::jucePlugInIsRunningInAudioSuiteFn = nullptr;
|
||||||
|
|
||||||
#if JucePlugin_Build_Unity
|
#if JucePlugin_Build_Unity
|
||||||
bool juce_isRunningInUnity() { return PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_Unity; }
|
bool juce_isRunningInUnity() { return PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_Unity; }
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ public:
|
||||||
String& errorMessage);
|
String& errorMessage);
|
||||||
|
|
||||||
/** A callback lambda that is passed to createPluginInstanceAsync() */
|
/** 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.
|
/** 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
|
When the plugin has been created, it will be passed to the caller via an
|
||||||
|
|
|
||||||
|
|
@ -1167,7 +1167,7 @@ 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.
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,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),
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,8 @@ public:
|
||||||
*/
|
*/
|
||||||
AudioParameterBool (const String& parameterID, const String& parameterName, bool defaultValue,
|
AudioParameterBool (const String& parameterID, const String& parameterName, bool defaultValue,
|
||||||
const String& parameterLabel = String(),
|
const String& parameterLabel = 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;
|
||||||
|
|
@ -82,8 +82,8 @@ private:
|
||||||
const NormalisableRange<float> range { 0.0f, 1.0f, 1.0f };
|
const NormalisableRange<float> range { 0.0f, 1.0f, 1.0f };
|
||||||
std::atomic<float> value;
|
std::atomic<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)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,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 ([this]
|
range ([this]
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ public:
|
||||||
const StringArray& choices,
|
const StringArray& choices,
|
||||||
int defaultItemIndex,
|
int defaultItemIndex,
|
||||||
const String& parameterLabel = String(),
|
const String& parameterLabel = 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;
|
||||||
|
|
@ -94,8 +94,8 @@ private:
|
||||||
const NormalisableRange<float> range;
|
const NormalisableRange<float> range;
|
||||||
std::atomic<float> value;
|
std::atomic<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)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,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),
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ public:
|
||||||
float defaultValue,
|
float defaultValue,
|
||||||
const String& parameterLabel = String(),
|
const String& parameterLabel = String(),
|
||||||
Category parameterCategory = AudioProcessorParameter::genericParameter,
|
Category parameterCategory = 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.
|
||||||
|
|
@ -100,8 +100,8 @@ private:
|
||||||
|
|
||||||
std::atomic<float> value;
|
std::atomic<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)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,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 ([minValue, maxValue]
|
range ([minValue, maxValue]
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,8 @@ public:
|
||||||
int minValue, int maxValue,
|
int minValue, int maxValue,
|
||||||
int defaultValue,
|
int defaultValue,
|
||||||
const String& parameterLabel = String(),
|
const String& parameterLabel = 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;
|
||||||
|
|
@ -90,8 +90,8 @@ private:
|
||||||
const NormalisableRange<float> range;
|
const NormalisableRange<float> range;
|
||||||
std::atomic<float> value;
|
std::atomic<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)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ AudioProcessorValueTreeState::Parameter::Parameter (const String& parameterID,
|
||||||
const String& labelText,
|
const String& labelText,
|
||||||
NormalisableRange<float> valueRange,
|
NormalisableRange<float> valueRange,
|
||||||
float defaultParameterValue,
|
float defaultParameterValue,
|
||||||
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,
|
||||||
|
|
@ -38,7 +38,7 @@ AudioProcessorValueTreeState::Parameter::Parameter (const String& parameterID,
|
||||||
defaultParameterValue,
|
defaultParameterValue,
|
||||||
labelText,
|
labelText,
|
||||||
parameterCategory,
|
parameterCategory,
|
||||||
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 (defaultParameterValue)),
|
unsnappedDefault (valueRange.convertTo0to1 (defaultParameterValue)),
|
||||||
|
|
@ -261,8 +261,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,
|
||||||
|
|
|
||||||
|
|
@ -254,8 +254,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,
|
||||||
|
|
@ -394,8 +394,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,
|
||||||
|
|
@ -514,7 +514,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));
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public:
|
||||||
requests a parameter change.
|
requests a parameter change.
|
||||||
*/
|
*/
|
||||||
ParameterAttachment (RangedAudioParameter& parameter,
|
ParameterAttachment (RangedAudioParameter& parameter,
|
||||||
std::function<void(float)> parameterChangedCallback,
|
std::function<void (float)> parameterChangedCallback,
|
||||||
UndoManager* undoManager = nullptr);
|
UndoManager* undoManager = nullptr);
|
||||||
|
|
||||||
/** Destructor. */
|
/** Destructor. */
|
||||||
|
|
@ -105,7 +105,7 @@ private:
|
||||||
RangedAudioParameter& parameter;
|
RangedAudioParameter& parameter;
|
||||||
std::atomic<float> lastValue { 0.0f };
|
std::atomic<float> lastValue { 0.0f };
|
||||||
UndoManager* undoManager = nullptr;
|
UndoManager* undoManager = nullptr;
|
||||||
std::function<void(float)> setValue;
|
std::function<void (float)> setValue;
|
||||||
|
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ParameterAttachment)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ParameterAttachment)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -503,11 +503,11 @@ public:
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
/** Allows the user to provide a function that will receive log messages from the block. */
|
/** Allows the user to provide a function that will receive log messages from the block. */
|
||||||
virtual void setLogger (std::function<void(const Block& block, const String&)> loggingCallback) = 0;
|
virtual void setLogger (std::function<void (const Block& block, const String&)> loggingCallback) = 0;
|
||||||
|
|
||||||
/** 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;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
/** Interface for objects listening to input data port. */
|
/** Interface for objects listening to input data port. */
|
||||||
|
|
|
||||||
|
|
@ -261,9 +261,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
std::function<void(const Block& block, const String&)> logger;
|
std::function<void (const Block& block, const String&)> logger;
|
||||||
|
|
||||||
void setLogger (std::function<void(const Block& block, const String&)> newLogger) override
|
void setLogger (std::function<void (const Block& block, const String&)> newLogger) override
|
||||||
{
|
{
|
||||||
logger = std::move (newLogger);
|
logger = std::move (newLogger);
|
||||||
}
|
}
|
||||||
|
|
@ -447,7 +447,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 = nullptr;
|
firmwarePacketAckCallback = nullptr;
|
||||||
|
|
||||||
|
|
@ -694,7 +694,7 @@ private:
|
||||||
std::unique_ptr<Program> program;
|
std::unique_ptr<Program> program;
|
||||||
uint32 programSize = 0;
|
uint32 programSize = 0;
|
||||||
|
|
||||||
std::function<void(uint8, uint32)> firmwarePacketAckCallback;
|
std::function<void (uint8, uint32)> firmwarePacketAckCallback;
|
||||||
|
|
||||||
bool isMaster = false;
|
bool isMaster = false;
|
||||||
Block::UID masterUID = {};
|
Block::UID masterUID = {};
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
namespace juce
|
namespace juce
|
||||||
{
|
{
|
||||||
|
|
||||||
BlockGraph::BlockGraph (const BlockTopology t, std::function<bool(Block::Ptr)> filterIn)
|
BlockGraph::BlockGraph (const BlockTopology t, std::function<bool (Block::Ptr)> filterIn)
|
||||||
: topology (t), filter (std::move (filterIn))
|
: topology (t), filter (std::move (filterIn))
|
||||||
{
|
{
|
||||||
buildGraph();
|
buildGraph();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public:
|
||||||
/** Creates a BlockGraph object from a BlockTopology with an optional filter function. This
|
/** Creates a BlockGraph object from a BlockTopology with an optional filter function. This
|
||||||
will build a block graph of traversal paths for each master.
|
will build a block graph of traversal paths for each master.
|
||||||
*/
|
*/
|
||||||
BlockGraph (const BlockTopology topology, std::function<bool(Block::Ptr block)> filter = nullptr);
|
BlockGraph (const BlockTopology topology, std::function<bool (Block::Ptr block)> filter = nullptr);
|
||||||
BlockGraph (BlockGraph&&);
|
BlockGraph (BlockGraph&&);
|
||||||
|
|
||||||
using BlockTraversalPaths = Array<Block::Array, CriticalSection>;
|
using BlockTraversalPaths = Array<Block::Array, CriticalSection>;
|
||||||
|
|
@ -58,7 +58,7 @@ private:
|
||||||
|
|
||||||
BlockTraversalPaths traversalPaths; // one path for each master block
|
BlockTraversalPaths traversalPaths; // one path for each master block
|
||||||
BlockTopology topology;
|
BlockTopology topology;
|
||||||
std::function<bool(Block::Ptr)> filter;
|
std::function<bool (Block::Ptr)> filter;
|
||||||
|
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BlockGraph)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BlockGraph)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,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. */
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ struct ConsoleApplication
|
||||||
String longDescription;
|
String longDescription;
|
||||||
|
|
||||||
/** The actual command that should be invoked to perform this action. */
|
/** 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. */
|
/** 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.
|
||||||
|
|
|
||||||
|
|
@ -620,7 +620,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))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
@ -642,11 +642,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();
|
||||||
|
|
|
||||||
|
|
@ -983,7 +983,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);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,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);
|
||||||
|
|
@ -36,7 +36,7 @@ LookupTable<FloatType>::LookupTable (const std::function<FloatType(size_t)>& fun
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
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)));
|
||||||
|
|
@ -64,7 +64,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)
|
||||||
|
|
@ -90,7 +90,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,
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,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.
|
||||||
|
|
||||||
|
|
@ -72,7 +72,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.
|
||||||
|
|
@ -188,7 +188,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)
|
||||||
|
|
@ -207,7 +207,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);
|
||||||
|
|
@ -301,7 +301,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,
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,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);
|
||||||
|
|
@ -53,7 +53,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)
|
||||||
|
|
@ -232,7 +232,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) };
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace LinuxEventLoop
|
||||||
file descriptor. The possible values for this are defined in
|
file descriptor. The possible values for this are defined in
|
||||||
<poll.h>
|
<poll.h>
|
||||||
*/
|
*/
|
||||||
void registerFdCallback (int fd, std::function<void(int)> readCallback, short eventMask = 1 /*POLLIN*/);
|
void registerFdCallback (int fd, std::function<void (int)> readCallback, short eventMask = 1 /*POLLIN*/);
|
||||||
|
|
||||||
/** Unregisters a previously registered file descriptor.
|
/** Unregisters a previously registered file descriptor.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ public:
|
||||||
fdReadCallbacks.reserve (16);
|
fdReadCallbacks.reserve (16);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerFdCallback (int fd, std::function<void(int)>&& cb, short eventMask)
|
void registerFdCallback (int fd, std::function<void (int)>&& cb, short eventMask)
|
||||||
{
|
{
|
||||||
const ScopedLock sl (lock);
|
const ScopedLock sl (lock);
|
||||||
|
|
||||||
|
|
@ -145,7 +145,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto removePredicate = [=] (const std::pair<int, std::function<void(int)>>& cb) { return cb.first == fd; };
|
auto removePredicate = [=] (const std::pair<int, std::function<void (int)>>& cb) { return cb.first == fd; };
|
||||||
|
|
||||||
fdReadCallbacks.erase (std::remove_if (std::begin (fdReadCallbacks), std::end (fdReadCallbacks), removePredicate),
|
fdReadCallbacks.erase (std::remove_if (std::begin (fdReadCallbacks), std::end (fdReadCallbacks), removePredicate),
|
||||||
std::end (fdReadCallbacks));
|
std::end (fdReadCallbacks));
|
||||||
|
|
@ -211,7 +211,7 @@ public:
|
||||||
poll (&pfds.front(), static_cast<nfds_t> (pfds.size()), timeoutMs);
|
poll (&pfds.front(), static_cast<nfds_t> (pfds.size()), timeoutMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::pair<int, std::function<void(int)>>> getFdReadCallbacks()
|
std::vector<std::pair<int, std::function<void (int)>>> getFdReadCallbacks()
|
||||||
{
|
{
|
||||||
const ScopedLock sl (lock);
|
const ScopedLock sl (lock);
|
||||||
return fdReadCallbacks;
|
return fdReadCallbacks;
|
||||||
|
|
@ -223,7 +223,7 @@ public:
|
||||||
private:
|
private:
|
||||||
CriticalSection lock;
|
CriticalSection lock;
|
||||||
|
|
||||||
std::vector<std::pair<int, std::function<void(int)>>> fdReadCallbacks;
|
std::vector<std::pair<int, std::function<void (int)>>> fdReadCallbacks;
|
||||||
std::vector<pollfd> pfds;
|
std::vector<pollfd> pfds;
|
||||||
|
|
||||||
bool shouldDeferModifyingReadCallbacks = false;
|
bool shouldDeferModifyingReadCallbacks = false;
|
||||||
|
|
@ -311,7 +311,7 @@ bool MessageManager::dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMes
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
void LinuxEventLoop::registerFdCallback (int fd, std::function<void(int)> readCallback, short eventMask)
|
void LinuxEventLoop::registerFdCallback (int fd, std::function<void (int)> readCallback, short eventMask)
|
||||||
{
|
{
|
||||||
if (auto* runLoop = InternalRunLoop::getInstanceWithoutCreating())
|
if (auto* runLoop = InternalRunLoop::getInstanceWithoutCreating())
|
||||||
runLoop->registerFdCallback (fd, std::move (readCallback), eventMask);
|
runLoop->registerFdCallback (fd, std::move (readCallback), eventMask);
|
||||||
|
|
@ -325,7 +325,7 @@ void LinuxEventLoop::unregisterFdCallback (int fd)
|
||||||
|
|
||||||
} // namespace juce
|
} // namespace juce
|
||||||
|
|
||||||
JUCE_API std::vector<std::pair<int, std::function<void(int)>>> getFdReadCallbacks()
|
JUCE_API std::vector<std::pair<int, std::function<void (int)>>> getFdReadCallbacks()
|
||||||
{
|
{
|
||||||
using namespace juce;
|
using namespace juce;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ int ModalComponentManager::runEventLoopForCurrentComponent()
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
struct LambdaCallback : public ModalComponentManager::Callback
|
struct LambdaCallback : public ModalComponentManager::Callback
|
||||||
{
|
{
|
||||||
LambdaCallback (std::function<void(int)> fn) noexcept : function (fn) {}
|
LambdaCallback (std::function<void (int)> fn) noexcept : function (fn) {}
|
||||||
|
|
||||||
void modalStateFinished (int result) override
|
void modalStateFinished (int result) override
|
||||||
{
|
{
|
||||||
|
|
@ -287,12 +287,12 @@ struct LambdaCallback : public ModalComponentManager::Callback
|
||||||
function (result);
|
function (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::function<void(int)> function;
|
std::function<void (int)> function;
|
||||||
|
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LambdaCallback)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LambdaCallback)
|
||||||
};
|
};
|
||||||
|
|
||||||
ModalComponentManager::Callback* ModalCallbackFunction::create (std::function<void(int)> f)
|
ModalComponentManager::Callback* ModalCallbackFunction::create (std::function<void (int)> f)
|
||||||
{
|
{
|
||||||
return new LambdaCallback (f);
|
return new LambdaCallback (f);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ public:
|
||||||
|
|
||||||
@see ModalComponentManager::Callback
|
@see ModalComponentManager::Callback
|
||||||
*/
|
*/
|
||||||
static ModalComponentManager::Callback* create (std::function<void(int)>);
|
static ModalComponentManager::Callback* create (std::function<void (int)>);
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
/** This is a utility function to create a ModalComponentManager::Callback that will
|
/** This is a utility function to create a ModalComponentManager::Callback that will
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,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_CONTENT_SHARING
|
#if JUCE_CONTENT_SHARING
|
||||||
startNewShare (callbackToUse);
|
startNewShare (callbackToUse);
|
||||||
|
|
@ -161,7 +161,7 @@ void ContentSharer::shareFiles (const Array<URL>& files,
|
||||||
}
|
}
|
||||||
|
|
||||||
#if JUCE_CONTENT_SHARING
|
#if JUCE_CONTENT_SHARING
|
||||||
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!
|
||||||
|
|
@ -182,7 +182,7 @@ void ContentSharer::startNewShare (std::function<void(bool, const String&)> call
|
||||||
#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_CONTENT_SHARING
|
#if JUCE_CONTENT_SHARING
|
||||||
startNewShare (callbackToUse);
|
startNewShare (callbackToUse);
|
||||||
|
|
@ -199,7 +199,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_CONTENT_SHARING
|
#if JUCE_CONTENT_SHARING
|
||||||
|
|
@ -232,7 +232,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_CONTENT_SHARING
|
#if JUCE_CONTENT_SHARING
|
||||||
startNewShare (callbackToUse);
|
startNewShare (callbackToUse);
|
||||||
|
|
@ -249,7 +249,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);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,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.
|
||||||
|
|
||||||
|
|
@ -55,7 +55,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
|
||||||
|
|
@ -79,7 +79,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
|
||||||
|
|
@ -92,7 +92,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();
|
||||||
|
|
@ -100,7 +100,7 @@ private:
|
||||||
|
|
||||||
Array<File> temporaryFiles;
|
Array<File> temporaryFiles;
|
||||||
|
|
||||||
std::function<void(bool, String)> callback;
|
std::function<void (bool, String)> callback;
|
||||||
|
|
||||||
#if JUCE_CONTENT_SHARING
|
#if JUCE_CONTENT_SHARING
|
||||||
struct Pimpl
|
struct Pimpl
|
||||||
|
|
@ -113,7 +113,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;
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,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
|
||||||
|
|
@ -246,7 +246,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;
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,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);
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
@ -302,7 +302,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>&);
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ public:
|
||||||
std::function<void()> onPanelMove;
|
std::function<void()> onPanelMove;
|
||||||
|
|
||||||
/** You can assign a lambda to this callback object and it will be called when the panel is shown or hidden. */
|
/** You can assign a lambda to this callback object and it will be called when the panel is shown or hidden. */
|
||||||
std::function<void(bool)> onPanelShowHide;
|
std::function<void (bool)> onPanelShowHide;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
|
||||||
|
|
@ -1789,7 +1789,7 @@ void PopupMenu::showMenuAsync (const Options& options, ModalComponentManager::Ca
|
||||||
showWithOptionalCallback (options, userCallback, false);
|
showWithOptionalCallback (options, userCallback, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupMenu::showMenuAsync (const Options& options, std::function<void(int)> userCallback)
|
void PopupMenu::showMenuAsync (const Options& options, std::function<void (int)> userCallback)
|
||||||
{
|
{
|
||||||
showWithOptionalCallback (options, ModalCallbackFunction::create (userCallback), false);
|
showWithOptionalCallback (options, ModalCallbackFunction::create (userCallback), false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -564,7 +564,7 @@ public:
|
||||||
|
|
||||||
/** Runs the menu asynchronously, with a user-provided callback that will receive the result. */
|
/** Runs the menu asynchronously, with a user-provided callback that will receive the result. */
|
||||||
void showMenuAsync (const Options& options,
|
void showMenuAsync (const Options& options,
|
||||||
std::function<void(int)> callback);
|
std::function<void (int)> callback);
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
/** Closes any menus that are currently open.
|
/** Closes any menus that are currently open.
|
||||||
|
|
|
||||||
|
|
@ -598,10 +598,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
|
||||||
|
|
|
||||||
|
|
@ -428,7 +428,7 @@ struct ShaderPrograms : public ReferenceCountedObject
|
||||||
|
|
||||||
OpenGLShaderProgram::Attribute positionAttribute, colourAttribute;
|
OpenGLShaderProgram::Attribute positionAttribute, colourAttribute;
|
||||||
OpenGLShaderProgram::Uniform screenBounds;
|
OpenGLShaderProgram::Uniform screenBounds;
|
||||||
std::function<void(OpenGLShaderProgram&)> onShaderActivated;
|
std::function<void (OpenGLShaderProgram&)> onShaderActivated;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MaskedShaderParams
|
struct MaskedShaderParams
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ struct JUCE_API OpenGLGraphicsContextCustomShader
|
||||||
/** Optional lambda that will be called when the shader is activated, to allow
|
/** Optional lambda that will be called when the shader is activated, to allow
|
||||||
user code to do setup tasks.
|
user code to do setup tasks.
|
||||||
*/
|
*/
|
||||||
std::function<void(OpenGLShaderProgram&)> onShaderActivated;
|
std::function<void (OpenGLShaderProgram&)> onShaderActivated;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
String code, hashName;
|
String code, hashName;
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,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.
|
||||||
|
|
|
||||||
|
|
@ -501,8 +501,8 @@ private:
|
||||||
InAppPurchases& owner;
|
InAppPurchases& owner;
|
||||||
GlobalRef billingClient;
|
GlobalRef billingClient;
|
||||||
|
|
||||||
std::queue<std::function<void(LocalRef<jobject>)>> skuDetailsQueryCallbackQueue,
|
std::queue<std::function<void (LocalRef<jobject>)>> skuDetailsQueryCallbackQueue,
|
||||||
purchasesListQueryCallbackQueue;
|
purchasesListQueryCallbackQueue;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl)
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,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,
|
||||||
|
|
@ -119,7 +119,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.
|
||||||
|
|
||||||
|
|
@ -164,7 +164,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;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -477,7 +477,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,
|
||||||
|
|
@ -553,7 +553,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)
|
||||||
{
|
{
|
||||||
|
|
@ -2926,7 +2926,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;
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,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;
|
||||||
|
|
@ -1742,7 +1742,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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,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*/,
|
||||||
|
|
@ -72,7 +72,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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ struct CameraDevice::Pimpl
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
bool openedOk() const noexcept { return openingError.isEmpty(); }
|
bool openedOk() const noexcept { return openingError.isEmpty(); }
|
||||||
|
|
||||||
void takeStillPicture (std::function<void(const Image&)> pictureTakenCallbackToUse)
|
void takeStillPicture (std::function<void (const Image&)> pictureTakenCallbackToUse)
|
||||||
{
|
{
|
||||||
if (pictureTakenCallbackToUse == nullptr)
|
if (pictureTakenCallbackToUse == nullptr)
|
||||||
{
|
{
|
||||||
|
|
@ -368,7 +368,7 @@ private:
|
||||||
CriticalSection listenerLock;
|
CriticalSection listenerLock;
|
||||||
ListenerList<Listener> listeners;
|
ListenerList<Listener> listeners;
|
||||||
|
|
||||||
std::function<void(const Image&)> pictureTakenCallback = nullptr;
|
std::function<void (const Image&)> pictureTakenCallback = nullptr;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
JUCE_DECLARE_WEAK_REFERENCEABLE (Pimpl)
|
JUCE_DECLARE_WEAK_REFERENCEABLE (Pimpl)
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,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())
|
||||||
{
|
{
|
||||||
|
|
@ -770,7 +770,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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,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);
|
||||||
|
|
@ -551,7 +551,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;
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ Result VideoComponent::load (const URL& url)
|
||||||
return loadInternal (url, false);
|
return loadInternal (url, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,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();
|
||||||
|
|
@ -161,7 +161,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:
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue