17 #include <QTextStream> 26 m_startFrame(startFrame),
37 m_startFrame(s.m_startFrame),
38 m_endFrame(s.m_endFrame)
139 SelectionList::iterator j = i;
142 if (i->getEndFrame() >= j->getStartFrame()) {
144 std::max(i->getEndFrame(), j->getEndFrame()));
182 for (SelectionList::const_iterator i =
m_selections.begin();
185 if (i ==
m_selections.begin() || i->getStartFrame() < startFrame) {
186 startFrame = i->getStartFrame();
189 if (i ==
m_selections.begin() || i->getEndFrame() > endFrame) {
190 endFrame = i->getEndFrame();
202 for (SelectionList::const_iterator i =
m_selections.begin();
205 if (i->contains(frame))
return *i;
207 if (i->getStartFrame() > frame) {
208 if (defaultToFollowing)
return *i;
218 QString extraAttributes)
const 220 stream << indent << QString(
"<selections %1>\n").arg(extraAttributes);
224 << QString(
" <selection start=\"%1\" end=\"%2\"/>\n")
225 .arg(i->getStartFrame()).arg(i->getEndFrame());
227 stream << indent <<
"</selections>\n";
void removeSelection(const Selection &selection)
void setSelection(const Selection &selection)
A selection object simply represents a range in time, via start and end frame.
bool contains(int frame) const
virtual ~MultiSelection()
bool operator==(const Selection &) const
SelectionList m_selections
void addSelection(const Selection &selection)
void getExtents(int &startFrame, int &endFrame) const
Selection getContainingSelection(int frame, bool defaultToFollowing) const
Return the selection that contains a given frame.
bool operator<(const Selection &) const
std::set< Selection > SelectionList
const SelectionList & getSelections() const
int getStartFrame() const
Selection & operator=(const Selection &)
virtual void toXml(QTextStream &stream, QString indent="", QString extraAttributes="") const
Stream this exportable object out to XML on a text stream.