processor routing: use small boxes (instead of circles) for ports
authorRobin Gareus <robin@gareus.org>
Thu, 9 Jan 2014 18:18:19 +0000 (19:18 +0100)
committerRobin Gareus <robin@gareus.org>
Thu, 9 Jan 2014 18:18:19 +0000 (19:18 +0100)
gtk2_ardour/processor_box.cc
gtk2_ardour/processor_box.h

index daab501daabb1622354919ef8bc1f2b45dbb36b7..106a301140708bf1c3ba1612a1e838b019e5073f 100644 (file)
@@ -706,9 +706,6 @@ ProcessorEntry::PortIcon::on_expose_event (GdkEventExpose* ev)
        cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
        cairo_clip (cr);
 
-       cairo_set_line_width (cr, 5.0);
-       cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
-
        Gtk::Allocation a = get_allocation();
        double const width = a.get_width();
        double const height = a.get_height();
@@ -719,8 +716,6 @@ ProcessorEntry::PortIcon::on_expose_event (GdkEventExpose* ev)
        cairo_rectangle (cr, 0, 0, width, height);
        cairo_fill (cr);
 
-       const double y0 = _input ? height-.5 : .5;
-
        if (_ports.n_total() > 1) {
                for (uint32_t i = 0; i < _ports.n_total(); ++i) {
                        if (i < _ports.n_midi()) {
@@ -734,10 +729,9 @@ ProcessorEntry::PortIcon::on_expose_event (GdkEventExpose* ev)
                                                UINT_RGBA_G_FLT(audio_port_color),
                                                UINT_RGBA_B_FLT(audio_port_color));
                        }
-                       const float x = rintf(width * (.2f + .6f * i / (_ports.n_total() - 1.f))) + .5f;
-                       cairo_move_to (cr, x, y0);
-                       cairo_close_path(cr);
-                       cairo_stroke(cr);
+                       const float x = rintf(width * (.2f + .6f * i / (_ports.n_total() - 1.f)));
+                       cairo_rectangle (cr, x-1, 0, 3, height);
+                       cairo_fill(cr);
                }
        } else if (_ports.n_total() == 1) {
                if (_ports.n_midi() == 1) {
@@ -751,8 +745,9 @@ ProcessorEntry::PortIcon::on_expose_event (GdkEventExpose* ev)
                                        UINT_RGBA_G_FLT(audio_port_color),
                                        UINT_RGBA_B_FLT(audio_port_color));
                }
-               cairo_move_to (cr, rintf(width * .5) + .5f, y0);
-               cairo_close_path(cr);
+               const float x = rintf(width * .5);
+               cairo_rectangle (cr, x-1, 0, 3, height);
+               cairo_fill(cr);
                cairo_stroke(cr);
        }
 
@@ -797,7 +792,7 @@ ProcessorEntry::RoutingIcon::on_expose_event (GdkEventExpose* ev)
                        UINT_RGBA_B_FLT(midi_port_color));
        if (midi_sources > 0 && midi_sinks > 0 && sinks > 1 && sources > 1) {
                for (uint32_t i = 0 ; i < midi_sources; ++i) {
-                       const float si_x = rintf(width * (.2f + .6f * i  / (sinks - 1.f))) + .5f;
+                       const float si_x  = rintf(width * (.2f + .6f * i  / (sinks - 1.f))) + .5f;
                        const float si_x0 = rintf(width * (.2f + .6f * i / (sources - 1.f))) + .5f;
                        cairo_move_to (cr, si_x, height);
                        cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
index d25710392eb081df104cfe1dd3fa6a3bc7548dcd..a66a6c4a5609db770f30494e06fb327fde556afe 100644 (file)
@@ -211,7 +211,7 @@ private:
                PortIcon(bool input) {
                        _input = input;
                        _ports = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1);
-                       set_size_request (-1, 3);
+                       set_size_request (-1, 2);
                }
                void set_ports(ARDOUR::ChanCount const ports) { _ports = ports; }
        private: