another unusued parameter fix
[ardour.git] / libs / ardour / midi_track.cc
index 800e7949d5a7b5f6694784e4df7739301fc2e427..65a42836a35b57d981579431e9eb0eb499fcb049 100644 (file)
@@ -196,10 +196,8 @@ MidiTrack::state(bool full_state)
                root.add_child_nocopy (*freeze_node);
        }
 
-       root.add_property (X_("note-mode"), enum_2_string (_note_mode));
-
-       root.add_property ("step-editing", (_step_editing ? "yes" : "no"));
        root.add_property ("note-mode", enum_2_string (_note_mode));
+       root.add_property ("step-editing", (_step_editing ? "yes" : "no"));
        root.add_property ("input-active", (_input_active ? "yes" : "no"));
 
        return root;
@@ -276,7 +274,7 @@ MidiTrack::set_state_part_two ()
 int
 MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
 {
-       Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+       Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
        if (!lm.locked()) {
                return 0;
        }
@@ -354,12 +352,16 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
                BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
                MidiBuffer& mbuf (bufs.get_midi (0));
 
-               /* we are a MIDI track, so we always start the chain with a single-channel diskstream */
+               /* we are a MIDI track, so we always start the chain with a
+                * single-MIDI-channel diskstream 
+                */
                ChanCount c;
                c.set_audio (0);
                c.set_midi (1);
                bufs.set_count (c);
 
+               assert (nframes > 0);
+
                diskstream->get_playback (mbuf, nframes);
 
                /* append immediate messages to the first MIDI buffer (thus sending it to the first output port) */
@@ -401,7 +403,7 @@ MidiTrack::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fr
 void
 MidiTrack::realtime_locate ()
 {
-       Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+       Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
 
        if (!lm.locked ()) {
                return;
@@ -417,7 +419,7 @@ MidiTrack::realtime_locate ()
 void
 MidiTrack::realtime_handle_transport_stopped ()
 {
-       Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+       Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
 
        if (!lm.locked ()) {
                return;
@@ -523,6 +525,13 @@ MidiTrack::set_note_mode (NoteMode m)
        midi_diskstream()->set_note_mode(m);
 }
 
+std::string
+MidiTrack::describe_parameter (Evoral::Parameter param)
+{
+       const std::string str(instrument_info().get_controller_name(param));
+       return str.empty() ? Automatable::describe_parameter(param) : str;
+}
+
 void
 MidiTrack::midi_panic()
 {
@@ -777,25 +786,9 @@ MidiTrack::set_monitoring (MonitorChoice mc)
 MonitorState
 MidiTrack::monitoring_state () const
 {
-       /* Explicit requests */
-       
-       if (_monitoring & MonitorInput) {
+       MonitorState ms = Track::monitoring_state();
+       if (ms == MonitoringSilence) {
                return MonitoringInput;
-       }
-               
-       if (_monitoring & MonitorDisk) {
-               return MonitoringDisk;
-       }
-
-       if (_session.transport_rolling()) {
-               return MonitoringDisk;
        } 
-
-       /* the return value here doesn't mean that we're actually monitoring
-        * input, let alone input *audio*. but it means that we are NOT 
-        * monitoring silence. this allows us to still hear any audio generated
-        * by using internal generation techniques
-        */
-
-       return MonitoringInput;
+       return ms;
 }