id_t becomes a fully-fledged object, UUID's used for IDs, generic MIDI now owns bindi...
[ardour.git] / libs / ardour / ardour / panner.h
index 806f350e03b915b4fe054531d932c7fa40fea2eb..37c985a2ef7fa935739086278b9495d81ad9eb16 100644 (file)
 #include <iostream>
 #include <sigc++/signal.h>
 
-#include <midi++/controllable.h>
+#include <pbd/stateful.h> 
+#include <pbd/controllable.h>
 
 #include <ardour/types.h>
-#include <ardour/stateful.h>
 #include <ardour/curve.h>
 
 using std::istream;
@@ -75,24 +75,7 @@ class StreamPanner : public sigc::trackable, public Stateful
        virtual void set_automation_state (AutoState) = 0;
        virtual void set_automation_style (AutoStyle) = 0;
        
-       /* MIDI control */
-
-       struct MIDIControl : public MIDI::Controllable {
-           MIDIControl (StreamPanner&, MIDI::Port *);
-           void set_value (float);
-           void send_feedback (gain_t);
-           MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, gain_t val, bool force = false);
-
-           pan_t (*midi_to_pan)(double val);
-           double (*pan_to_midi)(pan_t p);
-
-           StreamPanner& sp;
-           bool setting;
-           gain_t last_written;
-       };
-
-       MIDIControl& midi_control()  { return _midi_control; }
-       void reset_midi_control (MIDI::Port *, bool);
+       PBD::Controllable& control()  { return _control; }
        
        /* XXX this is wrong. for multi-dimensional panners, there
           must surely be more than 1 automation curve.
@@ -100,7 +83,6 @@ class StreamPanner : public sigc::trackable, public Stateful
 
        virtual Curve& automation() = 0;
 
-
        virtual int load (istream&, string path, uint32_t&) = 0;
 
        virtual int save (ostream&) const = 0;
@@ -130,12 +112,20 @@ class StreamPanner : public sigc::trackable, public Stateful
        float effective_z;
 
        bool             _muted;
-       MIDIControl _midi_control;
 
-       void add_state (XMLNode&);
-       bool get_midi_node_info (XMLNode * node, MIDI::eventType & ev, MIDI::channel_t & chan, MIDI::byte & additional);
-       bool set_midi_node_info (XMLNode * node, MIDI::eventType ev, MIDI::channel_t chan, MIDI::byte additional);
+       struct PanControllable : public PBD::Controllable {
+           PanControllable (StreamPanner& p) : panner (p) {}
+           
+           StreamPanner& panner;
+           
+           void set_value (float);
+           float get_value (void) const;
+           bool can_send_feedback() const;
+       };
 
+       PanControllable  _control;
+
+       void add_state (XMLNode&);
        virtual void update () = 0;
 };
 
@@ -290,10 +280,6 @@ class Panner : public std::vector<StreamPanner*>, public Stateful, public sigc::
        std::vector<Output> outputs;
        Session& session() const { return _session; }
 
-       void reset_midi_control (MIDI::Port *, bool);
-       void send_all_midi_feedback ();
-       MIDI::byte* write_midi_feedback (MIDI::byte*, int32_t& bufsize);
-
        enum LinkDirection {
                SameDirection,
                OppositeDirection