Rewrote MidiRingBuffer to more efficiently pack data (flat pack stamps, sizes, and...
[ardour.git] / gtk2_ardour / route_time_axis.cc
index 9684f74024b083469db5bfe8cfcdcc3dc1423874..4450118951f28b944b2b69a2e22fcda4de7dd774 100644 (file)
@@ -105,11 +105,6 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
 
        ignore_toggle = false;
 
-       mute_button->set_active (false);
-       solo_button->set_active (false);
-       
-       mute_button->set_name ("TrackMuteButton");
-       solo_button->set_name ("SoloButton");
        edit_group_button.set_name ("TrackGroupButton");
        playlist_button.set_name ("TrackPlaylistButton");
        automation_button.set_name ("TrackAutomationButton");
@@ -127,9 +122,9 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
        visual_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::visual_click));
        hide_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::hide_click));
 
-       solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press));
+       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));
-       mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press));
+       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));
 
        if (is_track()) {
@@ -147,8 +142,8 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
                }
                rec_enable_button->show_all ();
 
-               rec_enable_button->set_name ("TrackRecordEnableButton");
-               rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
+               rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press), false);
+               rec_enable_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::rec_enable_release));
                controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
                ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
        }
@@ -180,15 +175,6 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
 
        /* remove focus from the buttons */
        
-       automation_button.unset_flags (Gtk::CAN_FOCUS);
-       solo_button->unset_flags (Gtk::CAN_FOCUS);
-       mute_button->unset_flags (Gtk::CAN_FOCUS);
-       edit_group_button.unset_flags (Gtk::CAN_FOCUS);
-       size_button.unset_flags (Gtk::CAN_FOCUS);
-       playlist_button.unset_flags (Gtk::CAN_FOCUS);
-       hide_button.unset_flags (Gtk::CAN_FOCUS);
-       visual_button.unset_flags (Gtk::CAN_FOCUS);
-
        y_position = -1;
 
        _route->mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
@@ -491,7 +477,6 @@ RouteTimeAxisView::build_display_menu ()
 
 static bool __reset_item (RadioMenuItem* item)
 {
-       cerr << "reset item to true\n";
        item->set_active ();
        return false;
 }
@@ -1006,6 +991,18 @@ RouteTimeAxisView::update_diskstream_display ()
 void
 RouteTimeAxisView::selection_click (GdkEventButton* ev)
 {
+       if (Keyboard::modifier_state_equals (ev->state, (Keyboard::Shift|Keyboard::Control))) {
+
+               /* special case: select/deselect all tracks */
+               if (editor.get_selection().selected (this)) {
+                       editor.get_selection().clear_tracks ();
+               } else {
+                       editor.select_all_tracks ();
+               }
+
+               return;
+       } 
+
        PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route->edit_group());
 
        switch (Keyboard::selection_type (ev->state)) {
@@ -1051,6 +1048,9 @@ RouteTimeAxisView::set_selected_regionviews (RegionSelection& regions)
        }
 }
 
+/** Add the selectable things that we have to a list.
+ * @param results List to add things to.
+ */
 void
 RouteTimeAxisView::get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable*>& results)
 {
@@ -1779,3 +1779,10 @@ RouteTimeAxisView::reset_redirect_automation_curves ()
        }
 }
 
+void
+RouteTimeAxisView::update_rec_display ()
+{
+       RouteUI::update_rec_display ();
+       name_entry.set_sensitive (!_route->record_enabled());
+}
+