summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2008-12-16 23:21:01 +0000
committerCarl Hetherington <carl@carlh.net>2008-12-16 23:21:01 +0000
commit2ebb1af2997b8e8f162635b11e8acc5c5d0fe563 (patch)
treea88ebc1e46dbe43cc760626eddd57d0feac81216 /gtk2_ardour
parent43b14aa6098e266f07e1d7dfe4a8a65edda36b0a (diff)
Implement #2425: option for automation to follow region moves.
git-svn-id: svn://localhost/ardour2/branches/3.0@4326 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour.menus.in1
-rw-r--r--gtk2_ardour/automation_line.cc6
-rw-r--r--gtk2_ardour/automation_line.h1
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_actions.cc9
-rw-r--r--gtk2_ardour/mixer_strip.cc9
-rw-r--r--gtk2_ardour/mixer_strip.h2
-rw-r--r--gtk2_ardour/processor_box.cc10
-rw-r--r--gtk2_ardour/processor_box.h2
-rw-r--r--gtk2_ardour/route_time_axis.cc22
-rw-r--r--gtk2_ardour/route_time_axis.h4
11 files changed, 45 insertions, 22 deletions
diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in
index 3f00dbcb2f..bb59fd85af 100644
--- a/gtk2_ardour/ardour.menus.in
+++ b/gtk2_ardour/ardour.menus.in
@@ -567,6 +567,7 @@
<menuitem action='RubberbandingSnapsToGrid'/>
<menuitem action='AutoAnalyseAudio'/>
<menuitem action='toggle-region-fades'/>
+ <menuitem action='automation-follows-regions'/>
</menu>
</menu>
<menu name='Help' action='Help'>
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index 854eb57a92..06510b13e7 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -1102,12 +1102,6 @@ AutomationLine::change_model (AutomationList::iterator i, double x, double y)
}
void
-AutomationLine::change_model_range (AutomationList::iterator start, AutomationList::iterator end, double xdelta, float ydelta)
-{
- alist->move_range (start, end, xdelta, ydelta);
-}
-
-void
AutomationLine::set_list(boost::shared_ptr<ARDOUR::AutomationList> list)
{
alist = list;
diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h
index 1123a7b9a4..7fd9dd3447 100644
--- a/gtk2_ardour/automation_line.h
+++ b/gtk2_ardour/automation_line.h
@@ -162,7 +162,6 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
void sync_model_with_view_line (uint32_t, uint32_t);
virtual void change_model (ARDOUR::AutomationList::iterator, double x, double y);
- virtual void change_model_range (ARDOUR::AutomationList::iterator,ARDOUR::AutomationList::iterator, double delta, float ydelta);
void reset_callback (const Evoral::ControlList&);
void list_changed ();
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 2b421163e4..4ce8b1bcd2 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -356,6 +356,7 @@ class Editor : public PublicEditor
void update_layering_model ();
void toggle_link_region_and_track_selection ();
+ void toggle_automation_follows_regions ();
/* redirect shared ops menu. caller must free returned menu */
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 75d4b76668..24b411dd11 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -100,6 +100,7 @@ Editor::register_actions ()
/* add named actions for the editor */
ActionManager::register_toggle_action (editor_actions, "link-region-and-track-selection", _("Link Region/Track Selection"), mem_fun (*this, &Editor::toggle_link_region_and_track_selection));
+ ActionManager::register_toggle_action (editor_actions, "automation-follows-regions", _("Automation follows regions"), mem_fun (*this, &Editor::toggle_automation_follows_regions));
ActionManager::register_action (editor_actions, "break-drag", _("Break drag"), mem_fun (*this, &Editor::break_drag));
act = ActionManager::register_toggle_action (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), mem_fun (*this, &Editor::editor_mixer_button_toggled));
@@ -1731,6 +1732,12 @@ Editor::toggle_link_region_and_track_selection ()
ActionManager::toggle_config_state ("Editor", "link-region-and-track-selection", &Configuration::set_link_region_and_track_selection, &Configuration::get_link_region_and_track_selection);
}
+void
+Editor::toggle_automation_follows_regions ()
+{
+ ActionManager::toggle_config_state ("Editor", "automation-follows-regions", &Configuration::set_automation_follows_regions, &Configuration::get_automation_follows_regions);
+}
+
/** A Configuration parameter has changed.
* @param parameter_name Name of the changed parameter.
*/
@@ -1777,6 +1784,8 @@ Editor::parameter_changed (const char* parameter_name)
toggle_meter_updating();
} else if (PARAM_IS ("link-region-and-track-selection")) {
ActionManager::map_some_state ("Editor", "link-region-and-track-selection", &Configuration::get_link_region_and_track_selection);
+ } else if (PARAM_IS ("automation-follows-regions")) {
+ ActionManager::map_some_state ("Editor", "automation-follows-regions", &Configuration::get_automation_follows_regions);
}
#undef PARAM_IS
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 990581e63c..68b53da86c 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -1297,12 +1297,17 @@ MixerStrip::map_frozen ()
void
MixerStrip::hide_redirect_editors ()
{
- _route->foreach_processor (this, &MixerStrip::hide_processor_editor);
+ _route->foreach_processor (mem_fun (*this, &MixerStrip::hide_processor_editor));
}
void
-MixerStrip::hide_processor_editor (boost::shared_ptr<Processor> processor)
+MixerStrip::hide_processor_editor (boost::weak_ptr<Processor> p)
{
+ boost::shared_ptr<Processor> processor (p.lock ());
+ if (!processor) {
+ return;
+ }
+
void* gui = processor->get_gui ();
if (gui) {
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index 12d84c48fc..393a38569e 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -250,7 +250,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void name_changed ();
void update_speed_display ();
void map_frozen ();
- void hide_processor_editor (boost::shared_ptr<ARDOUR::Processor> processor);
+ void hide_processor_editor (boost::weak_ptr<ARDOUR::Processor> processor);
void hide_redirect_editors ();
bool ignore_speed_adjustment;
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index fe648352d0..75e54e4b66 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -562,8 +562,7 @@ ProcessorBox::redisplay_processors ()
processor_active_connections.clear ();
processor_name_connections.clear ();
- void (ProcessorBox::*method)(boost::shared_ptr<Processor>) = &ProcessorBox::add_processor_to_display;
- _route->foreach_processor (this, method);
+ _route->foreach_processor (mem_fun (*this, &ProcessorBox::add_processor_to_display));
switch (_placement) {
case PreFader:
@@ -576,8 +575,13 @@ ProcessorBox::redisplay_processors ()
}
void
-ProcessorBox::add_processor_to_display (boost::shared_ptr<Processor> processor)
+ProcessorBox::add_processor_to_display (boost::weak_ptr<Processor> p)
{
+ boost::shared_ptr<Processor> processor (p.lock ());
+ if (!processor) {
+ return;
+ }
+
if (processor->placement() != _placement) {
return;
}
diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h
index 92a301633a..6d57230cf8 100644
--- a/gtk2_ardour/processor_box.h
+++ b/gtk2_ardour/processor_box.h
@@ -154,7 +154,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject
bool processor_button_press_event (GdkEventButton *);
bool processor_button_release_event (GdkEventButton *);
void redisplay_processors ();
- void add_processor_to_display (boost::shared_ptr<ARDOUR::Processor>);
+ void add_processor_to_display (boost::weak_ptr<ARDOUR::Processor>);
void row_deleted (const Gtk::TreeModel::Path& path);
void show_processor_active (boost::weak_ptr<ARDOUR::Processor>);
void show_processor_name (boost::weak_ptr<ARDOUR::Processor>);
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 8e462c984e..431017aff9 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -286,8 +286,8 @@ RouteTimeAxisView::post_construct ()
update_diskstream_display ();
subplugin_menu.items().clear ();
- _route->foreach_processor (this, &RouteTimeAxisView::add_processor_to_subplugin_menu);
- _route->foreach_processor (this, &RouteTimeAxisView::add_existing_processor_automation_curves);
+ _route->foreach_processor (mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu));
+ _route->foreach_processor (mem_fun (*this, &RouteTimeAxisView::add_existing_processor_automation_curves));
reset_processor_automation_curves ();
}
@@ -1920,8 +1920,13 @@ RouteTimeAxisView::processor_automation_track_hidden (RouteTimeAxisView::Process
}
void
-RouteTimeAxisView::add_existing_processor_automation_curves (boost::shared_ptr<Processor> processor)
+RouteTimeAxisView::add_existing_processor_automation_curves (boost::weak_ptr<Processor> p)
{
+ boost::shared_ptr<Processor> processor (p.lock ());
+ if (!processor) {
+ return;
+ }
+
set<Evoral::Parameter> s;
boost::shared_ptr<AutomationLine> al;
@@ -1977,8 +1982,13 @@ RouteTimeAxisView::add_automation_child(Evoral::Parameter param, boost::shared_p
void
-RouteTimeAxisView::add_processor_to_subplugin_menu (boost::shared_ptr<Processor> processor)
+RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p)
{
+ boost::shared_ptr<Processor> processor (p.lock ());
+ if (!processor) {
+ return;
+ }
+
using namespace Menu_Helpers;
ProcessorAutomationInfo *rai;
list<ProcessorAutomationInfo*>::iterator x;
@@ -2108,8 +2118,8 @@ RouteTimeAxisView::processors_changed ()
subplugin_menu.items().clear ();
- _route->foreach_processor (this, &RouteTimeAxisView::add_processor_to_subplugin_menu);
- _route->foreach_processor (this, &RouteTimeAxisView::add_existing_processor_automation_curves);
+ _route->foreach_processor (mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu));
+ _route->foreach_processor (mem_fun (*this, &RouteTimeAxisView::add_existing_processor_automation_curves));
for (list<ProcessorAutomationInfo*>::iterator i = processor_automation.begin(); i != processor_automation.end(); ) {
diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h
index 405f4937ab..c41e60afce 100644
--- a/gtk2_ardour/route_time_axis.h
+++ b/gtk2_ardour/route_time_axis.h
@@ -184,7 +184,7 @@ protected:
void processors_changed ();
- void add_processor_to_subplugin_menu (boost::shared_ptr<ARDOUR::Processor>);
+ void add_processor_to_subplugin_menu (boost::weak_ptr<ARDOUR::Processor>);
void remove_processor_automation_node (ProcessorAutomationNode* pan);
void processor_menu_item_toggled (RouteTimeAxisView::ProcessorAutomationInfo*,
@@ -205,7 +205,7 @@ protected:
find_processor_automation_curve (boost::shared_ptr<ARDOUR::Processor> i, Evoral::Parameter);
void add_processor_automation_curve (boost::shared_ptr<ARDOUR::Processor> r, Evoral::Parameter);
- void add_existing_processor_automation_curves (boost::shared_ptr<ARDOUR::Processor>);
+ void add_existing_processor_automation_curves (boost::weak_ptr<ARDOUR::Processor>);
void add_automation_child(Evoral::Parameter param, boost::shared_ptr<AutomationTimeAxisView> track, bool show=true);