mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
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
3 changed files with 37 additions and 3 deletions
|
|
@ -43,6 +43,7 @@
|
||||||
#include "ardour/filesystem_paths.h"
|
#include "ardour/filesystem_paths.h"
|
||||||
#include "ardour/midi_port.h"
|
#include "ardour/midi_port.h"
|
||||||
#include "ardour/midiport_manager.h"
|
#include "ardour/midiport_manager.h"
|
||||||
|
#include "ardour/monitor_processor.h"
|
||||||
#include "ardour/rc_configuration.h"
|
#include "ardour/rc_configuration.h"
|
||||||
#include "ardour/route.h"
|
#include "ardour/route.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
|
|
@ -784,11 +785,34 @@ FaderPort::set_current_route (boost::shared_ptr<Route> r)
|
||||||
if (control) {
|
if (control) {
|
||||||
control->Changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_gain, this), this);
|
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 ();
|
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
|
void
|
||||||
FaderPort::map_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 (Mute).set_led_state (_output_port, false);
|
||||||
button_info (Solo).set_led_state (_output_port, false);
|
button_info (Solo).set_led_state (_output_port, false);
|
||||||
button_info (Rec).set_led_state (_output_port, false);
|
button_info (Rec).set_led_state (_output_port, false);
|
||||||
|
blinkers.remove (Mute);
|
||||||
|
blinkers.remove (Solo);
|
||||||
} else {
|
} else {
|
||||||
/* arguments to these map_*() methods are all ignored */
|
/* arguments to these map_*() methods are all ignored */
|
||||||
map_mute (0);
|
map_mute (0);
|
||||||
map_solo (false, 0, false);
|
map_solo (false, 0, false);
|
||||||
map_recenable ();
|
map_recenable ();
|
||||||
|
|
||||||
map_gain ();
|
map_gain ();
|
||||||
|
map_cut ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
|
||||||
void map_mute (void*);
|
void map_mute (void*);
|
||||||
void map_recenable ();
|
void map_recenable ();
|
||||||
void map_gain ();
|
void map_gain ();
|
||||||
|
void map_cut ();
|
||||||
|
|
||||||
/* operations (defined in operations.cc) */
|
/* operations (defined in operations.cc) */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,15 +102,18 @@ FaderPort::use_master ()
|
||||||
if (_current_route == r) {
|
if (_current_route == r) {
|
||||||
r = pre_master_route.lock();
|
r = pre_master_route.lock();
|
||||||
set_current_route (r);
|
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);
|
button_info(Output).set_led_state (_output_port, true);
|
||||||
|
blinkers.push_back (Output);
|
||||||
} else {
|
} else {
|
||||||
button_info(Output).set_led_state (_output_port, false);
|
button_info(Output).set_led_state (_output_port, false);
|
||||||
|
blinkers.remove (Output);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pre_master_route = boost::weak_ptr<Route> (_current_route);
|
pre_master_route = boost::weak_ptr<Route> (_current_route);
|
||||||
set_current_route (r);
|
set_current_route (r);
|
||||||
button_info(Output).set_led_state (_output_port, true);
|
button_info(Output).set_led_state (_output_port, true);
|
||||||
|
blinkers.remove (Output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -119,19 +122,23 @@ void
|
||||||
FaderPort::use_monitor ()
|
FaderPort::use_monitor ()
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Route> r = session->monitor_out();
|
boost::shared_ptr<Route> r = session->monitor_out();
|
||||||
|
|
||||||
if (r) {
|
if (r) {
|
||||||
if (_current_route == r) {
|
if (_current_route == r) {
|
||||||
r = pre_monitor_route.lock();
|
r = pre_monitor_route.lock();
|
||||||
set_current_route (r);
|
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);
|
button_info(Output).set_led_state (_output_port, true);
|
||||||
} else {
|
} else {
|
||||||
button_info(Output).set_led_state (_output_port, false);
|
button_info(Output).set_led_state (_output_port, false);
|
||||||
}
|
}
|
||||||
|
blinkers.remove (Output);
|
||||||
} else {
|
} else {
|
||||||
pre_monitor_route = boost::weak_ptr<Route> (_current_route);
|
pre_monitor_route = boost::weak_ptr<Route> (_current_route);
|
||||||
set_current_route (r);
|
set_current_route (r);
|
||||||
button_info(Output).set_led_state (_output_port, true);
|
button_info(Output).set_led_state (_output_port, true);
|
||||||
|
blinkers.push_back (Output);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue