An immutable(-ish) type used for point and event representation in sparse models, as well as for interchange within the clipboard. More...

#include <Event.h>

Classes

struct  ExportNameOptions
 

Public Member Functions

 Event ()
 
 Event (sv_frame_t frame)
 
 Event (sv_frame_t frame, QString label)
 
 Event (sv_frame_t frame, float value, QString label)
 
 Event (sv_frame_t frame, float value, sv_frame_t duration, QString label)
 
 Event (sv_frame_t frame, float value, sv_frame_t duration, float level, QString label)
 
 Event (const Event &event)=default
 
Eventoperator= (const Event &event)=default
 
Eventoperator= (Event &&event)=default
 
sv_frame_t getFrame () const
 
Event withFrame (sv_frame_t frame) const
 
bool hasValue () const
 
float getValue () const
 
Event withValue (float value) const
 
Event withoutValue () const
 
bool hasDuration () const
 
sv_frame_t getDuration () const
 
Event withDuration (sv_frame_t duration) const
 
Event withoutDuration () const
 
bool hasLabel () const
 
QString getLabel () const
 
Event withLabel (QString label) const
 
bool hasUri () const
 
QString getURI () const
 
Event withURI (QString uri) const
 
bool hasLevel () const
 
float getLevel () const
 
Event withLevel (float level) const
 
Event withoutLevel () const
 
bool hasReferenceFrame () const
 
sv_frame_t getReferenceFrame () const
 
bool referenceFrameDiffers () const
 
Event withReferenceFrame (sv_frame_t frame) const
 
Event withoutReferenceFrame () const
 
bool operator== (const Event &p) const
 
bool operator!= (const Event &p) const
 
bool operator< (const Event &p) const
 
void toXml (QTextStream &stream, QString indent="", QString extraAttributes="", ExportNameOptions opts=ExportNameOptions()) const
 
QString toXmlString (QString indent="", QString extraAttributes="") const
 
NoteData toNoteData (sv_samplerate_t sampleRate, bool valueIsMidiPitch) const
 
QVector< QString > getStringExportHeaders (DataExportOptions opts, ExportNameOptions nameOpts) const
 
QVector< QString > toStringExportRow (DataExportOptions opts, sv_samplerate_t sampleRate) const
 
uint hash (uint seed=0) const
 

Private Attributes

bool m_haveValue: 1
 
bool m_haveLevel: 1
 
bool m_haveDuration: 1
 
bool m_haveReferenceFrame: 1
 
float m_value
 
float m_level
 
sv_frame_t m_frame
 
sv_frame_t m_duration
 
sv_frame_t m_referenceFrame
 
QString m_label
 
QString m_uri
 

Detailed Description

An immutable(-ish) type used for point and event representation in sparse models, as well as for interchange within the clipboard.

An event always has a frame and (possibly empty) label, and optionally has numerical value, level, duration in frames, and a mapped reference frame. Event has an operator< defining a total ordering, by frame first and then by the other properties.

Event is based on the Clipboard::Point type up to SV v3.2.1 and is intended also to replace the custom point types previously found in sparse models.

Definition at line 55 of file Event.h.

Constructor & Destructor Documentation

Event::Event ( )
inline

Definition at line 58 of file Event.h.

Referenced by Event().

Event::Event ( sv_frame_t  frame)
inline

Definition at line 64 of file Event.h.

Event::Event ( sv_frame_t  frame,
QString  label 
)
inline

Definition at line 70 of file Event.h.

Event::Event ( sv_frame_t  frame,
float  value,
QString  label 
)
inline

Definition at line 76 of file Event.h.

Event::Event ( sv_frame_t  frame,
float  value,
sv_frame_t  duration,
QString  label 
)
inline

Definition at line 82 of file Event.h.

References m_duration, and m_frame.

Event::Event ( sv_frame_t  frame,
float  value,
sv_frame_t  duration,
float  level,
QString  label 
)
inline

Definition at line 93 of file Event.h.

References Event(), m_duration, m_frame, and operator=().

Event::Event ( const Event event)
default

Member Function Documentation

Event& Event::operator= ( const Event event)
default

Referenced by Event().

