From 44dcd48be42f63bc2a247c2f90ca5386397dee34 Mon Sep 17 00:00:00 2001 From: VKamyshniy Date: Tue, 15 Jul 2014 00:44:46 +0300 Subject: [PATCH] [Summary] Progressing MASTER UI --- gtk2_ardour/editor.cc | 12 +++++------ gtk2_ardour/editor.h | 7 ++++--- gtk2_ardour/editor_mixer.cc | 35 +++++++------------------------- gtk2_ardour/ui/editor_window.xml | 15 ++++++++++++++ gtk2_ardour/wscript | 1 + 5 files changed, 33 insertions(+), 37 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 596fe1364a..0c2cd24d3b 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -247,6 +247,10 @@ Editor::Editor () , cd_mark_label (_("CD Markers")) , videotl_label (_("Video Timeline")) , edit_packer (4, 4, true) + , global_hpacker (get_h_box ("global_hpacker")) + , global_vpacker (get_v_box ("global_vpacker")) + , inspector_home (get_container ("inspector_home")) + , master_bus_ui_home (get_container ("master_bus_ui_home")) , vpacker (get_v_box ("vpacker")) , _tool_marker_button (get_waves_button ("tool_marker_button")) , _tool_zoom_button (get_waves_button ("tool_zoom_button")) @@ -295,6 +299,7 @@ Editor::Editor () , _following_mixer_selection (false) , _control_point_toggled_on_press (false) , _stepping_axis_view (0) + , current_mixer_strip (0) { constructed = false; @@ -315,7 +320,6 @@ Editor::Editor () pre_press_cursor = 0; _drags = new DragManager (this); - current_mixer_strip = 0; tempo_lines = 0; snap_type_strings = I18N (_snap_type_strings); @@ -646,13 +650,9 @@ Editor::Editor () global_vpacker.pack_start (top_hbox, false, false); global_vpacker.pack_start (*hbox, true, true); - global_hpacker.pack_start (global_vpacker, true, true); - set_name ("EditorWindow"); add_accel_group (ActionManager::ui_manager->get_accel_group()); - vpacker.pack_end (global_hpacker, true, true); - /* register actions now so that set_state() can find them and set toggles/checks etc */ register_actions (); @@ -5590,7 +5590,7 @@ Editor::session_going_away () if (current_mixer_strip) { if (current_mixer_strip->get_parent() != 0) { - global_hpacker.remove (*current_mixer_strip); + current_mixer_strip->get_parent()->remove (*current_mixer_strip); } delete current_mixer_strip; current_mixer_strip = 0; diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 685102a8ff..107621e3d0 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -688,8 +688,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void add_routes (ARDOUR::RouteList&); void timeaxisview_deleted (TimeAxisView *); - Gtk::HBox global_hpacker; - Gtk::VBox global_vpacker; + Gtk::HBox& global_hpacker; + Gtk::VBox& global_vpacker; + Gtk::Container& inspector_home; + Gtk::Container& master_bus_ui_home; Gtk::VBox& vpacker; Gdk::Cursor* current_canvas_cursor; @@ -1905,7 +1907,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD MixerStrip *current_mixer_strip; bool show_editor_mixer_when_tracks_arrive; - Gtk::VBox current_mixer_strip_vbox; void cms_new (boost::shared_ptr); void current_mixer_strip_hidden (); diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index 0bf31013bd..eede62939d 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -42,6 +42,7 @@ #include "mixer_strip.h" #include "mixer_ui.h" #include "selection.h" +#include "master_bus_ui.h" #include "i18n.h" @@ -136,8 +137,7 @@ Editor::show_editor_mixer (bool yn) } if (current_mixer_strip && current_mixer_strip->get_parent() == 0) { - global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK ); - global_hpacker.reorder_child (*current_mixer_strip, 0); + inspector_home.add (*current_mixer_strip); current_mixer_strip->show (); } @@ -147,10 +147,9 @@ Editor::show_editor_mixer (bool yn) } } else { - if (current_mixer_strip) { if (current_mixer_strip->get_parent() != 0) { - global_hpacker.remove (*current_mixer_strip); + current_mixer_strip->get_parent()->remove (*current_mixer_strip); } } } @@ -175,14 +174,12 @@ void Editor::create_editor_mixer () { current_mixer_strip = new MixerStrip (*ARDOUR_UI::instance()->the_mixer(), - _session, "editor_mixer.xml"); + _session, + "editor_mixer.xml"); current_mixer_strip->Hiding.connect (sigc::mem_fun(*this, &Editor::current_mixer_strip_hidden)); -// current_mixer_strip->WidthChanged.connect (sigc::mem_fun (*this, &Editor::mixer_strip_width_changed)); - -#ifdef GTKOSX -// current_mixer_strip->WidthChanged.connect (sigc::mem_fun(*this, &Editor::ensure_all_elements_drawn)); -#endif current_mixer_strip->set_embedded (true); + MasterBusUI* mbu = new MasterBusUI (*this, _session); + master_bus_ui_home.add (*mbu); } void @@ -255,24 +252,6 @@ Editor::current_mixer_strip_hidden () } } -//void -//Editor::maybe_add_mixer_strip_width (XMLNode& node) -//{ -// if (current_mixer_strip) { -// //node.add_property ("mixer-width", enum_2_string (editor_mixer_strip_width)); -// } -//} - -//void -//Editor::mixer_strip_width_changed () -//{ -//#ifdef GTKOSX -// ensure_all_elements_drawn (); -//#endif -// -//// editor_mixer_strip_width = current_mixer_strip->get_width_enum (); -//} - void Editor::track_mixer_selection () { diff --git a/gtk2_ardour/ui/editor_window.xml b/gtk2_ardour/ui/editor_window.xml index 6f19a45ecb..b4d55631a9 100644 --- a/gtk2_ardour/ui/editor_window.xml +++ b/gtk2_ardour/ui/editor_window.xml @@ -168,5 +168,20 @@ + + + + + + + + diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 142bf2e276..ec67007ae1 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -152,6 +152,7 @@ gtk2_ardour_sources = [ 'mixer_group_tabs.cc', 'mixer_strip.cc', 'mixer_ui.cc', + 'master_bus_ui.cc', 'meterbridge.cc', 'meter_strip.cc', 'meter_patterns.cc',