Fix playhead smoothing when auditioning.
[ardour.git] / gtk2_ardour / patch_change_widget.h
index 47661982fa54e1bdd7ccf66a57faf3414425a08b..e1df94c0d0ff0a91e446ba7564e013de5e6a0706 100644 (file)
@@ -24,6 +24,7 @@
 #include <gtkmm/table.h>
 
 #include "pbd/signals.h"
+#include "midi++/midnam_patch.h"
 
 #include "ardour/route.h"
 
@@ -31,6 +32,7 @@
 #include "widgets/ardour_dropdown.h"
 
 #include "ardour_dialog.h"
+#include "gtk_pianokeyboard.h"
 
 class PatchChangeWidget : public Gtk::VBox
 {
@@ -38,6 +40,8 @@ public:
        PatchChangeWidget (boost::shared_ptr<ARDOUR::Route>);
        ~PatchChangeWidget ();
 
+       void refresh ();
+
 protected:
        int bank (uint8_t) const;
        uint8_t program (uint8_t) const;
@@ -57,6 +61,7 @@ private:
 
        uint8_t _channel;
        bool    _ignore_spin_btn_signals;
+       bool    _no_notifications;
 
        void select_channel (uint8_t);
        void select_bank (uint32_t);
@@ -65,11 +70,13 @@ private:
 
        void bank_changed ();
        void program_changed ();
+       void bankpatch_changed (uint8_t);
 
        void refill_banks ();
        void refill_program_list ();
 
        void instrument_info_changed ();
+       void processors_changed ();
 
        PBD::ScopedConnection _info_changed_connection;
        PBD::ScopedConnection _route_connection;
@@ -88,18 +95,30 @@ private:
        ArdourWidgets::ArdourButton _audition_enable;
        Gtk::SpinButton             _audition_start_spin; // Consider a click-box w/note-names
        Gtk::SpinButton             _audition_end_spin;
+       Gtk::SpinButton             _audition_velocity;
        uint8_t                     _audition_note_num;
        bool                        _audition_note_on;
+
+       PianoKeyboard* _piano;
+       Gtk::Widget*   _pianomm;
+
+       static void _note_on_event_handler (GtkWidget*, int, gpointer);
+       static void _note_off_event_handler (GtkWidget*, int, gpointer);
+       void note_on_event_handler (int, bool for_audition);
+       void note_off_event_handler (int);
 };
 
 class PatchChangeGridDialog : public ArdourDialog
 {
 public:
-       PatchChangeGridDialog (std::string const&, boost::shared_ptr<ARDOUR::Route>);
+       PatchChangeGridDialog (boost::shared_ptr<ARDOUR::Route>);
        void on_hide () { w.hide (); ArdourDialog::on_hide (); }
        void on_show () { w.show (); ArdourDialog::on_show (); }
+       void refresh () { w.refresh (); }
 
 private:
+       void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route>);
+       PBD::ScopedConnection _route_connection;
        PatchChangeWidget w;
 };