diff options
author | Ben Loftis <ben@glw.com> | 2009-08-21 18:24:02 +0000 |
---|---|---|
committer | Ben Loftis <ben@glw.com> | 2009-08-21 18:24:02 +0000 |
commit | 3ffa60f5ec242e6c206516b0b7eb3927a9df95e4 (patch) | |
tree | 1b52c9799e164f177810f11e0847a38410c3abbe | |
parent | 0a570e03149091dde5de3cf190e228db0c249b93 (diff) |
enable very basic plugin boolean automation via Write and Read. no Touch. graphical editing is not allowed. a little crude but better than none at all
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5564 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/ardour.menus.in | 2 | ||||
-rw-r--r-- | gtk2_ardour/automation_line.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/automation_line.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/generic_pluginui.cc | 7 | ||||
-rw-r--r-- | gtk2_ardour/redirect_automation_line.cc | 4 | ||||
-rw-r--r-- | libs/ardour/insert.cc | 6 |
6 files changed, 21 insertions, 10 deletions
diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index d0f1f524da..fbb20d4cdc 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -381,7 +381,7 @@ <menuitem action='ToggleMaximalEditor'/> <menuitem action='show-editor-mixer'/> <menuitem action='ToggleMeasureVisibility'/> - <menu action="Waveforms"> + <menu action="WaveformMenu"> <menuitem action='toggle-waveform-visible'/> <menuitem action='toggle-waveform-rectified'/> <menuitem action='ToggleWaveformsWhileRecording'/> diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index bf9bd159e7..a15c113a67 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -229,7 +229,7 @@ AutomationLine::AutomationLine (const string & name, TimeAxisView& tv, ArdourCan points_visible = false; update_pending = false; _vc_uses_gain_mapping = false; - no_draw = false; + auto_is_boolean = false; _visible = true; terminal_points_can_slide = true; _height = 0; @@ -1242,10 +1242,6 @@ AutomationLine::reset () { update_pending = false; - if (no_draw) { - return; - } - alist.apply_to_points (*this, &AutomationLine::reset_callback); } @@ -1274,6 +1270,10 @@ AutomationLine::change_model_range (AutomationList::iterator start, AutomationLi void AutomationLine::show_all_control_points () { + if (auto_is_boolean) { //show the automation line but don't allow any control points + return; + } + points_visible = true; for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) { diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index 0a25a839e5..dcbbac7604 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -172,7 +172,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin bool _vc_uses_gain_mapping : 1; bool terminal_points_can_slide : 1; bool update_pending : 1; - bool no_draw : 1; + bool auto_is_boolean : 1; bool points_visible : 1; bool did_push; diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index c90b709416..2a8738f818 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -448,7 +448,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, PBD::Controllable* mcontr control_ui->pack_start (control_ui->label, true, true); control_ui->pack_start (*control_ui->button, false, true); - //control_ui->pack_start (control_ui->automate_button, false, false); + control_ui->pack_start (control_ui->automate_button, false, false); if(plugin->get_parameter (port_index) > 0.5){ control_ui->button->set_active(true); @@ -458,6 +458,11 @@ GenericPluginUI::build_control_ui (guint32 port_index, PBD::Controllable* mcontr plugin->ParameterChanged.connect (bind (mem_fun(*this, &GenericPluginUI::toggle_parameter_changed), control_ui)); + control_ui->automate_button.signal_clicked().connect (bind (mem_fun(*this, &GenericPluginUI::astate_clicked), control_ui, (uint32_t) port_index)); + automation_state_changed (control_ui); + insert->automation_list (port_index).automation_state_changed.connect + (bind (mem_fun(*this, &GenericPluginUI::automation_state_changed), control_ui)); + return control_ui; } diff --git a/gtk2_ardour/redirect_automation_line.cc b/gtk2_ardour/redirect_automation_line.cc index 942344a127..c0c8ad49e7 100644 --- a/gtk2_ardour/redirect_automation_line.cc +++ b/gtk2_ardour/redirect_automation_line.cc @@ -61,11 +61,11 @@ RedirectAutomationLine::RedirectAutomationLine (const string & name, Redirect& r range = upper - lower; if (desc.toggled) { - no_draw = true; + auto_is_boolean = true; return; } - no_draw = false; + auto_is_boolean = false; /* XXX set min/max for underlying curve ??? */ } diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc index a866191359..3214182c4f 100644 --- a/libs/ardour/insert.cc +++ b/libs/ardour/insert.cc @@ -399,9 +399,15 @@ PluginInsert::set_parameter (uint32_t port, float val) { /* the others will be set from the event triggered by this */ + float last_val = _plugins[0]->get_parameter (port); + Plugin::ParameterDescriptor desc; + _plugins[0]->get_parameter_descriptor(port, desc); + _plugins[0]->set_parameter (port, val); if (automation_list (port).automation_write()) { + if ( desc.toggled ) //store the previous value just before this so any interpolation works right + automation_list (port).add (_session.audible_frame()-1, last_val); automation_list (port).add (_session.audible_frame(), val); } |