13
0

Transfer indicators from ardour_ui

This commit is contained in:
Robin Gareus 2024-11-08 02:27:09 +01:00
parent c808deae46
commit e0e0eb09f3
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
7 changed files with 199 additions and 221 deletions

View File

@ -120,6 +120,11 @@ ApplicationBar::ApplicationBar ()
, _primary_clock (X_("primary"), X_("transport"), MainClock::PrimaryClock) , _primary_clock (X_("primary"), X_("transport"), MainClock::PrimaryClock)
, _secondary_clock (X_("secondary"), X_("secondary"), MainClock::SecondaryClock) , _secondary_clock (X_("secondary"), X_("secondary"), MainClock::SecondaryClock)
, _secondary_clock_spacer (0) , _secondary_clock_spacer (0)
, _auditioning_alert_button (_("Audition"))
, _solo_alert_button (_("Solo"))
, _feedback_alert_button (_("Feedback"))
, _feedback_exists (false)
, _ambiguous_latency (false)
{ {
_record_mode_strings = I18N (_record_mode_strings_); _record_mode_strings = I18N (_record_mode_strings_);
} }
@ -184,6 +189,20 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
_auto_return_button.set_text(_("Auto Return")); _auto_return_button.set_text(_("Auto Return"));
_follow_edits_button.set_text(_("Follow Range")); _follow_edits_button.set_text(_("Follow Range"));
/* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
_solo_alert_button.set_related_action (act);
_auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ApplicationBar::audition_alert_clicked));
/* alert box sub-group */
VBox* alert_box = manage (new VBox);
alert_box->set_homogeneous (true);
alert_box->set_spacing (1);
alert_box->set_border_width (0);
alert_box->pack_start (_solo_alert_button, true, true);
alert_box->pack_start (_auditioning_alert_button, true, true);
alert_box->pack_start (_feedback_alert_button, true, true);
int vpadding = 1; int vpadding = 1;
int hpadding = 2; int hpadding = 2;
int col = 0; int col = 0;
@ -251,6 +270,12 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
++col; ++col;
} }
_table.attach (*alert_box, TCOL, 0, 2, SHRINK, EXPAND|FILL, hpadding, 0);
++col;
_table.attach (_monitor_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col;
_table.set_spacings (0); _table.set_spacings (0);
_table.set_row_spacings (4); _table.set_row_spacings (4);
_table.set_border_width (1); _table.set_border_width (1);
@ -296,6 +321,9 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
Gtkmm2ext::UI::instance()->set_tip (_follow_edits_button, _("Playhead follows Range tool clicks, and Range selections")); Gtkmm2ext::UI::instance()->set_tip (_follow_edits_button, _("Playhead follows Range tool clicks, and Range selections"));
Gtkmm2ext::UI::instance()->set_tip (_primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n")); Gtkmm2ext::UI::instance()->set_tip (_primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
Gtkmm2ext::UI::instance()->set_tip (_secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n")); Gtkmm2ext::UI::instance()->set_tip (_secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
Gtkmm2ext::UI::instance()->set_tip (_solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything"));
Gtkmm2ext::UI::instance()->set_tip (_auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition"));
Gtkmm2ext::UI::instance()->set_tip (_feedback_alert_button, _("When lit, there is a ports connection issue, leading to feedback loop or ambiguous alignment.\nThis is caused by connecting an output back to some input (feedback), or by multiple connections from a source to the same output via different paths (ambiguous latency, record alignment)."));
/* theming */ /* theming */
_sync_button.set_name ("transport active option button"); _sync_button.set_name ("transport active option button");
@ -305,9 +333,24 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
_latency_disable_button.set_name ("latency button"); _latency_disable_button.set_name ("latency button");
_auto_return_button.set_name ("transport option button"); _auto_return_button.set_name ("transport option button");
_follow_edits_button.set_name ("transport option button"); _follow_edits_button.set_name ("transport option button");
_solo_alert_button.set_name ("rude solo");
_auditioning_alert_button.set_name ("rude audition");
_feedback_alert_button.set_name ("feedback alert");
_solo_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
_auditioning_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
_feedback_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
_solo_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
_auditioning_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
_feedback_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
_feedback_alert_button.set_sizing_text (_("Feedgeek")); //< longest of "Feedback" and "No Align", include descender
/* indicate global latency compensation en/disable */ /* indicate global latency compensation en/disable */
ARDOUR::Latent::DisableSwitchChanged.connect (_forever_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::latency_switch_changed, this), gui_context ()); ARDOUR::Latent::DisableSwitchChanged.connect (_forever_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::latency_switch_changed, this), gui_context ());
ARDOUR::Session::FeedbackDetected.connect (_forever_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::feedback_detected, this), gui_context ());
ARDOUR::Session::SuccessfulGraphSort.connect (_forever_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::successful_graph_sort, this), gui_context ());
/* initialize */ /* initialize */
update_clock_visibility (); update_clock_visibility ();
@ -315,6 +358,12 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
latency_switch_changed (); latency_switch_changed ();
session_latency_updated (true); session_latency_updated (true);
/* desensitize */
_feedback_alert_button.set_sensitive (false);
_feedback_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
_auditioning_alert_button.set_sensitive (false);
_auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
if (_session) { if (_session) {
repack_transport_hbox (); repack_transport_hbox ();
} }
@ -426,6 +475,113 @@ ApplicationBar::repack_transport_hbox ()
*/ */
} }
void
ApplicationBar::feedback_detected ()
{
_feedback_exists = true;
}
void
ApplicationBar::successful_graph_sort ()
{
_feedback_exists = false;
}
void
ApplicationBar::soloing_changed (bool onoff)
{
if (_solo_alert_button.get_active() != onoff) {
_solo_alert_button.set_active (onoff);
}
}
void
ApplicationBar::_auditioning_changed (bool onoff)
{
_auditioning_alert_button.set_active (onoff);
_auditioning_alert_button.set_sensitive (onoff);
if (!onoff) {
_auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
}
set_transport_sensitivity (!onoff);
}
void
ApplicationBar::auditioning_changed (bool onoff)
{
UI::instance()->call_slot (MISSING_INVALIDATOR, std::bind (&ApplicationBar::_auditioning_changed, this, onoff));
}
void
ApplicationBar::audition_alert_clicked ()
{
if (_session) {
_session->cancel_audition();
}
}
void
ApplicationBar::solo_blink (bool onoff)
{
if (_session == 0) {
return;
}
if (_session->soloing() || _session->listening()) {
if (onoff) {
_solo_alert_button.set_active (true);
} else {
_solo_alert_button.set_active (false);
}
} else {
_solo_alert_button.set_active (false);
}
}
void
ApplicationBar::audition_blink (bool onoff)
{
if (_session == 0) {
return;
}
if (_session->is_auditioning()) {
if (onoff) {
_auditioning_alert_button.set_active (true);
} else {
_auditioning_alert_button.set_active (false);
}
} else {
_auditioning_alert_button.set_active (false);
}
}
void
ApplicationBar::feedback_blink (bool onoff)
{
if (_feedback_exists) {
_feedback_alert_button.set_active (true);
_feedback_alert_button.set_text (_("Feedback"));
if (onoff) {
_feedback_alert_button.reset_fixed_colors ();
} else {
_feedback_alert_button.set_active_color (UIConfigurationBase::instance().color ("feedback alert: alt active", NULL));
}
} else if (_ambiguous_latency && !UIConfiguration::instance().get_show_toolbar_latency ()) {
_feedback_alert_button.set_text (_("No Align"));
_feedback_alert_button.set_active (true);
if (onoff) {
_feedback_alert_button.reset_fixed_colors ();
} else {
_feedback_alert_button.set_active_color (UIConfigurationBase::instance().color ("feedback alert: alt active", NULL));
}
} else {
_feedback_alert_button.set_text (_("Feedback"));
_feedback_alert_button.reset_fixed_colors ();
_feedback_alert_button.set_active (false);
}
}
void void
ApplicationBar::set_session (Session *s) ApplicationBar::set_session (Session *s)
{ {
@ -456,6 +612,8 @@ ApplicationBar::set_session (Session *s)
_session->TransportStateChange.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::map_transport_state, this), gui_context()); _session->TransportStateChange.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::map_transport_state, this), gui_context());
_session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::parameter_changed, this, _1), gui_context()); _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::parameter_changed, this, _1), gui_context());
_session->LatencyUpdated.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::session_latency_updated, this, _1), gui_context()); _session->LatencyUpdated.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::session_latency_updated, this, _1), gui_context());
_session->SoloActive.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::soloing_changed, this, _1), gui_context());
_session->AuditionActive.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::auditioning_changed, this, _1), gui_context());
//initialize all session config settings //initialize all session config settings
std::function<void (std::string)> pc (std::bind (&ApplicationBar::parameter_changed, this, _1)); std::function<void (std::string)> pc (std::bind (&ApplicationBar::parameter_changed, this, _1));
@ -464,6 +622,8 @@ ApplicationBar::set_session (Session *s)
/* initialize */ /* initialize */
session_latency_updated (true); session_latency_updated (true);
_solo_alert_button.set_active (_session->soloing());
_blink_connection = Timers::blink_connect (sigc::mem_fun(*this, &ApplicationBar::blink_handler)); _blink_connection = Timers::blink_connect (sigc::mem_fun(*this, &ApplicationBar::blink_handler));
} }
@ -528,34 +688,15 @@ ApplicationBar::session_latency_updated (bool for_playback)
_route_latency_value.set_text (samples_as_time_string (wrl, rate)); _route_latency_value.set_text (samples_as_time_string (wrl, rate));
if (_session->engine().check_for_ambiguous_latency (true)) { if (_session->engine().check_for_ambiguous_latency (true)) {
// _ambiguous_latency = true; _ambiguous_latency = true;
_io_latency_value.set_markup ("<span background=\"red\" foreground=\"white\">ambiguous</span>"); _io_latency_value.set_markup ("<span background=\"red\" foreground=\"white\">ambiguous</span>");
} else { } else {
// _ambiguous_latency = false; _ambiguous_latency = false;
_io_latency_value.set_text (samples_as_time_string (iol, rate)); _io_latency_value.set_text (samples_as_time_string (iol, rate));
} }
} }
} }
void
ApplicationBar::_auditioning_changed (bool onoff)
{
// auditioning_alert_button.set_active (onoff);
// auditioning_alert_button.set_sensitive (onoff);
// if (!onoff) {
// auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
// }
set_transport_sensitivity (!onoff);
}
void
ApplicationBar::auditioning_changed (bool onoff)
{
UI::instance()->call_slot (MISSING_INVALIDATOR, std::bind (&ApplicationBar::_auditioning_changed, this, onoff));
}
void void
ApplicationBar::parameter_changed (std::string p) ApplicationBar::parameter_changed (std::string p)
{ {
@ -680,15 +821,12 @@ ApplicationBar::blink_handler (bool blink_on)
{ {
sync_blink (blink_on); sync_blink (blink_on);
#if 0
if (UIConfiguration::instance().get_no_strobe() || !UIConfiguration::instance().get_blink_alert_indicators()) { if (UIConfiguration::instance().get_no_strobe() || !UIConfiguration::instance().get_blink_alert_indicators()) {
blink_on = true; blink_on = true;
} }
error_blink (blink_on);
solo_blink (blink_on); solo_blink (blink_on);
audition_blink (blink_on); audition_blink (blink_on);
feedback_blink (blink_on); feedback_blink (blink_on);
#endif
} }
void void

View File

@ -38,6 +38,7 @@
#include "startup_fsm.h" #include "startup_fsm.h"
#include "transport_control.h" #include "transport_control.h"
#include "transport_control_ui.h" #include "transport_control_ui.h"
#include "main_clock.h"
#include "visibility_group.h" #include "visibility_group.h"
#include "window_manager.h" #include "window_manager.h"
@ -72,9 +73,6 @@ private:
void map_transport_state (); void map_transport_state ();
void set_transport_sensitivity (bool); void set_transport_sensitivity (bool);
void auditioning_changed (bool);
void _auditioning_changed (bool);
void set_record_mode (ARDOUR::RecordMode); void set_record_mode (ARDOUR::RecordMode);
void latency_switch_changed (); void latency_switch_changed ();
@ -82,6 +80,20 @@ private:
void update_clock_visibility (); void update_clock_visibility ();
void solo_blink (bool);
void audition_blink (bool);
void feedback_blink (bool);
void soloing_changed (bool);
void auditioning_changed (bool);
void _auditioning_changed (bool);
void feedback_detected ();
void successful_graph_sort ();
bool solo_alert_press (GdkEventButton* ev);
void audition_alert_clicked ();
/* blinking alerts */ /* blinking alerts */
void sync_blink (bool); void sync_blink (bool);
void blink_handler (bool); void blink_handler (bool);
@ -109,6 +121,14 @@ private:
TransportClock _primary_clock; TransportClock _primary_clock;
TransportClock _secondary_clock; TransportClock _secondary_clock;
ArdourWidgets::ArdourVSpacer* _secondary_clock_spacer; ArdourWidgets::ArdourVSpacer* _secondary_clock_spacer;
ArdourWidgets::ArdourButton _auditioning_alert_button;
ArdourWidgets::ArdourButton _solo_alert_button;
ArdourWidgets::ArdourButton _feedback_alert_button;
Gtk::VBox _alert_box;
ArdourWidgets::ArdourVSpacer _monitor_spacer;
bool _feedback_exists;
bool _ambiguous_latency;
std::vector<std::string> _record_mode_strings; std::vector<std::string> _record_mode_strings;

View File

@ -301,9 +301,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, _cue_rec_enable (_("Rec Cues"), ArdourButton::led_default_elements) , _cue_rec_enable (_("Rec Cues"), ArdourButton::led_default_elements)
, _cue_play_enable (_("Play Cues"), ArdourButton::led_default_elements) , _cue_play_enable (_("Play Cues"), ArdourButton::led_default_elements)
, time_info_box (0) , time_info_box (0)
, auditioning_alert_button (_("Audition"))
, solo_alert_button (_("Solo"))
, feedback_alert_button (_("Feedback"))
, error_alert_button ( ArdourButton::just_led_default_elements ) , error_alert_button ( ArdourButton::just_led_default_elements )
, editor_meter_peak_display() , editor_meter_peak_display()
, editor_meter(0) , editor_meter(0)
@ -346,7 +343,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, last_peak_grab (0) , last_peak_grab (0)
, have_disk_speed_dialog_displayed (false) , have_disk_speed_dialog_displayed (false)
, _status_bar_visibility (X_("status-bar")) , _status_bar_visibility (X_("status-bar"))
, _feedback_exists (false)
, _log_not_acknowledged (LogLevelNone) , _log_not_acknowledged (LogLevelNone)
, duplicate_routes_dialog (0) , duplicate_routes_dialog (0)
, editor_visibility_button (S_("Window|Edit")) , editor_visibility_button (S_("Window|Edit"))
@ -454,11 +450,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
ARDOUR::Session::Quit.connect (forever_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::finish, this), gui_context ()); ARDOUR::Session::Quit.connect (forever_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::finish, this), gui_context ());
/* tell the user about feedback */
ARDOUR::Session::FeedbackDetected.connect (forever_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::feedback_detected, this), gui_context ());
ARDOUR::Session::SuccessfulGraphSort.connect (forever_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::successful_graph_sort, 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, std::bind (&ARDOUR_UI::missing_file, this, _1, _2, _3)); ARDOUR::Session::MissingFile.connect_same_thread (forever_connections, std::bind (&ARDOUR_UI::missing_file, this, _1, _2, _3));
@ -561,8 +552,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
_process_thread = new ProcessThread (); _process_thread = new ProcessThread ();
ARDOUR::Port::set_connecting_blocked (ARDOUR_COMMAND_LINE::no_connect_ports); ARDOUR::Port::set_connecting_blocked (ARDOUR_COMMAND_LINE::no_connect_ports);
application_bar = new ApplicationBar(); //TODO: move this to Editor, Cue, Rec, Mix
} }
GlobalPortMatrixWindow* GlobalPortMatrixWindow*
@ -3011,18 +3000,6 @@ ARDOUR_UI::drop_process_buffers ()
_process_thread->drop_buffers (); _process_thread->drop_buffers ();
} }
void
ARDOUR_UI::feedback_detected ()
{
_feedback_exists = true;
}
void
ARDOUR_UI::successful_graph_sort ()
{
_feedback_exists = false;
}
void void
ARDOUR_UI::midi_panic () ARDOUR_UI::midi_panic ()
{ {

View File

@ -238,6 +238,16 @@ public:
RCOptionEditor* get_rc_option_editor() { return rc_option_editor; } RCOptionEditor* get_rc_option_editor() { return rc_option_editor; }
void show_tabbable (ArdourWidgets::Tabbable*); void show_tabbable (ArdourWidgets::Tabbable*);
enum ArdourLogLevel {
LogLevelNone = 0,
LogLevelInfo,
LogLevelWarning,
LogLevelError
};
ArdourLogLevel log_not_acknowledged () const { return _log_not_acknowledged; }
void set_log_not_acknowledged (const ArdourLogLevel lvl) { _log_not_acknowledged =lvl; }
void start_session_load (bool create_new); void start_session_load (bool create_new);
void session_dialog_response_handler (int response, SessionDialog* session_dialog); void session_dialog_response_handler (int response, SessionDialog* session_dialog);
void build_session_from_dialog (SessionDialog&, std::string const& session_name, std::string const& session_path, std::string const& session_template, Temporal::TimeDomain domain); void build_session_from_dialog (SessionDialog&, std::string const& session_name, std::string const& session_path, std::string const& session_template, Temporal::TimeDomain domain);
@ -529,7 +539,6 @@ private:
ApplicationBar *application_bar; ApplicationBar *application_bar;
ArdourWidgets::ArdourVSpacer monitor_spacer;
ArdourWidgets::ArdourVSpacer scripts_spacer; ArdourWidgets::ArdourVSpacer scripts_spacer;
ArdourWidgets::ArdourVSpacer cuectrl_spacer; ArdourWidgets::ArdourVSpacer cuectrl_spacer;
@ -551,15 +560,10 @@ private:
ArdourWidgets::ArdourVSpacer meterbox_spacer; ArdourWidgets::ArdourVSpacer meterbox_spacer;
Gtk::HBox meterbox_spacer2; Gtk::HBox meterbox_spacer2;
ArdourWidgets::ArdourButton auditioning_alert_button;
ArdourWidgets::ArdourButton solo_alert_button;
ArdourWidgets::ArdourButton feedback_alert_button;
ArdourWidgets::ArdourButton error_alert_button; ArdourWidgets::ArdourButton error_alert_button;
ArdourWidgets::ArdourButton action_script_call_btn[MAX_LUA_ACTION_BUTTONS]; ArdourWidgets::ArdourButton action_script_call_btn[MAX_LUA_ACTION_BUTTONS];
Gtk::VBox alert_box;
Gtk::Table editor_meter_table; Gtk::Table editor_meter_table;
ArdourWidgets::ArdourButton editor_meter_peak_display; ArdourWidgets::ArdourButton editor_meter_peak_display;
LevelMeterHBox * editor_meter; LevelMeterHBox * editor_meter;
@ -572,21 +576,11 @@ private:
sigc::connection blink_connection; sigc::connection blink_connection;
void cancel_solo (); void cancel_solo ();
void solo_blink (bool);
void audition_blink (bool);
void feedback_blink (bool);
void error_blink (bool); void error_blink (bool);
void set_flat_buttons(); void set_flat_buttons();
void soloing_changed (bool);
void auditioning_changed (bool);
void _auditioning_changed (bool);
bool solo_alert_press (GdkEventButton* ev);
void audition_alert_clicked ();
bool error_alert_press (GdkEventButton *); bool error_alert_press (GdkEventButton *);
/* menu bar and associated stuff */ /* menu bar and associated stuff */
Gtk::MenuBar* menu_bar; Gtk::MenuBar* menu_bar;
@ -849,22 +843,10 @@ private:
void toggle_latency_switch (); void toggle_latency_switch ();
void latency_switch_changed (); void latency_switch_changed ();
void feedback_detected ();
ArdourWidgets::ArdourButton midi_panic_button; ArdourWidgets::ArdourButton midi_panic_button;
void midi_panic (); void midi_panic ();
void successful_graph_sort ();
bool _feedback_exists;
bool _ambiguous_latency;
enum ArdourLogLevel {
LogLevelNone = 0,
LogLevelInfo,
LogLevelWarning,
LogLevelError
};
ArdourLogLevel _log_not_acknowledged; ArdourLogLevel _log_not_acknowledged;
void on_theme_changed (); void on_theme_changed ();

View File

@ -92,9 +92,6 @@ ARDOUR_UI::setup_tooltips ()
ArdourCanvas::Canvas::set_tooltip_timeout (Gtk::Settings::get_default()->property_gtk_tooltip_timeout ()); ArdourCanvas::Canvas::set_tooltip_timeout (Gtk::Settings::get_default()->property_gtk_tooltip_timeout ());
parameter_changed("click-gain"); parameter_changed("click-gain");
set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything"));
set_tip (auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition"));
set_tip (feedback_alert_button, _("When lit, there is a ports connection issue, leading to feedback loop or ambiguous alignment.\nThis is caused by connecting an output back to some input (feedback), or by multiple connections from a source to the same output via different paths (ambiguous latency, record alignment)."));
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 (_cue_rec_enable, _("<b>When enabled</b>, triggering Cues will result in Cue Markers added to the timeline")); set_tip (_cue_rec_enable, _("<b>When enabled</b>, triggering Cues will result in Cue Markers added to the timeline"));
@ -196,9 +193,6 @@ ARDOUR_UI::setup_transport ()
/* setup actions */ /* setup actions */
/* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */ /* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
solo_alert_button.set_related_action (act);
auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false); error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window")); act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
error_alert_button.set_related_action(act); error_alert_button.set_related_action(act);
@ -210,6 +204,7 @@ ARDOUR_UI::setup_transport ()
recorder_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-recorder-visibility"))); recorder_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-recorder-visibility")));
trigger_page_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-trigger-visibility"))); trigger_page_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-trigger-visibility")));
application_bar = new ApplicationBar (); //TODO: move this to Editor, Cue, Rec, Mix //TODO: all transport, ui and monitor actions need to be instantiated before this
act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-dim-all")); act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-dim-all"));
monitor_dim_button.set_related_action (act); monitor_dim_button.set_related_action (act);
act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-mono")); act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-mono"));
@ -243,21 +238,6 @@ ARDOUR_UI::setup_transport ()
/* setup widget style/name */ /* setup widget style/name */
solo_alert_button.set_name ("rude solo");
auditioning_alert_button.set_name ("rude audition");
feedback_alert_button.set_name ("feedback alert");
error_alert_button.set_name ("error alert");
solo_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
auditioning_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
feedback_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
solo_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
auditioning_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
feedback_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
feedback_alert_button.set_sizing_text (_("Facdbeek")); //< longest of "Feedback" and "No Align"
editor_visibility_button.set_name (X_("page switch button")); editor_visibility_button.set_name (X_("page switch button"));
mixer_visibility_button.set_name (X_("page switch button")); mixer_visibility_button.set_name (X_("page switch button"));
prefs_visibility_button.set_name (X_("page switch button")); prefs_visibility_button.set_name (X_("page switch button"));
@ -339,15 +319,6 @@ ARDOUR_UI::setup_transport ()
transport_frame.add (*ebox); transport_frame.add (*ebox);
ebox->add (transport_table); ebox->add (transport_table);
/* alert box sub-group */
VBox* alert_box = manage (new VBox);
alert_box->set_homogeneous (true);
alert_box->set_spacing (1);
alert_box->set_border_width (0);
alert_box->pack_start (solo_alert_button, true, true);
alert_box->pack_start (auditioning_alert_button, true, true);
alert_box->pack_start (feedback_alert_button, true, true);
/* monitor section sub-group */ /* monitor section sub-group */
VBox* monitor_box = manage (new VBox); VBox* monitor_box = manage (new VBox);
monitor_box->set_homogeneous (true); monitor_box->set_homogeneous (true);
@ -377,12 +348,6 @@ ARDOUR_UI::setup_transport ()
transport_table.attach (*application_bar, TCOL, 0, 2 , EXPAND|FILL, EXPAND|FILL, 3, 0); transport_table.attach (*application_bar, TCOL, 0, 2 , EXPAND|FILL, EXPAND|FILL, 3, 0);
++col; ++col;
transport_table.attach (*alert_box, TCOL, 0, 2, SHRINK, EXPAND|FILL, hpadding, 0);
++col;
transport_table.attach (monitor_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col;
transport_table.attach (*monitor_box, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0); transport_table.attach (*monitor_box, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col; ++col;
@ -416,48 +381,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;
/* desensitize */
feedback_alert_button.set_sensitive (false);
feedback_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
auditioning_alert_button.set_sensitive (false);
auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
} }
#undef PX_SCALE #undef PX_SCALE
#undef TCOL #undef TCOL
void
ARDOUR_UI::soloing_changed (bool onoff)
{
if (solo_alert_button.get_active() != onoff) {
solo_alert_button.set_active (onoff);
}
}
void
ARDOUR_UI::_auditioning_changed (bool onoff)
{
auditioning_alert_button.set_active (onoff);
auditioning_alert_button.set_sensitive (onoff);
if (!onoff) {
auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
}
}
void
ARDOUR_UI::auditioning_changed (bool onoff)
{
UI::instance()->call_slot (MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::_auditioning_changed, this, onoff));
}
void
ARDOUR_UI::audition_alert_clicked ()
{
if (_session) {
_session->cancel_audition();
}
}
bool bool
ARDOUR_UI::error_alert_press (GdkEventButton* ev) ARDOUR_UI::error_alert_press (GdkEventButton* ev)
{ {
@ -477,69 +404,6 @@ ARDOUR_UI::error_alert_press (GdkEventButton* ev)
return !do_toggle; return !do_toggle;
} }
void
ARDOUR_UI::solo_blink (bool onoff)
{
if (_session == 0) {
return;
}
if (_session->soloing() || _session->listening()) {
if (onoff) {
solo_alert_button.set_active (true);
} else {
solo_alert_button.set_active (false);
}
} else {
solo_alert_button.set_active (false);
}
}
void
ARDOUR_UI::audition_blink (bool onoff)
{
if (_session == 0) {
return;
}
if (_session->is_auditioning()) {
if (onoff) {
auditioning_alert_button.set_active (true);
} else {
auditioning_alert_button.set_active (false);
}
} else {
auditioning_alert_button.set_active (false);
}
}
void
ARDOUR_UI::feedback_blink (bool onoff)
{
if (_feedback_exists) {
feedback_alert_button.set_active (true);
feedback_alert_button.set_text (_("Feedback"));
if (onoff) {
feedback_alert_button.reset_fixed_colors ();
} else {
feedback_alert_button.set_active_color (UIConfigurationBase::instance().color ("feedback alert: alt active", NULL));
}
} else if (_ambiguous_latency && !UIConfiguration::instance().get_show_toolbar_latency ()) {
feedback_alert_button.set_text (_("No Align"));
feedback_alert_button.set_active (true);
if (onoff) {
feedback_alert_button.reset_fixed_colors ();
} else {
feedback_alert_button.set_active_color (UIConfigurationBase::instance().color ("feedback alert: alt active", NULL));
}
} else {
feedback_alert_button.set_text (_("Feedback"));
feedback_alert_button.reset_fixed_colors ();
feedback_alert_button.set_active (false);
}
}
void void
ARDOUR_UI::error_blink (bool onoff) ARDOUR_UI::error_blink (bool onoff)
{ {

View File

@ -118,8 +118,6 @@ ARDOUR_UI::we_have_dependents ()
std::function<void (std::string)> pc (std::bind (&ARDOUR_UI::parameter_changed, this, _1)); std::function<void (std::string)> pc (std::bind (&ARDOUR_UI::parameter_changed, this, _1));
Config->map_parameters (pc); Config->map_parameters (pc);
UIConfiguration::instance().reset_dpi ();
} }
void void
@ -332,6 +330,9 @@ ARDOUR_UI::setup_windows ()
build_menu_bar (); build_menu_bar ();
setup_tooltips (); setup_tooltips ();
/* set DPI before realizing widgets */
UIConfiguration::instance().reset_dpi ();
_main_window.signal_delete_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::main_window_delete_event)); _main_window.signal_delete_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::main_window_delete_event));
/* pack the main vpacker into the main window and show everything /* pack the main vpacker into the main window and show everything

View File

@ -193,8 +193,6 @@ ARDOUR_UI::set_session (Session *s)
ActionManager::set_sensitive (ActionManager::point_selection_sensitive_actions, false); ActionManager::set_sensitive (ActionManager::point_selection_sensitive_actions, false);
ActionManager::set_sensitive (ActionManager::playlist_selection_sensitive_actions, false); ActionManager::set_sensitive (ActionManager::playlist_selection_sensitive_actions, false);
solo_alert_button.set_active (_session->soloing());
setup_session_options (); setup_session_options ();
blink_connection = Timers::blink_connect (sigc::mem_fun(*this, &ARDOUR_UI::blink_handler)); blink_connection = Timers::blink_connect (sigc::mem_fun(*this, &ARDOUR_UI::blink_handler));
@ -210,8 +208,6 @@ ARDOUR_UI::set_session (Session *s)
_session->auto_punch_location_changed.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::set_punch_sensitivity, this), gui_context ()); _session->auto_punch_location_changed.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::set_punch_sensitivity, this), gui_context ());
_session->Xrun.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::xrun_handler, this, _1), gui_context()); _session->Xrun.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::xrun_handler, this, _1), gui_context());
_session->SoloActive.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::soloing_changed, this, _1), gui_context());
_session->AuditionActive.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::auditioning_changed, this, _1), gui_context());
_session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context()); _session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
_session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context()); _session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
_session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ()); _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ());