2010-12-22 18:45:04 -05:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2012-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2013-2015 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2017-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.
|
|
|
|
*/
|
2010-12-22 18:45:04 -05:00
|
|
|
|
|
|
|
#include <gtkmm/spinbutton.h>
|
2012-06-02 09:02:01 -04:00
|
|
|
#include <gtkmm/comboboxtext.h>
|
2013-01-20 03:56:00 -05:00
|
|
|
|
2019-10-25 15:13:51 -04:00
|
|
|
#include "evoral/PatchChange.h"
|
2010-12-22 18:45:04 -05:00
|
|
|
#include "ardour_dialog.h"
|
2010-12-28 13:43:22 -05:00
|
|
|
#include "audio_clock.h"
|
2010-12-22 18:45:04 -05:00
|
|
|
|
2010-12-28 13:43:22 -05:00
|
|
|
namespace ARDOUR {
|
2017-09-18 12:39:17 -04:00
|
|
|
class BeatsSamplesConverter;
|
2010-12-28 13:43:22 -05:00
|
|
|
class Session;
|
2012-06-11 18:59:35 -04:00
|
|
|
class InstrumentInfo;
|
2010-12-28 13:43:22 -05:00
|
|
|
}
|
|
|
|
|
2012-06-02 09:02:01 -04:00
|
|
|
namespace MIDI {
|
|
|
|
namespace Name {
|
|
|
|
class PatchBank;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-28 13:43:22 -05:00
|
|
|
class PatchChangeDialog : public ArdourDialog
|
2010-12-22 18:45:04 -05:00
|
|
|
{
|
|
|
|
public:
|
2010-12-28 13:43:22 -05:00
|
|
|
PatchChangeDialog (
|
2019-04-08 15:37:02 -04:00
|
|
|
ARDOUR::Session*,
|
|
|
|
Evoral::PatchChange<Temporal::Beats> const&,
|
2012-06-11 18:59:35 -04:00
|
|
|
ARDOUR::InstrumentInfo&,
|
2019-04-08 15:37:02 -04:00
|
|
|
const Gtk::BuiltinStockID&,
|
2017-08-24 17:41:21 -04:00
|
|
|
bool allow_delete = false,
|
2020-10-02 23:26:17 -04:00
|
|
|
bool modal = true,
|
|
|
|
boost::shared_ptr<ARDOUR::Region> region = boost::shared_ptr<ARDOUR::Region>()
|
2010-12-28 13:43:22 -05:00
|
|
|
);
|
2010-12-22 18:45:04 -05:00
|
|
|
|
2017-09-24 12:03:54 -04:00
|
|
|
Evoral::PatchChange<Temporal::Beats> patch () const;
|
2010-12-22 18:45:04 -05:00
|
|
|
|
2017-08-24 17:41:21 -04:00
|
|
|
protected:
|
|
|
|
void on_response (int);
|
|
|
|
|
2010-12-22 18:45:04 -05:00
|
|
|
private:
|
2012-06-02 09:02:01 -04:00
|
|
|
void fill_bank_combo ();
|
|
|
|
void set_active_bank_combo ();
|
|
|
|
void fill_patch_combo ();
|
|
|
|
void set_active_patch_combo ();
|
|
|
|
void bank_combo_changed ();
|
|
|
|
void patch_combo_changed ();
|
|
|
|
void channel_changed ();
|
|
|
|
void bank_changed ();
|
|
|
|
void program_changed ();
|
|
|
|
|
2017-02-14 17:46:22 -05:00
|
|
|
int get_14bit_bank () const;
|
|
|
|
|
2020-10-02 23:26:17 -04:00
|
|
|
const boost::shared_ptr<ARDOUR::Region> _region;
|
2017-02-14 17:46:22 -05:00
|
|
|
ARDOUR::InstrumentInfo& _info;
|
2010-12-28 13:43:22 -05:00
|
|
|
AudioClock _time;
|
2019-04-08 15:37:02 -04:00
|
|
|
Gtk::SpinButton _channel;
|
|
|
|
Gtk::SpinButton _program;
|
|
|
|
Gtk::SpinButton _bank_msb;
|
|
|
|
Gtk::SpinButton _bank_lsb;
|
2012-06-02 09:02:01 -04:00
|
|
|
Gtk::ComboBoxText _bank_combo;
|
|
|
|
Gtk::ComboBoxText _patch_combo;
|
|
|
|
|
|
|
|
boost::shared_ptr<MIDI::Name::PatchBank> _current_patch_bank;
|
2019-04-08 15:37:02 -04:00
|
|
|
|
2012-06-02 09:02:01 -04:00
|
|
|
bool _ignore_signals;
|
2017-08-24 17:41:21 -04:00
|
|
|
bool _keep_open;
|
2012-06-12 00:05:10 -04:00
|
|
|
|
2017-07-01 12:42:24 -04:00
|
|
|
void instrument_info_changed ();
|
|
|
|
PBD::ScopedConnection _info_changed_connection;
|
2010-12-22 18:45:04 -05:00
|
|
|
};
|