summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/io.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-06-29 04:02:58 +0000
committerDavid Robillard <d@drobilla.net>2007-06-29 04:02:58 +0000
commit24ccaac67e9d416b3f3c564a441934313f3e9a21 (patch)
treef244c9835aadc67f88c73ad2f499b6575f06c27c /libs/ardour/ardour/io.h
parentf8697ed223c1f59dde5aee1ac7bff8bd8a6e19a8 (diff)
Further automation refactoring - bring in the concept of Controllable, work towards
making automation + GUI + play/write/touch generic and easily reusable. Added bar controller to automation track controls (mostly relevant for MIDI CC, but added for gain and pan too Just Because). Fixed glaring "redirect" list errors. Fix plugin controls/automation loading. git-svn-id: svn://localhost/ardour2/trunk@2080 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/io.h')
-rw-r--r--libs/ardour/ardour/io.h54
1 files changed, 21 insertions, 33 deletions
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index fc49f0699f..60e1fc25f1 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -42,6 +42,7 @@
#include <ardour/port_set.h>
#include <ardour/chan_count.h>
#include <ardour/latent.h>
+#include <ardour/automation_control.h>
using std::string;
using std::vector;
@@ -60,6 +61,7 @@ class AudioPort;
class MidiPort;
class BufferSet;
+
/** A collection of input and output ports with connections.
*
* An IO can contain ports of varying types, making routes/inserts/etc with
@@ -103,8 +105,6 @@ class IO : public Automatable, public Latent
void just_meter_input (nframes_t start_frame, nframes_t end_frame,
nframes_t nframes, nframes_t offset);
- virtual void set_gain (gain_t g, void *src);
- void inc_gain (gain_t delta, void *src);
gain_t gain () const { return _desired_gain; }
virtual gain_t effective_gain () const;
@@ -182,8 +182,6 @@ class IO : public Automatable, public Latent
sigc::signal<void,IOChange,void*> input_changed;
sigc::signal<void,IOChange,void*> output_changed;
- sigc::signal<void,void*> gain_changed;
-
virtual XMLNode& state (bool full);
XMLNode& get_state (void);
int set_state (const XMLNode&);
@@ -206,10 +204,6 @@ class IO : public Automatable, public Latent
static sigc::signal<void,ChanCount> MoreChannels;
static sigc::signal<int> PortsCreated;
- PBD::Controllable& gain_control() {
- return _gain_control;
- }
-
static void update_meters();
private:
@@ -221,13 +215,24 @@ class IO : public Automatable, public Latent
public:
/* automation */
+
+ struct GainControl : public AutomationControl {
+ GainControl (std::string name, IO& i, boost::shared_ptr<AutomationList> al)
+ : AutomationControl (i._session, al, name)
+ , _io (i)
+ {}
+
+ void set_value (float val);
+ float get_value (void) const;
+
+ IO& _io;
+ };
- static void set_automation_interval (nframes_t frames) {
- _automation_interval = frames;
+ boost::shared_ptr<GainControl> gain_control() {
+ return _gain_control;
}
-
- static nframes_t automation_interval() {
- return _automation_interval;
+ boost::shared_ptr<const GainControl> gain_control() const {
+ return _gain_control;
}
void clear_automation ();
@@ -237,10 +242,6 @@ class IO : public Automatable, public Latent
virtual void transport_stopped (nframes_t now); // interface: matches Insert
void automation_snapshot (nframes_t now); // interface: matches Automatable
- // FIXME: these will probably become unsafe in the near future
- ARDOUR::AutomationList& gain_automation() { return *automation_list(GainAutomation); }
- const ARDOUR::AutomationList& gain_automation() const { return *automation_list(GainAutomation); }
-
void start_pan_touch (uint32_t which);
void end_pan_touch (uint32_t which);
@@ -282,25 +283,12 @@ class IO : public Automatable, public Latent
virtual uint32_t pans_required() const
{ return _inputs.count().n_audio(); }
- struct GainControllable : public PBD::Controllable {
- GainControllable (std::string name, IO& i) : Controllable (name), io (i) {}
-
- void set_value (float val);
- float get_value (void) const;
-
- IO& io;
- };
-
- GainControllable _gain_control;
+ boost::shared_ptr<GainControl> _gain_control;
- nframes_t last_automation_snapshot;
- static nframes_t _automation_interval;
-
- /*AutoState _gain_automation_state;
- AutoStyle _gain_automation_style;*/
+ virtual void set_gain (gain_t g, void *src);
+ void inc_gain (gain_t delta, void *src);
bool apply_gain_automation;
- //Curve _gain_automation_curve;
virtual int load_automation (std::string path);