Compare commits

...

10 Commits

18 changed files with 133 additions and 43 deletions

View File

@ -198,6 +198,18 @@ ARDOUR_UI::setup_transport ()
/* setup widget style/name */
editor_visibility_button.set_elements (ArdourButton::Element (ArdourButton::Text|ArdourButton::Body));
editor_visibility_button.set_icon (ArdourWidgets::ArdourIcon::TrackWaveform);
mixer_visibility_button.set_elements (ArdourButton::Element (ArdourButton::Text|ArdourButton::Body));
mixer_visibility_button.set_icon (ArdourWidgets::ArdourIcon::Mixer);
recorder_visibility_button.set_elements (ArdourButton::Element (ArdourButton::Text|ArdourButton::Body));
recorder_visibility_button.set_icon (ArdourWidgets::ArdourIcon::RecButton);
trigger_page_visibility_button.set_elements (ArdourButton::Element (ArdourButton::Text|ArdourButton::Body));
trigger_page_visibility_button.set_icon (ArdourWidgets::ArdourIcon::Meters);
editor_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"));

View File

@ -1053,11 +1053,19 @@ ARDOUR_UI::on_theme_changed ()
void
ARDOUR_UI::focus_on_clock ()
{
//cast to a tabbable and call focus_on_clock to its clock
//somewhat hacky; _tab holds a widget which is not the Tabbable. y not though?
//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 ();
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 ();
}
}

View File

@ -230,7 +230,7 @@ static const gchar *_rb_opt_strings[] = {
#endif
Editor::Editor ()
: PublicEditor (_content_vbox)
: PublicEditor (_content)
, editor_mixer_strip_width (Wide)
, constructed (false)
, _properties_box (0)
@ -504,6 +504,8 @@ Editor::Editor ()
CairoWidget::set_focus_handler (sigc::mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::reset_focus));
_content.pack_start (_content_vbox, true, true);
_transport_bar = manage(new TransportBar());
_transport_bar->show();
@ -687,19 +689,18 @@ Editor::Editor ()
toolbar_shadow->show();
global_vpacker.pack_start (*toolbar_shadow, false, false);
global_vpacker.pack_start (editor_summary_pane, true, true);
global_vpacker.pack_start (ebox_hpacker, true, true);
/* pack all the main pieces into appropriate containers from _tabbable
*/
_content_transport_ebox.add (*_transport_bar);
_content_list_ebox.add (_editor_list_vbox);
_content_toolbar_ebox.add (ebox_hpacker);
_content_innermost_ebox.add (global_vpacker);
_content_toolbar_ebox.add (global_vpacker);
_content_innermost_hbox.add (editor_summary_pane);
/* need to show the "contents" widget so that notebook will show if tab is switched to
*/
_content_hbox.show ();
ebox_hpacker.show();
global_vpacker.show();
@ -2156,6 +2157,14 @@ Editor::set_edit_point_preference (EditPoint ep, bool force)
instant_save ();
}
void
Editor::focus_on_clock()
{
if (_transport_bar) {
_transport_bar->focus_on_clock();
}
}
int
Editor::set_state (const XMLNode& node, int version)
{

View File

@ -511,6 +511,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);
@ -783,6 +785,8 @@ private:
void parameter_changed (std::string);
void ui_parameter_changed (std::string);
Gtk::HBox _content;
TransportBar* _transport_bar;
Gtk::EventBox time_bars_event_box;

View File

