add display name to processors (so that it can differ from the "real name"); pay attention to active status in Amp, Meter and Delivery

git-svn-id: svn://localhost/ardour2/branches/3.0@5360 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-07-14 00:11:04 +00:00
parent 17bfb7cad5
commit 997dd32d5e
6 changed files with 38 additions and 1 deletions

View file

@ -47,6 +47,12 @@ Amp::Amp(Session& s, boost::shared_ptr<MuteMaster> mm)
add_control(_gain_control);
}
std::string
Amp::display_name() const
{
return _("Fader");
}
bool
Amp::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
{
@ -69,6 +75,10 @@ Amp::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t
{
gain_t mute_gain;
if (!_active) {
return;
}
if (_mute_master) {
mute_gain = _mute_master->mute_gain_at (MuteMaster::PreFader);
} else {

View file

@ -37,6 +37,8 @@ class Amp : public Processor {
public:
Amp(Session& s, boost::shared_ptr<MuteMaster> m);
std::string display_name() const;
bool visible () const { return false; }
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;

View file

@ -51,6 +51,8 @@ public:
Delivery (Session&, boost::shared_ptr<MuteMaster> mm, const XMLNode&);
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;

View file

@ -53,6 +53,8 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
Processor(Session&, const XMLNode& node);
virtual ~Processor() { }
virtual std::string display_name() const { return SessionObject::name(); }
virtual bool visible() const { return true; }
virtual void set_visible (bool) {}

View file

@ -145,6 +145,23 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> out, boost::shared_ptr<Mut
CycleStart.connect (mem_fun (*this, &Delivery::cycle_start));
}
std::string
Delivery::display_name () const
{
switch (_role) {
case Main:
return _("main outs");
break;
case Listen:
return _("listen");
break;
case Send:
case Insert:
default:
return name();
}
}
void
Delivery::cycle_start (nframes_t nframes)
{
@ -194,7 +211,7 @@ Delivery::configure_io (ChanCount in, ChanCount out)
void
Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
{
if (_output->n_ports ().get (_output->default_type()) == 0) {
if (!_active || _output->n_ports ().get (_output->default_type()) == 0) {
return;
}

View file

@ -73,6 +73,10 @@ Metering::update_meters()
void
PeakMeter::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
{
if (!_active) {
return;
}
const uint32_t n_audio = min(_configured_input.n_audio(), bufs.count().n_audio());
const uint32_t n_midi = min(_configured_input.n_midi(), bufs.count().n_midi());