fix OSX compilation
[ardour.git] / gtk2_ardour / region_layering_order_editor.h
1 /*
2     Copyright (C) 2011-2012 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 __gtk2_ardour_region_layering_order_editor_h__
21 #define __gtk2_ardour_region_layering_order_editor_h__
22
23 #include <gtkmm/dialog.h>
24 #include <gtkmm/liststore.h>
25 #include <gtkmm/treeview.h>
26 #include <gtkmm/scrolledwindow.h>
27
28 #include "ardour/region.h"
29 #include "ardour/playlist.h"
30
31 #include "ardour_window.h"
32 #include "audio_clock.h"
33
34 class PublicEditor;
35
36 namespace ARDOUR {
37         class Session;
38 }
39
40 class RegionLayeringOrderEditor : public ArdourWindow
41 {
42   public:
43         RegionLayeringOrderEditor (PublicEditor&);
44         virtual ~RegionLayeringOrderEditor ();
45
46         void set_context (const std::string &, ARDOUR::Session *, TimeAxisView *, boost::shared_ptr<ARDOUR::Playlist>, ARDOUR::framepos_t);
47         void maybe_present ();
48
49   protected:
50         virtual bool on_key_press_event (GdkEventKey* event);
51
52   private:
53         framepos_t position;
54         bool in_row_change;
55         uint32_t regions_at_position;
56
57         PBD::ScopedConnection playlist_modified_connection;
58
59         struct LayeringOrderColumns : public Gtk::TreeModel::ColumnRecord {
60                 LayeringOrderColumns () {
61                         add (name);
62                         add (region_view);
63                 }
64                 Gtk::TreeModelColumn<std::string> name;
65                 Gtk::TreeModelColumn<RegionView *> region_view;
66         };
67         LayeringOrderColumns layering_order_columns;
68         Glib::RefPtr<Gtk::ListStore> layering_order_model;
69         Gtk::TreeView layering_order_display;
70         AudioClock clock;
71         Gtk::Label track_label;
72         Gtk::Label track_name_label;
73         Gtk::Label clock_label;
74         Gtk::ScrolledWindow scroller;   // Available layers
75         PublicEditor& editor;
76         TimeAxisView* _time_axis_view;
77
78         void row_selected ();
79         void refill ();
80         void playlist_modified ();
81 };
82
83 #endif /* __gtk2_ardour_region_layering_order_editor_h__ */