rough-in global Cue functions (rec-enable and play-enable i.e. cue-ffwd)

This commit is contained in:
Ben Loftis 2022-02-12 21:45:53 -06:00
parent bb67041938
commit 54d794e242
4 changed files with 49 additions and 0 deletions

View file

@ -124,6 +124,7 @@
#include "ardour/source_factory.h" #include "ardour/source_factory.h"
#include "ardour/transport_master.h" #include "ardour/transport_master.h"
#include "ardour/transport_master_manager.h" #include "ardour/transport_master_manager.h"
#include "ardour/triggerbox.h"
#include "ardour/system_exec.h" #include "ardour/system_exec.h"
#include "ardour/track.h" #include "ardour/track.h"
#include "ardour/vca_manager.h" #include "ardour/vca_manager.h"
@ -314,6 +315,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, startup_fsm (0) , startup_fsm (0)
, secondary_clock_spacer (0) , secondary_clock_spacer (0)
, latency_disable_button (ArdourButton::led_default_elements) , latency_disable_button (ArdourButton::led_default_elements)
, _cue_rec_enable (_("Rec Cues"), ArdourButton::led_default_elements)
, _cue_play_enable (_("Play Cues"), 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)
@ -437,6 +442,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
ARDOUR::Session::VersionMismatch.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_format_mismatch, this, _1, _2), gui_context()); ARDOUR::Session::VersionMismatch.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_format_mismatch, this, _1, _2), gui_context());
TriggerBox::CueRecordingChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::cue_rec_state_changed, this), gui_context ());
cue_rec_state_changed();
/* handle dialog requests */ /* handle dialog requests */
ARDOUR::Session::Dialog.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_dialog, this, _1), gui_context()); ARDOUR::Session::Dialog.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_dialog, this, _1), gui_context());

View file

@ -472,6 +472,10 @@ private:
void session_dirty_changed (); void session_dirty_changed ();
void update_title (); void update_title ();
void cue_rec_state_changed ();
void cue_rec_state_clicked ();
void cue_ffwd_state_clicked ();
void map_transport_state (); void map_transport_state ();
int32_t do_engine_start (); int32_t do_engine_start ();
@ -536,6 +540,9 @@ private:
ArdourWidgets::ArdourButton latency_disable_button; ArdourWidgets::ArdourButton latency_disable_button;
ArdourWidgets::ArdourButton _cue_rec_enable;
ArdourWidgets::ArdourButton _cue_play_enable;
Gtk::Label route_latency_value; Gtk::Label route_latency_value;
Gtk::Label io_latency_label; Gtk::Label io_latency_label;
Gtk::Label io_latency_value; Gtk::Label io_latency_value;

View file

@ -171,6 +171,27 @@ bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult resu
return false; 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 void
ARDOUR_UI::repack_transport_hbox () ARDOUR_UI::repack_transport_hbox ()
{ {
@ -346,6 +367,12 @@ ARDOUR_UI::setup_transport ()
recorder_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), recorder)); 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)); 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 ("record enable 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 */ /* 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); editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
@ -622,6 +649,10 @@ ARDOUR_UI::setup_transport ()
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;
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 */ /* editor-meter, mini-timeline and selection clock are options in the transport_hbox */
transport_hbox.set_spacing (3); transport_hbox.set_spacing (3);
transport_table.attach (transport_hbox, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, hpadding, 0); transport_table.attach (transport_hbox, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, hpadding, 0);

View file

@ -461,6 +461,9 @@ ARDOUR_UI::parameter_changed (std::string p)
} else { } else {
scripts_spacer.show (); scripts_spacer.show ();
} }
} else if (p == "cue-behavior") {
CueBehavior cb (Config->get_cue_behavior());
_cue_play_enable.set_active (cb & ARDOUR::FollowCues);
} else if (p == "layered-record-mode") { } else if (p == "layered-record-mode") {
layered_button.set_active (_session->config.get_layered_record_mode ()); layered_button.set_active (_session->config.get_layered_record_mode ());
} else if (p == "flat-buttons") { } else if (p == "flat-buttons") {