RefPtr<Action> ProcessorBox::copy_action;
RefPtr<Action> ProcessorBox::rename_action;
RefPtr<Action> ProcessorBox::delete_action;
+RefPtr<Action> ProcessorBox::backspace_action;
RefPtr<Action> ProcessorBox::manage_pins_action;
RefPtr<Action> ProcessorBox::edit_action;
RefPtr<Action> ProcessorBox::edit_generic_action;
}
{
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_processor);
- if (pi && pi->plugin() && pi->plugin()->get_info()->type != ARDOUR::Lua) {
+ if (pi && pi->plugin()) {
_plugin_preset_pointer = PluginPresetPtr (new PluginPreset (pi->plugin()->get_info()));
}
}
if (_plugin_display) {
XMLNode* n = GUIObjectState::get_node (node, X_("InlineDisplay"));
- XMLProperty* p = n ? n->property (X_("visible")) : NULL;
+ XMLProperty const * p = n ? n->property (X_("visible")) : NULL;
if (p) {
if (string_is_affirmative (p->value ())) {
_plugin_display->show();
{
XMLNode* n = GUIObjectState::get_node (node, state_id ());
if (n) {
- XMLProperty* p = n->property (X_("visible"));
+ XMLProperty const * p = n->property (X_("visible"));
set_visible (p && string_is_affirmative (p->value ()));
} else {
set_visible (false);
if (_fed_by && _f_out != _f_sources) {
return false;
}
+ if (_fed_by && !_f_out_map.is_identity () && !_in_map.is_identity ()) {
+ return false;
+ }
if (_input && _sinks == _in && (!_fed_by || _f_out == _in)) {
return true;
}
void
ProcessorEntry::RoutingIcon::draw_thru_src (cairo_t* cr, double x0, double y0, double height, bool midi)
{
- const double rad = 2;
+ const double rad = 1;
const double y1 = height - rad - 1.5;
cairo_arc (cr, x0, y0 + y1, rad, 0, 2. * M_PI);
void
ProcessorEntry::RoutingIcon::draw_thru_sink (cairo_t* cr, double x0, double y0, double height, bool midi)
{
- const double rad = 2;
+ const double rad = 1;
const double y1 = rad + 1;
cairo_arc (cr, x0, y0 + y1, rad, 0, 2. * M_PI);
_i_in_map.get_src (dt, idx, &valid_sink);
_i_thru_map.get_src (dt, idx, &valid_thru);
if (!valid_thru && !valid_sink) {
- continue;
+ if (!is_midi || i != 0) { // special case midi-bypass
+ continue;
+ }
}
}
double c_x0 = pin_x_pos (i, width, pc_out, 0, false);
_i_in_map.get_src (dt, pn, &valid_sink);
_i_thru_map.get_src (dt, pn, &valid_thru_f);
if (!valid_thru_f && !valid_sink) {
- continue;
+ if (!is_midi || i != 0) { // special case midi-bypass
+ continue;
+ }
}
}
}
}
+ cairo_surface_flush(_surf);
cairo_surface_mark_dirty(_surf);
const double xc = floor ((width - dis->width) * .5);
cairo_set_source_surface(cr, _surf, xc, 0);
return h;
}
} catch (luabridge::LuaException const& e) {
- ;
+#ifndef NDEBUG
+ cerr << "LuaException:" << e.what () << endl;
+#endif
}
return 0;
}
std::list<Gtk::TargetEntry> tmp;
tmp.push_back (Gtk::TargetEntry ("processor")); // from processor-box to processor-box
tmp.push_back (Gtk::TargetEntry ("PluginInfoPtr")); // from plugin-manager
- tmp.push_back (Gtk::TargetEntry ("PluginPresetPtr")); // from sidebar
+ tmp.push_back (Gtk::TargetEntry ("PluginFavoritePtr")); // from sidebar
return tmp;
}
if (data.get_target() == "PluginInfoPtr") {
_drop_plugin (data, pl);
}
- else if (data.get_target() == "PluginPresetPtr") {
+ else if (data.get_target() == "PluginFavoritePtr") {
_drop_plugin_preset (data, pl);
}
else {
}
}
- Gtk::MenuItem* send_menu_item = dynamic_cast<Gtk::MenuItem*>(ActionManager::get_widget("/ProcessorMenu/send_options"));
- if (send_menu_item) {
- if (single_selection && !_route->is_monitor()) {
- Menu* m = single_selection->build_send_options_menu ();
- if (m && !m->items().empty()) {
- send_menu_item->set_submenu (*m);
- send_menu_item->set_sensitive (true);
+
+ if (!ARDOUR::Profile->get_mixbus()) {
+ Gtk::MenuItem* send_menu_item = dynamic_cast<Gtk::MenuItem*>(ActionManager::get_widget("/ProcessorMenu/send_options"));
+ if (send_menu_item) {
+ if (single_selection && !_route->is_monitor()) {
+ Menu* m = single_selection->build_send_options_menu ();
+ if (m && !m->items().empty()) {
+ send_menu_item->set_submenu (*m);
+ send_menu_item->set_sensitive (true);
+ } else {
+ gtk_menu_item_set_submenu (send_menu_item->gobj(), 0);
+ send_menu_item->set_sensitive (false);
+ }
} else {
- gtk_menu_item_set_submenu (send_menu_item->gobj(), 0);
send_menu_item->set_sensitive (false);
}
- } else {
- send_menu_item->set_sensitive (false);
}
}
cut_action->set_sensitive (sensitive && can_cut ());
copy_action->set_sensitive (sensitive);
delete_action->set_sensitive (sensitive || stub_processor_selected ());
+ backspace_action->set_sensitive (sensitive || stub_processor_selected ());
edit_action->set_sensitive (one_processor_can_be_edited ());
edit_generic_action->set_sensitive (one_processor_can_be_edited ());
_get_plugin_selector()->set_interested_object (*this);
}
-/** @return true if an error occurred, otherwise false */
-bool
-ProcessorBox::choose_lua ()
-{
- LuaScriptInfoPtr spi;
-
- ScriptSelector ss (_("Add Lua DSP Processor"), LuaScriptInfo::DSP);
- switch (ss.run ()) {
- case Gtk::RESPONSE_ACCEPT:
- spi = ss.script();
- break;
- default:
- return true;
- }
- ss.hide ();
-
- PluginPtr p;
- try {
- LuaPluginInfoPtr lpi (new LuaPluginInfo(spi));
- p = (lpi->load (*_session));
- } catch (...) {
- string msg = _(
- "Failed to instantiate Lua DSP Processor,\n"
- "probably because the script is invalid (no dsp function).");
- MessageDialog am (msg);
- am.run ();
- return true;
- }
-
- boost::shared_ptr<Processor> processor (new PluginInsert (*_session, p));
-
- Route::ProcessorStreams err_streams;
- if (_route->add_processor_by_index (processor, _placement, &err_streams, Config->get_new_plugins_active ())) {
- string msg = _(
- "Failed to add Lua DSP Processor at the given position,\n"
- "probably because the I/O configuration of the plugins\n"
- "could not match the configuration of this track.");
- MessageDialog am (msg);
- am.run ();
- }
- return false;
-}
-
/** @return true if an error occurred, otherwise false */
bool
ProcessorBox::use_plugins (const SelectedPlugins& plugins)
wp->set_state (*ui_xml, 0);
}
- void* existing_ui = p->get_ui ();
-
- if (existing_ui) {
- wp->use_window (*(reinterpret_cast<Gtk::Window*>(existing_ui)));
- }
-
p->set_pingmgr_proxy (wp);
WM::Manager::instance().register_window (wp);
}
}
} else {
(*i)->output_routing_icon.set_terminal(false);
- if (!(*i)->routing_icon.out_identity ()
- && !(*i)->routing_icon.in_identity ()
- && (*i)->routing_icon.can_coalesce ()) {
+ if ( !(*i)->routing_icon.out_identity ()
+ && !(*next)->routing_icon.in_identity ()
+ && (*next)->routing_icon.can_coalesce ()) {
(*i)->output_routing_icon.hide();
} else if (!(*i)->routing_icon.out_identity ()) {
(*i)->output_routing_icon.show();
myactions.register_action (processor_box_actions, X_("newplugin"), _("New Plugin"),
sigc::ptr_fun (ProcessorBox::rb_choose_plugin));
- act = myactions.register_action (processor_box_actions, X_("newlua"), _("New Lua DSP"),
- sigc::ptr_fun (ProcessorBox::rb_choose_lua));
act = myactions.register_action (processor_box_actions, X_("newinsert"), _("New Insert"),
sigc::ptr_fun (ProcessorBox::rb_choose_insert));
ActionManager::engine_sensitive_actions.push_back (act);
sigc::ptr_fun (ProcessorBox::rb_copy));
delete_action = myactions.register_action (processor_box_actions, X_("delete"), _("Delete"),
sigc::ptr_fun (ProcessorBox::rb_delete));
+ backspace_action = myactions.register_action (processor_box_actions, X_("backspace"), _("Delete"),
+ sigc::ptr_fun (ProcessorBox::rb_delete));
ActionManager::plugin_selection_sensitive_actions.push_back (cut_action);
ActionManager::plugin_selection_sensitive_actions.push_back (copy_action);
ActionManager::plugin_selection_sensitive_actions.push_back (delete_action);
+ ActionManager::plugin_selection_sensitive_actions.push_back (backspace_action);
paste_action = myactions.register_action (processor_box_actions, X_("paste"), _("Paste"),
sigc::ptr_fun (ProcessorBox::rb_paste));
_current_processor_box->choose_plugin ();
}
-void
-ProcessorBox::rb_choose_lua ()
-{
- if (_current_processor_box == 0) {
- return;
- }
- _current_processor_box->choose_lua ();
-}
-
void
ProcessorBox::rb_choose_insert ()
{
XMLNodeList children = node.children ();
XMLNodeList::const_iterator i = children.begin ();
while (i != children.end()) {
- XMLProperty* prop = (*i)->property (X_("name"));
+ XMLProperty const * prop = (*i)->property (X_("name"));
if ((*i)->name() == X_("Window") && prop && prop->value() == _name) {
break;
}
}
if (i != children.end()) {
- XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = (*i)->property (X_("custom-ui"))) != 0) {
want_custom = PBD::string_is_affirmative (prop->value ());
}
if (_window) {
setup ();
}
+ _window->show_all ();
}
- _window->show_all ();
return _window;
}
if (_window && (is_custom != want_custom)) {
/* drop existing window - wrong type */
drop_window ();
- get (true);
- setup ();
- assert (_window);
- is_custom = want_custom;
}
-
toggle ();
}
if (aw) {
aw->set_session (_session);
}
+ _window->show_all ();
}
-
- _window->show_all ();
return _window;
}