13
0

implement focus_on_clock for each tabbable

This commit is contained in:
Ben Loftis 2024-10-30 08:55:04 -05:00 committed by Robin Gareus
parent 9a03fa59b1
commit 983236f348
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
10 changed files with 48 additions and 2 deletions

View File

@ -1054,7 +1054,20 @@ ARDOUR_UI::on_theme_changed ()
void
ARDOUR_UI::focus_on_clock ()
{
// TODO cast to a tabbable and call focus_on_clock to its clock
// TODO: how do we handle detached windows? Use WindowManager?
if (editor->tabbed() && _tabs.get_current_page() == _tabs.page_num (editor->contents())) {
editor->focus_on_clock ();
}
if (mixer->tabbed() && _tabs.get_current_page() == _tabs.page_num (mixer->contents())) {
mixer->focus_on_clock ();
}
if (recorder->tabbed() && _tabs.get_current_page() == _tabs.page_num (recorder->contents())) {
recorder->focus_on_clock ();
}
if (trigger_page->tabbed() && _tabs.get_current_page() == _tabs.page_num (trigger_page->contents())) {
trigger_page->focus_on_clock ();
}
}
bool

View File

@ -2147,6 +2147,12 @@ Editor::set_edit_point_preference (EditPoint ep, bool force)
instant_save ();
}
void
Editor::focus_on_clock()
{
_application_bar.focus_on_clock();
}
int
Editor::set_state (const XMLNode& node, int version)
{

View File

@ -512,6 +512,8 @@ public:
bool rb_click (GdkEvent*, Temporal::timepos_t const &);
void line_drag_click (GdkEvent*, Temporal::timepos_t const &, double);
void focus_on_clock();
protected:
void map_transport_state ();
void map_position_change (samplepos_t);

View File

@ -2535,6 +2535,12 @@ Mixer_UI::set_strip_width (Width w, bool save)
}
}
void
Mixer_UI::focus_on_clock()
{
_application_bar.focus_on_clock();
}
int
Mixer_UI::set_state (const XMLNode& node, int version)
{

View File

@ -144,6 +144,8 @@ public:
void register_actions ();
void focus_on_clock();
void load_bindings ();
Gtkmm2ext::Bindings* bindings;

View File

@ -406,7 +406,6 @@ public:
virtual MixerStrip* get_current_mixer_strip () const = 0;
virtual Temporal::TempoMap::WritableSharedPtr begin_tempo_map_edit () = 0;
virtual void abort_tempo_map_edit () = 0;
void commit_tempo_map_edit (Temporal::TempoMap::WritableSharedPtr& map, bool with_update = false) {
@ -449,6 +448,8 @@ public:
virtual void end_track_drag () = 0;
virtual bool track_dragging() const = 0;
virtual void focus_on_clock() = 0;
/// Singleton instance, set up by Editor::Editor()
static PublicEditor* _instance;

View File

@ -361,6 +361,12 @@ RecorderUI::get_state () const
return *node;
}
void
RecorderUI::focus_on_clock()
{
_application_bar.focus_on_clock();
}
int
RecorderUI::set_state (const XMLNode& node, int version)
{

View File

@ -73,6 +73,8 @@ public:
void spill_port (std::string const&);
void add_track (std::string const&);
void focus_on_clock();
private:
void load_bindings ();
void register_actions ();

View File

@ -251,6 +251,12 @@ TriggerPage::get_state () const
return *node;
}
void
TriggerPage::focus_on_clock()
{
_application_bar.focus_on_clock();
}
int
TriggerPage::set_state (const XMLNode& node, int version)
{

View File

@ -64,6 +64,8 @@ public:
RouteProcessorSelection& selection() { return _selection; }
void focus_on_clock();
private:
void load_bindings ();
void register_actions ();