Report init/callback thread to the framework
[ardour.git] / gtk2_ardour / route_time_axis.cc
index 7131be8fbd71ce05ce86b5d47d7124a3037cf9bd..588ba5601ba3351c0c5320c11c2605b9b00005f3 100644 (file)
@@ -130,6 +130,13 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
        visual_button.set_name ("TrackVisualButton");
        hide_button.set_name ("TrackRemoveButton");
 
+       edit_group_button.unset_flags (Gtk::CAN_FOCUS);
+       playlist_button.unset_flags (Gtk::CAN_FOCUS);
+       automation_button.unset_flags (Gtk::CAN_FOCUS);
+       size_button.unset_flags (Gtk::CAN_FOCUS);
+       visual_button.unset_flags (Gtk::CAN_FOCUS);
+       hide_button.unset_flags (Gtk::CAN_FOCUS);
+
        hide_button.add (*(manage (new Image (::get_icon("hide")))));
        hide_button.show_all ();
 
@@ -141,9 +148,9 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
        hide_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::hide_click));
 
        solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press), false);
-       solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release));
+       solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release), false);
        mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press), false);
-       mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
+       mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release), false);
 
        if (is_track()) {
 
@@ -507,7 +514,12 @@ RouteTimeAxisView::build_display_menu ()
 
        items.push_back (SeparatorElem());
        items.push_back (MenuElem (_("Hide"), mem_fun(*this, &RouteTimeAxisView::hide_click)));
-       items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
+       if (!Profile->get_sae()) {
+               items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
+       } else {
+               items.push_front (SeparatorElem());
+               items.push_front (MenuElem (_("Delete"), mem_fun(*this, &RouteUI::remove_this_route)));
+       }
 }
 
 static bool __reset_item (RadioMenuItem* item)
@@ -882,33 +894,30 @@ RouteTimeAxisView::resolve_new_group_playlist_name(std::string &basename, vector
 
        std::string group_string = "."+edit_group()->name()+".";
 
-       if (basename.find(group_string) == string::npos) {
-               int maxnumber = 0;
-
-               // iterate through all playlists
-               for (vector<boost::shared_ptr<Playlist> >::const_iterator i = playlists.begin(); i != playlists.end(); ++i) {
-                       std::string tmp = (*i)->name();
+       // iterate through all playlists
+       int maxnumber = 0;
+       for (vector<boost::shared_ptr<Playlist> >::const_iterator i = playlists.begin(); i != playlists.end(); ++i) {
+               std::string tmp = (*i)->name();
 
-                       std::string::size_type idx = tmp.find(group_string);                    
-                       // find those which belong to this group
-                       if (idx != string::npos) {
-                               tmp = tmp.substr(idx + group_string.length());
+               std::string::size_type idx = tmp.find(group_string);                    
+               // find those which belong to this group
+               if (idx != string::npos) {
+                       tmp = tmp.substr(idx + group_string.length());
 
-                               // and find the largest current number
-                               int x = atoi(tmp.c_str());
-                               if (x > maxnumber) {
-                                       maxnumber = x;
-                               }
+                       // and find the largest current number
+                       int x = atoi(tmp.c_str());
+                       if (x > maxnumber) {
+                               maxnumber = x;
                        }
                }
+       }
 
-               maxnumber++;
+       maxnumber++;
 
-               char buf[32];
-                snprintf (buf, sizeof(buf), "%d", maxnumber);
+       char buf[32];
+       snprintf (buf, sizeof(buf), "%d", maxnumber);
                
-               ret = this->name()+"."+edit_group()->name()+"."+buf;
-       }
+       ret = this->name()+"."+edit_group()->name()+"."+buf;
 
        return ret;
 }
@@ -1826,6 +1835,7 @@ RouteTimeAxisView::redirect_menu_item_toggled (RouteTimeAxisView::RedirectAutoma
                if (showit) {
                        ran->view->set_marked_for_display (true);
                        ran->view->canvas_display->show();
+                       ran->view->canvas_background->show();
                } else {
                        rai->redirect->mark_automation_visible (ran->what, true);
                        ran->view->set_marked_for_display (false);