Mercurial > hg > svcore
diff base/Clipboard.cpp @ 872:afeb580b1b57 tonioni
Add methods to return new Clipboard points with particular characteristics (this is an immutable object)
author | Chris Cannam |
---|---|
date | Fri, 10 Jan 2014 15:21:01 +0000 |
parents | e73a1a1e8f24 |
children | 6a94bb528e9d |
line wrap: on
line diff
--- a/base/Clipboard.cpp Thu Jan 09 21:43:33 2014 +0000 +++ b/base/Clipboard.cpp Fri Jan 10 15:21:01 2014 +0000 @@ -123,6 +123,15 @@ return m_frame; } +Clipboard::Point +Clipboard::Point::withFrame(long frame) const +{ + Point p(*this); + p.m_haveFrame = true; + p.m_frame = frame; + return p; +} + bool Clipboard::Point::haveValue() const { @@ -135,6 +144,15 @@ return m_value; } +Clipboard::Point +Clipboard::Point::withValue(float value) const +{ + Point p(*this); + p.m_haveValue = true; + p.m_value = value; + return p; +} + bool Clipboard::Point::haveDuration() const { @@ -147,6 +165,15 @@ return m_duration; } +Clipboard::Point +Clipboard::Point::withDuration(size_t duration) const +{ + Point p(*this); + p.m_haveDuration = true; + p.m_duration = duration; + return p; +} + bool Clipboard::Point::haveLabel() const { @@ -159,6 +186,15 @@ return m_label; } +Clipboard::Point +Clipboard::Point::withLabel(QString label) const +{ + Point p(*this); + p.m_haveLabel = true; + p.m_label = label; + return p; +} + bool Clipboard::Point::haveLevel() const { @@ -171,6 +207,15 @@ return m_level; } +Clipboard::Point +Clipboard::Point::withLevel(float level) const +{ + Point p(*this); + p.m_haveLevel = true; + p.m_level = level; + return p; +} + bool Clipboard::Point::haveReferenceFrame() const {