various fixes to MidiRegionView selection handling, key handling, drawing of ghost...
[ardour2.git] / gtk2_ardour / time_info_box.h
blob7409d7631e20f21ebbcc3f8e9c5f20f42ef7ee8b
1 /*
2 Copyright (C) 2011 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 __time_info_box_h__
21 #define __time_info_box_h__
23 #include <map>
25 #include <gtkmm/box.h>
26 #include <gtkmm/label.h>
27 #include <gtkmm/table.h>
29 #include "ardour/ardour.h"
30 #include "ardour/session_handle.h"
32 namespace ARDOUR {
33 class Session;
34 class Location;
37 class AudioClock;
39 class TimeInfoBox : public Gtk::HBox, public ARDOUR::SessionHandlePtr
41 public:
42 TimeInfoBox ();
43 ~TimeInfoBox ();
45 void set_session (ARDOUR::Session*);
47 protected:
48 bool on_expose_event (GdkEventExpose*);
50 private:
51 Gtk::Table left;
52 Gtk::Table right;
54 AudioClock* selection_start;
55 AudioClock* selection_end;
56 AudioClock* selection_length;
58 AudioClock* punch_start;
59 AudioClock* punch_end;
61 Gtk::Label selection_title;
62 Gtk::Label punch_title;
63 bool syncing_selection;
64 bool syncing_punch;
66 void punch_changed (ARDOUR::Location*);
67 void punch_location_changed (ARDOUR::Location*);
68 void watch_punch (ARDOUR::Location*);
69 PBD::ScopedConnectionList punch_connections;
70 PBD::ScopedConnectionList editor_connections;
72 Gtkmm2ext::StatefulToggleButton punch_in_button;
73 Gtkmm2ext::StatefulToggleButton punch_out_button;
75 void selection_changed ();
77 void sync_selection_mode (AudioClock*);
78 void sync_punch_mode (AudioClock*);
80 bool clock_button_release_event (GdkEventButton* ev, AudioClock* src);
81 void track_mouse_mode ();
85 #endif /* __time_info_box_h__ */