fix math bug with numthreads computation
[ardour2.git] / gtk2_ardour / canvas-program-change.h
blobcddd78059b5223b8627cbb1dcfa4f9d28bbe477e
1 #ifndef CANVASPROGRAMCHANGE_H_
2 #define CANVASPROGRAMCHANGE_H_
4 #include "canvas-flag.h"
6 class MidiRegionView;
8 namespace MIDI {
9 namespace Name {
10 struct PatchPrimaryKey;
14 namespace Gnome {
15 namespace Canvas {
17 class CanvasProgramChange : public CanvasFlag
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
34 virtual ~CanvasProgramChange();
36 virtual bool on_event(GdkEvent* ev);
38 string model_name() const { return _model_name; }
39 void set_model_name(string model_name) { _model_name = model_name; }
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; }
44 nframes_t event_time() const { return _event_time; }
45 void set_event_time(nframes_t new_time) { _event_time = new_time; };
47 uint8_t program() const { return _program; }
48 void set_program(uint8_t new_program) { _program = new_program; };
50 uint8_t channel() const { return _channel; }
51 void set_channel(uint8_t new_channel) { _channel = new_channel; };
53 void initialize_popup_menus();
55 void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey& key);
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;
67 } // namespace Canvas
68 } // namespace Gnome
70 #endif /*CANVASPROGRAMCHANGE_H_*/