720a87c4ba6fd4f11b1ec6fd9cc2d224468e4c47
[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/comboboxtext.h>
12
13 #include <ardour/types.h>
14 #include <ardour/tempo.h>
15
16 #include "ardour_dialog.h"
17
18 struct TempoDialog : public ArdourDialog 
19 {
20     Gtk::Entry   bpm_entry;
21     Gtk::Frame   bpm_frame;
22     Gtk::VBox    vpacker;
23     Gtk::Button  ok_button;
24     Gtk::Button  cancel_button;
25     Gtk::HBox    button_box;
26     Gtk::HBox    hspacer1;
27     Gtk::VBox    vspacer1;
28     Gtk::Entry   when_bar_entry;
29     Gtk::Entry   when_beat_entry;
30     Gtk::Label   when_bar_label;
31     Gtk::Label   when_beat_label;
32     Gtk::Table   when_table;
33     Gtk::Frame   when_frame;
34     char buf[64];
35     
36     TempoDialog (ARDOUR::TempoMap&, nframes_t, const string & action);
37     TempoDialog (ARDOUR::TempoSection&, const string & action);
38
39     double get_bpm ();
40     bool   get_bbt_time (ARDOUR::BBT_Time&);
41     
42   private:
43     void init (const ARDOUR::BBT_Time& start, double, bool);
44     bool bpm_key_press (GdkEventKey* );
45     bool bpm_key_release (GdkEventKey* );
46 };
47
48 struct MeterDialog : public ArdourDialog 
49 {
50     Gtk::Entry   bpb_entry;
51     Gtk::ComboBoxText note_types;
52     vector<string> strings;
53     Gtk::Frame   note_frame;
54     Gtk::Frame   bpb_frame;
55     Gtk::VBox    vpacker;
56     Gtk::Button  ok_button;
57     Gtk::Button  cancel_button;
58     Gtk::HBox    button_box;
59     Gtk::HBox    hspacer1, hspacer2;
60     Gtk::VBox    vspacer1, vspacer2;
61     Gtk::Entry   when_bar_entry;
62     Gtk::Entry   when_beat_entry;
63     Gtk::Label   when_bar_label;
64     Gtk::Label   when_beat_label;
65     Gtk::Table   when_table;
66     Gtk::Frame   when_frame;
67     char buf[64];
68     
69     MeterDialog (ARDOUR::TempoMap&, nframes_t, const string & action);
70     MeterDialog (ARDOUR::MeterSection&, const string & action);
71
72     double get_bpb ();
73     double get_note_type ();
74     bool   get_bbt_time (ARDOUR::BBT_Time&);
75
76   private:
77     void init (const ARDOUR::BBT_Time&, double, double, bool);
78     bool bpb_key_press (GdkEventKey* );
79     bool bpb_key_release (GdkEventKey* );
80     void note_types_change ();
81 };
82
83 #endif /* __ardour_gtk_tempo_dialog_h__ */