Move Loop Location to Processors
[ardour.git] / libs / ardour / disk_writer.cc
index 06218d1ff140337706e4cbca59e5f15ebbb8ae91..c5c9beca36f222d515dd5c95162d1a7fad5150a0 100644 (file)
@@ -272,9 +272,9 @@ DiskWriter::set_align_style (AlignStyle a, bool force)
 }
 
 XMLNode&
-DiskWriter::state (bool full)
+DiskWriter::state ()
 {
-       XMLNode& node (DiskIOProcessor::state (full));
+       XMLNode& node (DiskIOProcessor::state ());
        node.set_property (X_("type"), X_("diskwriter"));
        node.set_property (X_("record-safe"), (_record_safe ? X_("yes" : "no")));
        return node;
@@ -359,7 +359,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
        bool re = record_enabled ();
        bool punch_in = _session.config.get_punch_in () && _session.locations()->auto_punch_location ();
        bool can_record = _session.actively_recording ();
-       can_record |= _session.get_record_enabled () && punch_in && _session.transport_sample () <= _session.locations()->auto_punch_location ()->start ();
+       can_record |= speed != 0 && _session.get_record_enabled () && punch_in && _session.transport_sample () <= _session.locations()->auto_punch_location ()->start ();
 
        _need_butler = false;
 
@@ -384,7 +384,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
                last_recordable_sample = max_samplepos;
        }
 
-       const Location* const loop_loc    = loop_location;
+       const Location* const loop_loc    = _loop_location;
        samplepos_t           loop_start  = 0;
        samplepos_t           loop_end    = 0;
        samplepos_t           loop_length = 0;
@@ -648,6 +648,16 @@ DiskWriter::finish_capture (boost::shared_ptr<ChannelList> c)
        first_recordable_sample = max_samplepos;
 }
 
+boost::shared_ptr<MidiBuffer>
+DiskWriter::get_gui_feed_buffer () const
+{
+       boost::shared_ptr<MidiBuffer> b (new MidiBuffer (AudioEngine::instance()->raw_buffer_size (DataType::MIDI)));
+
+       Glib::Threads::Mutex::Lock lm (_gui_feed_buffer_mutex);
+       b->copy (_gui_feed_buffer);
+       return b;
+}
+
 void
 DiskWriter::set_record_enabled (bool yn)
 {
@@ -1371,14 +1381,8 @@ DiskWriter::use_destructive_playlist ()
                assert((*chan)->write_source);
                (*chan)->write_source->set_allow_remove_if_empty (false);
 
-               /* this might be false if we switched modes, so force it */
-
-#ifdef XXX_OLD_DESTRUCTIVE_API_XXX
-               (*chan)->write_source->set_destructive (true);
-#else
                // should be set when creating the source or loading the state
                assert ((*chan)->write_source->destructive());
-#endif
        }
 
        /* the source list will never be reset for a destructive track */
@@ -1397,7 +1401,6 @@ DiskWriter::adjust_buffering ()
 void
 DiskWriter::realtime_handle_transport_stopped ()
 {
-       realtime_speed_change ();
 }
 
 bool