2008-04-29 03:28:24 -04:00
|
|
|
#ifndef CANVASPROGRAMCHANGE_H_
|
|
|
|
#define CANVASPROGRAMCHANGE_H_
|
|
|
|
|
2008-12-11 03:06:27 -05:00
|
|
|
#include "canvas-flag.h"
|
2008-04-29 03:28:24 -04:00
|
|
|
|
2008-04-29 17:58:05 -04:00
|
|
|
class MidiRegionView;
|
|
|
|
|
2008-12-23 01:03:45 -05:00
|
|
|
namespace MIDI {
|
|
|
|
namespace Name {
|
|
|
|
struct PatchPrimaryKey;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-04-29 17:58:05 -04:00
|
|
|
namespace Gnome {
|
|
|
|
namespace Canvas {
|
2008-04-29 03:28:24 -04:00
|
|
|
|
2008-12-11 03:06:27 -05:00
|
|
|
class CanvasProgramChange : public CanvasFlag
|
2008-04-29 03:28:24 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CanvasProgramChange(
|
2009-02-16 00:33:23 -05:00
|
|
|
MidiRegionView& region,
|
|
|
|
Group& parent,
|
2009-02-16 00:54:12 -05:00
|
|
|
const string& text,
|
2009-02-16 00:33:23 -05:00
|
|
|
double height,
|
|
|
|
double x,
|
|
|
|
double y,
|
|
|
|
string& model_name,
|
|
|
|
string& custom_device_mode,
|
|
|
|
nframes_t event_time,
|
|
|
|
uint8_t channel,
|
|
|
|
uint8_t program
|
2008-04-29 03:28:24 -04:00
|
|
|
);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-04-29 03:28:24 -04:00
|
|
|
virtual ~CanvasProgramChange();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-12 17:04:22 -05:00
|
|
|
virtual bool on_event(GdkEvent* ev);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-23 01:03:45 -05:00
|
|
|
string model_name() const { return _model_name; }
|
|
|
|
void set_model_name(string model_name) { _model_name = model_name; }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-23 01:03:45 -05:00
|
|
|
string custom_device_mode() const { return _custom_device_mode; }
|
|
|
|
void set_custom_device_mode(string custom_device_mode) { _custom_device_mode = custom_device_mode; }
|
|
|
|
|
2008-12-14 17:56:44 -05:00
|
|
|
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; }
|
2008-12-15 06:05:41 -05:00
|
|
|
void set_program(uint8_t new_program) { _program = new_program; };
|
2008-12-14 17:56:44 -05:00
|
|
|
|
|
|
|
uint8_t channel() const { return _channel; }
|
2008-12-15 06:05:41 -05:00
|
|
|
void set_channel(uint8_t new_channel) { _channel = new_channel; };
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-23 01:03:45 -05:00
|
|
|
void initialize_popup_menus();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-23 01:03:45 -05:00
|
|
|
void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey& key);
|
2008-12-14 17:56:44 -05:00
|
|
|
|
2008-04-29 03:28:24 -04:00
|
|
|
private:
|
2008-12-23 01:03:45 -05:00
|
|
|
string _model_name;
|
2009-10-14 12:10:01 -04:00
|
|
|
string _custom_device_mode;
|
2008-12-23 01:03:45 -05:00
|
|
|
nframes_t _event_time;
|
|
|
|
uint8_t _channel;
|
|
|
|
uint8_t _program;
|
|
|
|
Gtk::Menu _popup;
|
2009-01-14 04:36:40 -05:00
|
|
|
bool _popup_initialized;
|
2008-04-29 03:28:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Canvas
|
|
|
|
} // namespace Gnome
|
|
|
|
|
|
|
|
#endif /*CANVASPROGRAMCHANGE_H_*/
|