summaryrefslogtreecommitdiff
path: root/gtk2_ardour/virtual_keyboard_window.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-10-18 03:50:52 +0200
committerRobin Gareus <robin@gareus.org>2019-10-18 03:50:52 +0200
commitebb89ba80522448527f0bd3f9efdb810d8df8506 (patch)
tree78a0b951f0d700e1ba2dcbbc661a638b37b49b82 /gtk2_ardour/virtual_keyboard_window.h
parentf961fd46874d407c6569e0b6f9ddbede09900b3a (diff)
Super basic Virtual-Keyboard UI
Diffstat (limited to 'gtk2_ardour/virtual_keyboard_window.h')
-rw-r--r--gtk2_ardour/virtual_keyboard_window.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/gtk2_ardour/virtual_keyboard_window.h b/gtk2_ardour/virtual_keyboard_window.h
new file mode 100644
index 0000000000..af09f74e89
--- /dev/null
+++ b/gtk2_ardour/virtual_keyboard_window.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2019 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _virtual_keyboard_window_h_
+#define _virtual_keyboard_window_h_
+
+#include "ardour_window.h"
+#include "gtk_pianokeyboard.h"
+
+namespace ARDOUR {
+ class Session;
+}
+
+class VirtualKeyboardWindow : public ArdourWindow
+{
+public:
+ VirtualKeyboardWindow ();
+ ~VirtualKeyboardWindow ();
+
+protected:
+ void on_unmap ();
+ bool on_key_press_event (GdkEventKey*);
+
+private:
+ static void _note_on_event_handler (GtkWidget*, int note, gpointer arg)
+ {
+ static_cast<VirtualKeyboardWindow*>(arg)->note_on_event_handler(note);
+ }
+
+ static void _note_off_event_handler (GtkWidget*, int note, gpointer arg)
+ {
+ static_cast<VirtualKeyboardWindow*>(arg)->note_off_event_handler(note);
+ }
+
+ void note_on_event_handler (int);
+ void note_off_event_handler (int);
+
+ PianoKeyboard* _piano;
+ Gtk::Widget* _pianomm;
+ Gtk::SpinButton _piano_velocity;
+ Gtk::SpinButton _piano_channel;
+};
+
+#endif