2 Copyright (C) 2003 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include "pbd/error.h"
29 #include "pbd/convert.h"
31 #include <gtkmm2ext/utils.h>
32 #include <gtkmm2ext/gtk_ui.h>
34 #include "ardour/selection.h"
36 #include "public_editor.h"
37 #include "ardour_ui.h"
38 #include "gui_object.h"
39 #include "axis_view.h"
46 using namespace Gtkmm2ext;
47 using namespace ARDOUR;
48 using namespace ARDOUR_UI_UTILS;
50 list<Gdk::Color> AxisView::used_colors;
61 AxisView::unique_random_color()
63 return ::unique_random_color (used_colors);
67 AxisView::gui_property (const string& property_name) const
69 if (property_hashtable.count(property_name)) {
70 return property_hashtable[property_name];
72 string rv = gui_object_state().get_string (state_id(), property_name);
73 property_hashtable.erase(property_name);
74 property_hashtable.emplace(property_name, rv);
80 AxisView::get_gui_property (const std::string& property_name, std::string& value) const
82 std::string str = gui_property(property_name);
93 AxisView::set_gui_property (const std::string& property_name, const std::string& value)
95 property_hashtable.erase (property_name);
96 property_hashtable.emplace (property_name, value);
97 gui_object_state ().set_property (state_id (), property_name, value);
101 AxisView::marked_for_display () const
104 if (!get_gui_property ("visible", visible)) {
111 AxisView::set_marked_for_display (bool yn)
114 if (get_gui_property ("visible", visible) && visible == yn) {
115 return false; // nothing changed
118 set_gui_property ("visible", yn);
119 return true; // things changed
123 AxisView::gui_object_state()
125 return *ARDOUR_UI::instance()->gui_object_state;
129 AxisView::set_selected (bool yn)
131 if (selected() == yn) {
135 Selectable::set_selected (yn);