Fly my pretties!
[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 #include <gtkmm.h>
26 #include <pbd/xml++.h>
27 #include "prompter.h"
28
29 namespace ARDOUR {
30         class Session;
31 }
32
33 /**
34  * AxisView defines the abstract base class for time-axis trackviews and routes.
35  *
36  */
37 class AxisView : public sigc::trackable
38 {
39   public:
40         /**
41          * Returns the current 'Track' Color
42          *
43          * @return the current Track Color
44          */
45         Gdk_Color color() const { return _color; }
46
47         ARDOUR::Session& session() const { return _session; }
48
49         virtual string name() const = 0;
50
51         virtual void set_selected (bool yn) {
52                 if (yn != _selected) {
53                         _selected = yn;
54                 }
55         }
56         
57         virtual bool marked_for_display() const { return _marked_for_display; }
58
59         virtual void set_marked_for_display (bool yn) {
60                 if (yn != _marked_for_display) {
61                         _marked_for_display = yn;
62                 }
63         }
64         
65         virtual bool selected() const { return _selected; }
66         sigc::signal<void> Hiding;
67         sigc::signal<void> GoingAway;
68
69   protected:
70
71         AxisView (ARDOUR::Session& sess);
72         virtual ~AxisView();
73         
74
75         /**
76          * Generate a new random TrackView color, unique from those colors already used.
77          *
78          * @return the unique random color.
79          */
80         static GdkColor unique_random_color();
81
82
83         ARDOUR::Session& _session;
84         Gdk_Color _color;
85
86         static list<GdkColor> used_colors;
87
88         Gtk::Label name_label;
89
90         bool _selected;
91
92         bool _marked_for_display;
93         
94 }; /* class AxisView */
95
96 #endif /* __ardour_gtk_axis_view_h__ */
97