+ std::multiset<cueEntry>::iterator i(m_cue_entries.begin());
+
+ while (1)
+ {
+ if (i == m_cue_entries.end())
+ out = m_length;
+ else {
+ if (i->what == 0) /* in */
+ {
+ in = i++->where;
+ continue;
+ } else if (i->what == 1) /* out */
+ out = i++->where;
+ else /* mark or last */
+ {
+ xm = scale(i->where);
+ if (i->what == 2) {
+ painter.setForegroundColor(gRGB(0xFF8080));
+ if (xm - 2 < xm_last) /* Make sure last is not overdrawn */
+ painter.fill(eRect(xm_last, 0, 2 + xm - xm_last, s.height()));
+ else
+ painter.fill(eRect(xm - 2, 0, 4, s.height()));
+ } else if (i->what == 3) {
+ painter.setForegroundColor(gRGB(0x80FF80));
+ painter.fill(eRect(xm - 1, 0, 3, s.height()));
+ xm_last = xm + 2;
+ }
+ i++;
+ continue;
+ }
+ }
+
+ if (m_have_foreground_color)
+ {
+ painter.setForegroundColor(gRGB(m_foreground_color));
+ int xi = scale(in), xo = scale(out);
+ painter.fill(eRect(xi, (s.height()-4) / 2, xo-xi, 4));
+ }
+
+ in = m_length;
+
+ if (i == m_cue_entries.end())
+ break;
+ }