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 void
ARDOUR_UI::focus_on_clock () 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 bool

View File

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

View File

@ -512,6 +512,8 @@ public:
bool rb_click (GdkEvent*, Temporal::timepos_t const &); bool rb_click (GdkEvent*, Temporal::timepos_t const &);
void line_drag_click (GdkEvent*, Temporal::timepos_t const &, double); void line_drag_click (GdkEvent*, Temporal::timepos_t const &, double);
void focus_on_clock();
protected: protected:
void map_transport_state (); void map_transport_state ();
void map_position_change (samplepos_t); 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 int
Mixer_UI::set_state (const XMLNode& node, int version) Mixer_UI::set_state (const XMLNode& node, int version)
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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