Fix up modifier behaviour
[ardour.git] / gtk2_ardour / keyboard.h
1 /*
2     Copyright (C) 2001 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 __ardour_keyboard_h__
21 #define __ardour_keyboard_h__
22
23 #include "ardour/types.h"
24 #include "gtkmm2ext/keyboard.h"
25
26 #include "selection.h"
27
28 class ARDOUR_UI;
29
30 class ArdourKeyboard : public Gtkmm2ext::Keyboard
31 {
32   public:
33         ArdourKeyboard(ARDOUR_UI& ardour_ui) : ui(ardour_ui) {}
34
35         XMLNode& get_state (void);
36         int set_state (const XMLNode&, int version);
37
38         void setup_keybindings ();
39
40         static Selection::Operation selection_type (guint state);
41
42         ARDOUR_UI& ui;
43
44         static bool indicates_snap (guint state);
45         static bool indicates_snap_delta (guint state);
46
47         static void set_trim_contents_modifier (guint);
48         /** @return Modifier mask to move contents rather than region bounds during trim;
49          */
50         static ModifierMask trim_contents_modifier () { return ModifierMask (trim_contents_mod); }
51
52         static void set_trim_overlap_modifier (guint);
53         /** @return Modifier mask to remove region overlaps during trim;
54          */
55         static ModifierMask trim_overlap_modifier () { return ModifierMask (trim_overlap_mod); }
56
57         static void set_trim_anchored_modifier (guint);
58         /** @return Modifier mask to use anchored trim;
59          */
60         static ModifierMask trim_anchored_modifier () { return ModifierMask (trim_anchored_mod); }
61
62         static void set_fine_adjust_modifier (guint);
63         /** @return Modifier mask to fine adjust (control points only atm);
64          */
65         static ModifierMask fine_adjust_modifier () { return ModifierMask (fine_adjust_mod); }
66
67         static void set_push_points_modifier (guint);
68         /** @return Modifier mask to push proceeding points;
69          */
70         static ModifierMask push_points_modifier () { return ModifierMask (push_points_mod); }
71
72         static void set_note_size_relative_modifier (guint);
73         /** @return Modifier mask to resize notes relatively;
74          */
75         static ModifierMask note_size_relative_modifier () { return ModifierMask (note_size_relative_mod); }
76 private:
77         static guint     trim_contents_mod;
78         static guint     trim_overlap_mod;
79         static guint     trim_anchored_mod;
80         static guint     fine_adjust_mod;
81         static guint     push_points_mod;
82         static guint     note_size_relative_mod;
83 };
84
85 #endif /* __ardour_keyboard_h__ */