fix up file renaming code a little bit
[ArdourMidi.git] / gtk2_ardour / axis_view.h
blob108d14c1f12f7fb358a5fcedf6bb8e1a89f2d5e5
1 /*
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.
20 #ifndef __ardour_gtk_axis_view_h__
21 #define __ardour_gtk_axis_view_h__
23 #include <list>
25 #include <gtkmm/label.h>
26 #include <gdkmm/color.h>
28 #include "pbd/xml++.h"
29 #include "pbd/signals.h"
31 #include "ardour/session_handle.h"
33 #include "prompter.h"
34 #include "selectable.h"
36 namespace ARDOUR {
37 class Session;
40 /**
41 * AxisView defines the abstract base class for time-axis trackviews and routes.
44 class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
46 public:
47 /**
48 * Returns the current 'Track' Color
50 * @return the current Track Color
52 Gdk::Color color() const { return _color; }
54 ARDOUR::Session* session() const { return _session; }
56 virtual std::string name() const = 0;
58 virtual bool marked_for_display() const { return _marked_for_display; }
59 virtual void set_marked_for_display (bool yn) {
60 _marked_for_display = yn;
63 sigc::signal<void> Hiding;
65 void set_old_order_key (uint32_t ok) { _old_order_key = ok; }
66 uint32_t old_order_key() const { return _old_order_key; }
68 protected:
70 AxisView (ARDOUR::Session* sess);
71 virtual ~AxisView();
73 /**
74 * Generate a new random TrackView color, unique from those colors already used.
76 * @return the unique random color.
78 static Gdk::Color unique_random_color();
81 Gdk::Color _color;
83 static std::list<Gdk::Color> used_colors;
85 Gtk::Label name_label;
87 bool _marked_for_display;
88 uint32_t _old_order_key;
90 }; /* class AxisView */
92 #endif /* __ardour_gtk_axis_view_h__ */