summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/audio_time_axis.cc11
-rw-r--r--gtk2_ardour/automation_time_axis.cc20
-rw-r--r--gtk2_ardour/route_time_axis.cc6
-rw-r--r--libs/ardour/ardour/panner.h14
-rw-r--r--libs/ardour/ardour/param_id.h6
-rw-r--r--libs/ardour/automatable.cc4
-rw-r--r--libs/ardour/panner.cc36
7 files changed, 55 insertions, 42 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 53c1a84848..d032aaca9f 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -317,10 +317,12 @@ AudioTimeAxisView::update_pans ()
/* This is a filthy kludge until the panner stuff gets up to speed. */
/* Remove all our old automation tracks. Slowly. */
- while (true) {
+ /*while (true) {
bool found = false;
for (AutomationTracks::iterator i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
if (i->first.type() == PanAutomation) {
+ remove_child(i->second->track);
+ delete i->second;
_automation_tracks.erase(i);
found = true;
break;
@@ -329,9 +331,10 @@ AudioTimeAxisView::update_pans ()
if ( ! found)
break;
- }
+ }*/
/* Man I hate that damn stereo->stereo panner */
+ uint32_t i = 0;
for (p = _route->panner().begin(); p != _route->panner().end(); ++p) {
boost::shared_ptr<AutomationTimeAxisView> pan_track(new AutomationTimeAxisView (_session,
_route, _route/*FIXME*/, (*p)->pan_control(),
@@ -339,7 +342,9 @@ AudioTimeAxisView::update_pans ()
*this,
parent_canvas,
_route->describe_parameter((*p)->pan_control()->list()->param_id()),
- (*p)->pan_control()->list()->param_id().to_string() /* FIXME: correct state name? */));
+ ParamID(PanAutomation, i).to_string()/* FIXME: correct state name? */));
+ add_automation_child(ParamID(PanAutomation, i), pan_track);
+ ++i;
}
}
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index 067fece9b0..465945fadf 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -170,6 +170,9 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
controls_table.attach (auto_button, 5, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (clear_button, 5, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
+
+ /* add bar controller */
+ controls_table.attach (*_controller.get(), 0, 8, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.show_all ();
@@ -382,14 +385,8 @@ AutomationTimeAxisView::set_height (TrackHeight ht)
//if (changed_between_small_and_normal || first_call_to_set_height) {
first_call_to_set_height = false;
switch (ht) {
- case Largest:
- case Large:
- case Larger:
-
- _controller->show ();
- controls_table.attach (*_controller.get(), 0, 8, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
-
case Normal:
+ _controller->hide();
controls_table.remove (name_hbox);
@@ -413,8 +410,16 @@ AutomationTimeAxisView::set_height (TrackHeight ht)
clear_button.show();
hide_button.show_all();
break;
+
+ case Large:
+ case Larger:
+ case Largest:
+ _controller->show ();
+ break;
case Smaller:
+ _controller->hide();
+
case Small:
controls_table.remove (name_hbox);
@@ -436,6 +441,7 @@ AutomationTimeAxisView::set_height (TrackHeight ht)
hide_button.hide();
break;
}
+
//}
if (changed) {
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 3d6c6823e8..3f37b73f12 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -451,8 +451,8 @@ RouteTimeAxisView::build_automation_action_menu ()
automation_items.push_back (*i->second->menu_item);
}
- i->second->menu_item->set_active(show_automation(i->second->param));
- //i->second->menu_item->set_active(false);
+ //i->second->menu_item->set_active(show_automation(i->second->param));
+ i->second->menu_item->set_active(false);
}
}
@@ -1796,8 +1796,6 @@ RouteTimeAxisView::add_automation_child(ParamID param, boost::shared_ptr<Automat
_show_automation.insert(param);
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
-
- build_automation_action_menu();
}
diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h
index ec3cb59b9b..a6cfc9a6c1 100644
--- a/libs/ardour/ardour/panner.h
+++ b/libs/ardour/ardour/panner.h
@@ -46,7 +46,7 @@ class AudioBuffer;
class StreamPanner : public sigc::trackable, public PBD::Stateful
{
public:
- StreamPanner (Panner& p);
+ StreamPanner (Panner& p, ParamID param);
~StreamPanner ();
void set_muted (bool yn);
@@ -79,7 +79,7 @@ class StreamPanner : public sigc::trackable, public PBD::Stateful
virtual XMLNode& state (bool full_state) = 0;
Panner & get_parent() { return parent; }
-
+
/* old school automation loading */
virtual int load (istream&, string path, uint32_t&) = 0;
@@ -103,9 +103,9 @@ class StreamPanner : public sigc::trackable, public PBD::Stateful
bool _muted;
struct PanControllable : public AutomationControl {
- PanControllable (Session& s, std::string name, StreamPanner& p)
+ PanControllable (Session& s, std::string name, StreamPanner& p, ParamID param)
: AutomationControl (s, boost::shared_ptr<AutomationList>(new AutomationList(
- ParamID(PanAutomation), 0.0, 1.0, 0.5)), name)
+ param, 0.0, 1.0, 0.5)), name)
, panner (p) {}
StreamPanner& panner;
@@ -160,7 +160,7 @@ class EqualPowerStereoPanner : public BaseStereoPanner
void get_current_coefficients (pan_t*) const;
void get_desired_coefficients (pan_t*) const;
- static StreamPanner* factory (Panner&);
+ static StreamPanner* factory (Panner&, ParamID param);
static string name;
XMLNode& state (bool full_state);
@@ -174,14 +174,14 @@ class EqualPowerStereoPanner : public BaseStereoPanner
class Multi2dPanner : public StreamPanner
{
public:
- Multi2dPanner (Panner& parent);
+ Multi2dPanner (Panner& parent, ParamID);
~Multi2dPanner ();
void distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes);
void distribute_automated (AudioBuffer& src, BufferSet& obufs,
nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
- static StreamPanner* factory (Panner&);
+ static StreamPanner* factory (Panner&, ParamID);
static string name;
XMLNode& state (bool full_state);
diff --git a/libs/ardour/ardour/param_id.h b/libs/ardour/ardour/param_id.h
index eb5563b06d..d9763d5594 100644
--- a/libs/ardour/ardour/param_id.h
+++ b/libs/ardour/ardour/param_id.h
@@ -70,11 +70,11 @@ public:
} else if (str.length() > 10 && str.substr(0, 10) == "parameter-") {
_type = PluginAutomation;
_id = atoi(str.c_str()+10);
- PBD::info << "Parameter: " << str << " -> " << _id << endl;
+ //PBD::info << "Parameter: " << str << " -> " << _id << endl;
} else if (str.length() > 7 && str.substr(0, 7) == "midicc-") {
_type = MidiCCAutomation;
_id = atoi(str.c_str()+7);
- PBD::info << "MIDI CC: " << str << " -> " << _id << endl;
+ //PBD::info << "MIDI CC: " << str << " -> " << _id << endl;
} else {
PBD::warning << "Unknown ParamID '" << str << "'" << endmsg;
}
@@ -103,7 +103,7 @@ public:
if (_type == GainAutomation) {
return "gain";
} else if (_type == PanAutomation) {
- return "pan";
+ return string_compose("pan-%1", _id);
} else if (_type == SoloAutomation) {
return "solo";
} else if (_type == MuteAutomation) {
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc
index 8c061ad296..5b31904615 100644
--- a/libs/ardour/automatable.cc
+++ b/libs/ardour/automatable.cc
@@ -201,8 +201,8 @@ Automatable::describe_parameter (ParamID param)
if (param == ParamID(GainAutomation))
return _("Fader");
- else if (param == ParamID(PanAutomation))
- return _("Pan");
+ else if (param.type() == PanAutomation)
+ return (string_compose(_("Pan %1"), param.id()));
else if (param.type() == MidiCCAutomation)
return string_compose("CC %1", param.id());
else
diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc
index e0dcf20634..a20342330f 100644
--- a/libs/ardour/panner.cc
+++ b/libs/ardour/panner.cc
@@ -69,9 +69,9 @@ static double direct_pan_to_control (pan_t val) {
return val;
}
-StreamPanner::StreamPanner (Panner& p)
- : parent (p),
- _control (new PanControllable(p.session(), X_("panner"), *this))
+StreamPanner::StreamPanner (Panner& p, ParamID param)
+ : parent (p)
+ , _control (new PanControllable(p.session(), X_("panner"), *this, param))
{
_muted = false;
@@ -190,7 +190,7 @@ StreamPanner::add_state (XMLNode& node)
/*---------------------------------------------------------------------- */
BaseStereoPanner::BaseStereoPanner (Panner& p)
- : StreamPanner (p)
+ : StreamPanner (p, ParamID(PanAutomation, 0))
{
}
@@ -386,6 +386,7 @@ EqualPowerStereoPanner::update ()
desired_right = panR * (scale * panR + 1.0f - scale);
effective_x = x;
+ _control->set_value(x);
}
void
@@ -411,8 +412,10 @@ EqualPowerStereoPanner::distribute_automated (AudioBuffer& srcbuf, BufferSet& ob
/* store effective pan position. do this even if we are muted */
- if (nframes > 0)
+ if (nframes > 0) {
effective_x = buffers[0][nframes-1];
+ _control->set_value(effective_x); // signal, update UI
+ }
if (_muted) {
return;
@@ -458,7 +461,7 @@ EqualPowerStereoPanner::distribute_automated (AudioBuffer& srcbuf, BufferSet& ob
}
StreamPanner*
-EqualPowerStereoPanner::factory (Panner& parent)
+EqualPowerStereoPanner::factory (Panner& parent, ParamID who_cares)
{
return new EqualPowerStereoPanner (parent);
}
@@ -527,8 +530,8 @@ EqualPowerStereoPanner::set_state (const XMLNode& node)
/*----------------------------------------------------------------------*/
-Multi2dPanner::Multi2dPanner (Panner& p)
- : StreamPanner (p)
+Multi2dPanner::Multi2dPanner (Panner& p, ParamID param)
+ : StreamPanner (p, param)
{
update ();
}
@@ -567,6 +570,7 @@ Multi2dPanner::update ()
}
effective_x = x;
+ _control->set_value(x);
}
void
@@ -644,9 +648,9 @@ Multi2dPanner::distribute_automated (AudioBuffer& src, BufferSet& obufs,
}
StreamPanner*
-Multi2dPanner::factory (Panner& p)
+Multi2dPanner::factory (Panner& p, ParamID param)
{
- return new Multi2dPanner (p);
+ return new Multi2dPanner (p, param);
}
int
@@ -804,7 +808,7 @@ Panner::reset (uint32_t nouts, uint32_t npans)
outputs.push_back (Output (1.0, 1.0));
for (n = 0; n < npans; ++n) {
- push_back (new Multi2dPanner (*this));
+ push_back (new Multi2dPanner (*this, ParamID(PanAutomation, n)));
}
break;
@@ -816,7 +820,7 @@ Panner::reset (uint32_t nouts, uint32_t npans)
outputs.push_back (Output (0, 1.0));
for (n = 0; n < npans; ++n) {
- push_back (new Multi2dPanner (*this));
+ push_back (new Multi2dPanner (*this, ParamID(PanAutomation, n)));
}
break;
@@ -829,7 +833,7 @@ Panner::reset (uint32_t nouts, uint32_t npans)
outputs.push_back (Output (0.5, 0.75));
for (n = 0; n < npans; ++n) {
- push_back (new Multi2dPanner (*this));
+ push_back (new Multi2dPanner (*this, ParamID(PanAutomation, n)));
}
break;
@@ -841,7 +845,7 @@ Panner::reset (uint32_t nouts, uint32_t npans)
}
for (n = 0; n < npans; ++n) {
- push_back (new Multi2dPanner (*this));
+ push_back (new Multi2dPanner (*this, ParamID(PanAutomation, n)));
}
break;
@@ -975,7 +979,7 @@ Panner::clear_automation ()
struct PanPlugins {
string name;
uint32_t nouts;
- StreamPanner* (*factory)(Panner&);
+ StreamPanner* (*factory)(Panner&, ParamID);
};
PanPlugins pan_plugins[] = {
@@ -1077,7 +1081,7 @@ Panner::set_state (const XMLNode& node)
assumption, but its still an assumption.
*/
- sp = pan_plugins[i].factory (*this);
+ sp = pan_plugins[i].factory (*this, ParamID(PanAutomation, 0));
if (sp->set_state (**niter) == 0) {
push_back (sp);