Large nasty commit in the form of a 5000 line patch chock-full of completely
[ardour.git] / libs / ardour / panner.cc
index 130db16191aadf95d4a375da29e6b5dbe699ea4b..83c9e6eb4d7f48854bb4cbc8246451172b52f9a9 100644 (file)
 #include <unistd.h>
 #include <float.h>
 
+#include <glibmm.h>
+
 #include <pbd/error.h>
 #include <pbd/failed_constructor.h>
-#include <pbd/basename.h>
 #include <pbd/xml++.h>
 
 #include <ardour/session.h>
@@ -43,9 +44,9 @@
 
 #include <pbd/mathfix.h>
 
-
 using namespace std;
 using namespace ARDOUR;
+using namespace PBD;
 
 float Panner::current_automation_version_number = 1.0;
 
@@ -109,7 +110,8 @@ StreamPanner::MIDIControl::send_feedback (pan_t value)
                if (get_control_info (ch, ev, additional)) {
                        data.controller_number = additional;
                        data.value = val;
-
+                       last_written = val;
+                       
                        sp.get_parent().session().send_midi_message (get_port(), ev, ch, data);
                }
 
@@ -612,7 +614,8 @@ EqualPowerStereoPanner::distribute_automated (Sample* src, Sample** obufs,
 
        /* store effective pan position. do this even if we are muted */
 
-       effective_x = buffers[0][nframes-1];
+       if (nframes > 0) 
+               effective_x = buffers[0][nframes-1];
 
        if (_muted) {
                return;
@@ -1367,7 +1370,7 @@ Panner::state (bool full)
 
        if (full) {
                if (save () == 0) {
-                       root->add_property (X_("automation"), PBD::basename (automation_path));
+                       root->add_property (X_("automation"), Glib::path_get_basename (automation_path));
                }
        }