X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fprocessor_box.cc;h=1f219352f79586a11204a5d2da87e0e9efb35a57;hb=dfbc9da79aef9cc05808d29a20c6d12c5d553a80;hp=9f5a8bddf36485d5849de673d394f56a661484a6;hpb=2ba58dfe65bb0c5ba7d5eb18a1566fa79eeb6993;p=ardour.git diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 9f5a8bddf3..1f219352f7 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -21,6 +21,10 @@ #include "gtk2ardour-config.h" #endif +#ifdef COMPILER_MSVC +#define rintf(x) round((x) + 0.5) +#endif + #include #include #include @@ -72,7 +76,6 @@ #include "return_ui.h" #include "route_processor_selection.h" #include "send_ui.h" -#include "utils.h" #include "i18n.h" @@ -100,6 +103,7 @@ static const uint32_t midi_port_color = 0x960909FF; //Red ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr p, Width w) : _button (ArdourButton::led_default_elements) , _position (PreFader) + , _selectable(true) , _parent (parent) , _processor (p) , _width (w) @@ -111,6 +115,7 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr (&items.back ()); + Gtk::CheckMenuItem* c = dynamic_cast (&items.back ()); c->set_active (send->panner_shell()->is_linked_to_route()); c->signal_toggled().connect (sigc::mem_fun (*this, &ProcessorEntry::toggle_panner_link)); @@ -1192,14 +1197,14 @@ ProcessorBox::leave_notify (GdkEventCrossing*) return false; } -void +bool ProcessorBox::processor_operation (ProcessorOperation op) { ProcSelection targets; get_selected_processors (targets); - if (targets.empty()) { +/* if (targets.empty()) { int x, y; processor_display.get_pointer (x, y); @@ -1210,12 +1215,20 @@ ProcessorBox::processor_operation (ProcessorOperation op) targets.push_back (pointer.first->processor ()); } } +*/ + if ( (op == ProcessorsDelete) && targets.empty() ) + return false; //nothing to delete. return false so the editor-mixer, because the user was probably intending to delete something in the editor + switch (op) { case ProcessorsSelectAll: processor_display.select_all (); break; + case ProcessorsSelectNone: + processor_display.select_none (); + break; + case ProcessorsCopy: copy_processors (targets); break; @@ -1253,6 +1266,8 @@ ProcessorBox::processor_operation (ProcessorOperation op) default: break; } + + return true; } ProcessorWindowProxy* @@ -1298,6 +1313,12 @@ ProcessorBox::processor_button_press_event (GdkEventButton *ev, ProcessorEntry* ret = true; + } else if (Keyboard::is_context_menu_event (ev)) { + + show_processor_menu (ev->time); + + ret = true; + } else if (processor && ev->button == 1 && selected) { // this is purely informational but necessary for route params UI @@ -1326,10 +1347,6 @@ ProcessorBox::processor_button_release_event (GdkEventButton *ev, ProcessorEntry sigc::mem_fun(*this, &ProcessorBox::idle_delete_processor), boost::weak_ptr(processor))); - } else if (Keyboard::is_context_menu_event (ev)) { - - show_processor_menu (ev->time); - } else if (processor && Keyboard::is_button2_event (ev) #ifndef GTKOSX && (Keyboard::no_modifier_keys_pressed (ev) && ((ev->state & Gdk::BUTTON2_MASK) == Gdk::BUTTON2_MASK)) @@ -1740,6 +1757,7 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr p) } boost::shared_ptr plugin_insert = boost::dynamic_pointer_cast (processor); + ProcessorEntry* e = 0; if (plugin_insert) { e = new PluginInsertProcessorEntry (this, plugin_insert, _width); @@ -1747,6 +1765,13 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr p) e = new ProcessorEntry (this, processor, _width); } + boost::shared_ptr send = boost::dynamic_pointer_cast (processor); + boost::shared_ptr ext = boost::dynamic_pointer_cast (processor); + + //faders and meters are not deletable, copy/paste-able, so they shouldn't be selectable + if (!send && !plugin_insert && !ext) + e->set_selectable(false); + /* Set up this entry's state from the GUIObjectState */ XMLNode* proc = entry_gui_object_state (e); if (proc) { @@ -2107,8 +2132,8 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr boost::shared_ptr sendpan(new Pannable (*_session)); XMLNode n (**niter); - InternalSend* s = new InternalSend (*_session, sendpan, _route->mute_master(), - boost::shared_ptr(), Delivery::Aux); + InternalSend* s = new InternalSend (*_session, sendpan, _route->mute_master(), + _route, boost::shared_ptr(), Delivery::Aux); IOProcessor::prepare_for_reset (n, s->name());