Event& Event::operator= ( Event &&  event)
default
bool Event::hasValue ( ) const
inline

Definition at line 121 of file Event.h.

References m_haveValue.

Referenced by RegionModel::add().

Event Event::withoutValue ( ) const
inline

Definition at line 130 of file Event.h.

References m_haveValue, and m_value.

Referenced by ImageModel::add(), and SparseOneDimensionalModel::add().

bool Event::hasDuration ( ) const
inline

Definition at line 137 of file Event.h.

References m_haveDuration.

Referenced by EventSeries::add(), and EventSeries::remove().

Event Event::withDuration ( sv_frame_t  duration) const
inline
Event Event::withoutDuration ( ) const
inline
bool Event::hasLabel ( ) const
inline

Definition at line 157 of file Event.h.

References m_label.

bool Event::hasUri ( ) const
inline

Definition at line 166 of file Event.h.

References m_uri.

QString Event::getURI ( ) const
inline

Definition at line 167 of file Event.h.

References m_uri.

Referenced by ImageModel::getData().

Event Event::withURI ( QString  uri) const
inline

Definition at line 169 of file Event.h.

References m_uri.

Referenced by ImageModel::getSetDataCommand().

bool Event::hasLevel ( ) const
inline

Definition at line 175 of file Event.h.

References m_haveLevel.

float Event::getLevel ( ) const
inline

Definition at line 176 of file Event.h.

References m_haveLevel, and m_level.

Referenced by BoxModel::add(), BoxModel::getData(), and NoteModel::getData().

Event Event::withLevel ( float  level) const
inline

Definition at line 178 of file Event.h.

References m_haveLevel, and m_level.

Referenced by BoxModel::getSetDataCommand(), and NoteModel::getSetDataCommand().

Event Event::withoutLevel ( ) const
inline

Definition at line 184 of file Event.h.

References m_haveLevel, and m_level.

Referenced by TextModel::add(), and ImageModel::add().

bool Event::hasReferenceFrame ( ) const
inline

Definition at line 191 of file Event.h.

References m_haveReferenceFrame.

sv_frame_t Event::getReferenceFrame ( ) const
inline

Definition at line 192 of file Event.h.

References m_frame, m_haveReferenceFrame, and m_referenceFrame.

bool Event::referenceFrameDiffers ( ) const
inline

Definition at line 196 of file Event.h.

References m_frame, m_haveReferenceFrame, and m_referenceFrame.

Event Event::withReferenceFrame ( sv_frame_t  frame) const
inline

Definition at line 200 of file Event.h.

References m_haveReferenceFrame, and m_referenceFrame.

Event Event::withoutReferenceFrame ( ) const
inline

Definition at line 206 of file Event.h.

References m_haveReferenceFrame, and m_referenceFrame.

bool Event::operator== ( const Event p) const
inline
bool Event::operator!= ( const Event p) const
inline

Definition at line 236 of file Event.h.

References operator==().

bool Event::operator< ( const Event p) const
inline
void Event::toXml ( QTextStream &  stream,
QString  indent = "",
QString  extraAttributes = "",
ExportNameOptions  opts = ExportNameOptions() 
) const
inline
QString Event::toXmlString ( QString  indent = "",
QString  extraAttributes = "" 
) const
inline

Definition at line 329 of file Event.h.

References toXml().

Referenced by EventSeries::remove().

NoteData Event::toNoteData ( sv_samplerate_t  sampleRate,
bool  valueIsMidiPitch 
) const
inline
QVector<QString> Event::toStringExportRow ( DataExportOptions  opts,
sv_samplerate_t  sampleRate 
) const
inline
uint Event::hash ( uint  seed = 0) const
inline

Member Data Documentation

bool Event::m_haveValue
private
bool Event::m_haveLevel
private
bool Event::m_haveDuration
private
bool Event::m_haveReferenceFrame
private
float Event::m_value
private
float Event::m_level
private
sv_frame_t Event::m_duration
private
sv_frame_t Event::m_referenceFrame
private
QString Event::m_label
private

Definition at line 486 of file Event.h.

Referenced by getLabel(), hash(), hasLabel(), operator<(), operator==(), toStringExportRow(), toXml(), and withLabel().

QString Event::m_uri
private

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