2 * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
3 * Copyright (C) 2012-2017 Paul Davis <paul@linuxaudiosystems.com>
4 * Copyright (C) 2013-2015 David Robillard <d@drobilla.net>
5 * Copyright (C) 2017-2019 Robin Gareus <robin@gareus.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include <gtkmm/spinbutton.h>
23 #include <gtkmm/comboboxtext.h>
25 #include "evoral/PatchChange.h"
26 #include "ardour_dialog.h"
27 #include "audio_clock.h"
30 class BeatsSamplesConverter;
41 class PatchChangeDialog : public ArdourDialog
45 const ARDOUR::BeatsSamplesConverter*,
47 Evoral::PatchChange<Temporal::Beats> const&,
48 ARDOUR::InstrumentInfo&,
49 const Gtk::BuiltinStockID&,
50 bool allow_delete = false,
54 Evoral::PatchChange<Temporal::Beats> patch () const;
57 void on_response (int);
60 void fill_bank_combo ();
61 void set_active_bank_combo ();
62 void fill_patch_combo ();
63 void set_active_patch_combo ();
64 void bank_combo_changed ();
65 void patch_combo_changed ();
66 void channel_changed ();
68 void program_changed ();
70 int get_14bit_bank () const;
72 const ARDOUR::BeatsSamplesConverter* _time_converter;
73 ARDOUR::InstrumentInfo& _info;
76 Gtk::SpinButton _channel;
77 Gtk::SpinButton _program;
78 Gtk::SpinButton _bank_msb;
79 Gtk::SpinButton _bank_lsb;
80 Gtk::ComboBoxText _bank_combo;
81 Gtk::ComboBoxText _patch_combo;
83 boost::shared_ptr<MIDI::Name::PatchBank> _current_patch_bank;
88 void instrument_info_changed ();
89 PBD::ScopedConnection _info_changed_connection;