mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Add Latency Control Toolbar Widgets
This commit is contained in:
parent
24aa61f08c
commit
4f41367836
8 changed files with 108 additions and 0 deletions
|
|
@ -304,6 +304,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
||||||
, _shared_popup_menu (0)
|
, _shared_popup_menu (0)
|
||||||
, secondary_clock_spacer (0)
|
, secondary_clock_spacer (0)
|
||||||
, auto_input_button (ArdourButton::led_default_elements)
|
, auto_input_button (ArdourButton::led_default_elements)
|
||||||
|
, latency_disable_button (ArdourButton::led_default_elements)
|
||||||
, time_info_box (0)
|
, time_info_box (0)
|
||||||
, auto_return_button (ArdourButton::led_default_elements)
|
, auto_return_button (ArdourButton::led_default_elements)
|
||||||
, follow_edits_button (ArdourButton::led_default_elements)
|
, follow_edits_button (ArdourButton::led_default_elements)
|
||||||
|
|
@ -454,6 +455,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
||||||
ARDOUR::Session::FeedbackDetected.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::feedback_detected, this), gui_context ());
|
ARDOUR::Session::FeedbackDetected.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::feedback_detected, this), gui_context ());
|
||||||
ARDOUR::Session::SuccessfulGraphSort.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::successful_graph_sort, this), gui_context ());
|
ARDOUR::Session::SuccessfulGraphSort.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::successful_graph_sort, this), gui_context ());
|
||||||
|
|
||||||
|
/* indicate global latency compensation en/disable */
|
||||||
|
ARDOUR::Latent::DisableSwitchChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::latency_switch_changed, this), gui_context ());
|
||||||
|
|
||||||
/* handle requests to deal with missing files */
|
/* handle requests to deal with missing files */
|
||||||
|
|
||||||
ARDOUR::Session::MissingFile.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::missing_file, this, _1, _2, _3));
|
ARDOUR::Session::MissingFile.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::missing_file, this, _1, _2, _3));
|
||||||
|
|
|
||||||
|
|
@ -496,6 +496,7 @@ private:
|
||||||
|
|
||||||
ArdourWidgets::ArdourVSpacer recpunch_spacer;
|
ArdourWidgets::ArdourVSpacer recpunch_spacer;
|
||||||
ArdourWidgets::ArdourVSpacer monitoring_spacer;
|
ArdourWidgets::ArdourVSpacer monitoring_spacer;
|
||||||
|
ArdourWidgets::ArdourVSpacer latency_spacer;
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton monitor_in_button;
|
ArdourWidgets::ArdourButton monitor_in_button;
|
||||||
ArdourWidgets::ArdourButton monitor_disk_button;
|
ArdourWidgets::ArdourButton monitor_disk_button;
|
||||||
|
|
@ -511,6 +512,13 @@ private:
|
||||||
void toggle_time_master ();
|
void toggle_time_master ();
|
||||||
void toggle_video_sync ();
|
void toggle_video_sync ();
|
||||||
|
|
||||||
|
|
||||||
|
ArdourWidgets::ArdourButton latency_disable_button;
|
||||||
|
|
||||||
|
Gtk::Label route_latency_value;
|
||||||
|
Gtk::Label io_latency_label;
|
||||||
|
Gtk::Label io_latency_value;
|
||||||
|
|
||||||
ShuttleControl shuttle_box;
|
ShuttleControl shuttle_box;
|
||||||
MiniTimeline mini_timeline;
|
MiniTimeline mini_timeline;
|
||||||
TimeInfoBox* time_info_box;
|
TimeInfoBox* time_info_box;
|
||||||
|
|
@ -828,6 +836,10 @@ private:
|
||||||
*/
|
*/
|
||||||
ARDOUR::ProcessThread* _process_thread;
|
ARDOUR::ProcessThread* _process_thread;
|
||||||
|
|
||||||
|
void toggle_latency_switch ();
|
||||||
|
void latency_switch_changed ();
|
||||||
|
void session_latency_updated ();
|
||||||
|
|
||||||
void feedback_detected ();
|
void feedback_detected ();
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton midi_panic_button;
|
ArdourWidgets::ArdourButton midi_panic_button;
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,8 @@ ARDOUR_UI::setup_tooltips ()
|
||||||
set_tip (editor_meter_peak_display, _("Reset All Peak Meters"));
|
set_tip (editor_meter_peak_display, _("Reset All Peak Meters"));
|
||||||
set_tip (error_alert_button, _("Show Error Log and acknowledge warnings"));
|
set_tip (error_alert_button, _("Show Error Log and acknowledge warnings"));
|
||||||
|
|
||||||
|
set_tip (latency_disable_button, _("Disable all latency compensation. This will result in playback and monitoring to not be out of sync."));
|
||||||
|
|
||||||
synchronize_sync_source_and_video_pullup ();
|
synchronize_sync_source_and_video_pullup ();
|
||||||
|
|
||||||
editor->setup_tooltips ();
|
editor->setup_tooltips ();
|
||||||
|
|
@ -233,6 +235,18 @@ ARDOUR_UI::repack_transport_hbox ()
|
||||||
recpunch_spacer.hide ();
|
recpunch_spacer.hide ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool show_pdc = UIConfiguration::instance().get_show_toolbar_latency ();
|
||||||
|
if (show_pdc) {
|
||||||
|
latency_disable_button.show ();
|
||||||
|
route_latency_value.show ();
|
||||||
|
io_latency_value.show ();
|
||||||
|
latency_spacer.show ();
|
||||||
|
} else {
|
||||||
|
latency_disable_button.hide ();
|
||||||
|
route_latency_value.hide ();
|
||||||
|
io_latency_value.hide ();
|
||||||
|
latency_spacer.hide ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -302,6 +316,12 @@ ARDOUR_UI::setup_transport ()
|
||||||
act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
|
act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
|
||||||
monitor_disk_button.set_related_action (act);
|
monitor_disk_button.set_related_action (act);
|
||||||
|
|
||||||
|
act = ActionManager::get_action ("Main", "ToggleLatencyCompensation");
|
||||||
|
latency_disable_button.set_related_action (act);
|
||||||
|
|
||||||
|
set_size_request_to_display_given_text (route_latency_value, "1000 spl", 0, 0);
|
||||||
|
set_size_request_to_display_given_text (io_latency_value, "1000 spl", 0, 0);
|
||||||
|
|
||||||
/* connect signals */
|
/* connect signals */
|
||||||
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (primary_clock, &MainClock::set), false, 0));
|
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (primary_clock, &MainClock::set), false, 0));
|
||||||
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false, 0));
|
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false, 0));
|
||||||
|
|
@ -350,6 +370,8 @@ ARDOUR_UI::setup_transport ()
|
||||||
monitor_disk_button.set_name ("monitor button");
|
monitor_disk_button.set_name ("monitor button");
|
||||||
auto_input_button.set_name ("transport option button");
|
auto_input_button.set_name ("transport option button");
|
||||||
|
|
||||||
|
latency_disable_button.set_name ("monitor button");
|
||||||
|
|
||||||
sync_button.set_name ("transport active option button");
|
sync_button.set_name ("transport active option button");
|
||||||
|
|
||||||
/* and widget text */
|
/* and widget text */
|
||||||
|
|
@ -363,6 +385,9 @@ ARDOUR_UI::setup_transport ()
|
||||||
monitor_disk_button.set_text (_("All Disk"));
|
monitor_disk_button.set_text (_("All Disk"));
|
||||||
auto_input_button.set_text (_("Auto-Input"));
|
auto_input_button.set_text (_("Auto-Input"));
|
||||||
|
|
||||||
|
latency_disable_button.set_text (_("Disable PDC"));
|
||||||
|
io_latency_label.set_text (_("I/O Latency:"));
|
||||||
|
|
||||||
punch_label.set_text (_("Punch:"));
|
punch_label.set_text (_("Punch:"));
|
||||||
layered_label.set_text (_("Rec:"));
|
layered_label.set_text (_("Rec:"));
|
||||||
|
|
||||||
|
|
@ -504,6 +529,20 @@ ARDOUR_UI::setup_transport ()
|
||||||
transport_table.attach (monitoring_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
|
transport_table.attach (monitoring_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
|
||||||
++col;
|
++col;
|
||||||
|
|
||||||
|
|
||||||
|
transport_table.attach (latency_disable_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
|
||||||
|
transport_table.attach (io_latency_label, TCOL, 1, 2 , SHRINK, EXPAND|FILL, hpadding, vpadding);
|
||||||
|
++col;
|
||||||
|
transport_table.attach (route_latency_value, TCOL, 0, 1 , SHRINK, EXPAND|FILL, hpadding, vpadding);
|
||||||
|
transport_table.attach (io_latency_value, TCOL, 1, 2 , SHRINK, EXPAND|FILL, hpadding, vpadding);
|
||||||
|
++col;
|
||||||
|
|
||||||
|
route_latency_value.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
|
||||||
|
io_latency_value.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
|
||||||
|
|
||||||
|
transport_table.attach (latency_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
|
||||||
|
++col;
|
||||||
|
|
||||||
transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
|
transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
|
||||||
transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
|
transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
|
||||||
++col;
|
++col;
|
||||||
|
|
@ -549,6 +588,10 @@ ARDOUR_UI::setup_transport ()
|
||||||
transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
|
transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
|
||||||
++col;
|
++col;
|
||||||
|
|
||||||
|
/* initialize */
|
||||||
|
latency_switch_changed ();
|
||||||
|
session_latency_updated ();
|
||||||
|
|
||||||
repack_transport_hbox ();
|
repack_transport_hbox ();
|
||||||
update_clock_visibility ();
|
update_clock_visibility ();
|
||||||
/* desensitize */
|
/* desensitize */
|
||||||
|
|
@ -563,6 +606,32 @@ ARDOUR_UI::setup_transport ()
|
||||||
#undef PX_SCALE
|
#undef PX_SCALE
|
||||||
#undef TCOL
|
#undef TCOL
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::latency_switch_changed ()
|
||||||
|
{
|
||||||
|
bool pdc_off = ARDOUR::Latent::zero_latency ();
|
||||||
|
if (latency_disable_button.get_active() != pdc_off) {
|
||||||
|
latency_disable_button.set_active (pdc_off);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::session_latency_updated ()
|
||||||
|
{
|
||||||
|
if (!_session) {
|
||||||
|
route_latency_value.set_text ("--");
|
||||||
|
io_latency_value.set_text ("--");
|
||||||
|
} else {
|
||||||
|
samplecnt_t wrl = _session->worst_route_latency ();
|
||||||
|
samplecnt_t wpl = _session->worst_latency_preroll ();
|
||||||
|
float rate = _session->nominal_sample_rate ();
|
||||||
|
|
||||||
|
route_latency_value.set_text (samples_as_time_string (wrl, rate));
|
||||||
|
io_latency_value.set_text (samples_as_time_string (wpl, rate));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ARDOUR_UI::soloing_changed (bool onoff)
|
ARDOUR_UI::soloing_changed (bool onoff)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,9 @@ ARDOUR_UI::set_session (Session *s)
|
||||||
_session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
|
_session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
|
||||||
_session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ());
|
_session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ());
|
||||||
|
|
||||||
|
_session->LatencyUpdated.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_latency_updated, this), gui_context());
|
||||||
|
session_latency_updated ();
|
||||||
|
|
||||||
/* Clocks are on by default after we are connected to a session, so show that here.
|
/* Clocks are on by default after we are connected to a session, so show that here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -483,6 +483,8 @@ ARDOUR_UI::install_actions ()
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
ActionManager::transport_sensitive_actions.push_back (act);
|
ActionManager::transport_sensitive_actions.push_back (act);
|
||||||
|
|
||||||
|
act = ActionManager::register_toggle_action (main_actions, X_("ToggleLatencyCompensation"), _("Disable Latency Compensation"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_latency_switch));
|
||||||
|
|
||||||
act = ActionManager::register_action (main_actions, X_("MonitorMenu"), _("Monitor Section")); /* just the submenu item */
|
act = ActionManager::register_action (main_actions, X_("MonitorMenu"), _("Monitor Section")); /* just the submenu item */
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -278,6 +278,13 @@ ARDOUR_UI::toggle_editing_space()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::toggle_latency_switch ()
|
||||||
|
{
|
||||||
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Main", "ToggleLatencyCompensation");
|
||||||
|
ARDOUR::Latent::force_zero_latency (tact->get_active());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ARDOUR_UI::setup_session_options ()
|
ARDOUR_UI::setup_session_options ()
|
||||||
{
|
{
|
||||||
|
|
@ -429,6 +436,8 @@ ARDOUR_UI::parameter_changed (std::string p)
|
||||||
repack_transport_hbox ();
|
repack_transport_hbox ();
|
||||||
} else if (p == "show-toolbar-selclock") {
|
} else if (p == "show-toolbar-selclock") {
|
||||||
repack_transport_hbox ();
|
repack_transport_hbox ();
|
||||||
|
} else if (p == "show-toolbar-latency") {
|
||||||
|
repack_transport_hbox ();
|
||||||
} else if (p == "show-editor-meter") {
|
} else if (p == "show-editor-meter") {
|
||||||
repack_transport_hbox ();
|
repack_transport_hbox ();
|
||||||
} else if (p == "show-secondary-clock") {
|
} else if (p == "show-secondary-clock") {
|
||||||
|
|
|
||||||
|
|
@ -3877,6 +3877,14 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_toolbar_monitoring)
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_toolbar_monitoring)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
add_option (_("Appearance/Toolbar"),
|
||||||
|
new BoolOption (
|
||||||
|
"show-toolbar-latency",
|
||||||
|
_("Display Latency Compensation Info"),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_toolbar_latency),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_toolbar_latency)
|
||||||
|
));
|
||||||
|
|
||||||
add_option (_("Appearance/Toolbar"),
|
add_option (_("Appearance/Toolbar"),
|
||||||
new BoolOption (
|
new BoolOption (
|
||||||
"show-toolbar-selclock",
|
"show-toolbar-selclock",
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ UI_CONFIG_VARIABLE (bool, show_editor_meter, "show-editor-meter", true)
|
||||||
UI_CONFIG_VARIABLE (bool, show_toolbar_recpunch, "show-toolbar-recpunch", true)
|
UI_CONFIG_VARIABLE (bool, show_toolbar_recpunch, "show-toolbar-recpunch", true)
|
||||||
UI_CONFIG_VARIABLE (bool, show_toolbar_monitoring, "show-toolbar-monitoring", false)
|
UI_CONFIG_VARIABLE (bool, show_toolbar_monitoring, "show-toolbar-monitoring", false)
|
||||||
UI_CONFIG_VARIABLE (bool, show_toolbar_selclock, "show-toolbar-selclock", false)
|
UI_CONFIG_VARIABLE (bool, show_toolbar_selclock, "show-toolbar-selclock", false)
|
||||||
|
UI_CONFIG_VARIABLE (bool, show_toolbar_latency, "show-toolbar-latency", false)
|
||||||
UI_CONFIG_VARIABLE (bool, show_mini_timeline, "show-mini-timeline", true)
|
UI_CONFIG_VARIABLE (bool, show_mini_timeline, "show-mini-timeline", true)
|
||||||
UI_CONFIG_VARIABLE (bool, show_secondary_clock, "show-secondary-clock", true)
|
UI_CONFIG_VARIABLE (bool, show_secondary_clock, "show-secondary-clock", true)
|
||||||
UI_CONFIG_VARIABLE (double, waveform_clip_level, "waveform-clip-level", -0.0933967) /* units of dB */
|
UI_CONFIG_VARIABLE (double, waveform_clip_level, "waveform-clip-level", -0.0933967) /* units of dB */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue