mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
Super basic Virtual-Keyboard UI
This commit is contained in:
parent
f961fd4687
commit
ebb89ba805
8 changed files with 211 additions and 0 deletions
59
gtk2_ardour/virtual_keyboard_window.h
Normal file
59
gtk2_ardour/virtual_keyboard_window.h
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue