faderport: handle mute for monitor out by using monitor processor ops; try to blink mute button when cut-all is in effect.
Still some logic bugs when switching between master, monitor and other
This commit is contained in:
parent
9cbab4070f
commit
e1ea14f10a
|
@ -43,6 +43,7 @@
|
|||
#include "ardour/filesystem_paths.h"
|
||||
#include "ardour/midi_port.h"
|
||||
#include "ardour/midiport_manager.h"
|
||||
#include "ardour/monitor_processor.h"
|
||||
#include "ardour/rc_configuration.h"
|
||||
#include "ardour/route.h"
|
||||
#include "ardour/session.h"
|
||||
|
@ -784,11 +785,34 @@ FaderPort::set_current_route (boost::shared_ptr<Route> r)
|
|||
if (control) {
|
||||
control->Changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_gain, this), this);
|
||||
}
|
||||
|
||||
boost::shared_ptr<MonitorProcessor> mp = _current_route->monitor_control();
|
||||
if (mp) {
|
||||
mp->cut_control()->Changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_cut, this), this);
|
||||
}
|
||||
}
|
||||
|
||||
map_route_state ();
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort::map_cut ()
|
||||
{
|
||||
boost::shared_ptr<MonitorProcessor> mp = _current_route->monitor_control();
|
||||
|
||||
if (mp) {
|
||||
bool yn = mp->cut_all ();
|
||||
button_info (Mute).set_led_state (_output_port, yn);
|
||||
if (yn) {
|
||||
blinkers.push_back (Mute);
|
||||
} else {
|
||||
blinkers.remove (Mute);
|
||||
}
|
||||
} else {
|
||||
blinkers.remove (Mute);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort::map_mute (void*)
|
||||
{
|
||||
|
@ -875,12 +899,14 @@ FaderPort::map_route_state ()
|
|||
button_info (Mute).set_led_state (_output_port, false);
|
||||
button_info (Solo).set_led_state (_output_port, false);
|
||||
button_info (Rec).set_led_state (_output_port, false);
|
||||
blinkers.remove (Mute);
|
||||
blinkers.remove (Solo);
|
||||
} else {
|
||||
/* arguments to these map_*() methods are all ignored */
|
||||
map_mute (0);
|
||||
map_solo (false, 0, false);
|
||||
map_recenable ();
|
||||
|
||||
map_gain ();
|
||||
map_cut ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,6 +260,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
|
|||
void map_mute (void*);
|
||||
void map_recenable ();
|
||||
void map_gain ();
|
||||
void map_cut ();
|
||||
|
||||
/* operations (defined in operations.cc) */
|
||||
|
||||
|
|
|
@ -102,15 +102,18 @@ FaderPort::use_master ()
|
|||
if (_current_route == r) {
|
||||
r = pre_master_route.lock();
|
||||
set_current_route (r);
|
||||
if (r == session->monitor_out() || r == session->master_out()) {
|
||||
if (r == session->monitor_out()) {
|
||||
button_info(Output).set_led_state (_output_port, true);
|
||||
blinkers.push_back (Output);
|
||||
} else {
|
||||
button_info(Output).set_led_state (_output_port, false);
|
||||
blinkers.remove (Output);
|
||||
}
|
||||
} else {
|
||||
pre_master_route = boost::weak_ptr<Route> (_current_route);
|
||||
set_current_route (r);
|
||||
button_info(Output).set_led_state (_output_port, true);
|
||||
blinkers.remove (Output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,19 +122,23 @@ void
|
|||
FaderPort::use_monitor ()
|
||||
{
|
||||
boost::shared_ptr<Route> r = session->monitor_out();
|
||||
|
||||
if (r) {
|
||||
if (_current_route == r) {
|
||||
r = pre_monitor_route.lock();
|
||||
set_current_route (r);
|
||||
if (r == session->monitor_out() || r == session->master_out()) {
|
||||
if (r == session->master_out()) {
|
||||
button_info(Output).set_led_state (_output_port, true);
|
||||
} else {
|
||||
button_info(Output).set_led_state (_output_port, false);
|
||||
}
|
||||
blinkers.remove (Output);
|
||||
} else {
|
||||
pre_monitor_route = boost::weak_ptr<Route> (_current_route);
|
||||
set_current_route (r);
|
||||
button_info(Output).set_led_state (_output_port, true);
|
||||
blinkers.push_back (Output);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user