JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_SliderPropertyComponent.cpp
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
30 const double rangeMin,
31 const double rangeMax,
32 const double interval,
33 const double skewFactor,
34 bool symmetricSkew)
35 : PropertyComponent (name)
36{
38
39 slider.setRange (rangeMin, rangeMax, interval);
40 slider.setSkewFactor (skewFactor, symmetricSkew);
42
43 slider.onValueChange = [this]
44 {
47 };
48}
49
51 const String& name,
52 const double rangeMin,
53 const double rangeMax,
54 const double interval,
55 const double skewFactor,
56 bool symmetricSkew)
57 : PropertyComponent (name)
58{
60
61 slider.setRange (rangeMin, rangeMax, interval);
62 slider.setSkewFactor (skewFactor, symmetricSkew);
64
66}
67
71
72void SliderPropertyComponent::setValue (const double /*newValue*/)
73{
74}
75
77{
78 return slider.getValue();
79}
80
85
86} // namespace juce
void addAndMakeVisible(Component *child, int zOrder=-1)
Adds a child component to this one, and also makes the child visible if it isn't already.
A base class for a component that goes in a PropertyPanel and displays one of an item's properties.
SliderPropertyComponent(const String &propertyName, double rangeMin, double rangeMax, double interval, double skewFactor=1.0, bool symmetricSkew=false)
Creates the property component.
Slider slider
The slider component being used in this component.
virtual void setValue(double newValue)
Called when the user moves the slider to change its value.
virtual double getValue() const
Returns the value that the slider should show.
void refresh() override
Updates the property component if the item it refers to has changed.
void setSliderStyle(SliderStyle newStyle)
Changes the type of slider interface being used.
std::function< void()> onValueChange
You can assign a lambda to this callback object to have it called when the slider value is changed.
void setSkewFactor(double factor, bool symmetricSkew=false)
Sets up a skew factor to alter the way values are distributed.
double getValue() const
Returns the slider's current value.
@ LinearBar
A horizontal bar slider with the text label drawn on top of it.
Definition juce_Slider.h:65
void setValue(double newValue, NotificationType notification=sendNotificationAsync)
Changes the slider's current value.
Value & getValueObject() noexcept
Returns the Value object that represents the slider's current position.
void setRange(double newMinimum, double newMaximum, double newInterval=0)
Sets the limits that the slider's value can take.
The JUCE String class!
Definition juce_String.h:53
Represents a shared variant value.
Definition juce_Value.h:51
void referTo(const Value &valueToReferTo)
Makes this object refer to the same underlying ValueSource as another one.
JUCE Namespace.
constexpr bool approximatelyEqual(Type a, Type b, Tolerance< Type > tolerance=Tolerance< Type >{} .withAbsolute(std::numeric_limits< Type >::min()) .withRelative(std::numeric_limits< Type >::epsilon()))
Returns true if the two floating-point numbers are approximately equal.
@ dontSendNotification
No notification message should be sent.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88