summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-09-07 13:45:52 +0000
committerCarl Hetherington <carl@carlh.net>2011-09-07 13:45:52 +0000
commit3ba6804f27f43fe968884351762173313063b865 (patch)
tree0bc26627e9f25b12dba77ca123642f7849c4ffc1
parent10e1807fba8e9c4aa543b8caced2fdf506990723 (diff)
Don't create new regions on clicks on MIDI plugin automation
tracks (#4298). git-svn-id: svn://localhost/ardour2/branches/3.0@10062 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/automation_time_axis.cc1
-rw-r--r--gtk2_ardour/automation_time_axis.h6
-rw-r--r--gtk2_ardour/editor_mouse.cc4
3 files changed, 10 insertions, 1 deletions
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index 7f70d3cd84..e4daf6e74c 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -87,6 +87,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
, _view (show_regions ? new AutomationStreamView (*this) : 0)
, _name (nom)
, auto_button (X_("")) /* force addition of a label */
+ , _show_regions (show_regions)
{
if (!have_name_font) {
name_font = get_font_for_style (X_("AutomationTrackName"));
diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h
index 0904357c27..a48b1f9b2a 100644
--- a/gtk2_ardour/automation_time_axis.h
+++ b/gtk2_ardour/automation_time_axis.h
@@ -117,6 +117,10 @@ class AutomationTimeAxisView : public TimeAxisView {
return _route;
}
+ bool show_regions () const {
+ return _show_regions;
+ }
+
static void what_has_visible_automation (const boost::shared_ptr<ARDOUR::Automatable>& automatable, std::set<Evoral::Parameter>& visible);
protected:
@@ -155,6 +159,8 @@ class AutomationTimeAxisView : public TimeAxisView {
Gtk::CheckMenuItem* mode_discrete_item;
Gtk::CheckMenuItem* mode_line_item;
+ bool _show_regions;
+
void add_line (boost::shared_ptr<AutomationLine>);
void clear_clicked ();
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 0e1278ab1f..4816c2e04c 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -881,7 +881,9 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
case AutomationTrackItem:
{
TimeAxisView* parent = clicked_axisview->get_parent ();
- if (parent && dynamic_cast<MidiTimeAxisView*> (parent)) {
+ AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (clicked_axisview);
+ assert (atv);
+ if (parent && dynamic_cast<MidiTimeAxisView*> (parent) && atv->show_regions ()) {
/* create a MIDI region so that we have somewhere to put automation */
_drags->set (new RegionCreateDrag (this, item, parent), event);
} else {