comparison base/Selection.cpp @ 9:73d85d19919f

* Add play-selection and looping modes. Looping seems to work OK, but the plain play-selection is miscalculating current frame number to feed back to the GUI. * Cache selection rectanges wherever possible in View::paintEvent.
author Chris Cannam
date Tue, 24 Jan 2006 16:20:58 +0000
parents 214054a0d8b8
children bb9291d84810
comparison
equal deleted inserted replaced
8:214054a0d8b8 9:73d85d19919f
63 { 63 {
64 return m_endFrame; 64 return m_endFrame;
65 } 65 }
66 66
67 bool 67 bool
68 Selection::contains(size_t frame) const
69 {
70 return (frame >= m_startFrame) && (frame < m_endFrame);
71 }
72
73 bool
68 Selection::operator<(const Selection &s) const 74 Selection::operator<(const Selection &s) const
69 { 75 {
70 return (m_startFrame < s.m_startFrame); 76 if (isEmpty()) {
77 if (s.isEmpty()) return false;
78 else return true;
79 } else {
80 if (s.isEmpty()) return false;
81 else return (m_startFrame < s.m_startFrame);
82 }
71 } 83 }
72 84
73 bool 85 bool
74 Selection::operator==(const Selection &s) const 86 Selection::operator==(const Selection &s) const
75 { 87 {
88 if (isEmpty()) return s.isEmpty();
89
76 return (m_startFrame == s.m_startFrame && 90 return (m_startFrame == s.m_startFrame &&
77 m_endFrame == s.m_endFrame); 91 m_endFrame == s.m_endFrame);
78 } 92 }
79 93