diff options
author | Johannes Mueller <github@johannes-mueller.org> | 2018-10-27 03:28:52 +0200 |
---|---|---|
committer | Johannes Mueller <github@johannes-mueller.org> | 2018-11-01 18:52:51 +0100 |
commit | 9a01ef35e71fb9885f08a43c9ebaf729ddb071e3 (patch) | |
tree | 3fe96e727c3122647c8a990f979e4a9c3434e1bf /gtk2_ardour | |
parent | 694c5fcfa66b6c78bfc46ff9ac8b634b8ffdc05f (diff) |
Put the sidechain ports into a dedicated tab in PortMatrix
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/port_group.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index a39f86619b..f68a00dd8f 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -30,9 +30,11 @@ #include "ardour/io_processor.h" #include "ardour/midi_port.h" #include "ardour/midiport_manager.h" +#include "ardour/plugin_insert.h" #include "ardour/port.h" #include "ardour/profile.h" #include "ardour/session.h" +#include "ardour/sidechain.h" #include "ardour/user_bundle.h" #include "control_protocol/control_protocol.h" @@ -337,6 +339,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp boost::shared_ptr<PortGroup> bus (new PortGroup (string_compose (_("%1 Busses"), PROGRAM_NAME))); boost::shared_ptr<PortGroup> track (new PortGroup (string_compose (_("%1 Tracks"), PROGRAM_NAME))); + boost::shared_ptr<PortGroup> sidechain (new PortGroup (string_compose (_("%1 Sidechains"), PROGRAM_NAME))); boost::shared_ptr<PortGroup> system (new PortGroup (_("Hardware"))); boost::shared_ptr<PortGroup> program (new PortGroup (string_compose (_("%1 Misc"), PROGRAM_NAME))); boost::shared_ptr<PortGroup> other (new PortGroup (_("Other"))); @@ -399,6 +402,25 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp } } } + + /* When on input side, let's look for sidechains in the route's plugins + to display them right next to their route */ + for (uint32_t n = 0; inputs; ++n) { + boost::shared_ptr<Processor> p = (i->route)->nth_plugin (n); + if (!p) { + break; + } + boost::shared_ptr<SideChain> sc = boost::static_pointer_cast<PluginInsert> (p)->sidechain (); + + if (sc) { + boost::shared_ptr<IO> io = sc->input(); + if (tv) { + sidechain->add_bundle (io->bundle(), io, tv->color ()); + } else { + sidechain->add_bundle (io->bundle(), io); + } + } + } } /* Bundles owned by the session; add user bundles first, then normal ones, so @@ -528,6 +550,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp if (!system->has_port(p) && !bus->has_port(p) && !track->has_port(p) && + !sidechain->has_port(p) && !program->has_port(p) && !other->has_port(p)) { @@ -646,6 +669,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp add_group_if_not_empty (other); add_group_if_not_empty (bus); add_group_if_not_empty (track); + add_group_if_not_empty (sidechain); add_group_if_not_empty (program); add_group_if_not_empty (system); |