X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fcanvas-program-change.h;h=cddd78059b5223b8627cbb1dcfa4f9d28bbe477e;hb=6fbaa5403bcefba3186fb5490017e110210122e3;hp=cf99ca07157049ac472d81eb5a3d7b02e303ea31;hpb=6d319e2132270b89efc47820e707840eb49a2cfe;p=ardour.git diff --git a/gtk2_ardour/canvas-program-change.h b/gtk2_ardour/canvas-program-change.h index cf99ca0715..cddd78059b 100644 --- a/gtk2_ardour/canvas-program-change.h +++ b/gtk2_ardour/canvas-program-change.h @@ -1,40 +1,67 @@ #ifndef CANVASPROGRAMCHANGE_H_ #define CANVASPROGRAMCHANGE_H_ -#include -#include "simplerect.h" -#include "simpleline.h" -#include "midi_region_view.h" -#include -#include -#include - -namespace Gnome -{ -namespace Canvas -{ +#include "canvas-flag.h" + +class MidiRegionView; + +namespace MIDI { + namespace Name { + struct PatchPrimaryKey; + } +} -class CanvasProgramChange : public Group +namespace Gnome { +namespace Canvas { + +class CanvasProgramChange : public CanvasFlag { public: CanvasProgramChange( - MidiRegionView& region, - Group& parent, - boost::shared_ptr event, - double height, - double x = 0.0, - double y = 0.0 + MidiRegionView& region, + Group& parent, + const string& text, + double height, + double x, + double y, + string& model_name, + string& custom_device_mode, + nframes_t event_time, + uint8_t channel, + uint8_t program ); - + virtual ~CanvasProgramChange(); - + + virtual bool on_event(GdkEvent* ev); + + string model_name() const { return _model_name; } + void set_model_name(string model_name) { _model_name = model_name; } + + string custom_device_mode() const { return _custom_device_mode; } + void set_custom_device_mode(string custom_device_mode) { _custom_device_mode = custom_device_mode; } + + nframes_t event_time() const { return _event_time; } + void set_event_time(nframes_t new_time) { _event_time = new_time; }; + + uint8_t program() const { return _program; } + void set_program(uint8_t new_program) { _program = new_program; }; + + uint8_t channel() const { return _channel; } + void set_channel(uint8_t new_channel) { _channel = new_channel; }; + + void initialize_popup_menus(); + + void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey& key); + private: - MidiRegionView& _region; - boost::shared_ptr _event; - Text* _text; - SimpleLine* _line; - SimpleRect* _rect; - Widget* _widget; + string _model_name; + string _custom_device_mode; + nframes_t _event_time; + uint8_t _channel; + uint8_t _program; + Gtk::Menu _popup; + bool _popup_initialized; }; } // namespace Canvas