13
0

Transfer Cue State from ArdourUI

This commit is contained in:
Robin Gareus 2024-11-08 02:58:55 +01:00
parent c815ffcdb3
commit fb07b8b57c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
6 changed files with 47 additions and 53 deletions

View File

@ -123,6 +123,8 @@ ApplicationBar::ApplicationBar ()
, _auditioning_alert_button (_("Audition"))
, _solo_alert_button (_("Solo"))
, _feedback_alert_button (_("Feedback"))
, _cue_rec_enable (_("Rec Cues"), ArdourButton::led_default_elements)
, _cue_play_enable (_("Play Cues"), ArdourButton::led_default_elements)
, _feedback_exists (false)
, _ambiguous_latency (false)
{
@ -223,6 +225,9 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
_monitor_mono_button.set_text (_("Mono"));
_monitor_mute_button.set_text (_("Mute All"));
_cue_rec_enable.signal_clicked.connect(sigc::mem_fun(*this, &ApplicationBar::cue_rec_state_clicked));
_cue_play_enable.signal_clicked.connect(sigc::mem_fun(*this, &ApplicationBar::cue_ffwd_state_clicked));
int vpadding = 1;
int hpadding = 2;
int col = 0;
@ -299,6 +304,13 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
_table.attach (*monitor_box, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col;
_table.attach (_cuectrl_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col;
_table.attach (_cue_rec_enable, TCOL, 0, 1 , FILL, FILL, 3, 0);
_table.attach (_cue_play_enable, TCOL, 1, 2 , FILL, FILL, 3, 0);
++col;
_table.set_spacings (0);
_table.set_row_spacings (4);
_table.set_border_width (1);
@ -355,6 +367,8 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
Gtkmm2ext::UI::instance()->set_tip (_monitor_dim_button, _("Monitor section dim output"));
Gtkmm2ext::UI::instance()->set_tip (_monitor_mono_button, _("Monitor section mono output"));
Gtkmm2ext::UI::instance()->set_tip (_monitor_mute_button, _("Monitor section mute output"));
Gtkmm2ext::UI::instance()->set_tip (_cue_rec_enable, _("<b>When enabled</b>, triggering Cues will result in Cue Markers added to the timeline"));
Gtkmm2ext::UI::instance()->set_tip (_cue_play_enable, _("<b>When enabled</b>, Cue Markers will trigger the associated Cue when passed on the timeline"));
/* theming */
_sync_button.set_name ("transport active option button");
@ -389,11 +403,17 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
_feedback_alert_button.set_sizing_text (_("Feedgeek")); //< longest of "Feedback" and "No Align", include descender
_cue_rec_enable.set_name ("record enable button");
_cue_play_enable.set_name ("transport option button");
/* indicate global latency compensation en/disable */
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 ());
TriggerBox::CueRecordingChanged.connect (_forever_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::cue_rec_state_changed, this), gui_context ());
cue_rec_state_changed();
/* initialize */
update_clock_visibility ();
set_transport_sensitivity (false);
@ -802,7 +822,7 @@ ApplicationBar::parameter_changed (std::string p)
} */
} else if (p == "cue-behavior") {
CueBehavior cb (_session->config.get_cue_behavior());
// _cue_play_enable.set_active (cb & ARDOUR::FollowCues);
_cue_play_enable.set_active (cb & ARDOUR::FollowCues);
} else if (p == "record-mode") {
size_t m = _session->config.get_record_mode ();
assert (m < _record_mode_strings.size ());
@ -827,6 +847,25 @@ ApplicationBar::sync_button_clicked (GdkEventButton* ev)
return true;
}
void
ApplicationBar::cue_ffwd_state_clicked ()
{
PublicEditor::instance().toggle_cue_behavior ();
}
void
ApplicationBar::cue_rec_state_clicked ()
{
TriggerBox::set_cue_recording(!TriggerBox::cue_recording());
}
void
ApplicationBar::cue_rec_state_changed ()
{
_cue_rec_enable.set_active_state( TriggerBox::cue_recording() ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off);
//Config->get_cue_behavior()
}
void
ApplicationBar::set_record_mode (RecordMode m)
{

View File

@ -94,6 +94,10 @@ private:
bool solo_alert_press (GdkEventButton* ev);
void audition_alert_clicked ();
void cue_ffwd_state_clicked ();
void cue_rec_state_changed ();
void cue_rec_state_clicked ();
/* blinking alerts */
void sync_blink (bool);
void blink_handler (bool);
@ -129,6 +133,9 @@ private:
ArdourWidgets::ArdourButton _monitor_dim_button;
ArdourWidgets::ArdourButton _monitor_mono_button;
ArdourWidgets::ArdourButton _monitor_mute_button;
ArdourWidgets::ArdourVSpacer _cuectrl_spacer;
ArdourWidgets::ArdourButton _cue_rec_enable;
ArdourWidgets::ArdourButton _cue_play_enable;
bool _feedback_exists;
bool _ambiguous_latency;

View File

@ -298,8 +298,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, _shared_popup_menu (0)
, _basic_ui (0)
, startup_fsm (0)
, _cue_rec_enable (_("Rec Cues"), ArdourButton::led_default_elements)
, _cue_play_enable (_("Play Cues"), ArdourButton::led_default_elements)
, time_info_box (0)
, error_alert_button ( ArdourButton::just_led_default_elements )
, editor_meter_peak_display()
@ -428,9 +426,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
ARDOUR::Session::VersionMismatch.connect (forever_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::session_format_mismatch, this, _1, _2), gui_context());
TriggerBox::CueRecordingChanged.connect (forever_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::cue_rec_state_changed, this), gui_context ());
cue_rec_state_changed();
/* handle dialog requests */
ARDOUR::Session::Dialog.connect (forever_connections, MISSING_INVALIDATOR, std::bind (&ARDOUR_UI::session_dialog, this, _1), gui_context());

