diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-06-11 22:59:35 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-06-11 22:59:35 +0000 |
commit | d97312d438a813985916dd35f613510e9448441f (patch) | |
tree | 5be2844fc16359c2eb550b72c9f84737c534d614 /gtk2_ardour/canvas_patch_change.cc | |
parent | c81691741118ab34c5f6f458c2d84f431e481ada (diff) |
lots more work trying to create a common structure for accessing plugin and MIDNAME patch/preset/program names. still not done
git-svn-id: svn://localhost/ardour2/branches/3.0@12665 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/canvas_patch_change.cc')
-rw-r--r-- | gtk2_ardour/canvas_patch_change.cc | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/gtk2_ardour/canvas_patch_change.cc b/gtk2_ardour/canvas_patch_change.cc index 44389ae96c..b3d8caa488 100644 --- a/gtk2_ardour/canvas_patch_change.cc +++ b/gtk2_ardour/canvas_patch_change.cc @@ -22,7 +22,7 @@ #include <glibmm/regex.h> #include "gtkmm2ext/keyboard.h" -#include "ardour/midi_patch_manager.h" +#include "ardour/instrument_info.h" #include "ardour_ui.h" #include "midi_region_view.h" @@ -44,8 +44,7 @@ CanvasPatchChange::CanvasPatchChange( double height, double x, double y, - string& model_name, - string& custom_device_mode, + ARDOUR::InstrumentInfo& info, ARDOUR::MidiModel::PatchChangePtr patch, bool active_channel) : CanvasFlag( @@ -60,12 +59,11 @@ CanvasPatchChange::CanvasPatchChange( ARDOUR_UI::config()->canvasvar_MidiPatchChangeInactiveChannelFill.get(), x, y) - , _model_name(model_name) - , _custom_device_mode(custom_device_mode) + , _info (info) , _patch (patch) , _popup_initialized(false) { - set_text(text); + set_text (text); } CanvasPatchChange::~CanvasPatchChange() @@ -75,9 +73,7 @@ CanvasPatchChange::~CanvasPatchChange() void CanvasPatchChange::initialize_popup_menus() { - boost::shared_ptr<ChannelNameSet> channel_name_set = - MidiPatchManager::instance() - .find_channel_name_set(_model_name, _custom_device_mode, _patch->channel()); + boost::shared_ptr<ChannelNameSet> channel_name_set = _info.get_patches (_patch->channel()); if (!channel_name_set) { return; @@ -193,22 +189,28 @@ CanvasPatchChange::on_event (GdkEvent* ev) break; case GDK_SCROLL: - if (ev->scroll.direction == GDK_SCROLL_UP) { - if (Keyboard::modifier_state_contains (ev->scroll.state, Keyboard::PrimaryModifier)) { - _region.previous_bank (*this); - } else { - _region.previous_patch (*this); - } - return true; - } else if (ev->scroll.direction == GDK_SCROLL_DOWN) { - if (Keyboard::modifier_state_contains (ev->scroll.state, Keyboard::PrimaryModifier)) { - _region.next_bank (*this); - } else { - _region.next_patch (*this); + { + /* XXX: icky dcast */ + Editor* e = dynamic_cast<Editor*> (&_region.get_time_axis_view().editor()); + if (e->current_mouse_mode() == Editing::MouseObject && e->internal_editing()) { + if (ev->scroll.direction == GDK_SCROLL_UP) { + if (Keyboard::modifier_state_contains (ev->scroll.state, Keyboard::PrimaryModifier)) { + _region.previous_bank (*this); + } else { + _region.previous_patch (*this); + } + return true; + } else if (ev->scroll.direction == GDK_SCROLL_DOWN) { + if (Keyboard::modifier_state_contains (ev->scroll.state, Keyboard::PrimaryModifier)) { + _region.next_bank (*this); + } else { + _region.next_patch (*this); + } + return true; } - return true; + break; } - break; + } case GDK_ENTER_NOTIFY: _region.patch_entered (this); @@ -218,6 +220,9 @@ CanvasPatchChange::on_event (GdkEvent* ev) _region.patch_left (this); break; + case GDK_KEY_RELEASE: + return true; + case GDK_BUTTON_RELEASE: return true; |