summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/processor_box.cc8
-rw-r--r--gtk2_ardour/route_ui.cc7
-rw-r--r--gtk2_ardour/route_ui.h2
-rw-r--r--libs/ardour/amp.cc6
-rw-r--r--libs/ardour/ardour/amp.h2
-rw-r--r--libs/ardour/ardour/delivery.h3
-rw-r--r--libs/ardour/ardour/internal_send.h3
-rw-r--r--libs/ardour/ardour/meter.h2
-rw-r--r--libs/ardour/ardour/route.h2
-rw-r--r--libs/ardour/ardour/send.h6
-rw-r--r--libs/ardour/ardour/session.h4
-rw-r--r--libs/ardour/delivery.cc4
-rw-r--r--libs/ardour/internal_send.cc22
-rw-r--r--libs/ardour/meter.cc6
-rw-r--r--libs/ardour/route.cc189
-rw-r--r--libs/ardour/send.cc22
-rw-r--r--libs/ardour/session.cc18
17 files changed, 161 insertions, 145 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 9ba3632d2d..e874550712 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -46,6 +46,7 @@
#include "ardour/audio_diskstream.h"
#include "ardour/audio_track.h"
#include "ardour/audioengine.h"
+#include "ardour/internal_send.h"
#include "ardour/ladspa_plugin.h"
#include "ardour/meter.h"
#include "ardour/plugin_insert.h"
@@ -768,11 +769,9 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr<Processor> p)
return;
}
-#if 0
- if (processor == _route->amp() || !processor->visible()) {
+ if (!processor->visible()) {
return;
}
-#endif
Gtk::TreeModel::Row row = *(model->append());
row[columns.text] = processor_name (processor);
@@ -804,7 +803,8 @@ ProcessorBox::processor_name (boost::weak_ptr<Processor> weak_processor)
name_display = " (";
}
- if ((send = boost::dynamic_pointer_cast<Send> (processor)) != 0) {
+ if ((send = boost::dynamic_pointer_cast<Send> (processor)) != 0 &&
+ !boost::dynamic_pointer_cast<InternalSend>(processor)) {
name_display += '>';
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index c7f835d2df..577dc1ea31 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -526,7 +526,8 @@ RouteUI::build_sends_menu ()
sends_menu->set_name ("ArdourContextMenu");
MenuList& items = sends_menu->items();
- items.push_back (MenuElem(_("Assign all tracks"), mem_fun (*this, &RouteUI::create_sends)));
+ items.push_back (MenuElem(_("Assign all tracks (prefader)"), bind (mem_fun (*this, &RouteUI::create_sends), PreFader)));
+ items.push_back (MenuElem(_("Assign all tracks (postfader)"), bind (mem_fun (*this, &RouteUI::create_sends), PostFader)));
items.push_back (MenuElem(_("Copy track gains to sends"), mem_fun (*this, &RouteUI::set_sends_gain_from_track)));
items.push_back (MenuElem(_("Set sends gain to -inf"), mem_fun (*this, &RouteUI::set_sends_gain_to_zero)));
items.push_back (MenuElem(_("Set sends gain to 0dB"), mem_fun (*this, &RouteUI::set_sends_gain_to_unity)));
@@ -534,9 +535,9 @@ RouteUI::build_sends_menu ()
}
void
-RouteUI::create_sends ()
+RouteUI::create_sends (Placement p)
{
- _session.globally_add_internal_sends (_route);
+ _session.globally_add_internal_sends (_route, p);
}
void
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index 2bfbc4452d..c2f03eb394 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -123,7 +123,7 @@ class RouteUI : public virtual AxisView
void set_sends_gain_from_track ();
void set_sends_gain_to_zero ();
void set_sends_gain_to_unity ();
- void create_sends ();
+ void create_sends (ARDOUR::Placement);
void solo_changed(void*);
void solo_changed_so_update_mute ();
diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc
index 34ea20addf..9aa88068a9 100644
--- a/libs/ardour/amp.cc
+++ b/libs/ardour/amp.cc
@@ -323,3 +323,9 @@ Amp::setup_gain_automation (sframes_t start_frame, sframes_t end_frame, nframes_
_apply_gain_automation = false;
}
}
+
+bool
+Amp::visible() const
+{
+ return true;
+}
diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h
index 822d7a2d6d..7be324dba1 100644
--- a/libs/ardour/ardour/amp.h
+++ b/libs/ardour/ardour/amp.h
@@ -39,7 +39,7 @@ public:
std::string display_name() const;
- bool visible () const { return false; }
+ bool visible () const;
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h
index 1d01acad5f..e46823d075 100644
--- a/libs/ardour/ardour/delivery.h
+++ b/libs/ardour/ardour/delivery.h
@@ -37,7 +37,8 @@ public:
Insert = 0x1,
Send = 0x2,
Listen = 0x4,
- Main = 0x8
+ Main = 0x8,
+ Aux = 0x10
};
/* Delivery to an existing output */
diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h
index ea2ffce3fe..3e89b8aec6 100644
--- a/libs/ardour/ardour/internal_send.h
+++ b/libs/ardour/ardour/internal_send.h
@@ -28,10 +28,11 @@ namespace ARDOUR {
class InternalSend : public Send
{
public:
- InternalSend (Session&, boost::shared_ptr<MuteMaster>, boost::shared_ptr<Route> send_to);
+ InternalSend (Session&, boost::shared_ptr<MuteMaster>, boost::shared_ptr<Route> send_to, Delivery::Role role);
InternalSend (Session&, boost::shared_ptr<MuteMaster>, const XMLNode&);
virtual ~InternalSend ();
+ std::string display_name() const;
bool set_name (const std::string&);
bool visible() const;
diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h
index 414b559de0..e1fd97f107 100644
--- a/libs/ardour/ardour/meter.h
+++ b/libs/ardour/ardour/meter.h
@@ -53,6 +53,8 @@ public:
PeakMeter(Session& s) : Processor(s, "Meter") {}
PeakMeter(Session&s, const XMLNode& node);
+ bool visible() const;
+
void meter();
void reset ();
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 133ec1eb78..7a44cb454c 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -260,7 +260,7 @@ class Route : public SessionObject, public AutomatableControls
sigc::signal<void,void*> SelectedChanged;
- int listen_via (boost::shared_ptr<Route>, bool);
+ int listen_via (boost::shared_ptr<Route>, Placement p, bool active, bool aux);
void drop_listen (boost::shared_ptr<Route>);
bool feeds (boost::shared_ptr<Route>);
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index 37d56e2abd..d4b9bca1b3 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -37,12 +37,14 @@ class Amp;
class Send : public Delivery
{
public:
- Send (Session&, boost::shared_ptr<MuteMaster>, bool internal = false);
- Send (Session&, boost::shared_ptr<MuteMaster>, const XMLNode&, bool internal = false);
+ Send (Session&, boost::shared_ptr<MuteMaster>, Delivery::Role r = Delivery::Send);
+ Send (Session&, boost::shared_ptr<MuteMaster>, const XMLNode&, Delivery::Role r = Delivery::Send);
virtual ~Send ();
uint32_t bit_slot() const { return _bitslot; }
+ bool visible() const;
+
boost::shared_ptr<Amp> amp() const { return _amp; }
boost::shared_ptr<PeakMeter> meter() const { return _meter; }
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 429d30a5c1..7669883185 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -740,8 +740,8 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
boost::shared_ptr<Route> control_out() const { return _control_out; }
boost::shared_ptr<Route> master_out() const { return _master_out; }
- void globally_add_internal_sends (boost::shared_ptr<Route> dest);
- void add_internal_sends (boost::shared_ptr<Route> dest, boost::shared_ptr<RouteList> senders);
+ void globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p);
+ void add_internal_sends (boost::shared_ptr<Route> dest, Placement p, boost::shared_ptr<RouteList> senders);
static void set_disable_all_loaded_plugins (bool yn) {
_disable_all_loaded_plugins = yn;
diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc
index 1d86542100..49f4569a1c 100644
--- a/libs/ardour/delivery.cc
+++ b/libs/ardour/delivery.cc
@@ -178,10 +178,6 @@ Delivery::increment_output_offset (nframes_t n)
bool
Delivery::visible () const
{
- if (_role & Main) {
- return false;
- }
-
return true;
}
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc
index 718e34f29e..540a6869e1 100644
--- a/libs/ardour/internal_send.cc
+++ b/libs/ardour/internal_send.cc
@@ -33,8 +33,8 @@
using namespace PBD;
using namespace ARDOUR;
-InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, boost::shared_ptr<Route> sendto)
- : Send (s, mm, true)
+InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, boost::shared_ptr<Route> sendto, Delivery::Role role)
+ : Send (s, mm, role)
, _send_to (sendto)
{
if ((target = _send_to->get_return_buffer ()) == 0) {
@@ -42,12 +42,12 @@ InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, boost:
}
set_name (sendto->name());
-
+
_send_to->GoingAway.connect (mem_fun (*this, &InternalSend::send_to_going_away));
}
InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node)
- : Send (s, mm, node, true)
+ : Send (s, mm, node, Delivery::Aux /* will be reset in set_state() */)
{
set_state (node);
}
@@ -223,8 +223,22 @@ InternalSend::set_name (const std::string& str)
return IOProcessor::set_name (str);
}
+std::string
+InternalSend::display_name () const
+{
+ if (_role == Aux) {
+ return string_compose (X_("aux-%1"), _name);
+ } else {
+ return _name;
+ }
+}
+
bool
InternalSend::visible () const
{
+ if (_role == Aux) {
+ return true;
+ }
+
return false;
}
diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc
index 7f05cf103d..3bc12f20d6 100644
--- a/libs/ardour/meter.cc
+++ b/libs/ardour/meter.cc
@@ -218,3 +218,9 @@ PeakMeter::state (bool full_state)
return node;
}
+
+bool
+PeakMeter::visible() const
+{
+ return true;
+}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index af80fd6c89..cc90a855a5 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -619,22 +619,10 @@ Route::add_processor (boost::shared_ptr<Processor> processor, Placement placemen
if (placement == PreFader) {
/* generic pre-fader: insert immediately before the amp */
- loc = find(_processors.begin(), _processors.end(), _amp);
+ loc = find (_processors.begin(), _processors.end(), _amp);
} else {
- /* generic post-fader: insert at end */
- loc = _processors.end();
-
- if (processor->visible() && !_processors.empty()) {
- /* check for invisible processors stacked at the end and leave them there */
- ProcessorList::iterator p;
- p = _processors.end();
- --p;
- while (!(*p)->visible() && p != _processors.begin()) {
- --p;
- }
- ++p;
- loc = p;
- }
+ /* generic post-fader: insert right before the main outs */
+ loc = find (_processors.begin(), _processors.end(), _main_outs);
}
return add_processor (processor, loc, err);
@@ -725,129 +713,116 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
{
const XMLProperty *prop;
- // legacy sessions use a different node name for sends
- if (node.name() == "Send") {
-
- try {
- boost::shared_ptr<Send> send (new Send (_session, _mute_master, node));
- add_processor (send, iter);
- return true;
- }
-
- catch (failed_constructor &err) {
- error << _("Send construction failed") << endmsg;
- return false;
- }
-
- } else if (node.name() == "Processor") {
+ if (node.name() != "Processor") {
+ return false;
+ }
- try {
- if ((prop = node.property ("type")) != 0) {
-
- boost::shared_ptr<Processor> processor;
+ try {
+ if ((prop = node.property ("type")) != 0) {
+
+ boost::shared_ptr<Processor> processor;
- if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
- prop->value() == "lv2" ||
- prop->value() == "vst" ||
- prop->value() == "audiounit") {
+ if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
+ prop->value() == "lv2" ||
+ prop->value() == "vst" ||
+ prop->value() == "audiounit") {
- processor.reset (new PluginInsert(_session, node));
+ processor.reset (new PluginInsert(_session, node));
- } else if (prop->value() == "port") {
+ } else if (prop->value() == "port") {
- processor.reset (new PortInsert (_session, _mute_master, node));
+ processor.reset (new PortInsert (_session, _mute_master, node));
- } else if (prop->value() == "send") {
+ } else if (prop->value() == "send") {
- processor.reset (new Send (_session, _mute_master, node));
+ processor.reset (new Send (_session, _mute_master, node));
- } else if (prop->value() == "meter") {
+ } else if (prop->value() == "meter") {
- if (_meter) {
- if (_meter->set_state (node)) {
- return false;
- } else {
- return true;
- }
+ if (_meter) {
+ if (_meter->set_state (node)) {
+ return false;
+ } else {
+ return true;
}
+ }
- _meter.reset (new PeakMeter (_session, node));
- processor = _meter;
+ _meter.reset (new PeakMeter (_session, node));
+ processor = _meter;
- } else if (prop->value() == "amp") {
+ } else if (prop->value() == "amp") {
- /* amp always exists */
+ /* amp always exists */
- processor = _amp;
- if (processor->set_state (node)) {
- return false;
- } else {
- /* never any reason to add it */
- return true;
- }
+ processor = _amp;
+ if (processor->set_state (node)) {
+ return false;
+ } else {
+ /* never any reason to add it */
+ return true;
+ }
- } else if (prop->value() == "listen" || prop->value() == "deliver") {
+ } else if (prop->value() == "listen" || prop->value() == "deliver") {
- /* XXX need to generalize */
+ /* XXX need to generalize */
- } else if (prop->value() == "intsend") {
+ } else if (prop->value() == "intsend") {
- processor.reset (new InternalSend (_session, _mute_master, node));
+ processor.reset (new InternalSend (_session, _mute_master, node));
- } else if (prop->value() == "intreturn") {
+ } else if (prop->value() == "intreturn") {
- if (_intreturn) {
- if (_intreturn->set_state (node)) {
- return false;
- } else {
- return true;
- }
+ if (_intreturn) {
+ if (_intreturn->set_state (node)) {
+ return false;
+ } else {
+ return true;
}
- _intreturn.reset (new InternalReturn (_session, node));
- processor = _intreturn;
+ }
+ _intreturn.reset (new InternalReturn (_session, node));
+ processor = _intreturn;
- } else if (prop->value() == "main-outs") {
+ } else if (prop->value() == "main-outs") {
- if (_main_outs) {
- if (_main_outs->set_state (node)) {
- return false;
- } else {
- return true;
- }
+ if (_main_outs) {
+ if (_main_outs->set_state (node)) {
+ return false;
+ } else {
+ return true;
}
+ }
- _main_outs.reset (new Delivery (_session, _output, _mute_master, node));
- processor = _main_outs;
+ _main_outs.reset (new Delivery (_session, _output, _mute_master, node));
+ processor = _main_outs;
- } else {
- error << string_compose(_("unknown Processor type \"%1\"; ignored"), prop->value()) << endmsg;
- }
+ } else {
+ error << string_compose(_("unknown Processor type \"%1\"; ignored"), prop->value()) << endmsg;
+ }
- if (iter == _processors.end() && processor->visible() && !_processors.empty()) {
- /* check for invisible processors stacked at the end and leave them there */
- ProcessorList::iterator p;
- p = _processors.end();
+ if (iter == _processors.end() && processor->visible() && !_processors.empty()) {
+ /* check for invisible processors stacked at the end and leave them there */
+ ProcessorList::iterator p;
+ p = _processors.end();
+ --p;
+ while (!(*p)->visible() && p != _processors.begin()) {
--p;
- while (!(*p)->visible() && p != _processors.begin()) {
- --p;
- }
- ++p;
- iter = p;
}
-
- return (add_processor (processor, iter) == 0);
-
- } else {
- error << _("Processor XML node has no type property") << endmsg;
+ ++p;
+ iter = p;
}
- }
- catch (failed_constructor &err) {
- warning << _("processor could not be created. Ignored.") << endmsg;
+ return (add_processor (processor, iter) == 0);
+
+ } else {
+ error << _("Processor XML node has no type property") << endmsg;
return false;
}
}
- return false;
+
+ catch (failed_constructor &err) {
+ warning << _("processor could not be created. Ignored.") << endmsg;
+ return false;
+ }
}
int
@@ -1885,7 +1860,7 @@ Route::release_return_buffer () const
}
int
-Route::listen_via (boost::shared_ptr<Route> route, bool active)
+Route::listen_via (boost::shared_ptr<Route> route, Placement placement, bool active, bool aux)
{
vector<string> ports;
vector<string>::const_iterator i;
@@ -1917,7 +1892,7 @@ Route::listen_via (boost::shared_ptr<Route> route, bool active)
boost::shared_ptr<InternalSend> listener;
try {
- listener.reset (new InternalSend (_session, _mute_master, route));
+ listener.reset (new InternalSend (_session, _mute_master, route, (aux ? Delivery::Aux : Delivery::Listen)));
} catch (failed_constructor& err) {
return -1;
@@ -1927,7 +1902,7 @@ Route::listen_via (boost::shared_ptr<Route> route, bool active)
_control_outs = listener;
}
- add_processor (listener, (Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader));
+ add_processor (listener, placement);
return 0;
}
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc
index df6b87a686..3d44070e68 100644
--- a/libs/ardour/send.cc
+++ b/libs/ardour/send.cc
@@ -36,9 +36,8 @@
using namespace ARDOUR;
using namespace PBD;
-Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm, bool internal)
- : Delivery (s, mm, string_compose (_("send %1"), (_bitslot = s.next_send_id()) + 1),
- (internal ? Delivery::Listen : Delivery::Send))
+Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm, Role r)
+ : Delivery (s, mm, string_compose (_("send %1"), (_bitslot = s.next_send_id()) + 1), r)
, _metering (false)
{
_amp.reset (new Amp (_session, _mute_master));
@@ -47,8 +46,8 @@ Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm, bool internal)
ProcessorCreated (this); /* EMIT SIGNAL */
}
-Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node, bool internal)
- : Delivery (s, mm, "send", (internal ? Delivery::Listen : Delivery::Send))
+Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node, Role r)
+ : Delivery (s, mm, "send", r)
, _metering (false)
{
_amp.reset (new Amp (_session, _mute_master));
@@ -184,6 +183,7 @@ Send::make_unique (XMLNode &state, Session &session)
state.property("name")->set_value (name);
XMLNode* io = state.child ("IO");
+
if (io) {
io->property("name")->set_value (name);
}
@@ -194,7 +194,7 @@ Send::set_name (const std::string& new_name)
{
std::string unique_name;
- if (_role != Listen) {
+ if (_role == Delivery::Send) {
char buf[32];
snprintf (buf, sizeof (buf), "%u", _bitslot);
unique_name = new_name;
@@ -205,3 +205,13 @@ Send::set_name (const std::string& new_name)
return Delivery::set_name (unique_name);
}
+
+bool
+Send::visible () const
+{
+ if (_role == Listen) {
+ return false;
+ }
+
+ return true;
+}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 7abbcb49d1..b1d33e948c 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -820,7 +820,9 @@ Session::hookup_io ()
continue;
}
- (*x)->listen_via (_control_out, false);
+ (*x)->listen_via (_control_out,
+ (Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader),
+ false, false);
}
}
@@ -2147,8 +2149,9 @@ Session::add_routes (RouteList& new_routes, bool save)
if ((*x)->is_control() || (*x)->is_master()) {
continue;
}
- cerr << "Add listen via control outs\n";
- (*x)->listen_via (_control_out, false);
+ (*x)->listen_via (_control_out,
+ (Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader),
+ false, false);
}
resort_routes ();
@@ -2164,7 +2167,7 @@ Session::add_routes (RouteList& new_routes, bool save)
}
void
-Session::globally_add_internal_sends (boost::shared_ptr<Route> dest)
+Session::globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p)
{
boost::shared_ptr<RouteList> r = routes.reader ();
boost::shared_ptr<RouteList> t (new RouteList);
@@ -2177,11 +2180,11 @@ Session::globally_add_internal_sends (boost::shared_ptr<Route> dest)
}
}
- add_internal_sends (dest, t);
+ add_internal_sends (dest, p, t);
}
void
-Session::add_internal_sends (boost::shared_ptr<Route> dest, boost::shared_ptr<RouteList> senders)
+Session::add_internal_sends (boost::shared_ptr<Route> dest, Placement p, boost::shared_ptr<RouteList> senders)
{
if (dest->is_control() || dest->is_master()) {
return;
@@ -2197,8 +2200,7 @@ Session::add_internal_sends (boost::shared_ptr<Route> dest, boost::shared_ptr<Ro
continue;
}
- cerr << (*i)->name() << " listening via " << dest->name() << endl;
- (*i)->listen_via (dest, true);
+ (*i)->listen_via (dest, p, true, true);
}
}