openshot-audio  0.1.6
Public Member Functions | Static Public Member Functions | List of all members
juce::Range< ValueType > Class Template Reference

#include <juce_core.h>

Public Member Functions

 Range () noexcept
 
 Range (const ValueType startValue, const ValueType endValue) noexcept
 
 Range (const Range &other) noexcept
 
Rangeoperator= (Range other) noexcept
 
ValueType getStart () const noexcept
 
ValueType getLength () const noexcept
 
ValueType getEnd () const noexcept
 
bool isEmpty () const noexcept
 
void setStart (const ValueType newStart) noexcept
 
Range withStart (const ValueType newStart) const noexcept
 
Range movedToStartAt (const ValueType newStart) const noexcept
 
void setEnd (const ValueType newEnd) noexcept
 
Range withEnd (const ValueType newEnd) const noexcept
 
Range movedToEndAt (const ValueType newEnd) const noexcept
 
void setLength (const ValueType newLength) noexcept
 
Range withLength (const ValueType newLength) const noexcept
 
Range operator+= (const ValueType amountToAdd) noexcept
 
Range operator-= (const ValueType amountToSubtract) noexcept
 
Range operator+ (const ValueType amountToAdd) const noexcept
 
Range operator- (const ValueType amountToSubtract) const noexcept
 
bool operator== (Range other) const noexcept
 
bool operator!= (Range other) const noexcept
 
bool contains (const ValueType position) const noexcept
 
ValueType clipValue (const ValueType value) const noexcept
 
bool contains (Range other) const noexcept
 
bool intersects (Range other) const noexcept
 
Range getIntersectionWith (Range other) const noexcept
 
Range getUnionWith (Range other) const noexcept
 
Range getUnionWith (const ValueType valueToInclude) const noexcept
 
Range constrainRange (Range rangeToConstrain) const noexcept
 

Static Public Member Functions

static Range between (const ValueType position1, const ValueType position2) noexcept
 
static Range withStartAndLength (const ValueType startValue, const ValueType length) noexcept
 
static Range emptyRange (const ValueType start) noexcept
 
static Range findMinAndMax (const ValueType *values, int numValues) noexcept
 

Detailed Description

template<typename ValueType>
class juce::Range< ValueType >

A general-purpose range object, that simply represents any linear range with a start and end point.

Note that when checking whether values fall within the range, the start value is considered to be inclusive, and the end of the range exclusive.

The templated parameter is expected to be a primitive integer or floating point type, though class types could also be used if they behave in a number-like way.

Constructor & Destructor Documentation

template<typename ValueType>
juce::Range< ValueType >::Range ( )
inlinenoexcept

Constructs an empty range.

template<typename ValueType>
juce::Range< ValueType >::Range ( const ValueType  startValue,
const ValueType  endValue 
)
inlinenoexcept

Constructs a range with given start and end values.

template<typename ValueType>
juce::Range< ValueType >::Range ( const Range< ValueType > &  other)
inlinenoexcept

Constructs a copy of another range.

Member Function Documentation

template<typename ValueType>
static Range juce::Range< ValueType >::between ( const ValueType  position1,
const ValueType  position2 
)
inlinestaticnoexcept

Returns the range that lies between two positions (in either order).

template<typename ValueType>
ValueType juce::Range< ValueType >::clipValue ( const ValueType  value) const
inlinenoexcept

Returns the nearest value to the one supplied, which lies within the range.

template<typename ValueType>
Range juce::Range< ValueType >::constrainRange ( Range< ValueType >  rangeToConstrain) const
inlinenoexcept

Returns a given range, after moving it forwards or backwards to fit it within this range.

If the supplied range has a greater length than this one, the return value will be this range.

Otherwise, if the supplied range is smaller than this one, the return value will be the new range, shifted forwards or backwards so that it doesn't extend beyond this one, but keeping its original length.

template<typename ValueType>
bool juce::Range< ValueType >::contains ( const ValueType  position) const
inlinenoexcept

Returns true if the given position lies inside this range.

template<typename ValueType>
bool juce::Range< ValueType >::contains ( Range< ValueType >  other) const
inlinenoexcept

Returns true if the given range lies entirely inside this range. When making this comparison, the start value is considered to be inclusive, and the end of the range exclusive.

template<typename ValueType>
static Range juce::Range< ValueType >::emptyRange ( const ValueType  start)
inlinestaticnoexcept

Returns a range with the specified start position and a length of zero.

template<typename ValueType>
static Range juce::Range< ValueType >::findMinAndMax ( const ValueType *  values,
int  numValues 
)
inlinestaticnoexcept

Scans an array of values for its min and max, and returns these as a Range.

