A rectangle that represents a range of samples. More...
Inherits Component.
Public Member Functions | |
void | checkBounds () |
This can be used to limit the sample area bounds. More... | |
Colour | getAreaColour () const |
Returns the hardcoded colour depending on the AreaType. More... | |
int | getSampleForX (int x, bool relativeToAudioDisplayComponent=false) const |
Returns the sample index for the given x coordinate. More... | |
Range< int > | getSampleRange () const |
Returns the sample range (0 ... More... | |
int | getXForSample (int sample, bool relativeToAudioDisplayComponent=false) const |
Returns the x-coordinate of the given sample within its parent. More... | |
void | mouseDown (const MouseEvent &e) override |
Sets the current SampleArea. More... | |
void | mouseDrag (const MouseEvent &e) override |
Updates the position by using a boundary check for legal bounds. More... | |
void | mouseUp (const MouseEvent &e) override |
Sends a change message to all registered listeners of the parent AudioDisplayComponent. More... | |
SampleArea (int areaType, AudioDisplayComponent *parentWaveform_) | |
Creates a new SampleArea. More... | |
void | setAllowedPixelRanges (Range< int > leftRangeInSamples, Range< int > rightRangeInSamples) |
You can set a constrainer on the boundaries of the SampleArea. More... | |
void | setAreaEnabled (bool shouldBeEnabled) |
This toggles the area enabled (which is not the same as Component::setEnabled()) | |
void | setSampleRange (Range< int > r) |
Sets the sample range that this SampleArea represents. More... | |
A rectangle that represents a range of samples.
SampleArea | ( | int | areaType, |
AudioDisplayComponent * | parentWaveform_ | ||
) |
Creates a new SampleArea.
area | the AreaType that will be used. |
parentWaveform | the waveform that owns this area. |
void checkBounds | ( | ) |
This can be used to limit the sample area bounds.
Colour getAreaColour | ( | ) | const |
Returns the hardcoded colour depending on the AreaType.
int getSampleForX | ( | int | x, |
bool | relativeToAudioDisplayComponent = false |
||
) | const |
Returns the sample index for the given x coordinate.
If 'relativeToAudioDisplayComponent' is set to true, the x coordinate is relative to the parent AudioDisplayComponent
|
inline |
Returns the sample range (0 ...
numSamples).
int getXForSample | ( | int | sample, |
bool | relativeToAudioDisplayComponent = false |
||
) | const |
Returns the x-coordinate of the given sample within its parent.
If a SampleArea is a child of another SampleArea, you can still get the absolute x value by passing 'true'.a
|
override |
Sets the current SampleArea.
|
override |
Updates the position by using a boundary check for legal bounds.
|
override |
Sends a change message to all registered listeners of the parent AudioDisplayComponent.
|
inline |
You can set a constrainer on the boundaries of the SampleArea.
If you don't want a constrainer (which is the default), simply pass two empty ranges.
|
inline |
Sets the sample range that this SampleArea represents.