Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
871:0b15c9328003 | 872:afeb580b1b57 |
---|---|
121 Clipboard::Point::getFrame() const | 121 Clipboard::Point::getFrame() const |
122 { | 122 { |
123 return m_frame; | 123 return m_frame; |
124 } | 124 } |
125 | 125 |
126 Clipboard::Point | |
127 Clipboard::Point::withFrame(long frame) const | |
128 { | |
129 Point p(*this); | |
130 p.m_haveFrame = true; | |
131 p.m_frame = frame; | |
132 return p; | |
133 } | |
134 | |
126 bool | 135 bool |
127 Clipboard::Point::haveValue() const | 136 Clipboard::Point::haveValue() const |
128 { | 137 { |
129 return m_haveValue; | 138 return m_haveValue; |
130 } | 139 } |
133 Clipboard::Point::getValue() const | 142 Clipboard::Point::getValue() const |
134 { | 143 { |
135 return m_value; | 144 return m_value; |
136 } | 145 } |
137 | 146 |
147 Clipboard::Point | |
148 Clipboard::Point::withValue(float value) const | |
149 { | |
150 Point p(*this); | |
151 p.m_haveValue = true; | |
152 p.m_value = value; | |
153 return p; | |
154 } | |
155 | |
138 bool | 156 bool |
139 Clipboard::Point::haveDuration() const | 157 Clipboard::Point::haveDuration() const |
140 { | 158 { |
141 return m_haveDuration; | 159 return m_haveDuration; |
142 } | 160 } |
145 Clipboard::Point::getDuration() const | 163 Clipboard::Point::getDuration() const |
146 { | 164 { |
147 return m_duration; | 165 return m_duration; |
148 } | 166 } |
149 | 167 |
168 Clipboard::Point | |
169 Clipboard::Point::withDuration(size_t duration) const | |
170 { | |
171 Point p(*this); | |
172 p.m_haveDuration = true; | |
173 p.m_duration = duration; | |
174 return p; | |
175 } | |
176 | |
150 bool | 177 bool |
151 Clipboard::Point::haveLabel() const | 178 Clipboard::Point::haveLabel() const |
152 { | 179 { |
153 return m_haveLabel; | 180 return m_haveLabel; |
154 } | 181 } |
157 Clipboard::Point::getLabel() const | 184 Clipboard::Point::getLabel() const |
158 { | 185 { |
159 return m_label; | 186 return m_label; |
160 } | 187 } |
161 | 188 |
189 Clipboard::Point | |
190 Clipboard::Point::withLabel(QString label) const | |
191 { | |
192 Point p(*this); | |
193 p.m_haveLabel = true; | |
194 p.m_label = label; | |
195 return p; | |
196 } | |
197 | |
162 bool | 198 bool |
163 Clipboard::Point::haveLevel() const | 199 Clipboard::Point::haveLevel() const |
164 { | 200 { |
165 return m_haveLevel; | 201 return m_haveLevel; |
166 } | 202 } |
167 | 203 |
168 float | 204 float |
169 Clipboard::Point::getLevel() const | 205 Clipboard::Point::getLevel() const |
170 { | 206 { |
171 return m_level; | 207 return m_level; |
208 } | |
209 | |
210 Clipboard::Point | |
211 Clipboard::Point::withLevel(float level) const | |
212 { | |
213 Point p(*this); | |
214 p.m_haveLevel = true; | |
215 p.m_level = level; | |
216 return p; | |
172 } | 217 } |
173 | 218 |
174 bool | 219 bool |
175 Clipboard::Point::haveReferenceFrame() const | 220 Clipboard::Point::haveReferenceFrame() const |
176 { | 221 { |