throw failed_constructor();
}
in_set_state--;
+
+ relayer ();
}
AudioPlaylist::AudioPlaylist (Session& session, string name, bool hidden)
Glib::RecMutex::Lock rm (region_lock);
framepos_t const end = start + cnt - 1;
- framecnt_t read_frames = 0;
- framecnt_t skip_frames = 0;
- _read_data_count = 0;
-
- _read_data_count = 0;
- RegionList* rlist = regions_to_read (start, start+cnt);
+ boost::shared_ptr<RegionList> rlist = regions_to_read (start, start+cnt);
if (rlist->empty()) {
- delete rlist;
return cnt;
}
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("Checking %1 xfades\n", _crossfades.size()));
for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {
- DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("%1 check xfade between %2 and %3 ...\n",
- name(), (*i)->out()->name(), (*i)->in()->name()));
+ DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("%1 check xfade between %2 and %3 ... [ %4 ... %5 | %6 ... %7]\n",
+ name(), (*i)->out()->name(), (*i)->in()->name(),
+ (*i)->first_frame(), (*i)->last_frame(),
+ start, end));
if ((*i)->coverage (start, end) != OverlapNone) {
relevant_xfades[(*i)->upper_layer()].push_back (*i);
- DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\t\txfade is relevant, place on layer %1\n",
- (*i)->upper_layer()));
+ DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\t\txfade is relevant (coverage = %2), place on layer %1\n",
+ (*i)->upper_layer(), enum_2_string ((*i)->coverage (start, end))));
}
}
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(*i);
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("read from region %1\n", ar->name()));
assert(ar);
- ar->read_at (buf, mixdown_buffer, gain_buffer, start, cnt, chan_n, read_frames, skip_frames);
- _read_data_count += ar->read_data_count();
+ ar->read_at (buf, mixdown_buffer, gain_buffer, start, cnt, chan_n);
}
for (vector<boost::shared_ptr<Crossfade> >::iterator i = x.begin(); i != x.end(); ++i) {
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("read from xfade between %1 & %2\n", (*i)->out()->name(), (*i)->in()->name()));
(*i)->read_at (buf, mixdown_buffer, gain_buffer, start, cnt, chan_n);
-
- /* don't JACK up _read_data_count, since its the same data as we just
- read from the regions, and the OS should handle that for us.
- */
}
}
- delete rlist;
return ret;
}
boost::shared_ptr<AudioRegion> top;
boost::shared_ptr<AudioRegion> bottom;
boost::shared_ptr<Crossfade> xfade;
- RegionList* touched_regions = 0;
+ boost::shared_ptr<RegionList> touched_regions;
if (in_set_state || in_partition) {
return;
OverlapType c = top->coverage (bottom->position(), bottom->last_frame());
- delete touched_regions;
- touched_regions = 0;
+ touched_regions.reset ();
try {
framecnt_t xfade_length;
if (top_region_at (top->first_frame()) == top) {
- xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn));
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, StartOfIn));
+ xfade->set_position (top->first_frame());
add_crossfade (xfade);
}
would cover it).
*/
- xfade = boost::shared_ptr<Crossfade> (new Crossfade (bottom, top, xfade_length, top->last_frame() - xfade_length, EndOfOut));
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (bottom, top, xfade_length, EndOfOut));
+ xfade->set_position (top->last_frame() - xfade_length);
add_crossfade (xfade);
}
break;
}
}
-
- delete touched_regions;
}
void