add "custom" meter option which is the only option where the meter processor is visible in the UI; hide main outs always
git-svn-id: svn://localhost/ardour2/branches/3.0@6126 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
dd4565801b
commit
57e1358fb2
@ -469,9 +469,14 @@ next_meter_point (MeterPoint mp)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MeterPostFader:
|
case MeterPostFader:
|
||||||
|
return MeterCustom;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MeterCustom:
|
||||||
return MeterInput;
|
return MeterInput;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
return MeterInput;
|
return MeterInput;
|
||||||
}
|
}
|
||||||
|
@ -403,6 +403,10 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
|
|||||||
case MeterPostFader:
|
case MeterPostFader:
|
||||||
meter_point_label.set_text (_("post"));
|
meter_point_label.set_text (_("post"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MeterCustom:
|
||||||
|
meter_point_label.set_text (_("custom"));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete route_ops_menu;
|
delete route_ops_menu;
|
||||||
@ -1603,6 +1607,10 @@ MixerStrip::meter_changed (void *src)
|
|||||||
case MeterPostFader:
|
case MeterPostFader:
|
||||||
meter_point_label.set_text (_("post"));
|
meter_point_label.set_text (_("post"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MeterCustom:
|
||||||
|
meter_point_label.set_text (_("custom"));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpm.setup_meters ();
|
gpm.setup_meters ();
|
||||||
|
@ -804,11 +804,8 @@ void
|
|||||||
ProcessorBox::add_processor_to_display (boost::weak_ptr<Processor> p)
|
ProcessorBox::add_processor_to_display (boost::weak_ptr<Processor> p)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Processor> processor (p.lock ());
|
boost::shared_ptr<Processor> processor (p.lock ());
|
||||||
if (!processor) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!processor->visible()) {
|
if (!processor || !processor->display_to_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1994,11 +1994,8 @@ void
|
|||||||
RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p)
|
RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Processor> processor (p.lock ());
|
boost::shared_ptr<Processor> processor (p.lock ());
|
||||||
if (!processor) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!processor->visible ()) {
|
if (!processor || !processor->display_to_user ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,6 @@ public:
|
|||||||
bool set_name (const std::string& name);
|
bool set_name (const std::string& name);
|
||||||
std::string display_name() const;
|
std::string display_name() const;
|
||||||
|
|
||||||
bool visible() const;
|
|
||||||
Role role() const { return _role; }
|
Role role() const { return _role; }
|
||||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||||
bool configure_io (ChanCount in, ChanCount out);
|
bool configure_io (ChanCount in, ChanCount out);
|
||||||
|
@ -53,10 +53,7 @@ public:
|
|||||||
PeakMeter(Session& s) : Processor(s, "Meter") {}
|
PeakMeter(Session& s) : Processor(s, "Meter") {}
|
||||||
PeakMeter(Session&s, const XMLNode& node);
|
PeakMeter(Session&s, const XMLNode& node);
|
||||||
|
|
||||||
bool visible() const;
|
|
||||||
|
|
||||||
void meter();
|
void meter();
|
||||||
|
|
||||||
void reset ();
|
void reset ();
|
||||||
void reset_max ();
|
void reset_max ();
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
|
|||||||
|
|
||||||
virtual std::string display_name() const { return SessionObject::name(); }
|
virtual std::string display_name() const { return SessionObject::name(); }
|
||||||
|
|
||||||
virtual bool visible() const { return true; }
|
virtual bool display_to_user() const { return _display_to_user; }
|
||||||
virtual void set_visible (bool) {}
|
virtual void set_display_to_user (bool);
|
||||||
|
|
||||||
bool active () const { return _pending_active; }
|
bool active () const { return _pending_active; }
|
||||||
|
|
||||||
@ -109,6 +109,7 @@ protected:
|
|||||||
ChanCount _configured_input;
|
ChanCount _configured_input;
|
||||||
ChanCount _configured_output;
|
ChanCount _configured_output;
|
||||||
void* _gui; /* generic, we don't know or care what this is */
|
void* _gui; /* generic, we don't know or care what this is */
|
||||||
|
bool _display_to_user;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int set_state_2X (const XMLNode&, int version);
|
int set_state_2X (const XMLNode&, int version);
|
||||||
|
@ -43,7 +43,7 @@ class Send : public Delivery
|
|||||||
|
|
||||||
uint32_t bit_slot() const { return _bitslot; }
|
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<Amp> amp() const { return _amp; }
|
||||||
boost::shared_ptr<PeakMeter> meter() const { return _meter; }
|
boost::shared_ptr<PeakMeter> meter() const { return _meter; }
|
||||||
|
@ -127,7 +127,8 @@ namespace ARDOUR {
|
|||||||
enum MeterPoint {
|
enum MeterPoint {
|
||||||
MeterInput,
|
MeterInput,
|
||||||
MeterPreFader,
|
MeterPreFader,
|
||||||
MeterPostFader
|
MeterPostFader,
|
||||||
|
MeterCustom
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TrackMode {
|
enum TrackMode {
|
||||||
|
@ -59,9 +59,9 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Mute
|
|||||||
, _solo_isolated (false)
|
, _solo_isolated (false)
|
||||||
, _mute_master (mm)
|
, _mute_master (mm)
|
||||||
, no_panner_reset (false)
|
, no_panner_reset (false)
|
||||||
|
|
||||||
{
|
{
|
||||||
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
|
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
|
||||||
|
_display_to_user = false;
|
||||||
|
|
||||||
if (_output) {
|
if (_output) {
|
||||||
_output->changed.connect (mem_fun (*this, &Delivery::output_changed));
|
_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)
|
, no_panner_reset (false)
|
||||||
{
|
{
|
||||||
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
|
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
|
||||||
|
_display_to_user = false;
|
||||||
|
|
||||||
if (_output) {
|
if (_output) {
|
||||||
_output->changed.connect (mem_fun (*this, &Delivery::output_changed));
|
_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)
|
, no_panner_reset (false)
|
||||||
{
|
{
|
||||||
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
|
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
|
||||||
|
_display_to_user = false;
|
||||||
|
|
||||||
if (set_state (node, Stateful::loading_state_version)) {
|
if (set_state (node, Stateful::loading_state_version)) {
|
||||||
throw failed_constructor ();
|
throw failed_constructor ();
|
||||||
@ -135,6 +137,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> out, boost::shared_ptr<Mut
|
|||||||
, no_panner_reset (false)
|
, no_panner_reset (false)
|
||||||
{
|
{
|
||||||
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
|
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
|
||||||
|
_display_to_user = false;
|
||||||
|
|
||||||
if (set_state (node, Stateful::loading_state_version)) {
|
if (set_state (node, Stateful::loading_state_version)) {
|
||||||
throw failed_constructor ();
|
throw failed_constructor ();
|
||||||
@ -177,12 +180,6 @@ Delivery::increment_output_offset (nframes_t n)
|
|||||||
_output_offset += n;
|
_output_offset += n;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
Delivery::visible () const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||||
{
|
{
|
||||||
|
@ -160,6 +160,7 @@ setup_enum_writer ()
|
|||||||
REGISTER_ENUM (MeterInput);
|
REGISTER_ENUM (MeterInput);
|
||||||
REGISTER_ENUM (MeterPreFader);
|
REGISTER_ENUM (MeterPreFader);
|
||||||
REGISTER_ENUM (MeterPostFader);
|
REGISTER_ENUM (MeterPostFader);
|
||||||
|
REGISTER_ENUM (MeterCustom);
|
||||||
REGISTER (_MeterPoint);
|
REGISTER (_MeterPoint);
|
||||||
|
|
||||||
REGISTER_ENUM (Normal);
|
REGISTER_ENUM (Normal);
|
||||||
|
@ -393,9 +393,6 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
|
|||||||
uint32_t port_id;
|
uint32_t port_id;
|
||||||
LocaleGuard lg (X_("POSIX"));
|
LocaleGuard lg (X_("POSIX"));
|
||||||
|
|
||||||
cout << "LADSPA Plugin set state " << version << "\n";
|
|
||||||
cout << "- node " << node.name() << "\n";
|
|
||||||
|
|
||||||
if (node.name() != state_node_name()) {
|
if (node.name() != state_node_name()) {
|
||||||
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
|
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
@ -441,9 +438,6 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int version)
|
|||||||
uint32_t port_id;
|
uint32_t port_id;
|
||||||
LocaleGuard lg (X_("POSIX"));
|
LocaleGuard lg (X_("POSIX"));
|
||||||
|
|
||||||
cout << "LADSPA Plugin set state " << version << "\n";
|
|
||||||
cout << "- node " << node.name() << "\n";
|
|
||||||
|
|
||||||
if (node.name() != state_node_name()) {
|
if (node.name() != state_node_name()) {
|
||||||
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
|
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -225,8 +225,3 @@ PeakMeter::state (bool full_state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
PeakMeter::visible() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
@ -70,6 +70,7 @@ Processor::Processor(Session& session, const string& name)
|
|||||||
, _next_ab_is_active(false)
|
, _next_ab_is_active(false)
|
||||||
, _configured(false)
|
, _configured(false)
|
||||||
, _gui(0)
|
, _gui(0)
|
||||||
|
, _display_to_user (true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,6 +82,7 @@ Processor::Processor (Session& session, const XMLNode& node)
|
|||||||
, _next_ab_is_active(false)
|
, _next_ab_is_active(false)
|
||||||
, _configured(false)
|
, _configured(false)
|
||||||
, _gui(0)
|
, _gui(0)
|
||||||
|
, _display_to_user (true)
|
||||||
{
|
{
|
||||||
set_state (node, Stateful::loading_state_version);
|
set_state (node, Stateful::loading_state_version);
|
||||||
_pending_active = _active;
|
_pending_active = _active;
|
||||||
@ -271,3 +273,10 @@ Processor::configure_io (ChanCount in, ChanCount out)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Processor::set_display_to_user (bool yn)
|
||||||
|
{
|
||||||
|
_display_to_user = yn;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
|
|||||||
/* add standard processors other than amp (added by ::init()) */
|
/* add standard processors other than amp (added by ::init()) */
|
||||||
|
|
||||||
_meter.reset (new PeakMeter (_session));
|
_meter.reset (new PeakMeter (_session));
|
||||||
|
_meter->set_display_to_user (_meter_point == MeterCustom);
|
||||||
add_processor (_meter, PreFader);
|
add_processor (_meter, PreFader);
|
||||||
|
|
||||||
if (_flags & ControlOut) {
|
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.reset (new PeakMeter (_session, node));
|
||||||
|
_meter->set_display_to_user (_meter_point == MeterCustom);
|
||||||
processor = _meter;
|
processor = _meter;
|
||||||
|
|
||||||
} else if (prop->value() == "amp") {
|
} else if (prop->value() == "amp") {
|
||||||
@ -822,12 +824,12 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
|
|||||||
return false;
|
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 */
|
/* check for invisible processors stacked at the end and leave them there */
|
||||||
ProcessorList::iterator p;
|
ProcessorList::iterator p;
|
||||||
p = _processors.end();
|
p = _processors.end();
|
||||||
--p;
|
--p;
|
||||||
while (!(*p)->visible() && p != _processors.begin()) {
|
while (!(*p)->display_to_user() && p != _processors.begin()) {
|
||||||
--p;
|
--p;
|
||||||
}
|
}
|
||||||
++p;
|
++p;
|
||||||
@ -885,12 +887,12 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version, ProcessorLis
|
|||||||
return false;
|
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 */
|
/* check for invisible processors stacked at the end and leave them there */
|
||||||
ProcessorList::iterator p;
|
ProcessorList::iterator p;
|
||||||
p = _processors.end();
|
p = _processors.end();
|
||||||
--p;
|
--p;
|
||||||
while (!(*p)->visible() && p != _processors.begin()) {
|
while (!(*p)->display_to_user() && p != _processors.begin()) {
|
||||||
--p;
|
--p;
|
||||||
}
|
}
|
||||||
++p;
|
++p;
|
||||||
@ -1404,7 +1406,7 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
DEBUG_TRACE (DEBUG::Processors, "{\n");
|
DEBUG_TRACE (DEBUG::Processors, "{\n");
|
||||||
for (list<boost::shared_ptr<Processor> >::const_iterator p = _processors.begin(); p != _processors.end(); ++p) {
|
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");
|
DEBUG_TRACE (DEBUG::Processors, "}\n");
|
||||||
#endif
|
#endif
|
||||||
@ -1535,7 +1537,7 @@ int
|
|||||||
Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err)
|
Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err)
|
||||||
{
|
{
|
||||||
/* "new_order" is an ordered list of processors to be positioned according to "placement".
|
/* "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
|
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.
|
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 {
|
} else {
|
||||||
|
|
||||||
if (!(*oiter)->visible()) {
|
if (!(*oiter)->display_to_user()) {
|
||||||
|
|
||||||
as_it_will_be.push_back (*oiter);
|
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) {
|
if ((prop = node.property (X_("meter-point"))) != 0) {
|
||||||
_meter_point = MeterPoint (string_2_enum (prop->value (), _meter_point));
|
_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) {
|
if ((prop = node.property (X_("route-group"))) != 0) {
|
||||||
@ -2635,27 +2640,39 @@ Route::set_meter_point (MeterPoint p, void *src)
|
|||||||
Glib::RWLock::WriterLock lm (_processor_lock);
|
Glib::RWLock::WriterLock lm (_processor_lock);
|
||||||
ProcessorList as_it_was (_processors);
|
ProcessorList as_it_was (_processors);
|
||||||
|
|
||||||
// Move meter in the processors list
|
if (p != MeterCustom) {
|
||||||
ProcessorList::iterator loc = find(_processors.begin(), _processors.end(), _meter);
|
// Move meter in the processors list to reflect the new position
|
||||||
_processors.erase(loc);
|
ProcessorList::iterator loc = find(_processors.begin(), _processors.end(), _meter);
|
||||||
switch (p) {
|
_processors.erase(loc);
|
||||||
case MeterInput:
|
switch (p) {
|
||||||
loc = _processors.begin();
|
case MeterInput:
|
||||||
|
loc = _processors.begin();
|
||||||
|
break;
|
||||||
|
case MeterPreFader:
|
||||||
|
loc = find(_processors.begin(), _processors.end(), _amp);
|
||||||
|
break;
|
||||||
|
case MeterPostFader:
|
||||||
|
loc = _processors.end();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
break;
|
break;
|
||||||
case MeterPreFader:
|
}
|
||||||
loc = find(_processors.begin(), _processors.end(), _amp);
|
|
||||||
break;
|
|
||||||
case MeterPostFader:
|
|
||||||
loc = _processors.end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
_processors.insert(loc, _meter);
|
_processors.insert(loc, _meter);
|
||||||
|
|
||||||
if (configure_processors_unlocked (0)) {
|
if (configure_processors_unlocked (0)) {
|
||||||
_processors = as_it_was;
|
_processors = as_it_was;
|
||||||
configure_processors_unlocked (0); // it worked before we tried to add it ...
|
configure_processors_unlocked (0); // it worked before we tried to add it ...
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_meter->set_display_to_user (false);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// just make it visible and let the user move it
|
||||||
|
|
||||||
|
_meter->set_display_to_user (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -241,8 +241,10 @@ Send::set_name (const std::string& new_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Send::visible () const
|
Send::display_to_user () const
|
||||||
{
|
{
|
||||||
|
/* we ignore Deliver::_display_to_user */
|
||||||
|
|
||||||
if (_role == Listen) {
|
if (_role == Listen) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user