38template <
typename ValueType>
47 constexpr Range (
const ValueType startValue,
const ValueType endValue)
noexcept
59 constexpr static Range between (
const ValueType position1,
const ValueType position2)
noexcept
61 return position1 < position2 ?
Range (position1, position2)
62 :
Range (position2, position1);
96 void setStart (
const ValueType newStart)
noexcept
122 void setEnd (
const ValueType newEnd)
noexcept
171 inline Range operator+= (
const ValueType amountToAdd)
noexcept
173 start += amountToAdd;
179 inline Range operator-= (
const ValueType amountToSubtract)
noexcept
181 start -= amountToSubtract;
182 end -= amountToSubtract;
189 constexpr Range operator+ (
const ValueType amountToAdd)
const noexcept
196 constexpr Range operator- (
const ValueType amountToSubtract)
const noexcept
198 return Range (
start - amountToSubtract,
end - amountToSubtract);
201 constexpr bool operator== (
Range other)
const noexcept {
return start == other.start &&
end == other.end; }
202 constexpr bool operator!= (
Range other)
const noexcept {
return start != other.start ||
end != other.end; }
209 constexpr bool contains (
const ValueType position)
const noexcept
211 return start <= position && position <
end;
223 return start <= other.start &&
end >= other.end;
229 return other.start <
end &&
start < other.end;
266 const ValueType otherLen = rangeToConstrain.getLength();
269 : rangeToConstrain.movedToStartAt (
jlimit (
start,
end - otherLen, rangeToConstrain.getStart()));
273 template <typename Integral, std::enable_if_t<std::is_integral<Integral>::value,
int> = 0>
279 const ValueType first (*values++);
282 while (--numValues > 0)
284 const ValueType
v (*values++);
286 if (
r.end <
v)
r.end =
v;
287 if (
v <
r.start)
r.start =
v;
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
#define noexcept
Definition DistrhoDefines.h:72
void setEnd(const ValueType newEnd) noexcept
Definition juce_Range.h:122
Range constrainRange(Range rangeToConstrain) const noexcept
Definition juce_Range.h:264
constexpr ValueType getStart() const noexcept
Definition juce_Range.h:80
JUCE_NODISCARD constexpr Range withEnd(const ValueType newEnd) const noexcept
Definition juce_Range.h:133
JUCE_NODISCARD constexpr Range withLength(const ValueType newLength) const noexcept
Definition juce_Range.h:155
constexpr bool contains(Range other) const noexcept
Definition juce_Range.h:221
constexpr bool isEmpty() const noexcept
Definition juce_Range.h:89
JUCE_NODISCARD constexpr Range expanded(ValueType amount) const noexcept
Definition juce_Range.h:164
constexpr bool intersects(Range other) const noexcept
Definition juce_Range.h:227
JUCE_NODISCARD constexpr Range getIntersectionWith(Range other) const noexcept
Definition juce_Range.h:234
constexpr ValueType getEnd() const noexcept
Definition juce_Range.h:86
static JUCE_NODISCARD Range withStartAndLength(const ValueType startValue, const ValueType length) noexcept
Definition juce_Range.h:66
JUCE_NODISCARD constexpr Range movedToStartAt(const ValueType newStart) const noexcept
Definition juce_Range.h:113
JUCE_NODISCARD constexpr Range getUnionWith(Range other) const noexcept
Definition juce_Range.h:241
JUCE_NODISCARD constexpr Range getUnionWith(const ValueType valueToInclude) const noexcept
Definition juce_Range.h:248
constexpr Range(const ValueType startValue, const ValueType endValue) noexcept
Definition juce_Range.h:47
ValueType end
Definition juce_Range.h:295
JUCE_NODISCARD constexpr Range movedToEndAt(const ValueType newEnd) const noexcept
Definition juce_Range.h:139
constexpr Range(const Range &)=default
ValueType start
Definition juce_Range.h:295
JUCE_NODISCARD constexpr Range withStart(const ValueType newStart) const noexcept
Definition juce_Range.h:107
static Range findMinAndMax(const ValueType *values, Integral numValues) noexcept
Definition juce_Range.h:274
JUCE_NODISCARD static constexpr Range emptyRange(const ValueType start) noexcept
Definition juce_Range.h:73
ValueType clipValue(const ValueType value) const noexcept
Definition juce_Range.h:215
static constexpr Range between(const ValueType position1, const ValueType position2) noexcept
Definition juce_Range.h:59
void setLength(const ValueType newLength) noexcept
Definition juce_Range.h:147
void setStart(const ValueType newStart) noexcept
Definition juce_Range.h:96
constexpr ValueType getLength() const noexcept
Definition juce_Range.h:83
constexpr bool contains(const ValueType position) const noexcept
Definition juce_Range.h:209
constexpr Range()=default
unsigned v[N_MAX]
Definition inflate.c:1584
static PuglViewHint int value
Definition pugl.h:1708
virtual ASIOError start()=0
#define JUCE_NODISCARD
Definition juce_CompilerSupport.h:108
Definition carla_juce.cpp:31
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
constexpr Type jmax(Type a, Type b)
Definition juce_MathsFunctions.h:94
RangedDirectoryIterator end(const RangedDirectoryIterator &)
Definition juce_RangedDirectoryIterator.h:184
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
png_uint_32 length
Definition png.c:2247
int r
Definition crypt.c:458
#define const
Definition zconf.h:137