User toggling of editor region/route/etc list, ala editor mixer.
authorDavid Robillard <d@drobilla.net>
Fri, 15 Jun 2007 07:39:20 +0000 (07:39 +0000)
committerDavid Robillard <d@drobilla.net>
Fri, 15 Jun 2007 07:39:20 +0000 (07:39 +0000)
Canvas, from sea to shining sea.

git-svn-id: svn://localhost/ardour2/trunk@1983 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour.menus
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_actions.cc
gtk2_ardour/editor_mixer.cc
gtk2_ardour/editor_route_list.cc

index 0faa3ea60bb1b3773fa1d4ced4758c851e6ee024..13b8cbf738897cb67a20f963522b46f9aa0170df 100644 (file)
                <menuitem action='ToggleMeasureVisibility'/>
               <separator/>
               <menuitem action='show-editor-mixer'/>
+              <menuitem action='show-editor-list'/>
          </menu>
         <menu name='JACK' action='JACK'>
                <menuitem action='JACKDisconnect'/>
index 7b6b122ea02af9e73c782b719cd74508c1727ca0..a2f71a6a523b65a01c45cd84100685b4afe2e394 100644 (file)
@@ -628,10 +628,10 @@ Editor::Editor ()
 
        nlabel = manage (new Label (_("Regions")));
        nlabel->set_angle (-90);
-               the_notebook.append_page (region_list_scroller, *nlabel);
+       the_notebook.append_page (region_list_scroller, *nlabel);
        nlabel = manage (new Label (_("Tracks/Busses")));
        nlabel->set_angle (-90);
-               the_notebook.append_page (route_list_scroller, *nlabel);
+       the_notebook.append_page (route_list_scroller, *nlabel);
        nlabel = manage (new Label (_("Snapshots")));
        nlabel->set_angle (-90);
        the_notebook.append_page (snapshot_display_scroller, *nlabel);
@@ -812,6 +812,9 @@ Editor::show_window ()
 {
        show_all ();
        present ();
+       
+       /* re-hide editor list if necessary */
+       editor_list_button_toggled ();
 
        /* now reset all audio_time_axis heights, because widgets might need
           to be re-hidden
@@ -1966,6 +1969,22 @@ Editor::set_state (const XMLNode& node)
                        tact->set_active (yn);
                }
        }
+       
+       if ((prop = node.property ("show-editor-list"))) {
+
+               Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-list"));
+               assert(act);
+               if (act) {
+
+                       Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+                       bool yn = (prop->value() == X_("yes"));
+
+                       /* do it twice to force the change */
+                       
+                       tact->set_active (!yn);
+                       tact->set_active (yn);
+               }
+       }
 
 
        return 0;
@@ -2037,6 +2056,12 @@ Editor::get_state ()
                Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
                node->add_property (X_("show-editor-mixer"), tact->get_active() ? "yes" : "no");
        }
+       
+       act = ActionManager::get_action (X_("Editor"), X_("show-editor-list"));
+       if (act) {
+               Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+               node->add_property (X_("show-editor-list"), tact->get_active() ? "yes" : "no");
+       }
 
        return *node;
 }
index 5bb6ee44264f7ff93b7a9f0ee5f7ec4cac6afccd..739feb957e8a672a7bda309643cd759051768382 100644 (file)
@@ -268,6 +268,7 @@ class Editor : public PublicEditor
        Width editor_mixer_strip_width;
        void maybe_add_mixer_strip_width (XMLNode&);
        void show_editor_mixer (bool yn);
+       void show_editor_list (bool yn);
        void set_selected_mixer_strip (TimeAxisView&);
        void hide_track_in_display (TimeAxisView& tv);
        void show_track_in_display (TimeAxisView& tv);
@@ -721,7 +722,6 @@ class Editor : public PublicEditor
 
        Gtk::Menu          *region_list_menu;
        Gtk::ScrolledWindow region_list_scroller;
-       Gtk::Frame          region_list_frame;
 
        bool region_list_display_key_press (GdkEventKey *);
        bool region_list_display_key_release (GdkEventKey *);
@@ -1291,9 +1291,11 @@ class Editor : public PublicEditor
 
        /* toolbar */
        
-       Gtk::ToggleButton        editor_mixer_button;
+       Gtk::ToggleButton editor_mixer_button;
+       Gtk::ToggleButton editor_list_button;
 
        void editor_mixer_button_toggled ();
+       void editor_list_button_toggled ();
 
        AudioClock               edit_cursor_clock;
        AudioClock               zoom_range_clock;
index 6e0b5f704b3397fe2c6ad0b4928730efb8df0ddf..52f30e7d5d02a0953180bf851e5382cbeb47850c 100644 (file)
@@ -69,6 +69,8 @@ Editor::register_actions ()
 
        act = ActionManager::register_toggle_action (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), mem_fun (*this, &Editor::editor_mixer_button_toggled));
        ActionManager::session_sensitive_actions.push_back (act);
+       act = ActionManager::register_toggle_action (editor_actions, "show-editor-list", _("Show Editor List"), mem_fun (*this, &Editor::editor_list_button_toggled));
+       ActionManager::session_sensitive_actions.push_back (act);
 
        RadioAction::Group crossfade_model_group;
 
index 9bb481966e4091d365233821e43b02ac8abe56ab..dee928b62f5c3eff346453313fe6f9e931fae5ca 100644 (file)
@@ -47,6 +47,16 @@ Editor::editor_mixer_button_toggled ()
        }
 }
 
+void
+Editor::editor_list_button_toggled ()
+{
+       Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-list"));
+       if (act) {
+               Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
+               show_editor_list (tact->get_active());
+       }
+}
+
 void
 Editor::cms_deleted ()
 {
@@ -130,6 +140,16 @@ Editor::show_editor_mixer (bool yn)
        }
 }
 
+void
+Editor::show_editor_list (bool yn)
+{
+       if (yn) {
+               the_notebook.show();
+       } else {
+               the_notebook.hide();
+       }
+}
+
 void
 Editor::set_selected_mixer_strip (TimeAxisView& view)
 {
@@ -335,6 +355,9 @@ Editor::session_going_away ()
 
        editor_mixer_button.set_active(false);
        editor_mixer_button.set_sensitive(false);
+       editor_list_button.set_active(false);
+       editor_list_button.set_sensitive(false);
+       
        /* clear tempo/meter rulers */
 
        remove_metric_marks ();
index 36f2ed59c89b0f8222e76a3eb69380e91927fda5..04ef8b46b07845c49efae61c51bc39754fa7cb76 100644 (file)
@@ -124,6 +124,7 @@ Editor::handle_new_route (Session::RouteList& routes)
        }
 
        editor_mixer_button.set_sensitive(true);
+       editor_list_button.set_sensitive(true);
 }
 
 void
@@ -167,6 +168,10 @@ Editor::remove_route (TimeAxisView *tv)
 
        if (track_views.size() == 0) {
                editor_mixer_button.set_sensitive(false);
+               
+               editor_list_button.set_active(false);
+               ActionManager::uncheck_toggleaction ("<Actions>/Editor/show-editor-list");
+               editor_list_button.set_sensitive(false);
        }
 }