Fix session-open after selecting new, template, then back
[ardour.git] / gtk2_ardour / patch_change_dialog.h
index 1a0b63e51f85a2a7bc2866408b4a340406875814..65b107c8a517d9519d0daa54d8f242cb9a37ed81 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/comboboxtext.h>
-#include "midi++/midnam_patch.h"
+
 #include "evoral/PatchChange.hpp"
 #include "ardour_dialog.h"
 #include "audio_clock.h"
@@ -43,12 +43,13 @@ public:
        PatchChangeDialog (
                const ARDOUR::BeatsFramesConverter *,
                ARDOUR::Session *,
-               Evoral::PatchChange<Evoral::MusicalTime> const &,
+               Evoral::PatchChange<Evoral::Beats> const &,
                ARDOUR::InstrumentInfo&,
-               const Gtk::BuiltinStockID &
+               const Gtk::BuiltinStockID &,
+               bool allow_delete = false
                );
 
-       Evoral::PatchChange<Evoral::MusicalTime> patch () const;
+       Evoral::PatchChange<Evoral::Beats> patch () const;
 
 private:
        void fill_bank_combo ();
@@ -61,15 +62,21 @@ private:
        void bank_changed ();
        void program_changed ();
 
+       int get_14bit_bank () const;
+
        const ARDOUR::BeatsFramesConverter* _time_converter;
-        ARDOUR::InstrumentInfo& _info;
+       ARDOUR::InstrumentInfo& _info;
        AudioClock _time;
        Gtk::SpinButton _channel;
        Gtk::SpinButton _program;
-       Gtk::SpinButton _bank;
+       Gtk::SpinButton _bank_msb;
+       Gtk::SpinButton _bank_lsb;
        Gtk::ComboBoxText _bank_combo;
        Gtk::ComboBoxText _patch_combo;
 
        boost::shared_ptr<MIDI::Name::PatchBank> _current_patch_bank;
        bool _ignore_signals;
+
+       void instrument_info_changed ();
+       PBD::ScopedConnection _info_changed_connection;
 };