template<typename ValueType>
ValueType juce::Range< ValueType >::getEnd ( ) const
inlinenoexcept

Returns the end of the range.

template<typename ValueType>
Range juce::Range< ValueType >::getIntersectionWith ( Range< ValueType >  other) const
inlinenoexcept

Returns the range that is the intersection of the two ranges, or an empty range with an undefined start position if they don't overlap.

template<typename ValueType>
ValueType juce::Range< ValueType >::getLength ( ) const
inlinenoexcept

Returns the length of the range.

template<typename ValueType>
ValueType juce::Range< ValueType >::getStart ( ) const
inlinenoexcept

Returns the start of the range.

template<typename ValueType>
Range juce::Range< ValueType >::getUnionWith ( Range< ValueType >  other) const
inlinenoexcept

Returns the smallest range that contains both this one and the other one.

template<typename ValueType>
Range juce::Range< ValueType >::getUnionWith ( const ValueType  valueToInclude) const
inlinenoexcept

Returns the smallest range that contains both this one and the given value.

template<typename ValueType>
bool juce::Range< ValueType >::intersects ( Range< ValueType >  other) const
inlinenoexcept

Returns true if the given range intersects this one.

template<typename ValueType>
bool juce::Range< ValueType >::isEmpty ( ) const
inlinenoexcept

Returns true if the range has a length of zero.

template<typename ValueType>
Range juce::Range< ValueType >::movedToEndAt ( const ValueType  newEnd) const
inlinenoexcept

Returns a range with the same length as this one, but moved to have the given end position.

template<typename ValueType>
Range juce::Range< ValueType >::movedToStartAt ( const ValueType  newStart) const
inlinenoexcept

Returns a range with the same length as this one, but moved to have the given start position.

template<typename ValueType>
bool juce::Range< ValueType >::operator!= ( Range< ValueType >  other) const
inlinenoexcept
template<typename ValueType>
Range juce::Range< ValueType >::operator+ ( const ValueType  amountToAdd) const
inlinenoexcept

Returns a range that is equal to this one with an amount added to its start and end.

template<typename ValueType>
Range juce::Range< ValueType >::operator+= ( const ValueType  amountToAdd)
inlinenoexcept

Adds an amount to the start and end of the range.

template<typename ValueType>
Range juce::Range< ValueType >::operator- ( const ValueType  amountToSubtract) const
inlinenoexcept

Returns a range that is equal to this one with the specified amount subtracted from its start and end.

template<typename ValueType>
Range juce::Range< ValueType >::operator-= ( const ValueType  amountToSubtract)
inlinenoexcept

Subtracts an amount from the start and end of the range.

template<typename ValueType>
Range& juce::Range< ValueType >::operator= ( Range< ValueType >  other)
inlinenoexcept

Copies another range object.

template<typename ValueType>
bool juce::Range< ValueType >::operator== ( Range< ValueType >  other) const
inlinenoexcept
template<typename ValueType>
void juce::Range< ValueType >::setEnd ( const ValueType  newEnd)
inlinenoexcept

Changes the end position of the range, leaving the start unchanged. If the new end position is below the current start of the range, the start point will be pushed back to equal the new end point.

template<typename ValueType>
void juce::Range< ValueType >::setLength ( const ValueType  newLength)
inlinenoexcept

Changes the length of the range. Lengths less than zero are treated as zero.

template<typename ValueType>
void juce::Range< ValueType >::setStart ( const ValueType  newStart)
inlinenoexcept

Changes the start position of the range, leaving the end position unchanged. If the new start position is higher than the current end of the range, the end point will be pushed along to equal it, leaving an empty range at the new position.

template<typename ValueType>
Range juce::Range< ValueType >::withEnd ( const ValueType  newEnd) const
inlinenoexcept

Returns a range with the same start position as this one, but a different end. If the new end position is below the current start of the range, the start point will be pushed back to equal the new end point.

template<typename ValueType>
Range juce::Range< ValueType >::withLength ( const ValueType  newLength) const
inlinenoexcept

Returns a range with the same start as this one, but a different length. Lengths less than zero are treated as zero.

template<typename ValueType>
Range juce::Range< ValueType >::withStart ( const ValueType  newStart) const
inlinenoexcept

Returns a range with the same end as this one, but a different start. If the new start position is higher than the current end of the range, the end point will be pushed along to equal it, returning an empty range at the new position.

template<typename ValueType>
static Range juce::Range< ValueType >::withStartAndLength ( const ValueType  startValue,
const ValueType  length 
)
inlinestaticnoexcept

Returns a range with a given start and length.


The documentation for this class was generated from the following file: