Remove internal edit mode and add "content" tool.
[ardour.git] / gtk2_ardour / time_axis_view_item.cc
index 5948cebddd89d9c4696a5e5ef71b6ed83c554183..9df14240f587c2aaf9e362cc14f6eede9c736cbd 100644 (file)
@@ -169,6 +169,7 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
        group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
 
        fill_color = base_color;
+       _fill_color_name = "region base";
        samples_per_pixel = fpp;
        frame_position = start;
        item_duration = duration;
@@ -201,9 +202,9 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
                CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
 
                if (_recregion) {
-                       frame->set_outline_color (ARDOUR_UI::config()->get_RecordingRect());
+                       frame->set_outline_color (ARDOUR_UI::config()->color ("recording rect"));
                } else {
-                       frame->set_outline_color (ARDOUR_UI::config()->get_TimeAxisFrame());
+                       frame->set_outline_color (ARDOUR_UI::config()->color ("time axis frame"));
                }
        }
        
@@ -537,7 +538,7 @@ TimeAxisViewItem::set_selected(bool yn)
                if (!selection_frame) {
                        selection_frame = new ArdourCanvas::TimeRectangle (group);
                        selection_frame->set_fill (false);
-                       selection_frame->set_outline_color (ARDOUR_UI::config()->get_SelectedTimeAxisFrame());
+                       selection_frame->set_outline_color (ARDOUR_UI::config()->color ("selected time axis frame"));
                        selection_frame->set_ignore_events (true);
                }
                selection_frame->set (frame->get().shrink (1.0));
@@ -729,21 +730,19 @@ TimeAxisViewItem::fill_opacity () const
                return 130;
        }
 
-       uint32_t col = ARDOUR_UI::config()->get_FrameBase();
+       uint32_t col = ARDOUR_UI::config()->color_mod (_fill_color_name, _fill_color_name);
        return UINT_RGBA_A (col);
 }
 
 uint32_t
 TimeAxisViewItem::get_fill_color () const
 {
-        uint32_t f;
-       uint32_t o;
-
-       o = fill_opacity ();
+       uint32_t f;
+       uint32_t o = fill_opacity ();
 
        if (_selected) {
 
-                f = ARDOUR_UI::config()->get_SelectedFrameBase();
+               f = ARDOUR_UI::config()->color ("selected region base");
 
                if (o == 0) {
                        /* some condition of this item has set fill opacity to
@@ -756,10 +755,10 @@ TimeAxisViewItem::get_fill_color () const
        } else {
 
                if (_recregion) {
-                       f = ARDOUR_UI::config()->get_RecordingRect();
+                       f = ARDOUR_UI::config()->color ("recording rect");
                } else {
                        if ((!Config->get_show_name_highlight() || high_enough_for_name) && !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
-                               f = ARDOUR_UI::config()->get_FrameBase();
+                               f = ARDOUR_UI::config()->color_mod (_fill_color_name, _fill_color_name);
                        } else {
                                f = fill_color;
                        }
@@ -783,7 +782,7 @@ TimeAxisViewItem::set_frame_color()
        set_frame_gradient ();
 
        if (!_recregion) {
-               uint32_t f = ARDOUR_UI::config()->get_TimeAxisFrame();
+               uint32_t f = ARDOUR_UI::config()->color ("time axis frame");
 
                if (!rect_visible) {
                        /* make the frame outline be visible but rather transparent */
@@ -818,7 +817,7 @@ TimeAxisViewItem::set_frame_gradient ()
 
        v = min (1.0, v * (1.0 - ARDOUR_UI::config()->get_timeline_item_gradient_depth()));
        
-       ArdourCanvas::Color darker = ArdourCanvas::hsv_to_color (h, s, v, a);
+       ArdourCanvas::Color darker = ArdourCanvas::hsva_to_color (h, s, v, a);
        stops.push_back (std::make_pair (1.0, darker));
        
        frame->set_gradient (stops, true);
@@ -858,13 +857,10 @@ TimeAxisViewItem::frame_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle*
                item->set_fill (false);
                break;
        case GDK_ENTER_NOTIFY:
-               if (trackview.editor().effective_mouse_mode() == Editing::MouseObject &&
-                   !trackview.editor().internal_editing()) {
-                       /* never set this to be visible in internal
-                          edit mode. Note, however, that we do need to
-                          undo visibility (LEAVE_NOTIFY case above) no
-                          matter what the mode is.
-                       */
+               if (trackview.editor().effective_mouse_mode() == Editing::MouseObject) {
+                       /* Never set this to be visible in other modes.  Note, however,
+                          that we do need to undo visibility (LEAVE_NOTIFY case above) no
+                          matter what the mode is. */
                        item->set_fill (true);
                }
                break;
@@ -910,8 +906,8 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
                        if (!vestigial_frame) {
                                vestigial_frame = new ArdourCanvas::TimeRectangle (group, ArdourCanvas::Rect (0.0, 0.0, 2.0, trackview.current_height()));
                                CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
-                               vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_VestigialFrame());
-                               vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_VestigialFrame());
+                               vestigial_frame->set_outline_color (ARDOUR_UI::config()->color ("vestigial frame"));
+                               vestigial_frame->set_fill_color (ARDOUR_UI::config()->color ("vestigial frame"));
                                vestigial_frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
                        }