@ -765,7 +765,7 @@ void
Editor::load_bindings ()
{
bindings = Bindings::get_bindings (editor_name());
_content_vbox.set_data ("ardour-bindings", bindings);
_content.set_data ("ardour-bindings", bindings);
/* This set of bindings may expand in the future to include things
* other than MIDI editing, but for now this is all we've got as far as

View File

@ -131,8 +131,7 @@ Editor::show_editor_mixer (bool yn)
}
if (current_mixer_strip && current_mixer_strip->get_parent() == 0) {
_content_hbox.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK );
_content_hbox.reorder_child (*current_mixer_strip, 0);
_content_strip_ebox.add (*current_mixer_strip);
current_mixer_strip->show ();
}
@ -145,7 +144,7 @@ Editor::show_editor_mixer (bool yn)
if (current_mixer_strip) {
if (current_mixer_strip->get_parent() != 0) {
_content_hbox.remove (*current_mixer_strip);
_content_strip_ebox.remove ();
}
}
}

View File

@ -1253,6 +1253,8 @@ Editor::track_selection_changed ()
update_selection_markers ();
update_section_box ();
show_editor_mixer(!selection->tracks.empty());
}
void

View File

@ -133,7 +133,7 @@ Mixer_UI::instance ()
}
Mixer_UI::Mixer_UI ()
: Tabbable (_content_vbox, _("Mixer"), X_("mixer"))
: Tabbable (_content, _("Mixer"), X_("mixer"))
, plugin_search_clear_button (X_("Clear"))
, _mixer_scene_release (0)
, no_track_list_redisplay (false)
@ -155,6 +155,7 @@ Mixer_UI::Mixer_UI ()
, _strip_selection_change_without_scroll (false)
, _selection (*this, *this)
{
_content.pack_start (_content_vbox, true, true);
plugin_list_mode_strings = I18N (_plugin_list_mode_strings);
@ -163,11 +164,14 @@ Mixer_UI::Mixer_UI ()
Glib::RefPtr<ToggleAction> fb_act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
fb_act->set_sensitive (false);
_content_vbox.set_data ("ardour-bindings", bindings);
_content.set_data ("ardour-bindings", bindings);
_transport_bar = manage(new TransportBar());
_transport_bar->show();
_strip_attachment_button.set_sensitive(false);
_prop_attachment_button.set_sensitive(false);
PresentationInfo::Change.connect (*this, invalidator (*this), std::bind (&Mixer_UI::presentation_info_changed, this, _1), gui_context());
Route::FanOut.connect (*this, invalidator (*this), std::bind (&Mixer_UI::fan_out, this, _1, false, true), gui_context());
@ -390,12 +394,11 @@ Mixer_UI::Mixer_UI ()
_content_transport_ebox.add (*_transport_bar);
_content_list_ebox.add (list_vpacker);
_content_innermost_ebox.add (global_hpacker);
_content_innermost_hbox.add (global_hpacker);
update_title ();
_content_vbox.show ();
_content_vbox.set_name ("MixerWindow");
_content.set_name ("MixerWindow");
global_hpacker.show();
scroller.show();
@ -1482,7 +1485,7 @@ Mixer_UI::stop_updating ()
void
Mixer_UI::fast_update_strips ()
{
if (!UIConfiguration::instance().get_no_strobe() && _content_vbox.get_mapped () && _session) {
if (!UIConfiguration::instance().get_no_strobe() && _content.get_mapped () && _session) {
for (auto & s : strips) {
s->fast_update ();
}
@ -2528,6 +2531,14 @@ Mixer_UI::set_strip_width (Width w, bool save)
}
}
void
Mixer_UI::focus_on_clock()
{
if (_transport_bar) {
_transport_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;
@ -181,6 +183,8 @@ private:
Mixer_UI ();
static Mixer_UI* _instance;
Gtk::HBox _content;
Gtk::HBox global_hpacker;
Gtk::VBox global_vpacker;
Gtk::ScrolledWindow scroller;

View File

@ -33,7 +33,7 @@ ARDOUR::DataType PublicEditor::pbdid_dragged_dt = ARDOUR::DataType::NIL;
PublicEditor::PublicEditor (Gtk::Widget& content)
: EditingContext (X_("Editor"))
, Tabbable (_content_vbox, _("Editor"), X_("editor"))
, Tabbable (content, _("Editor"), X_("editor"))
{
_suspend_route_redisplay_counter.store (0);
}

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

@ -79,7 +79,7 @@ using namespace Menu_Helpers;
#define PX_SCALE(px) std::max ((float)px, rintf ((float)px* UIConfiguration::instance ().get_ui_scale ()))
RecorderUI::RecorderUI ()
: Tabbable (_content_vbox, _("Recorder"), X_("recorder"))
: Tabbable (_content, _("Recorder"), X_("recorder"))
, _toolbar_sep (1.0)
, _btn_rec_all (_("All"))
, _btn_rec_none (_("None"))
@ -102,6 +102,8 @@ RecorderUI::RecorderUI ()
load_bindings ();
register_actions ();
_content.pack_start (_content_vbox, true, true);
_transport_bar = manage(new TransportBar());
_transport_bar->show();
@ -205,7 +207,7 @@ RecorderUI::RecorderUI ()
_content_transport_ebox.add (*_transport_bar);
//_content_list_ebox.add (_editor_list_vbox); //TODO
_content_toolbar_ebox.add(_toolbar);
_content_innermost_ebox.add (_pane);
_content_innermost_hbox.add (_pane);
/* button_table setup is similar to transport_table in ardour_ui */
int vpadding = 1;
@ -290,10 +292,9 @@ RecorderUI::RecorderUI ()
_meter_area.show ();
_meter_scroller.show ();
_pane.show ();
_content_vbox.show ();
/* setup keybidings */
_content_vbox.set_data ("ardour-bindings", bindings);
_content.set_data ("ardour-bindings", bindings);
/* subscribe to signals */
AudioEngine::instance ()->Running.connect (_engine_connections, invalidator (*this), std::bind (&RecorderUI::start_updating, this), gui_context ());
@ -371,6 +372,14 @@ RecorderUI::get_state () const
return *node;
}
void
RecorderUI::focus_on_clock()
{
if (_transport_bar) {
_transport_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 ();
@ -126,6 +128,8 @@ private:
static int calc_columns (int child_width, int parent_width);
Gtk::HBox _content;
Gtkmm2ext::Bindings* bindings;
Gtk::HBox _toolbar;
Gtk::Table _button_table;

View File

@ -768,7 +768,7 @@ SlotPropertyWindow::SlotPropertyWindow (TriggerReference tref)
std::cerr << "here\n";
table->attach(*_trig_box, col, col+1, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND ); col++;
table->attach(_midi_editor->viewport(), col, col+1, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND ); col++;
table->attach(_midi_editor->toolbox(), col, col+1, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND ); col++;
}
}

