diff options
author | David Robillard <d@drobilla.net> | 2006-08-11 03:24:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-08-11 03:24:57 +0000 |
commit | 30c08ba655330232767554c48bda1975bfb5628c (patch) | |
tree | c6bf6b62de69afdd6b2a42ef3a7d9f80e0f65f7c /gtk2_ardour/redirect_box.cc | |
parent | ab6f1ed9bafa869648b6e94ee5186ff317b32c3e (diff) |
- Changed IO's vector<Port*>'s to PortList
- Added new Port classes, code to drive them
- Added PortList, which is a filthy mess ATM (nevermind that, it's the interface that's important at this stage)
- Added ChanCount, though it isn't very thoroughly used yet. That's the next step....
- Fixed a few bugs relating to loading sessions saved with trunk
- Fixed a few random other bugs
Slowly working towards type agnosticism while keeping all the former code/logic intact is the name of the game here
Warning: Removing ports is currently (intentionally) broken due solely to laziness.
git-svn-id: svn://localhost/ardour2/branches/midi@786 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/redirect_box.cc')
-rw-r--r-- | gtk2_ardour/redirect_box.cc | 71 |
1 files changed, 44 insertions, 27 deletions
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index 74198265d9..ddb9e85ca2 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -957,44 +957,61 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) { - PluginUIWindow *plugin_ui; + ARDOUR::PluginType type = plugin_insert->type(); + + if (type == ARDOUR::LADSPA || type == ARDOUR::VST) { + PluginUIWindow *plugin_ui; - if (plugin_insert->get_gui() == 0) { + if (plugin_insert->get_gui() == 0) { - string title; - string maker = plugin_insert->plugin()->maker(); - string::size_type email_pos; + string title; + string maker = plugin_insert->plugin()->maker(); + string::size_type email_pos; - if ((email_pos = maker.find_first_of ('<')) != string::npos) { - maker = maker.substr (0, email_pos - 1); - } + if ((email_pos = maker.find_first_of ('<')) != string::npos) { + maker = maker.substr (0, email_pos - 1); + } - if (maker.length() > 32) { - maker = maker.substr (0, 32); - maker += " ..."; - } + if (maker.length() > 32) { + maker = maker.substr (0, 32); + maker += " ..."; + } - title = string_compose(_("ardour: %1: %2 (by %3)"), _route->name(), plugin_insert->name(), maker); + title = string_compose(_("ardour: %1: %2 (by %3)"), _route->name(), plugin_insert->name(), maker); + + plugin_ui = new PluginUIWindow (_session.engine(), plugin_insert); + if (_owner_is_mixer) { + ARDOUR_UI::instance()->the_mixer()->ensure_float (*plugin_ui); + } else { + ARDOUR_UI::instance()->the_editor().ensure_float (*plugin_ui); + } + plugin_ui->set_title (title); + plugin_insert->set_gui (plugin_ui); - plugin_ui = new PluginUIWindow (_session.engine(), plugin_insert); - if (_owner_is_mixer) { - ARDOUR_UI::instance()->the_mixer()->ensure_float (*plugin_ui); } else { - ARDOUR_UI::instance()->the_editor().ensure_float (*plugin_ui); + plugin_ui = reinterpret_cast<PluginUIWindow *> (plugin_insert->get_gui()); } - plugin_ui->set_title (title); - plugin_insert->set_gui (plugin_ui); - - } else { - plugin_ui = reinterpret_cast<PluginUIWindow *> (plugin_insert->get_gui()); - } - if (plugin_ui->is_visible()) { - plugin_ui->get_window()->raise (); + if (plugin_ui->is_visible()) { + plugin_ui->get_window()->raise (); + } else { + plugin_ui->show_all (); + } +#ifdef HAVE_COREAUDIO + } else if (type == ARDOUR::AudioUnit) { + AUPluginUI* plugin_ui; + if (plugin_insert->get_gui() == 0) { + plugin_ui = new AUPluginUI (_session.engine(), plugin_insert); + } else { + plugin_ui = reinterpret_cast<AUPluginUI*> (plugin_insert->get_gui()); + } + + // raise window, somehow +#endif } else { - plugin_ui->show_all (); + warning << "Unsupported plugin sent to RedirectBox::edit_redirect()" << endmsg; + return; } - } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) { if (!_session.engine().connected()) { |