next iteration of clock work. still far from complete, and probably waiting on a...
[ardour.git] / gtk2_ardour / time_info_box.h
1 /*
2     Copyright (C) 2011 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 __time_info_box_h__
21 #define __time_info_box_h__
22
23 #include <map>
24
25 #include <gtkmm/box.h>
26 #include <gtkmm/label.h>
27
28 #include "ardour/ardour.h"
29 #include "ardour/session_handle.h"
30
31 class CairoEditableText;
32 class CairoCell;
33 class CairoTextCell;
34
35 namespace ARDOUR {
36         class Session;
37         class Location;
38 }
39
40 class AudioClock;
41
42 class TimeInfoBox : public Gtk::Table, public ARDOUR::SessionHandlePtr
43 {
44   public:
45     TimeInfoBox ();
46     ~TimeInfoBox ();
47
48     void set_session (ARDOUR::Session*);
49
50   protected:
51     bool on_expose_event (GdkEventExpose*);
52
53   private:
54     AudioClock* selection_start;
55     AudioClock* selection_end;
56     AudioClock* selection_length;
57     
58     AudioClock* punch_start;
59     AudioClock* punch_end;
60
61     Gtk::Label selection_title;
62     Gtk::Label punch_title;
63
64     void punch_changed (ARDOUR::Location*);
65     void punch_location_changed (ARDOUR::Location*);
66     void watch_punch (ARDOUR::Location*);
67     PBD::ScopedConnectionList punch_connections;
68
69     void selection_changed ();
70 };
71
72
73 #endif /* __time_info_box_h__ */