summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/automatable.h3
-rw-r--r--libs/ardour/ardour/debug.h1
-rw-r--r--libs/ardour/ardour/delivery.h13
-rw-r--r--libs/ardour/ardour/directory_names.h1
-rw-r--r--libs/ardour/ardour/internal_send.h2
-rw-r--r--libs/ardour/ardour/pannable.h18
-rw-r--r--libs/ardour/ardour/panner.h339
-rw-r--r--libs/ardour/ardour/port_insert.h3
-rw-r--r--libs/ardour/ardour/route.h7
-rw-r--r--libs/ardour/ardour/send.h2
-rw-r--r--libs/ardour/ardour/speakers.h12
-rw-r--r--libs/ardour/ardour/types.h35
-rw-r--r--libs/ardour/ardour/vbap.h70
-rw-r--r--libs/ardour/ardour/vbap_speakers.h107
14 files changed, 163 insertions, 450 deletions
diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h
index 541e9d562d..c9e900e6a9 100644
--- a/libs/ardour/ardour/automatable.h
+++ b/libs/ardour/ardour/automatable.h
@@ -44,7 +44,6 @@ class Automatable : virtual public Evoral::ControlSet
public:
Automatable(Session&);
Automatable (const Automatable& other);
- Automatable();
virtual ~Automatable() {}
@@ -93,6 +92,8 @@ public:
typedef Evoral::ControlSet::Controls Controls;
+ static const std::string xml_node_name;
+
int set_automation_xml_state (const XMLNode&, Evoral::Parameter default_param);
XMLNode& get_automation_xml_state();
diff --git a/libs/ardour/ardour/debug.h b/libs/ardour/ardour/debug.h
index 43fb468b7a..69421662f3 100644
--- a/libs/ardour/ardour/debug.h
+++ b/libs/ardour/ardour/debug.h
@@ -48,6 +48,7 @@ namespace PBD {
extern uint64_t Monitor;
extern uint64_t Solo;
extern uint64_t AudioPlayback;
+ extern uint64_t Panning;
}
}
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h
index e1aa389df7..99893976ba 100644
--- a/libs/ardour/ardour/delivery.h
+++ b/libs/ardour/ardour/delivery.h
@@ -30,7 +30,9 @@ namespace ARDOUR {
class BufferSet;
class IO;
class MuteMaster;
+class PannerShell;
class Panner;
+class Pannable;
class Delivery : public IOProcessor
{
@@ -52,11 +54,11 @@ public:
/* Delivery to an existing output */
- Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<MuteMaster> mm, const std::string& name, Role);
+ Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Pannable>, boost::shared_ptr<MuteMaster> mm, const std::string& name, Role);
/* Delivery to a new output owned by this object */
- Delivery (Session& s, boost::shared_ptr<MuteMaster> mm, const std::string& name, Role);
+ Delivery (Session& s, boost::shared_ptr<Pannable>, boost::shared_ptr<MuteMaster> mm, const std::string& name, Role);
~Delivery ();
bool set_name (const std::string& name);
@@ -90,15 +92,14 @@ public:
static int disable_panners (void);
static int reset_panners (void);
- boost::shared_ptr<Panner> panner() const { return _panner; }
+ boost::shared_ptr<PannerShell> panner_shell() const { return _panshell; }
+ boost::shared_ptr<Panner> panner() const;
void reset_panner ();
void defer_pan_reset ();
void allow_pan_reset ();
uint32_t pans_required() const { return _configured_input.n_audio(); }
- void start_pan_touch (uint32_t which, double when);
- void end_pan_touch (uint32_t which, bool mark, double when);
protected:
Role _role;
@@ -108,7 +109,7 @@ public:
bool _no_outs_cuz_we_no_monitor;
boost::shared_ptr<MuteMaster> _mute_master;
bool no_panner_reset;
- boost::shared_ptr<Panner> _panner;
+ boost::shared_ptr<PannerShell> _panshell;
static bool panners_legal;
static PBD::Signal0<int> PannersLegal;
diff --git a/libs/ardour/ardour/directory_names.h b/libs/ardour/ardour/directory_names.h
index 9cce077ad0..a5fd6dc754 100644
--- a/libs/ardour/ardour/directory_names.h
+++ b/libs/ardour/ardour/directory_names.h
@@ -21,6 +21,7 @@ extern const char* const route_templates_dir_name;
extern const char* const surfaces_dir_name;
extern const char* const user_config_dir_name;
extern const char* const stub_dir_name;
+extern const char* const panner_dir_name;
};
diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h
index 903e4673df..53c6686887 100644
--- a/libs/ardour/ardour/internal_send.h
+++ b/libs/ardour/ardour/internal_send.h
@@ -28,7 +28,7 @@ namespace ARDOUR {
class InternalSend : public Send
{
public:
- InternalSend (Session&, boost::shared_ptr<MuteMaster>, boost::shared_ptr<Route> send_to, Delivery::Role role);
+ InternalSend (Session&, boost::shared_ptr<Pannable>, boost::shared_ptr<MuteMaster>, boost::shared_ptr<Route> send_to, Delivery::Role role);
virtual ~InternalSend ();
std::string display_name() const;
diff --git a/libs/ardour/ardour/pannable.h b/libs/ardour/ardour/pannable.h
index e6ed2e41c1..dff64cec4b 100644
--- a/libs/ardour/ardour/pannable.h
+++ b/libs/ardour/ardour/pannable.h
@@ -24,6 +24,7 @@
#include <boost/shared_ptr.hpp>
+#include "pbd/stateful.h"
#include "evoral/Parameter.hpp"
#include "ardour/automatable.h"
@@ -33,8 +34,9 @@ namespace ARDOUR {
class Session;
class AutomationControl;
+class Panner;
-struct Pannable : public Automatable, public SessionHandleRef {
+struct Pannable : public PBD::Stateful, public Automatable, public SessionHandleRef {
Pannable (Session& s);
boost::shared_ptr<AutomationControl> pan_azimuth_control;
@@ -42,6 +44,9 @@ struct Pannable : public Automatable, public SessionHandleRef {
boost::shared_ptr<AutomationControl> pan_width_control;
boost::shared_ptr<AutomationControl> pan_frontback_control;
boost::shared_ptr<AutomationControl> pan_lfe_control;
+
+ boost::shared_ptr<Panner> panner() const { return _panner; }
+ void set_panner(boost::shared_ptr<Panner>);
Session& session() { return _session; }
@@ -66,10 +71,21 @@ struct Pannable : public Automatable, public SessionHandleRef {
bool writing() const { return _auto_state == Write; }
bool touch_enabled() const { return _auto_state == Touch; }
+ XMLNode& get_state ();
+ XMLNode& state (bool full_state);
+ int set_state (const XMLNode&, int version);
+
+ bool has_state() const { return _has_state; }
+
protected:
+ boost::shared_ptr<Panner> _panner;
AutoState _auto_state;
AutoStyle _auto_style;
gint _touching;
+ bool _has_state;
+ uint32_t _responding_to_control_auto_state_change;
+
+ void control_auto_state_changed (AutoState);
};
} // namespace
diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h
index b07167862e..f43be2dbbc 100644
--- a/libs/ardour/ardour/panner.h
+++ b/libs/ardour/ardour/panner.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004-2011 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,116 +26,75 @@
#include <string>
#include <iostream>
-#include "pbd/stateful.h"
-#include "pbd/controllable.h"
#include "pbd/cartesian.h"
+#include "pbd/signals.h"
+#include "pbd/stateful.h"
#include "ardour/types.h"
#include "ardour/automation_control.h"
-#include "ardour/processor.h"
+#include "ardour/automatable.h"
namespace ARDOUR {
class Session;
-class Panner;
+class Pannable;
class BufferSet;
class AudioBuffer;
class Speakers;
-class StreamPanner : public PBD::Stateful
+class Panner : public PBD::Stateful, public PBD::ScopedConnectionList
{
public:
- StreamPanner (Panner& p, Evoral::Parameter param);
- ~StreamPanner ();
-
- void set_muted (bool yn);
- bool muted() const { return _muted; }
-
- const PBD::AngularVector& get_position() const { return _angles; }
- const PBD::AngularVector& get_effective_position() const { return _effective_angles; }
- void set_position (const PBD::AngularVector&, bool link_call = false);
- void set_diffusion (double);
-
- void distribute (AudioBuffer &, BufferSet &, gain_t, pframes_t);
- void distribute_automated (AudioBuffer &, BufferSet &, framepos_t, framepos_t, pframes_t, pan_t **);
-
- /* the basic StreamPanner API */
-
- /**
- * Pan some input samples to a number of output buffers.
- *
- * @param src Input buffer.
- * @param obufs Output buffers (one per panner output).
- * @param gain_coeff Gain coefficient to apply to output samples.
- * @param nframes Number of frames in the input.
- */
- virtual void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes) = 0;
- virtual void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
- framepos_t start, framepos_t end, pframes_t nframes,
- pan_t** buffers) = 0;
-
- boost::shared_ptr<AutomationControl> pan_control() { return _control; }
-
- PBD::Signal0<void> Changed; /* for position or diffusion */
- PBD::Signal0<void> StateChanged; /* for mute, mono */
-
- int set_state (const XMLNode&, int version);
- virtual XMLNode& state (bool full_state) = 0;
-
- Panner & get_parent() { return parent; }
-
- /* old school automation loading */
- virtual int load (std::istream&, std::string path, uint32_t&) = 0;
-
- struct PanControllable : public AutomationControl {
- PanControllable (Session& s, std::string name, StreamPanner* p, Evoral::Parameter param)
- : AutomationControl (s, param,
- boost::shared_ptr<AutomationList>(new AutomationList(param)), name)
- , streampanner (p)
- { assert (param.type() == PanAutomation); }
-
- AutomationList* alist() { return (AutomationList*)_list.get(); }
- StreamPanner* streampanner;
-
- void set_value (double);
- double get_value (void) const;
- double lower () const;
- };
-
- protected:
- friend class Panner;
- Panner& parent;
+ Panner (boost::shared_ptr<Pannable>);
+ ~Panner ();
- void set_mono (bool);
-
- PBD::AngularVector _angles;
- PBD::AngularVector _effective_angles;
- double _diffusion;
+ virtual ChanCount in() const = 0;
+ virtual ChanCount out() const = 0;
- bool _muted;
- bool _mono;
+ virtual void configure_io (ARDOUR::ChanCount in, ARDOUR::ChanCount out) {}
+
+ /* derived implementations of these methods must indicate
+ whether it is legal for a Controllable to use the
+ value of the argument (post-call) in a call to
+ Controllable::set_value().
+
+ they have a choice of:
+
+ * return true, leave argument unchanged
+ * return true, modify argument
+ * return false
+
+ */
+
+ virtual bool clamp_position (double&) { return true; }
+ virtual bool clamp_width (double&) { return true; }
+ virtual bool clamp_elevation (double&) { return true; }
+
+ virtual void set_position (double) { }
+ virtual void set_width (double) { }
+ virtual void set_elevation (double) { }
- boost::shared_ptr<AutomationControl> _control;
+ virtual double position () const { return 0.0; }
+ virtual double width () const { return 0.0; }
+ virtual double elevation () const { return 0.0; }
- XMLNode& get_state ();
+ virtual void reset() {}
- /* Update internal parameters based on this.angles */
- virtual void update () = 0;
-};
+ virtual bool bypassed() const { return _bypassed; }
+ virtual void set_bypassed (bool yn);
-class BaseStereoPanner : public StreamPanner
-{
- public:
- BaseStereoPanner (Panner&, Evoral::Parameter param);
- ~BaseStereoPanner ();
+ virtual bool is_mono () const { return _mono; }
+ virtual void set_mono (bool);
+
+ void set_automation_state (AutoState);
+ AutoState automation_state() const;
+ void set_automation_style (AutoStyle);
+ AutoStyle automation_style() const;
- /* this class just leaves the pan law itself to be defined
- by the update(), do_distribute_automated()
- methods. derived classes also need a factory method
- and a type name. See EqualPowerStereoPanner as an example.
- */
+ virtual std::set<Evoral::Parameter> what_can_be_automated() const;
+ virtual std::string describe_parameter (Evoral::Parameter);
- void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
+ bool touching() const;
static double azimuth_to_lr_fract (double azi) {
/* 180.0 degrees=> left => 0.0 */
@@ -159,176 +118,70 @@ class BaseStereoPanner : public StreamPanner
return rint (180.0 - (fract * 180.0));
}
- /* old school automation loading */
-
- int load (std::istream&, std::string path, uint32_t&);
-
- protected:
- float left;
- float right;
- float desired_left;
- float desired_right;
- float left_interp;
- float right_interp;
-};
-
-class EqualPowerStereoPanner : public BaseStereoPanner
-{
- public:
- EqualPowerStereoPanner (Panner&, Evoral::Parameter param);
- ~EqualPowerStereoPanner ();
-
- void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
- framepos_t start, framepos_t end, pframes_t nframes,
- pan_t** buffers);
-
- void get_current_coefficients (pan_t*) const;
- void get_desired_coefficients (pan_t*) const;
-
- static StreamPanner* factory (Panner&, Evoral::Parameter param, Speakers&);
- static std::string name;
-
- XMLNode& state (bool full_state);
- XMLNode& get_state (void);
- int set_state (const XMLNode&, int version);
-
- private:
- void update ();
-};
-
-/** Class to pan from some number of inputs to some number of outputs.
- * This class has a number of StreamPanners, one for each input.
- */
-class Panner : public SessionObject, public Automatable
-{
-public:
- struct Output {
- PBD::AngularVector position;
- pan_t current_pan;
- pan_t desired_pan;
-
- Output (const PBD::AngularVector& a)
- : position (a), current_pan (0), desired_pan (0) {}
-
- };
-
- Panner (std::string name, Session&);
- virtual ~Panner ();
-
- void clear_panners ();
- bool empty() const { return _streampanners.empty(); }
-
- void set_automation_state (AutoState);
- AutoState automation_state() const;
- void set_automation_style (AutoStyle);
- AutoStyle automation_style() const;
- bool touching() const;
-
- std::string describe_parameter (Evoral::Parameter param);
-
- bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) const { return true; };
+ /**
+ * Pan some input buffers to a number of output buffers.
+ *
+ * @param ibufs Input buffers (one per panner input)
+ * @param obufs Output buffers (one per panner output).
+ * @param gain_coeff fixed, additional gain coefficient to apply to output samples.
+ * @param nframes Number of frames in the input.
+ *
+ * Derived panners can choose to implement these if they need to gain more control over the panning algorithm.
+ * the default is to (1) check if _mono is true, and if so, just deliver .. (2) otherwise, call
+ * distribute_one() or distribute_one_automated() on each input buffer to deliver it to each output
+ * buffer.
+ *
+ * If a panner does not need to override this default behaviour, it can just implement
+ * distribute_one() and distribute_one_automated() (below).
+ */
+ virtual void distribute (BufferSet& ibufs, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
+ virtual void distribute_automated (BufferSet& ibufs, BufferSet& obufs,
+ framepos_t start, framepos_t end, pframes_t nframes,
+ pan_t** buffers);
- /// The fundamental Panner function
- void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, pframes_t nframes);
+ PBD::Signal0<void> Changed; /* for positional info */
+ PBD::Signal0<void> StateChanged; /* for mute, mono */
- bool bypassed() const { return _bypassed; }
- void set_bypassed (bool yn);
- bool mono () const { return _mono; }
- void set_mono (bool);
+ int set_state (const XMLNode&, int version);
+ virtual XMLNode& state (bool full_state) = 0;
- StreamPanner* add ();
- void remove (uint32_t which);
- void reset (uint32_t noutputs, uint32_t npans);
- void reset_streampanner (uint32_t which_panner);
- void reset_to_default ();
+ boost::shared_ptr<Pannable> pannable() const { return _pannable; }
- XMLNode& get_state (void);
- XMLNode& state (bool full);
- int set_state (const XMLNode&, int version);
+ //virtual std::string describe_parameter (Evoral::Parameter);
+ //virtual std::string value_as_string (Evoral::Parameter, double val);
static bool equivalent (pan_t a, pan_t b) {
return fabsf (a - b) < 0.002; // about 1 degree of arc for a stereo panner
}
+
static bool equivalent (const PBD::AngularVector& a, const PBD::AngularVector& b) {
/* XXX azimuth only, at present */
return fabs (a.azi - b.azi) < 1.0;
}
- void move_output (uint32_t, float x, float y);
- uint32_t nouts() const { return outputs.size(); }
- Output& output (uint32_t n) { return outputs[n]; }
-
- enum LinkDirection {
- SameDirection,
- OppositeDirection
- };
-
- LinkDirection link_direction() const { return _link_direction; }
- void set_link_direction (LinkDirection);
-
- bool linked() const { return _linked; }
- void set_linked (bool yn);
-
- StreamPanner &streampanner( uint32_t n ) const { assert( n < _streampanners.size() ); return *_streampanners[n]; }
- uint32_t npanners() const { return _streampanners.size(); }
-
- PBD::Signal0<void> Changed; /* panner and/or outputs count changed */
- PBD::Signal0<void> LinkStateChanged;
- PBD::Signal0<void> StateChanged; /* for bypass */
-
- /* only StreamPanner should call these */
-
- void set_position (const PBD::AngularVector&, StreamPanner& orig);
-
- /* old school automation */
-
- int load ();
-
- boost::shared_ptr<AutomationControl> pan_control (int id, uint32_t chan=0) {
- return automation_control (Evoral::Parameter (PanAutomation, chan, id));
- }
-
- boost::shared_ptr<const AutomationControl> pan_control (int id, uint32_t chan=0) const {
- return automation_control (Evoral::Parameter (PanAutomation, chan, id));
- }
-
- boost::shared_ptr<AutomationControl> direction_control () {
- return automation_control (Evoral::Parameter (PanAutomation, 0, 100));
- }
-
- boost::shared_ptr<AutomationControl> width_control () {
- return automation_control (Evoral::Parameter (PanAutomation, 0, 200));
- }
-
- void set_stereo_position (double);
- void set_stereo_width (double);
- bool set_stereo_pan (double pos, double width);
-
- static std::string value_as_string (double);
-
- private:
- /* disallow copy construction */
- Panner (Panner const &);
-
- void distribute_no_automation(BufferSet& src, BufferSet& dest, pframes_t nframes, gain_t gain_coeff);
- std::vector<StreamPanner*> _streampanners; ///< one StreamPanner per input
- std::vector<Output> outputs;
- uint32_t current_outs;
- bool _linked;
- bool _bypassed;
- bool _mono;
- LinkDirection _link_direction;
-
- static float current_automation_version_number;
+ protected:
+ boost::shared_ptr<Pannable> _pannable;
+ bool _mono;
+ bool _bypassed;
- void setup_speakers (uint32_t nouts);
- void setup_meta_controls ();
+ XMLNode& get_state ();
- /* old school automation handling */
- std::string automation_path;
+ virtual void distribute_one (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes, uint32_t which) = 0;
+ virtual void distribute_one_automated (AudioBuffer&, BufferSet& obufs,
+ framepos_t start, framepos_t end, pframes_t nframes,
+ pan_t** buffers, uint32_t which) = 0;
};
-} // namespace ARDOUR
+} // namespace
+
+extern "C" {
+ struct PanPluginDescriptor {
+ std::string name;
+ int32_t in;
+ int32_t out;
+ ARDOUR::Panner* (*factory)(boost::shared_ptr<ARDOUR::Pannable>, ARDOUR::Speakers&);
+ };
+}
-#endif /*__ardour_panner_h__ */
+#endif /* __ardour_panner_h__ */
diff --git a/libs/ardour/ardour/port_insert.h b/libs/ardour/ardour/port_insert.h
index d460aa5546..959e46b4a5 100644
--- a/libs/ardour/ardour/port_insert.h
+++ b/libs/ardour/ardour/port_insert.h
@@ -37,13 +37,14 @@ class Session;
class IO;
class Delivery;
class MuteMaster;
+class Pannable;
/** Port inserts: send output to a Jack port, pick up input at a Jack port
*/
class PortInsert : public IOProcessor
{
public:
- PortInsert (Session&, boost::shared_ptr<MuteMaster> mm);
+ PortInsert (Session&, boost::shared_ptr<Pannable>, boost::shared_ptr<MuteMaster> mm);
~PortInsert ();
XMLNode& state(bool full);
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 90f5664eba..f90ec77b7e 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -54,11 +54,13 @@ class Amp;
class Delivery;
class IOProcessor;
class Panner;
+class PannerShell;
class Processor;
class RouteGroup;
class Send;
class InternalReturn;
class MonitorProcessor;
+class Pannable;
class CapturingProcessor;
class Route : public SessionObject, public Automatable, public RouteGroupMember, public GraphNode
@@ -365,8 +367,10 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
here.
*/
- boost::shared_ptr<Panner> panner() const;
+ boost::shared_ptr<Panner> panner() const; /* may return null */
+ boost::shared_ptr<PannerShell> panner_shell() const;
boost::shared_ptr<AutomationControl> gain_control() const;
+ boost::shared_ptr<Pannable> pannable() const;
void automation_snapshot (framepos_t now, bool force=false);
void protect_automation ();
@@ -423,6 +427,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
boost::shared_ptr<Delivery> _monitor_send;
boost::shared_ptr<InternalReturn> _intreturn;
boost::shared_ptr<MonitorProcessor> _monitor_control;
+ boost::shared_ptr<Pannable> _pannable;
Flag _flags;
int _pending_declick;
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index bf5c5d7370..40045d6b85 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -36,7 +36,7 @@ class Amp;
class Send : public Delivery
{
public:
- Send (Session&, boost::shared_ptr<MuteMaster>, Delivery::Role r = Delivery::Send);
+ Send (Session&, boost::shared_ptr<Pannable> pannable, boost::shared_ptr<MuteMaster>, Delivery::Role r = Delivery::Send);
virtual ~Send ();
uint32_t bit_slot() const { return _bitslot; }
diff --git a/libs/ardour/ardour/speakers.h b/libs/ardour/ardour/speakers.h
index bae8cb96db..f6e6e22848 100644
--- a/libs/ardour/ardour/speakers.h
+++ b/libs/ardour/ardour/speakers.h
@@ -23,12 +23,15 @@
#include <iostream>
#include <pbd/signals.h>
+#include <pbd/stateful.h>
#include "ardour/speaker.h"
+class XMLNode;
+
namespace ARDOUR {
-class Speakers {
+class Speakers : public PBD::Stateful {
public:
Speakers ();
virtual ~Speakers ();
@@ -38,12 +41,17 @@ public:
virtual void move_speaker (int id, const PBD::AngularVector& new_position);
virtual void clear_speakers ();
+ void setup_default_speakers (uint32_t nspeakers);
+
std::vector<Speaker>& speakers() { return _speakers; }
void dump_speakers (std::ostream&);
- PBD::Signal0<void> Changed;
+ XMLNode& get_state ();
+ int set_state (const XMLNode&, int version);
+ PBD::Signal0<void> Changed;
+
protected:
std::vector<Speaker> _speakers;
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 78e21d5a9d..744c06f552 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -122,24 +122,27 @@ namespace ARDOUR {
InsertMergeExtend // extend new (or old) to the range of old+new
};
- /** See parameter.h
- * XXX: I don't think/hope these hex values matter anymore.
+ /** See evoral/Parameter.hpp
*/
enum AutomationType {
- NullAutomation = 0x0,
- GainAutomation = 0x1,
- PanAutomation = 0x2,
- PluginAutomation = 0x4,
- SoloAutomation = 0x8,
- MuteAutomation = 0x10,
- MidiCCAutomation = 0x20,
- MidiPgmChangeAutomation = 0x21,
- MidiPitchBenderAutomation = 0x22,
- MidiChannelPressureAutomation = 0x23,
- MidiSystemExclusiveAutomation = 0x24,
- FadeInAutomation = 0x40,
- FadeOutAutomation = 0x80,
- EnvelopeAutomation = 0x100
+ NullAutomation,
+ GainAutomation,
+ PanAzimuthAutomation,
+ PanElevationAutomation,
+ PanWidthAutomation,
+ PanFrontBackAutomation,
+ PanLFEAutomation,
+ PluginAutomation,
+ SoloAutomation,
+ MuteAutomation,
+ MidiCCAutomation,
+ MidiPgmChangeAutomation,
+ MidiPitchBenderAutomation,
+ MidiChannelPressureAutomation,
+ MidiSystemExclusiveAutomation,
+ FadeInAutomation,
+ FadeOutAutomation,
+ EnvelopeAutomation
};
enum AutoState {
diff --git a/libs/ardour/ardour/vbap.h b/libs/ardour/ardour/vbap.h
deleted file mode 100644
index 419930c574..0000000000
--- a/libs/ardour/ardour/vbap.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- Copyright (C) 2010 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __libardour_vbap_h__
-#define __libardour_vbap_h__
-
-#include <string>
-#include <map>
-
-#include "ardour/panner.h"
-#include "ardour/vbap_speakers.h"
-
-namespace ARDOUR {
-
-class Speakers;
-
-class VBAPanner : public StreamPanner {
-public:
- VBAPanner (Panner& parent, Evoral::Parameter param, Speakers& s);
- ~VBAPanner ();
-
- static StreamPanner* factory (Panner& parent, Evoral::Parameter param, Speakers& s);
- static std::string name;
-
- void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
- void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
- framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers);
-
- void set_azimuth_elevation (double azimuth, double elevation);
-
- XMLNode& state (bool full_state);
- XMLNode& get_state ();
- int set_state (const XMLNode&, int version);
-
- /* there never was any old-school automation */
-
- int load (std::istream&, std::string path, uint32_t&) { return 0; }
-
-private:
- bool _dirty;
- double gains[3];
- double desired_gains[3];
- int outputs[3];
- int desired_outputs[3];
-
- VBAPSpeakers& _speakers;
-
- void compute_gains (double g[3], int ls[3], int azi, int ele);
-
- void update ();
-};
-
-} /* namespace */
-
-#endif /* __libardour_vbap_h__ */
diff --git a/libs/ardour/ardour/vbap_speakers.h b/libs/ardour/ardour/vbap_speakers.h
deleted file mode 100644
index 80989646bc..0000000000
--- a/libs/ardour/ardour/vbap_speakers.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright (C) 2010 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __libardour_vbap_speakers_h__
-#define __libardour_vbap_speakers_h__
-
-#include <string>
-#include <vector>
-
-#include <boost/utility.hpp>
-
-#include <pbd/signals.h>
-
-#include "ardour/panner.h"
-#include "ardour/speakers.h"
-
-namespace ARDOUR {
-
-class Speakers;
-
-class VBAPSpeakers : public boost::noncopyable {
-public:
- typedef std::vector<double> dvector;
-
- const dvector matrix (int tuple) const { return _matrices[tuple]; }
- int speaker_for_tuple (int tuple, int which) const { return _speaker_tuples[tuple][which]; }
-
- int n_tuples () const { return _matrices.size(); }
- int dimension() const { return _dimension; }
-
- static VBAPSpeakers& instance (Speakers&);
-
- ~VBAPSpeakers ();
-
-private:
- static VBAPSpeakers* _instance;
- static const double MIN_VOL_P_SIDE_LGTH = 0.01;
- int _dimension;
- std::vector<Speaker>& _speakers;
- PBD::ScopedConnection speaker_connection;
-
- VBAPSpeakers (Speakers&);
-
- struct azimuth_sorter {
- bool operator() (const Speaker& s1, const Speaker& s2) {
- return s1.angles().azi < s2.angles().azi;
- }
- };
-
- struct twoDmatrix : public dvector {
- twoDmatrix() : dvector (4, 0.0) {}
- };
-
- struct threeDmatrix : public dvector {
- threeDmatrix() : dvector (9, 0.0) {}
- };
-
- struct tmatrix : public dvector {
- tmatrix() : dvector (3, 0.0) {}
- };
-
- std::vector<dvector> _matrices; /* holds matrices for a given speaker combinations */
- std::vector<tmatrix> _speaker_tuples; /* holds speakers IDs for a given combination */
-
- /* A struct for all loudspeakers */
- struct ls_triplet_chain {
- int ls_nos[3];
- float inv_mx[9];
- struct ls_triplet_chain *next;
- };
-
- static float vec_angle(PBD::CartesianVector v1, PBD::CartesianVector v2);
- static float vec_length(PBD::CartesianVector v1);
- static float vec_prod(PBD::CartesianVector v1, PBD::CartesianVector v2);
- static float vol_p_side_lgth(int i, int j,int k, const std::vector<Speaker>&);
- static void cross_prod(PBD::CartesianVector v1,PBD::CartesianVector v2, PBD::CartesianVector *res);
-
- void update ();
- int any_ls_inside_triplet (int a, int b, int c);
- void add_ldsp_triplet (int i, int j, int k, struct ls_triplet_chain **ls_triplets);
- int lines_intersect (int i,int j,int k,int l);
- void calculate_3x3_matrixes (struct ls_triplet_chain *ls_triplets);
- void choose_speaker_triplets (struct ls_triplet_chain **ls_triplets);
- void choose_speaker_pairs ();
- void sort_2D_lss (int* sorted_lss);
- int calc_2D_inv_tmatrix (double azi1,double azi2, double* inv_mat);
-
-};
-
-} /* namespace */
-
-#endif /* __libardour_vbap_speakers_h__ */