Prepare RouteUI for RTA

This commit is contained in:
Robin Gareus
2025-04-01 15:52:58 +02:00
parent 53ac429b4f
commit 53773ec310
3 changed files with 38 additions and 1 deletions

View File

@@ -83,6 +83,7 @@
#include "rgb_macros.h"
#include "route_time_axis.h"
#include "route_ui.h"
#include "rta_manager.h"
#include "save_template_dialog.h"
#include "timers.h"
#include "ui_config.h"
@@ -214,6 +215,11 @@ RouteUI::init ()
solo_button->set_name ("solo button");
solo_button->set_no_show_all (true);
rta_button = manage (new ArdourButton);
rta_button->set_name ("rta button");
rta_button->set_act_on_release (true);
rta_button->set_text (_("RTA"));
rec_enable_button = manage (new ArdourButton);
rec_enable_button->set_name ("record enable button");
rec_enable_button->set_icon (ArdourIcon::RecButton);
@@ -256,6 +262,8 @@ RouteUI::init ()
rec_enable_button->signal_button_press_event().connect (sigc::mem_fun(*this, &RouteUI::rec_enable_press), false);
rec_enable_button->signal_button_release_event().connect (sigc::mem_fun(*this, &RouteUI::rec_enable_release), false);
rta_button->signal_clicked.connect (sigc::mem_fun(*this, &RouteUI::rta_clicked));
show_sends_button->signal_button_press_event().connect (sigc::mem_fun(*this, &RouteUI::show_sends_press), false);
show_sends_button->signal_button_release_event().connect (sigc::mem_fun(*this, &RouteUI::show_sends_release), false);
@@ -391,6 +399,8 @@ RouteUI::set_route (std::shared_ptr<Route> rp)
_route->solo_isolate_control()->Changed.connect (route_connections, invalidator (*this), std::bind (&RouteUI::update_solo_display, this), gui_context());
_route->phase_control()->Changed.connect (route_connections, invalidator (*this), std::bind (&RouteUI::update_polarity_display, this), gui_context());
_route->gui_changed.connect (route_connections, invalidator (*this), std::bind (&RouteUI::handle_gui_changes, this, _1), gui_context());
if (is_track()) {
track()->FreezeChange.connect (*this, invalidator (*this), std::bind (&RouteUI::map_frozen, this), gui_context());
track_mode_changed();
@@ -435,6 +445,7 @@ RouteUI::set_route (std::shared_ptr<Route> rp)
mute_button->set_can_focus (false);
solo_button->set_can_focus (false);
rta_button->set_can_focus (false);
mute_button->show();
@@ -454,6 +465,7 @@ RouteUI::set_route (std::shared_ptr<Route> rp)
update_mute_display ();
update_solo_display ();
update_solo_button ();
handle_gui_changes ("rta");
if (!UIConfiguration::instance().get_blink_rec_arm()) {
blink_rec_display(true); // set initial rec-en button state
@@ -1189,6 +1201,27 @@ RouteUI::send_blink (bool onoff)
}
}
void
RouteUI::rta_clicked ()
{
bool attached = RTAManager::instance ()->attached (_route);
if (attached) {
RTAManager::instance ()->remove (_route);
} else {
RTAManager::instance ()->attach (_route);
ARDOUR_UI::instance()->show_realtime_analyzer ();
}
}
void
RouteUI::handle_gui_changes (std::string const& what)
{
if (what == "rta") {
bool attached = RTAManager::instance ()->attached (_route);
rta_button->set_active_state (attached ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off);
}
}
Gtkmm2ext::ActiveState
RouteUI::solo_active_state (std::shared_ptr<Stripable> s)
{
@@ -2820,4 +2853,3 @@ RouteUI::clear_time_domain (bool apply_to_selection)
}
}

View File

@@ -147,6 +147,7 @@ public:
bool show_sends_release (GdkEventButton*);
bool solo_isolate_button_release (GdkEventButton*);
bool solo_safe_button_release (GdkEventButton*);
void rta_clicked ();
bool monitor_release (GdkEventButton*, ARDOUR::MonitorChoice);
bool monitor_input_press (GdkEventButton*);
@@ -197,6 +198,7 @@ protected:
ArdourWidgets::ArdourButton* show_sends_button; /* busses */
ArdourWidgets::ArdourButton* monitor_input_button;
ArdourWidgets::ArdourButton* monitor_disk_button;
ArdourWidgets::ArdourButton* rta_button;
ArdourWidgets::ArdourButton* solo_safe_led;
ArdourWidgets::ArdourButton* solo_isolated_led;
@@ -287,6 +289,7 @@ private:
void session_rec_enable_changed ();
void denormal_protection_changed ();
void muting_change ();
void handle_gui_changes (std::string const&);
void step_edit_changed (bool);
void toggle_rec_safe ();

View File

@@ -180,6 +180,7 @@ RTAManager::attach (std::shared_ptr<ARDOUR::Route> route)
_rta.back ().set_rta_warp (_warp);
_rta.back ().delivery ()->set_analysis_active (_active);
route->gui_changed ("rta", this); /* EMIT SIGNAL */
route->DropReferences.connect (*this, invalidator (*this), std::bind (&RTAManager::route_removed, this, std::weak_ptr<Route> (route)), gui_context ());
}
@@ -187,6 +188,7 @@ void
RTAManager::remove (std::shared_ptr<ARDOUR::Route> route)
{
_rta.remove_if ([route] (RTAManager::RTA const& r) { return r.route () == route; });
route->gui_changed ("rta", this); /* EMIT SIGNAL */
}
bool