2 * Copyright (C) 2005-2017 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
4 * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
5 * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
6 * Copyright (C) 2014-2018 Robin Gareus <robin@gareus.org>
7 * Copyright (C) 2016 Tim Mayberry <mojofunk@gmail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 #include "pbd/error.h"
33 #include "pbd/convert.h"
35 #include <gtkmm2ext/utils.h>
36 #include <gtkmm2ext/gtk_ui.h>
38 #include "ardour/selection.h"
40 #include "public_editor.h"
41 #include "ardour_ui.h"
42 #include "gui_object.h"
43 #include "axis_view.h"
50 using namespace Gtkmm2ext;
51 using namespace ARDOUR;
52 using namespace ARDOUR_UI_UTILS;
54 list<Gdk::Color> AxisView::used_colors;
65 AxisView::unique_random_color()
67 return ::unique_random_color (used_colors);
71 AxisView::gui_property (const string& property_name) const
73 if (property_hashtable.count(property_name)) {
74 return property_hashtable[property_name];
76 string rv = gui_object_state().get_string (state_id(), property_name);
77 property_hashtable.erase(property_name);
78 property_hashtable.emplace(property_name, rv);
84 AxisView::get_gui_property (const std::string& property_name, std::string& value) const
86 std::string str = gui_property(property_name);
97 AxisView::set_gui_property (const std::string& property_name, const std::string& value)
99 property_hashtable.erase (property_name);
100 property_hashtable.emplace (property_name, value);
101 gui_object_state ().set_property (state_id (), property_name, value);
105 AxisView::marked_for_display () const
108 if (!get_gui_property ("visible", visible)) {
115 AxisView::set_marked_for_display (bool yn)
118 if (get_gui_property ("visible", visible) && visible == yn) {
119 return false; // nothing changed
122 set_gui_property ("visible", yn);
123 return true; // things changed
127 AxisView::gui_object_state()
129 return *ARDOUR_UI::instance()->gui_object_state;
133 AxisView::set_selected (bool yn)
135 if (selected() == yn) {
139 Selectable::set_selected (yn);