2010-12-22 18:45:04 -05:00
|
|
|
/*
|
|
|
|
Copyright (C) 2010 Paul Davis
|
|
|
|
Author: Carl Hetherington <cth@carlh.net>
|
|
|
|
|
|
|
|
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gtkmm/spinbutton.h>
|
2012-06-02 09:02:01 -04:00
|
|
|
#include <gtkmm/comboboxtext.h>
|
2013-01-20 03:56:00 -05:00
|
|
|
|
2010-12-28 13:43:22 -05:00
|
|
|
#include "evoral/PatchChange.hpp"
|
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 {
|
|
|
|
class BeatsFramesConverter;
|
|
|
|
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 (
|
|
|
|
const ARDOUR::BeatsFramesConverter *,
|
|
|
|
ARDOUR::Session *,
|
2015-01-07 00:12:07 -05:00
|
|
|
Evoral::PatchChange<Evoral::Beats> const &,
|
2012-06-11 18:59:35 -04:00
|
|
|
ARDOUR::InstrumentInfo&,
|
2012-12-22 13:27:33 -05:00
|
|
|
const Gtk::BuiltinStockID &,
|
|
|
|
bool allow_delete = false
|
2010-12-28 13:43:22 -05:00
|
|
|
);
|
2010-12-22 18:45:04 -05:00
|
|
|
|
2015-01-07 00:12:07 -05:00
|
|
|
Evoral::PatchChange<Evoral::Beats> patch () const;
|
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;
|
|
|
|
|
2010-12-28 13:43:22 -05:00
|
|
|
const ARDOUR::BeatsFramesConverter* _time_converter;
|
2017-02-14 17:46:22 -05:00
|
|
|
ARDOUR::InstrumentInfo& _info;
|
2010-12-28 13:43:22 -05:00
|
|
|
AudioClock _time;
|
|
|
|
Gtk::SpinButton _channel;
|
2010-12-22 18:45:04 -05:00
|
|
|
Gtk::SpinButton _program;
|
2017-02-14 17:46:22 -05:00
|
|
|
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;
|
|
|
|
bool _ignore_signals;
|
2012-06-12 00:05:10 -04:00
|
|
|
|
|
|
|
void instrument_info_changed ();
|
|
|
|
PBD::ScopedConnection _info_changed_connection;
|
2010-12-22 18:45:04 -05:00
|
|
|
};
|