~ubuntu-branches/ubuntu/utopic/ardour3/utopic

« back to all changes in this revision

Viewing changes to gtk2_ardour/axis_view.h

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler
  • Date: 2013-09-21 19:05:02 UTC
  • Revision ID: package-import@ubuntu.com-20130921190502-8gsftrku6jnzhd7v
Tags: upstream-3.4~dfsg
ImportĀ upstreamĀ versionĀ 3.4~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
*/
 
19
 
 
20
#ifndef __ardour_gtk_axis_view_h__
 
21
#define __ardour_gtk_axis_view_h__
 
22
 
 
23
#include <list>
 
24
 
 
25
#include <gtkmm/label.h>
 
26
#include <gdkmm/color.h>
 
27
 
 
28
#include "pbd/xml++.h"
 
29
#include "pbd/signals.h"
 
30
 
 
31
#include "ardour/session_handle.h"
 
32
 
 
33
#include "gui_object.h"
 
34
#include "prompter.h"
 
35
#include "selectable.h"
 
36
 
 
37
namespace ARDOUR {
 
38
        class Session;
 
39
}
 
40
 
 
41
/**
 
42
 * AxisView defines the abstract base class for time-axis trackviews and routes.
 
43
 *
 
44
 */
 
45
class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
 
46
{
 
47
  public:
 
48
        /** @return the track's own color */
 
49
        Gdk::Color color () const { return _color; }
 
50
 
 
51
        ARDOUR::Session* session() const { return _session; }
 
52
 
 
53
        virtual std::string name() const = 0;
 
54
 
 
55
        sigc::signal<void> Hiding;
 
56
        
 
57
        void set_old_order_key (uint32_t ok) { _old_order_key = ok; }
 
58
        uint32_t old_order_key() const { return _old_order_key; }
 
59
 
 
60
        virtual std::string state_id() const = 0;
 
61
        /* for now, we always return properties in string form.
 
62
         */
 
63
        std::string gui_property (const std::string& property_name) const;
 
64
        
 
65
        template<typename T> void set_gui_property (const std::string& property_name, const T& value) {
 
66
                gui_object_state().set_property<T> (state_id(), property_name, value);
 
67
        }
 
68
 
 
69
        bool marked_for_display () const;
 
70
        virtual bool set_marked_for_display (bool);
 
71
 
 
72
        static GUIObjectState& gui_object_state();
 
73
        
 
74
  protected:
 
75
 
 
76
        AxisView (ARDOUR::Session* sess);
 
77
        virtual ~AxisView();
 
78
 
 
79
        /**
 
80
         * Generate a new random TrackView color, unique from those colors already used.
 
81
         *
 
82
         * @return the unique random color.
 
83
         */
 
84
        static Gdk::Color unique_random_color();
 
85
 
 
86
 
 
87
        Gdk::Color _color;
 
88
 
 
89
        static std::list<Gdk::Color> used_colors;
 
90
 
 
91
        Gtk::Label name_label;
 
92
 
 
93
        bool _marked_for_display;
 
94
        uint32_t _old_order_key;
 
95
}; /* class AxisView */
 
96
 
 
97
#endif /* __ardour_gtk_axis_view_h__ */
 
98