Holds a set of named marker points along a one-dimensional axis.
This class is used to store sets of X and Y marker points in components.
Classes | |
class | Listener |
A class for receiving events when changes are made to a MarkerList. More... | |
class | Marker |
Represents a marker in a MarkerList. More... | |
struct | MarkerListHolder |
A base class for objects that want to provide a MarkerList. More... | |
class | ValueTreeWrapper |
Forms a wrapper around a ValueTree that can be used for storing a MarkerList. More... |
Public Member Functions | |
MarkerList () | |
Creates an empty marker list. | |
MarkerList (const MarkerList &) | |
Creates a copy of another marker list. | |
MarkerList & | operator= (const MarkerList &) |
Copies another marker list to this one. | |
~MarkerList () | |
Destructor. | |
int | getNumMarkers () const noexcept |
Returns the number of markers in the list. | |
const Marker * | getMarker (int index) const noexcept |
Returns one of the markers in the list, by its index. | |
const Marker * | getMarker (const String &name) const noexcept |
Returns a named marker, or nullptr if no such name is found. | |
double | getMarkerPosition (const Marker &marker, Component *parentComponent) const |
Evaluates the given marker and returns its absolute position. | |
void | setMarker (const String &name, const RelativeCoordinate &position) |
Sets the position of a marker. | |
void | removeMarker (int index) |
Deletes the marker at the given list index. | |
void | removeMarker (const String &name) |
Deletes the marker with the given name. | |
bool | operator== (const MarkerList &) const noexcept |
Returns true if all the markers in these two lists match exactly. | |
bool | operator!= (const MarkerList &) const noexcept |
Returns true if not all the markers in these two lists match exactly. | |
void | addListener (Listener *listener) |
Registers a listener that will be called when the markers are changed. | |
void | removeListener (Listener *listener) |
Deregisters a previously-registered listener. | |
void | markersHaveChanged () |
Synchronously calls markersChanged() on all the registered listeners. |
juce::MarkerList::MarkerList | ( | ) |
Creates an empty marker list.
Referenced by juce::MarkerList::ValueTreeWrapper::applyTo(), juce::MarkerList::MarkerListHolder::getMarkers(), MarkerList(), juce::MarkerList::Listener::markerListBeingDeleted(), juce::MarkerList::Listener::markersChanged(), operator!=(), operator=(), operator==(), and juce::MarkerList::ValueTreeWrapper::readFrom().
juce::MarkerList::MarkerList | ( | const MarkerList & | ) |
Creates a copy of another marker list.
References MarkerList().
juce::MarkerList::~MarkerList | ( | ) |
Destructor.
MarkerList & juce::MarkerList::operator= | ( | const MarkerList & | ) |
Copies another marker list to this one.
References MarkerList().
|
noexcept |
Returns the number of markers in the list.
|
noexcept |
Returns one of the markers in the list, by its index.
References getMarker().
Referenced by getMarker(), and getMarker().
Returns a named marker, or nullptr if no such name is found.
Note that name comparisons are case-sensitive.
References getMarker().
double juce::MarkerList::getMarkerPosition | ( | const Marker & | marker, |
Component * | parentComponent ) const |
Evaluates the given marker and returns its absolute position.
The parent component must be supplied in case the marker's expression refers to the size of its parent component.
References getMarkerPosition().
Referenced by getMarkerPosition().
void juce::MarkerList::setMarker | ( | const String & | name, |
const RelativeCoordinate & | position ) |
Sets the position of a marker.
If the name already exists, then the existing marker is moved; if it doesn't exist, then a new marker is added.
References setMarker().
Referenced by setMarker().
void juce::MarkerList::removeMarker | ( | int | index | ) |
Deletes the marker at the given list index.
References removeMarker().
Referenced by removeMarker(), and removeMarker().
void juce::MarkerList::removeMarker | ( | const String & | name | ) |
Deletes the marker with the given name.
References removeMarker().
|
noexcept |
Returns true if all the markers in these two lists match exactly.
References MarkerList().
|
noexcept |
Returns true if not all the markers in these two lists match exactly.
References MarkerList().
void juce::MarkerList::addListener | ( | Listener * | listener | ) |
Registers a listener that will be called when the markers are changed.
void juce::MarkerList::removeListener | ( | Listener * | listener | ) |
Deregisters a previously-registered listener.
void juce::MarkerList::markersHaveChanged | ( | ) |
Synchronously calls markersChanged() on all the registered listeners.