Use labs() for long instead of abs()
[ardour.git] / gtk2_ardour / audio_time_axis.cc
index 7f7900c835d0bc9ece591fe3494fce88e88bb240..a4b32eb1548138e1be0fa4cbae95ee741c23b1d1 100644 (file)
@@ -1,21 +1,29 @@
 /*
-    Copyright (C) 2000-2006 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2005-2006 Nick Mainsbridge <mainsbridge@gmail.com>
+ * Copyright (C) 2005-2006 Sampo Savolainen <v2@iki.fi>
+ * Copyright (C) 2005-2006 Taybin Rutkin <taybin@taybin.com>
+ * Copyright (C) 2005-2007 Doug McLain <doug@nostar.net>
+ * Copyright (C) 2005-2017 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2005 Karsten Wiese <fzuuzf@googlemail.com>
+ * Copyright (C) 2006-2015 David Robillard <d@drobilla.net>
+ * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2013-2014 John Emmas <john@creativepost.co.uk>
+ * Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include <cstdlib>
 #include <cmath>
@@ -51,6 +59,7 @@
 #include "public_editor.h"
 #include "audio_region_view.h"
 #include "audio_streamview.h"
+#include "ui_config.h"
 #include "utils.h"
 
 #include "pbd/i18n.h"
@@ -67,6 +76,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session* sess, ArdourCan
        : SessionHandlePtr (sess)
        , RouteTimeAxisView(ed, sess, canvas)
 {
+       UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &AudioTimeAxisView::parameter_changed));
 }
 
 void
@@ -93,10 +103,10 @@ AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
 
        if (is_audio_track()) {
                controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
-               time_axis_sample.set_name ("AudioTrackControlsBaseUnselected");
+               time_axis_frame.set_name ("AudioTrackControlsBaseUnselected");
        } else { // bus
                controls_ebox.set_name ("AudioBusControlsBaseUnselected");
-               time_axis_sample.set_name ("AudioBusControlsBaseUnselected");
+               time_axis_frame.set_name ("AudioBusControlsBaseUnselected");
        }
 
        /* if set_state above didn't create a gain automation child, we need to make one */
@@ -278,6 +288,14 @@ AudioTimeAxisView::route_active_changed ()
        update_control_names ();
 }
 
+void
+AudioTimeAxisView::parameter_changed (string const & p)
+{
+       if (p == "vertical-region-gap") {
+               _view->update_contents_height ();
+       }
+}
+
 
 /**
  *    Set up the names of the controls so that they are coloured
@@ -308,10 +326,10 @@ AudioTimeAxisView::update_control_names ()
 
        if (selected()) {
                controls_ebox.set_name (controls_base_selected_name);
-               time_axis_sample.set_name (controls_base_selected_name);
+               time_axis_frame.set_name (controls_base_selected_name);
        } else {
                controls_ebox.set_name (controls_base_unselected_name);
-               time_axis_sample.set_name (controls_base_unselected_name);
+               time_axis_frame.set_name (controls_base_unselected_name);
        }
 }