JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::MarkerList Class Reference

Holds a set of named marker points along a one-dimensional axis. More...

#include <juce_MarkerList.h>

Collaboration diagram for juce::MarkerList:

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. More...
 
 MarkerList (const MarkerList &)
 Creates a copy of another marker list. More...
 
 ~MarkerList ()
 Destructor. More...
 
void addListener (Listener *listener)
 Registers a listener that will be called when the markers are changed. More...
 
const MarkergetMarker (int index) const noexcept
 Returns one of the markers in the list, by its index. More...
 
const MarkergetMarker (const String &name) const noexcept
 Returns a named marker, or nullptr if no such name is found. More...
 
double getMarkerPosition (const Marker &marker, Component *parentComponent) const
 Evaluates the given marker and returns its absolute position. More...
 
int getNumMarkers () const noexcept
 Returns the number of markers in the list. More...
 
void markersHaveChanged ()
 Synchronously calls markersChanged() on all the registered listeners. More...
 
bool operator!= (const MarkerList &) const noexcept
 Returns true if not all the markers in these two lists match exactly. More...
 
MarkerListoperator= (const MarkerList &)
 Copies another marker list to this one. More...
 
bool operator== (const MarkerList &) const noexcept
 Returns true if all the markers in these two lists match exactly. More...
 
void removeListener (Listener *listener)
 Deregisters a previously-registered listener. More...
 
void removeMarker (int index)
 Deletes the marker at the given list index. More...
 
void removeMarker (const String &name)
 Deletes the marker with the given name. More...
 
void setMarker (const String &name, const RelativeCoordinate &position)
 Sets the position of a marker. More...
 

Private Member Functions

MarkergetMarkerByName (const String &name) const noexcept
 

Private Attributes

ListenerList< Listenerlisteners
 
OwnedArray< Markermarkers
 

Detailed Description

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.

See also
Component::getMarkers().

{GUI}

Constructor & Destructor Documentation

◆ MarkerList() [1/2]

juce::MarkerList::MarkerList ( )

Creates an empty marker list.

◆ MarkerList() [2/2]

juce::MarkerList::MarkerList ( const MarkerList )

Creates a copy of another marker list.

◆ ~MarkerList()

juce::MarkerList::~MarkerList ( )

Destructor.

Member Function Documentation

◆ addListener()

void juce::MarkerList::addListener ( Listener listener)

Registers a listener that will be called when the markers are changed.

◆ getMarker() [1/2]

const Marker* juce::MarkerList::getMarker ( int  index) const
noexcept

Returns one of the markers in the list, by its index.

◆ getMarker() [2/2]

const Marker* juce::MarkerList::getMarker ( const String name) const
noexcept

Returns a named marker, or nullptr if no such name is found.

Note that name comparisons are case-sensitive.

◆ getMarkerByName()

Marker* juce::MarkerList::getMarkerByName ( const String name) const
privatenoexcept

◆ getMarkerPosition()

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.

◆ getNumMarkers()

int juce::MarkerList::getNumMarkers ( ) const
noexcept

Returns the number of markers in the list.

◆ markersHaveChanged()

void juce::MarkerList::markersHaveChanged ( )

Synchronously calls markersChanged() on all the registered listeners.

◆ operator!=()

bool juce::MarkerList::operator!= ( const MarkerList ) const
noexcept

Returns true if not all the markers in these two lists match exactly.

◆ operator=()

MarkerList& juce::MarkerList::operator= ( const MarkerList )

Copies another marker list to this one.

◆ operator==()

bool juce::MarkerList::operator== ( const MarkerList ) const
noexcept

Returns true if all the markers in these two lists match exactly.

◆ removeListener()

void juce::MarkerList::removeListener ( Listener listener)

Deregisters a previously-registered listener.

◆ removeMarker() [1/2]

void juce::MarkerList::removeMarker ( int  index)

Deletes the marker at the given list index.

◆ removeMarker() [2/2]

void juce::MarkerList::removeMarker ( const String name)

Deletes the marker with the given name.

◆ setMarker()

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.

Member Data Documentation

◆ listeners

ListenerList<Listener> juce::MarkerList::listeners
private

◆ markers

OwnedArray<Marker> juce::MarkerList::markers
private

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