summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/delivery.h1
-rw-r--r--libs/ardour/ardour/meter.h3
-rw-r--r--libs/ardour/ardour/processor.h5
-rw-r--r--libs/ardour/ardour/send.h2
-rw-r--r--libs/ardour/ardour/types.h3
-rw-r--r--libs/ardour/delivery.cc11
-rw-r--r--libs/ardour/enums.cc1
-rw-r--r--libs/ardour/ladspa_plugin.cc6
-rw-r--r--libs/ardour/meter.cc5
-rw-r--r--libs/ardour/processor.cc9
-rw-r--r--libs/ardour/route.cc73
-rw-r--r--libs/ardour/send.cc4
12 files changed, 68 insertions, 55 deletions
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h
index beccab73ae..add222a0f1 100644
--- a/libs/ardour/ardour/delivery.h
+++ b/libs/ardour/ardour/delivery.h
@@ -61,7 +61,6 @@ public:
bool set_name (const std::string& name);
std::string display_name() const;
- bool visible() const;
Role role() const { return _role; }
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h
index be8472b170..10272ee733 100644
--- a/libs/ardour/ardour/meter.h
+++ b/libs/ardour/ardour/meter.h
@@ -53,10 +53,7 @@ public:
PeakMeter(Session& s) : Processor(s, "Meter") {}
PeakMeter(Session&s, const XMLNode& node);
- bool visible() const;
-
void meter();
-
void reset ();
void reset_max ();
diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h
index 473bb97130..3ec4a9885d 100644
--- a/libs/ardour/ardour/processor.h
+++ b/libs/ardour/ardour/processor.h
@@ -56,8 +56,8 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
virtual std::string display_name() const { return SessionObject::name(); }
- virtual bool visible() const { return true; }
- virtual void set_visible (bool) {}
+ virtual bool display_to_user() const { return _display_to_user; }
+ virtual void set_display_to_user (bool);
bool active () const { return _pending_active; }
@@ -109,6 +109,7 @@ protected:
ChanCount _configured_input;
ChanCount _configured_output;
void* _gui; /* generic, we don't know or care what this is */
+ bool _display_to_user;
private:
int set_state_2X (const XMLNode&, int version);
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index f9f13ee309..b86d321bd2 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -43,7 +43,7 @@ class Send : public Delivery
uint32_t bit_slot() const { return _bitslot; }
- bool visible() const;
+ bool display_to_user() const;
boost::shared_ptr<Amp> amp() const { return _amp; }
boost::shared_ptr<PeakMeter> meter() const { return _meter; }
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 7e09417409..75c4d20db4 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -127,7 +127,8 @@ namespace ARDOUR {
enum MeterPoint {
MeterInput,
MeterPreFader,
- MeterPostFader
+ MeterPostFader,
+ MeterCustom
};
enum TrackMode {
diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc
index 5b063ad566..3494be2cf5 100644
--- a/libs/ardour/delivery.cc
+++ b/libs/ardour/delivery.cc
@@ -59,9 +59,9 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Mute
, _solo_isolated (false)
, _mute_master (mm)
, no_panner_reset (false)
-
{
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
+ _display_to_user = false;
if (_output) {
_output->changed.connect (mem_fun (*this, &Delivery::output_changed));
@@ -85,6 +85,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<MuteMaster> mm, const string&
, no_panner_reset (false)
{
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
+ _display_to_user = false;
if (_output) {
_output->changed.connect (mem_fun (*this, &Delivery::output_changed));
@@ -108,6 +109,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode&
, no_panner_reset (false)
{
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
+ _display_to_user = false;
if (set_state (node, Stateful::loading_state_version)) {
throw failed_constructor ();
@@ -135,6 +137,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> out, boost::shared_ptr<Mut
, no_panner_reset (false)
{
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
+ _display_to_user = false;
if (set_state (node, Stateful::loading_state_version)) {
throw failed_constructor ();
@@ -178,12 +181,6 @@ Delivery::increment_output_offset (nframes_t n)
}
bool
-Delivery::visible () const
-{
- return true;
-}
-
-bool
Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
{
if (_role == Main) {
diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc
index ed7ba88d8e..4b0ec3b343 100644
--- a/libs/ardour/enums.cc
+++ b/libs/ardour/enums.cc
@@ -160,6 +160,7 @@ setup_enum_writer ()
REGISTER_ENUM (MeterInput);
REGISTER_ENUM (MeterPreFader);
REGISTER_ENUM (MeterPostFader);
+ REGISTER_ENUM (MeterCustom);
REGISTER (_MeterPoint);
REGISTER_ENUM (Normal);
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc
index 6e2acfbe09..a242a76c31 100644
--- a/libs/ardour/ladspa_plugin.cc
+++ b/libs/ardour/ladspa_plugin.cc
@@ -393,9 +393,6 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
uint32_t port_id;
LocaleGuard lg (X_("POSIX"));
- cout << "LADSPA Plugin set state " << version << "\n";
- cout << "- node " << node.name() << "\n";
-
if (node.name() != state_node_name()) {
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
return -1;
@@ -441,9 +438,6 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int version)
uint32_t port_id;
LocaleGuard lg (X_("POSIX"));
- cout << "LADSPA Plugin set state " << version << "\n";
- cout << "- node " << node.name() << "\n";
-
if (node.name() != state_node_name()) {
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
return -1;
diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc
index a5e82c3bf3..e5fcc16f29 100644
--- a/libs/ardour/meter.cc
+++ b/libs/ardour/meter.cc
@@ -225,8 +225,3 @@ PeakMeter::state (bool full_state)
}
-bool
-PeakMeter::visible() const
-{
- return true;
-}
diff --git a/libs/ardour/processor.cc b/libs/ardour/processor.cc
index b46cc661e4..3bc9db024b 100644
--- a/libs/ardour/processor.cc
+++ b/libs/ardour/processor.cc
@@ -70,6 +70,7 @@ Processor::Processor(Session& session, const string& name)
, _next_ab_is_active(false)
, _configured(false)
, _gui(0)
+ , _display_to_user (true)
{
}
@@ -81,6 +82,7 @@ Processor::Processor (Session& session, const XMLNode& node)
, _next_ab_is_active(false)
, _configured(false)
, _gui(0)
+ , _display_to_user (true)
{
set_state (node, Stateful::loading_state_version);
_pending_active = _active;
@@ -271,3 +273,10 @@ Processor::configure_io (ChanCount in, ChanCount out)
return true;
}
+
+void
+Processor::set_display_to_user (bool yn)
+{
+ _display_to_user = yn;
+}
+
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 248d60ab67..e0543bdda9 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -80,6 +80,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
/* add standard processors other than amp (added by ::init()) */
_meter.reset (new PeakMeter (_session));
+ _meter->set_display_to_user (_meter_point == MeterCustom);
add_processor (_meter, PreFader);
if (_flags & ControlOut) {
@@ -774,6 +775,7 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
}
_meter.reset (new PeakMeter (_session, node));
+ _meter->set_display_to_user (_meter_point == MeterCustom);
processor = _meter;
} else if (prop->value() == "amp") {
@@ -822,12 +824,12 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
return false;
}
- if (iter == _processors.end() && processor->visible() && !_processors.empty()) {
+ if (iter == _processors.end() && processor->display_to_user() && !_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()) {
+ while (!(*p)->display_to_user() && p != _processors.begin()) {
--p;
}
++p;
@@ -885,12 +887,12 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version, ProcessorLis
return false;
}
- if (iter == _processors.end() && processor->visible() && !_processors.empty()) {
+ if (iter == _processors.end() && processor->display_to_user() && !_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()) {
+ while (!(*p)->display_to_user() && p != _processors.begin()) {
--p;
}
++p;
@@ -1404,7 +1406,7 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
#ifndef NDEBUG
DEBUG_TRACE (DEBUG::Processors, "{\n");
for (list<boost::shared_ptr<Processor> >::const_iterator p = _processors.begin(); p != _processors.end(); ++p) {
- DEBUG_TRACE (DEBUG::Processors, string_compose ("\t%1 ID = %2", (*p)->name(), (*p)->id()));
+ DEBUG_TRACE (DEBUG::Processors, string_compose ("\t%1 ID = %2\n", (*p)->name(), (*p)->id()));
}
DEBUG_TRACE (DEBUG::Processors, "}\n");
#endif
@@ -1535,7 +1537,7 @@ int
Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err)
{
/* "new_order" is an ordered list of processors to be positioned according to "placement".
- NOTE: all processors in "new_order" MUST be marked as visible. There maybe additional
+ NOTE: all processors in "new_order" MUST be marked as display_to_user(). There maybe additional
processors in the current actual processor list that are hidden. Any visible processors
in the current list but not in "new_order" will be assumed to be deleted.
*/
@@ -1574,7 +1576,7 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
} else {
- if (!(*oiter)->visible()) {
+ if (!(*oiter)->display_to_user()) {
as_it_will_be.push_back (*oiter);
@@ -1792,6 +1794,9 @@ Route::_set_state (const XMLNode& node, int version, bool /*call_base*/)
if ((prop = node.property (X_("meter-point"))) != 0) {
_meter_point = MeterPoint (string_2_enum (prop->value (), _meter_point));
+ if (_meter) {
+ _meter->set_display_to_user (_meter_point == MeterCustom);
+ }
}
if ((prop = node.property (X_("route-group"))) != 0) {
@@ -2634,28 +2639,40 @@ Route::set_meter_point (MeterPoint p, void *src)
{
Glib::RWLock::WriterLock lm (_processor_lock);
ProcessorList as_it_was (_processors);
-
- // Move meter in the processors list
- ProcessorList::iterator loc = find(_processors.begin(), _processors.end(), _meter);
- _processors.erase(loc);
- switch (p) {
- case MeterInput:
- loc = _processors.begin();
- break;
- case MeterPreFader:
- loc = find(_processors.begin(), _processors.end(), _amp);
- break;
- case MeterPostFader:
- loc = _processors.end();
+
+ if (p != MeterCustom) {
+ // Move meter in the processors list to reflect the new position
+ ProcessorList::iterator loc = find(_processors.begin(), _processors.end(), _meter);
+ _processors.erase(loc);
+ switch (p) {
+ case MeterInput:
+ loc = _processors.begin();
+ break;
+ case MeterPreFader:
+ loc = find(_processors.begin(), _processors.end(), _amp);
+ break;
+ case MeterPostFader:
+ loc = _processors.end();
+ break;
+ default:
break;
- }
-
- _processors.insert(loc, _meter);
-
- if (configure_processors_unlocked (0)) {
- _processors = as_it_was;
- configure_processors_unlocked (0); // it worked before we tried to add it ...
- return;
+ }
+
+ _processors.insert(loc, _meter);
+
+ if (configure_processors_unlocked (0)) {
+ _processors = as_it_was;
+ configure_processors_unlocked (0); // it worked before we tried to add it ...
+ return;
+ }
+
+ _meter->set_display_to_user (false);
+
+ } else {
+
+ // just make it visible and let the user move it
+
+ _meter->set_display_to_user (true);
}
}
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc
index 5a39c3322a..d2c1d3c493 100644
--- a/libs/ardour/send.cc
+++ b/libs/ardour/send.cc
@@ -241,8 +241,10 @@ Send::set_name (const std::string& new_name)
}
bool
-Send::visible () const
+Send::display_to_user () const
{
+ /* we ignore Deliver::_display_to_user */
+
if (_role == Listen) {
return false;
}