Add browse button to recent session dialogue. Fixes #3357.
[ardour.git] / gtk2_ardour / canvas-program-change.h
1 #ifndef CANVASPROGRAMCHANGE_H_
2 #define CANVASPROGRAMCHANGE_H_
3
4 #include "canvas-flag.h"
5
6 class MidiRegionView;
7
8 namespace MIDI {
9         namespace Name {
10                 struct PatchPrimaryKey;
11         }
12 }
13
14 namespace Gnome {
15 namespace Canvas {
16
17 class CanvasProgramChange : public CanvasFlag
18 {
19 public:
20         CanvasProgramChange(
21                 MidiRegionView& region,
22                 Group&          parent,
23                 const string&   text,
24                 double          height,
25                 double          x,
26                 double          y,
27                 string&         model_name,
28                 string&         custom_device_mode,
29                 nframes_t       event_time,
30                 uint8_t         channel,
31                 uint8_t         program
32         );
33
34         virtual ~CanvasProgramChange();
35
36         virtual bool on_event(GdkEvent* ev);
37
38         string model_name() const { return _model_name; }
39         void set_model_name(string model_name) { _model_name = model_name; }
40
41         string custom_device_mode() const { return _custom_device_mode; }
42         void set_custom_device_mode(string custom_device_mode) { _custom_device_mode = custom_device_mode; }
43
44         nframes_t event_time() const { return _event_time; }
45         void set_event_time(nframes_t new_time) { _event_time = new_time; };
46
47         uint8_t program() const { return _program; }
48         void set_program(uint8_t new_program) { _program = new_program; };
49
50         uint8_t channel() const { return _channel; }
51         void set_channel(uint8_t new_channel) { _channel = new_channel; };
52
53         void initialize_popup_menus();
54
55         void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey& key);
56
57 private:
58         string        _model_name;
59         string        _custom_device_mode;
60         nframes_t     _event_time;
61         uint8_t       _channel;
62         uint8_t       _program;
63         Gtk::Menu     _popup;
64         bool          _popup_initialized;
65 };
66
67 } // namespace Canvas
68 } // namespace Gnome
69
70 #endif /*CANVASPROGRAMCHANGE_H_*/