+ boost::shared_ptr<Processor> processor (p.lock ());
+ if (!processor) {
+ return;
+ }
+
+ list< Evoral::RangeMove<double> > movements;
+ for (list< Evoral::RangeMove<nframes_t> >::const_iterator i = movements_frames.begin();
+ i != movements_frames.end(); ++i) {
+ movements.push_back(Evoral::RangeMove<double>(i->from, i->length, i->to));
+ }
+
+ set<Evoral::Parameter> const a = processor->what_can_be_automated ();
+
+ for (set<Evoral::Parameter>::iterator i = a.begin (); i != a.end (); ++i) {
+ boost::shared_ptr<AutomationList> al = processor->automation_control(*i)->alist();
+ XMLNode & before = al->get_state ();
+ al->move_ranges (movements);
+ _session.add_command (
+ new MementoCommand<AutomationList> (
+ *al.get(), &before, &al->get_state ()
+ )
+ );
+ }
+}
+
+void
+Diskstream::check_record_status (nframes_t transport_frame, nframes_t /*nframes*/, bool can_record)
+{
+ int possibly_recording;
+ int rolling;
+ int change;
+ const int transport_rolling = 0x4;
+ const int track_rec_enabled = 0x2;
+ const int global_rec_enabled = 0x1;
+
+ /* merge together the 3 factors that affect record status, and compute
+ what has changed.
+ */
+
+ rolling = _session.transport_speed() != 0.0f;
+ possibly_recording = (rolling << 2) | (record_enabled() << 1) | can_record;
+ change = possibly_recording ^ last_possibly_recording;
+
+ if (possibly_recording == last_possibly_recording) {
+ return;
+ }
+
+ /* change state */
+
+ /* if per-track or global rec-enable turned on while the other was already on, we've started recording */
+
+ if (((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record)) ||
+ ((change & global_rec_enabled) && can_record && (!(change & track_rec_enabled) && record_enabled()))) {
+
+ /* starting to record: compute first+last frames */
+
+ first_recordable_frame = transport_frame + _capture_offset;
+ last_recordable_frame = max_frames;
+ capture_start_frame = transport_frame;
+
+ if (!(last_possibly_recording & transport_rolling) && (possibly_recording & transport_rolling)) {
+
+ /* was stopped, now rolling (and recording) */
+
+ if (_alignment_style == ExistingMaterial) {
+ first_recordable_frame += _session.worst_output_latency();
+ } else {
+ first_recordable_frame += _roll_delay;
+ }
+