un-triple-buffer fastmeter (not finished), fix mixer strip name button, comment edito...
[ardour.git] / gtk2_ardour / editor_region_list.cc
index f9e4b5bcb15a6b33f52d754974e50a0459db9538..de0abee8bfc4cbfaaa8c277553e7b440bfcca129 100644 (file)
@@ -42,7 +42,6 @@ using namespace sigc;
 using namespace ARDOUR;
 using namespace Gtk;
 using namespace Editing;
-using namespace ActionManager;
 
 #define wave_cursor_width 43
 #define wave_cursor_height 61
@@ -262,6 +261,7 @@ Editor::add_audio_region_to_region_display (AudioRegion *region)
                
                TreeModel::iterator i;
                TreeModel::Children rows = region_list_model->children();
+               bool found_parent = false;
 
                for (i = rows.begin(); i != rows.end(); ++i) {
 
@@ -272,13 +272,14 @@ Editor::add_audio_region_to_region_display (AudioRegion *region)
                                
                                if (region->source_equivalent (*r)) {
                                        row = *(region_list_model->append ((*i).children()));
+                                       found_parent = true;
                                        break;
                                }
                        }
                }
 
-               if (i == rows.end()) {
-                       TreeModel::Row row = *(region_list_model->append());
+               if (!found_parent) {
+                       row = *(region_list_model->append());
                }
 
                
@@ -304,7 +305,7 @@ Editor::region_list_selection_changed()
                sensitive = false;
        }
        
-       for (vector<Glib::RefPtr<Gtk::Action> >::iterator i = region_list_selection_sensitive_actions.begin(); i != region_list_selection_sensitive_actions.end(); ++i) {
+       for (vector<Glib::RefPtr<Gtk::Action> >::iterator i = ActionManager::region_list_selection_sensitive_actions.begin(); i != ActionManager::region_list_selection_sensitive_actions.end(); ++i) {
                (*i)->set_sensitive (sensitive);
        }
 
@@ -329,9 +330,9 @@ void
 Editor::redisplay_regions ()
 {
        if (session) {
-               
+
                region_list_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
-               region_list_model.clear ();
+               region_list_model->clear ();
 
                /* now add everything we have, via a temporary list used to help with
                   sorting.
@@ -357,18 +358,11 @@ Editor::region_list_clear ()
 void
 Editor::build_region_list_menu ()
 {
-       region_list_menu = dynamic_cast<Menu*>(ui_manager->get_widget ("/RegionListMenu"));
+       region_list_menu = dynamic_cast<Menu*>(ActionManager::get_widget ("/RegionListMenu"));
                                               
        /* now grab specific menu items that we need */
 
-       toggle_full_region_list_action = ui_manager->get_action ("<Actions>/RegionList/rlShowAll");
-       
-       region_list_selection_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlHide"));
-       region_list_selection_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlAudition"));
-       region_list_selection_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlRemove"));
-
-       session_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlEmbedAudio"));
-       session_sensitive_actions.push_back (ui_manager->get_action ("<Actions>/RegionList/rlImportAudio"));
+       toggle_full_region_list_action = ActionManager::get_action ("<Actions>/RegionList/rlShowAll");
 }
 
 void