endless further tweaks to step editor; stop stealing the "r" key inside MidiRegionVie...
[ardour.git] / gtk2_ardour / step_entry.h
1 /*
2     Copyright (C) 2010 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_step_entry_h__
21 #define __gtk2_ardour_step_entry_h__
22
23 #include <gtkmm/togglebutton.h>
24 #include <gtkmm/radiobutton.h>
25 #include <gtkmm/spinbutton.h>
26 #include <gtkmm/box.h>
27 #include <gtkmm/adjustment.h>
28
29 #include "ardour_dialog.h"
30 #include "gtk_pianokeyboard.h"
31
32 class MidiTimeAxisView;
33
34 class StepEntry : public ArdourDialog
35 {
36   public:
37         StepEntry (MidiTimeAxisView&);
38         ~StepEntry ();
39
40         void note_off_event_handler (int note);
41         void rest_event_handler ();
42
43         Evoral::MusicalTime note_length() const;
44         uint8_t note_velocity() const;
45         uint8_t note_channel() const;
46
47   private:
48         Gtk::VBox packer;
49         Gtk::HBox upper_box;
50         Gtk::HBox note_length_box;
51         Gtk::HBox note_velocity_box;
52
53         Gtk::ToggleButton chord_button;
54         Gtk::ToggleButton triplet_button;
55         Gtk::ToggleButton dot_button;
56         Gtk::ToggleButton restart_button;
57
58         Gtk::Button sustain_button;
59         Gtk::Button rest_button;
60         Gtk::Button grid_rest_button;
61         Gtk::VBox   rest_box;
62
63         Gtk::RadioButton length_1_button;
64         Gtk::RadioButton length_2_button;
65         Gtk::RadioButton length_4_button;
66         Gtk::RadioButton length_8_button;
67         Gtk::RadioButton length_12_button;
68         Gtk::RadioButton length_16_button;
69         Gtk::RadioButton length_32_button;
70         Gtk::RadioButton length_64_button;
71
72         Gtk::RadioButton velocity_ppp_button;
73         Gtk::RadioButton velocity_pp_button;
74         Gtk::RadioButton velocity_p_button;
75         Gtk::RadioButton velocity_mp_button;
76         Gtk::RadioButton velocity_mf_button;
77         Gtk::RadioButton velocity_f_button;
78         Gtk::RadioButton velocity_ff_button;
79         Gtk::RadioButton velocity_fff_button;
80
81         Gtk::Adjustment channel_adjustment;
82         Gtk::SpinButton channel_spinner;
83
84         PianoKeyboard* _piano;
85         Gtk::Widget* piano;
86         MidiTimeAxisView* _mtv;
87
88         void rest_click ();
89         void grid_rest_click ();
90         void sustain_click ();
91         void chord_toggled ();
92         void triplet_toggled ();
93
94         bool piano_enter_notify_event (GdkEventCrossing *ev);
95         bool on_key_release_event (GdkEventKey*);
96         bool on_key_press_event (GdkEventKey*);
97
98         void on_show ();
99 };
100
101 #endif /* __gtk2_ardour_step_entry_h__ */