-
- if (empty()) {
-
- _current_start = 0;
- _current_end = 0;
-
- } else {
-
- boost::shared_ptr<Region> region ((*i)->region());
-
- if (region->first_frame() == _current_start) {
-
- /* reset current start */
-
- nframes_t ref = max_frames;
-
- for (i = begin (); i != end(); ++i) {
- if (region->first_frame() < ref) {
- ref = region->first_frame();
- }
- }
-
- _current_start = ref;
-
- }
-
- if (region->last_frame() == _current_end) {
-
- /* reset current end */
-
- nframes_t ref = 0;
-
- for (i = begin (); i != end(); ++i) {
- if (region->first_frame() > ref) {
- ref = region->first_frame();
- }
- }
-
- _current_end = ref;
- }
- }