2 Copyright (C) 2014 Paul Davis
3 Author: David Robillard
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <gtkmm/stock.h>
22 #include "note_select_dialog.h"
27 _note_on_event_handler(GtkWidget* /*widget*/, int note, gpointer arg)
29 ((NoteSelectDialog*)arg)->note_on_event_handler(note);
32 NoteSelectDialog::NoteSelectDialog()
33 : ArdourDialog (_("Select Note"))
34 , _piano((PianoKeyboard*)piano_keyboard_new())
35 , _pianomm(Glib::wrap((GtkWidget*)_piano))
38 _pianomm->set_flags(Gtk::CAN_FOCUS);
40 g_signal_connect(G_OBJECT(_piano), "note-on", G_CALLBACK(_note_on_event_handler), this);
41 piano_keyboard_set_monophonic(_piano, TRUE);
42 piano_keyboard_sustain_press(_piano);
44 get_vbox()->pack_start(*_pianomm);
45 add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
46 add_button(Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);
47 set_default_response(Gtk::RESPONSE_ACCEPT);
51 NoteSelectDialog::note_on_event_handler(int note)
53 printf("NOTE: %d\n", note);