new keyboard bindings for moving playhead to region starts+ends ; use spin button...
[ardour.git] / gtk2_ardour / tempo_dialog.h
1 #ifndef __ardour_gtk_tempo_dialog_h__
2 #define __ardour_gtk_tempo_dialog_h__
3
4 #include <gtkmm/entry.h>
5 #include <gtkmm/frame.h>
6 #include <gtkmm/box.h>
7 #include <gtkmm/button.h>
8 #include <gtkmm/label.h>
9 #include <gtkmm/table.h>
10 #include <gtkmm/entry.h>
11 #include <gtkmm/spinbutton.h>
12 #include <gtkmm/comboboxtext.h>
13
14 #include <ardour/types.h>
15 #include <ardour/tempo.h>
16
17 #include "ardour_dialog.h"
18
19 struct TempoDialog : public ArdourDialog 
20 {
21     Gtk::Adjustment   bpm_adjustment;
22     Gtk::SpinButton   bpm_spinner;
23     Gtk::Frame        bpm_frame;
24     Gtk::VBox    vpacker;
25     Gtk::Button  ok_button;
26     Gtk::Button  cancel_button;
27     Gtk::HBox    button_box;
28     Gtk::HBox    hspacer1;
29     Gtk::VBox    vspacer1;
30     Gtk::Entry   when_bar_entry;
31     Gtk::Entry   when_beat_entry;
32     Gtk::Label   when_bar_label;
33     Gtk::Label   when_beat_label;
34     Gtk::Table   when_table;
35     Gtk::Frame   when_frame;
36     char buf[64];
37     
38     TempoDialog (ARDOUR::TempoMap&, nframes_t, const string & action);
39     TempoDialog (ARDOUR::TempoSection&, const string & action);
40
41     double get_bpm ();
42     bool   get_bbt_time (ARDOUR::BBT_Time&);
43     
44   private:
45     void init (const ARDOUR::BBT_Time& start, double, bool);
46     void bpm_changed ();
47     bool bpm_button_press (GdkEventButton* );
48     bool bpm_button_release (GdkEventButton* );
49 };
50
51 struct MeterDialog : public ArdourDialog 
52 {
53     Gtk::Entry   bpb_entry;
54     Gtk::ComboBoxText note_types;
55     vector<string> strings;
56     Gtk::Frame   note_frame;
57     Gtk::Frame   bpb_frame;
58     Gtk::VBox    vpacker;
59     Gtk::Button  ok_button;
60     Gtk::Button  cancel_button;
61     Gtk::HBox    button_box;
62     Gtk::HBox    hspacer1, hspacer2;
63     Gtk::VBox    vspacer1, vspacer2;
64     Gtk::Entry   when_bar_entry;
65     Gtk::Entry   when_beat_entry;
66     Gtk::Label   when_bar_label;
67     Gtk::Label   when_beat_label;
68     Gtk::Table   when_table;
69     Gtk::Frame   when_frame;
70     char buf[64];
71     
72     MeterDialog (ARDOUR::TempoMap&, nframes_t, const string & action);
73     MeterDialog (ARDOUR::MeterSection&, const string & action);
74
75     double get_bpb ();
76     double get_note_type ();
77     bool   get_bbt_time (ARDOUR::BBT_Time&);
78
79   private:
80     void init (const ARDOUR::BBT_Time&, double, double, bool);
81     bool bpb_key_press (GdkEventKey* );
82     bool bpb_key_release (GdkEventKey* );
83     void note_types_change ();
84 };
85
86 #endif /* __ardour_gtk_tempo_dialog_h__ */