further travels down the road toward true route group bliss
[ardour.git] / gtk2_ardour / axis_view.h
1 /*
2     Copyright (C) 2003 Paul Davis 
3
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.
8
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.
13
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.
17
18     $Id$
19 */
20
21 #ifndef __ardour_gtk_axis_view_h__
22 #define __ardour_gtk_axis_view_h__
23
24 #include <list>
25
26 #include <gtkmm/label.h>
27 #include <gdkmm/color.h>
28
29 #include <pbd/xml++.h>
30 #include "prompter.h"
31
32 namespace ARDOUR {
33         class Session;
34 }
35
36 /**
37  * AxisView defines the abstract base class for time-axis trackviews and routes.
38  *
39  */
40 class AxisView : public virtual sigc::trackable
41 {
42   public:
43         /**
44          * Returns the current 'Track' Color
45          *
46          * @return the current Track Color
47          */
48         Gdk::Color color() const { return _color; }
49
50         ARDOUR::Session& session() const { return _session; }
51
52         virtual string name() const = 0;
53
54         virtual void set_selected (bool yn) {
55                 if (yn != _selected) {
56                         _selected = yn;
57                 }
58         }
59         
60         virtual bool marked_for_display() const { return _marked_for_display; }
61
62         virtual void set_marked_for_display (bool yn) {
63                 if (yn != _marked_for_display) {
64                         _marked_for_display = yn;
65                 }
66         }
67         
68         virtual bool selected() const { return _selected; }
69         sigc::signal<void> Hiding;
70         sigc::signal<void> GoingAway;
71
72   protected:
73
74         AxisView (ARDOUR::Session& sess);
75         virtual ~AxisView();
76         
77
78         /**
79          * Generate a new random TrackView color, unique from those colors already used.
80          *
81          * @return the unique random color.
82          */
83         static Gdk::Color unique_random_color();
84
85
86         ARDOUR::Session& _session;
87         Gdk::Color _color;
88
89         static list<Gdk::Color> used_colors;
90
91         Gtk::Label name_label;
92
93         bool _selected;
94
95         bool _marked_for_display;
96         
97 }; /* class AxisView */
98
99 #endif /* __ardour_gtk_axis_view_h__ */
100