View File

@ -66,7 +66,7 @@ using namespace Gtk;
using namespace std;
TriggerPage::TriggerPage ()
: Tabbable (_content_vbox, _("Cues"), X_("trigger"))
: Tabbable (_content, _("Cues"), X_("trigger"))
, _cue_area_frame (0.5, 0, 1.0, 0)
, _cue_box (16, 16 * TriggerBox::default_triggers_per_box)
, _master_widget (16, 16)
@ -76,9 +76,13 @@ TriggerPage::TriggerPage ()
load_bindings ();
register_actions ();
_content.pack_start (_content_vbox, true, true);
_transport_bar = manage(new TransportBar());
_transport_bar->show();
_strip_attachment_button.set_sensitive(false);
/* Match TriggerStrip::_name_button height */
ArdourButton* spacer = manage (new ArdourButton (ArdourButton::Text));
spacer->set_name ("mixer strip button");
@ -154,10 +158,9 @@ TriggerPage::TriggerPage ()
/* Top-level Layout */
_content_transport_ebox.add (*_transport_bar);
_content_innermost_ebox.add (_strip_group_box);
_content_innermost_hbox.add (_strip_group_box);
_content_list_ebox.add (_sidebar_notebook);
_content_props_ebox.add (_parameter_box);
_content_vbox.show ();
_content_props_hbox.pack_start (_parameter_box, true, true);
/* Show all */
_strip_group_box.show ();
@ -169,7 +172,7 @@ TriggerPage::TriggerPage ()
_sidebar_notebook.show_all ();
/* setup keybidings */
_content_vbox.set_data ("ardour-bindings", bindings);
_content.set_data ("ardour-bindings", bindings);
/* subscribe to signals */
Config->ParameterChanged.connect (*this, invalidator (*this), std::bind (&TriggerPage::parameter_changed, this, _1), gui_context ());
@ -217,9 +220,20 @@ TriggerPage::get_state () const
node->add_child_nocopy (_midi_editor->get_state());
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Cues", "ToggleTriggerList");
node->set_property ("show-trigger-list", act->get_active ());
return *node;
}
void
TriggerPage::focus_on_clock()
{
if (_transport_bar) {
_transport_bar->focus_on_clock();
}
}
int
TriggerPage::set_state (const XMLNode& node, int version)
{
@ -233,6 +247,15 @@ TriggerPage::set_state (const XMLNode& node, int version)
_midi_editor->set_state (*mn, version);
}
bool yn = true;
node.get_property ("show-trigger-list", yn);
{
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Cues"), X_("ToggleTriggerList"));
/* do it twice to force the change */
tact->set_active (!yn);
tact->set_active (yn);
}
return Tabbable::set_state (node, version);
}
@ -396,7 +419,7 @@ TriggerPage::rec_enable_changed (Trigger const * trigger)
_slot_prop_box.hide ();
_audio_trig_box.hide ();
_midi_trig_box.hide ();
_midi_editor->viewport().hide ();
_midi_editor->toolbox().hide ();
_parameter_box.hide ();
@ -418,7 +441,7 @@ TriggerPage::rec_enable_changed (Trigger const * trigger)
_midi_trig_box.show ();
_midi_editor->set (ref);
_midi_editor->viewport().show ();
_midi_editor->toolbox().show ();
}
_parameter_box.show ();
@ -434,7 +457,7 @@ TriggerPage::selection_changed ()
_slot_prop_box.hide ();
_audio_trig_box.hide ();
_midi_trig_box.hide ();
_midi_editor->viewport().hide ();
_midi_editor->toolbox().hide ();
_parameter_box.hide ();
@ -458,7 +481,7 @@ TriggerPage::selection_changed ()
_midi_trig_box.show ();
_midi_editor->set (ref);
_midi_editor->viewport().show ();
_midi_editor->toolbox().show ();
}
_parameter_box.show ();
@ -813,7 +836,7 @@ TriggerPage::stop_updating ()
void
TriggerPage::fast_update_strips ()
{
if (_content_vbox.get_mapped () && _session) {
if (_content.get_mapped () && _session) {
for (list<TriggerStrip*>::iterator i = _strips.begin (); i != _strips.end (); ++i) {
(*i)->fast_update ();
}

View File

@ -63,6 +63,8 @@ public:
RouteProcessorSelection& selection() { return _selection; }
void focus_on_clock();
private:
void load_bindings ();
void register_actions ();
@ -108,6 +110,8 @@ private:
Gtkmm2ext::Bindings* bindings;
Gtk::HBox _content;
Gtk::HBox _strip_group_box;
Gtk::ScrolledWindow _strip_scroller;
Gtk::HBox _strip_packer;

View File

@ -71,7 +71,7 @@ Tabbable::Tabbable (Gtk::Widget& w, const string& visible_name, string const & n
_content_hbox.pack_start(_content_midlevel_vbox, true, true);
_content_midlevel_vbox.pack_start(_content_list_pane, true, true);
_content_midlevel_vbox.pack_start(_content_props_ebox, false, false);
_content_midlevel_vbox.pack_start(_content_props_hbox, true, true);
_content_list_pane.add(_content_inner_vbox);
_content_list_pane.add(_content_list_vbox);
@ -80,7 +80,7 @@ Tabbable::Tabbable (Gtk::Widget& w, const string& visible_name, string const & n
_content_list_vbox.pack_start(_content_list_ebox, true, true);
_content_inner_vbox.pack_start(_content_toolbar_ebox, false, false);
_content_inner_vbox.pack_start(_content_innermost_ebox, true, true);
_content_inner_vbox.pack_start(_content_innermost_hbox, true, true);
_content_list_pane.set_child_minsize (_content_list_ebox, 160); /* rough guess at width of notebook tabs */
_content_list_pane.set_check_divider_position (true);
@ -497,9 +497,9 @@ void
Tabbable::showhide_btm_props (bool yn)
{
if (yn) {
_content_props_ebox.show ();
_content_props_hbox.show ();
} else {
_content_props_ebox.hide ();
_content_props_hbox.hide ();
}
}

View File

@ -113,15 +113,15 @@ protected:
Gtk::HBox _content_hbox;
Gtk::EventBox _content_strip_ebox; /* a placeholder for the mixer strip, if you want one */
Gtk::VBox _content_midlevel_vbox;
Gtk::EventBox _content_props_ebox; /* a placeholder for the property box, if you want one */
Gtk::HBox _content_props_hbox; /* a placeholder for the property box, if you want one */
ArdourWidgets::HPane _content_list_pane;
Gtk::VBox _content_list_vbox;
Gtk::EventBox _content_list_ebox; /* a placeholder for the sidebar list, if you want one */
Gtk::VBox _content_inner_vbox;
Gtk::EventBox _content_toolbar_ebox; /* a placeholder for the content-specific toolbar, if you want one */
Gtk::HBox _content_innermost_ebox; /* a placeholder for the innermost content (recorder, cues, editor, mixer) */
Gtk::HBox _content_innermost_hbox; /* a placeholder for the innermost content (recorder, cues, editor, mixer) */
Gtk::Widget& _contents; //for most Tabbables this will be _content_vbox; but rc_options, for example, does something different.
Gtk::Widget& _contents; //for most Tabbables this will hold _content_vbox; but rc_options, for example, does something different.
/* visibility controls */
ArdourWidgets::ArdourButton _strip_attachment_button;