From 50a3102b9b533d7f8786d220f8df67421b9227c8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Jul 2006 03:43:32 +0000 Subject: Merge big changes (mostly Controllable) from trunk git-svn-id: svn://localhost/ardour2/branches/midi@682 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/panner.h | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) (limited to 'libs/ardour/ardour/panner.h') diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h index 806f350e03..37c985a2ef 100644 --- a/libs/ardour/ardour/panner.h +++ b/libs/ardour/ardour/panner.h @@ -27,10 +27,10 @@ #include #include -#include +#include +#include #include -#include #include 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, public Stateful, public sigc:: std::vector 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 -- cgit v1.2.3