View File

@ -499,10 +499,6 @@ private:
void session_dirty_changed ();
void update_title ();
void cue_rec_state_changed ();
void cue_rec_state_clicked ();
void cue_ffwd_state_clicked ();
void map_transport_state ();
int32_t do_engine_start ();
@ -540,15 +536,11 @@ private:
ApplicationBar *application_bar;
ArdourWidgets::ArdourVSpacer scripts_spacer;
ArdourWidgets::ArdourVSpacer cuectrl_spacer;
void toggle_external_sync ();
void toggle_time_master ();
void toggle_video_sync ();
ArdourWidgets::ArdourButton _cue_rec_enable;
ArdourWidgets::ArdourButton _cue_play_enable;
MiniTimeline mini_timeline;
TimeInfoBox* time_info_box;

View File

@ -94,8 +94,6 @@ ARDOUR_UI::setup_tooltips ()
parameter_changed("click-gain");
set_tip (editor_meter_peak_display, _("Reset All Peak Meters"));
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_play_enable, _("<b>When enabled</b>, Cue Markers will trigger the associated Cue when passed on the timeline"));
synchronize_sync_source_and_video_pullup ();
@ -165,27 +163,6 @@ bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult resu
return false;
}
void
ARDOUR_UI::cue_rec_state_clicked ()
{
TriggerBox::set_cue_recording(!TriggerBox::cue_recording());
}
void
ARDOUR_UI::cue_ffwd_state_clicked ()
{
if (editor) {
editor->toggle_cue_behavior ();
}
}
void
ARDOUR_UI::cue_rec_state_changed ()
{
_cue_rec_enable.set_active_state( TriggerBox::cue_recording() ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off);
//Config->get_cue_behavior()
}
void
ARDOUR_UI::setup_transport ()
{
@ -216,12 +193,6 @@ ARDOUR_UI::setup_transport ()
recorder_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), recorder));
trigger_page_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), trigger_page));
_cue_rec_enable.set_name ("record enable button");
_cue_rec_enable.signal_clicked.connect(sigc::mem_fun(*this, &ARDOUR_UI::cue_rec_state_clicked));
_cue_play_enable.set_name ("transport option button");
_cue_play_enable.signal_clicked.connect(sigc::mem_fun(*this, &ARDOUR_UI::cue_ffwd_state_clicked));
/* catch context clicks so that we can show a menu on these buttons */
editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
@ -307,13 +278,6 @@ ARDOUR_UI::setup_transport ()
transport_table.attach (*application_bar, TCOL, 0, 2 , EXPAND|FILL, EXPAND|FILL, 3, 0);
++col;
transport_table.attach (cuectrl_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col;
transport_table.attach (_cue_rec_enable, TCOL, 0, 1 , FILL, FILL, 3, 0);
transport_table.attach (_cue_play_enable, TCOL, 1, 2 , FILL, FILL, 3, 0);
++col;
/* editor-meter, mini-timeline and selection clock are options in the transport_hbox */
transport_hbox.set_spacing (3);
transport_table.attach (transport_hbox, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, hpadding, 0);

View File

@ -427,9 +427,6 @@ ARDOUR_UI::parameter_changed (std::string p)
} else {
scripts_spacer.show ();
}
} else if (p == "cue-behavior") {
CueBehavior cb (_session->config.get_cue_behavior());
_cue_play_enable.set_active (cb & ARDOUR::FollowCues);
} else if (p == "flat-buttons") {
bool flat = UIConfiguration::instance().get_flat_buttons();
if (ArdourButton::flat_buttons () != flat) {