mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 15:16:25 +01:00
fixups for xrun-marker work, now that Region::sample() and Region::length() so not return sample types
This commit is contained in:
parent
6536655a0a
commit
9a9bc3408f
2 changed files with 7 additions and 5 deletions
|
|
@ -501,7 +501,7 @@ RegionView::reset_width_dependent_items (double pixel_width)
|
||||||
_pixel_width = pixel_width;
|
_pixel_width = pixel_width;
|
||||||
|
|
||||||
if (_xrun_markers_visible) {
|
if (_xrun_markers_visible) {
|
||||||
const samplepos_t start = _region->start();
|
const samplepos_t start = _region->start_sample();
|
||||||
for (list<std::pair<samplepos_t, ArdourCanvas::Arrow*> >::iterator i = _xrun_markers.begin(); i != _xrun_markers.end(); ++i) {
|
for (list<std::pair<samplepos_t, ArdourCanvas::Arrow*> >::iterator i = _xrun_markers.begin(); i != _xrun_markers.end(); ++i) {
|
||||||
float x_pos = trackview.editor().sample_to_pixel (i->first - start);
|
float x_pos = trackview.editor().sample_to_pixel (i->first - start);
|
||||||
i->second->set_x (x_pos);
|
i->second->set_x (x_pos);
|
||||||
|
|
@ -517,8 +517,8 @@ RegionView::update_xrun_markers ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const samplepos_t start = _region->start();
|
const samplepos_t start = _region->start_sample();
|
||||||
const samplepos_t length = _region->length();
|
const samplepos_t length = _region->length_samples();
|
||||||
for (list<std::pair<samplepos_t, ArdourCanvas::Arrow*> >::iterator i = _xrun_markers.begin(); i != _xrun_markers.end(); ++i) {
|
for (list<std::pair<samplepos_t, ArdourCanvas::Arrow*> >::iterator i = _xrun_markers.begin(); i != _xrun_markers.end(); ++i) {
|
||||||
float x_pos = trackview.editor().sample_to_pixel (i->first - start);
|
float x_pos = trackview.editor().sample_to_pixel (i->first - start);
|
||||||
i->second->set_x (x_pos);
|
i->second->set_x (x_pos);
|
||||||
|
|
|
||||||
|
|
@ -1826,11 +1826,13 @@ Region::captured_xruns (XrunPositions& xruns, bool abs) const
|
||||||
bool was_empty = xruns.empty ();
|
bool was_empty = xruns.empty ();
|
||||||
for (SourceList::const_iterator i = _sources.begin (); i != _sources.end(); ++i) {
|
for (SourceList::const_iterator i = _sources.begin (); i != _sources.end(); ++i) {
|
||||||
XrunPositions const& x = (*i)->captured_xruns ();
|
XrunPositions const& x = (*i)->captured_xruns ();
|
||||||
|
const samplepos_t ss = start_sample();
|
||||||
|
const samplecnt_t ll = length_samples();
|
||||||
for (XrunPositions::const_iterator p = x.begin (); p != x.end (); ++p) {
|
for (XrunPositions::const_iterator p = x.begin (); p != x.end (); ++p) {
|
||||||
if (abs) {
|
if (abs) {
|
||||||
xruns.push_back (*p);
|
xruns.push_back (*p);
|
||||||
} else if (*p >= _start && *p < _start + _length) {
|
} else if (*p >= ss && *p < ss + ll) {
|
||||||
xruns.push_back (*p - _start);
|
xruns.push_back (*p - ss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue