#include "gtk2ardour-config.h"
#endif
-#ifdef COMPILER_MSVC
-#define rintf(x) round((x) + 0.5)
-#endif
-
#include <cmath>
#include <iostream>
#include <set>
#include "ardour/audioengine.h"
#include "ardour/internal_return.h"
#include "ardour/internal_send.h"
+#include "ardour/meter.h"
#include "ardour/panner_shell.h"
#include "ardour/plugin_insert.h"
#include "ardour/pannable.h"
_button.signal_led_clicked.connect (sigc::mem_fun (*this, &ProcessorEntry::led_clicked));
_button.set_text (name (_width));
+ if (boost::dynamic_pointer_cast<PeakMeter> (_processor)) {
+ _button.set_elements(ArdourButton::Element(_button.elements() & ~ArdourButton::Indicator));
+ }
if (_processor) {
_vbox.pack_start (_routing_icon);
ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string const & n)
: _control (c)
, _adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0, 1, 0.01, 0.1)
- , _slider (&_adjustment, boost::shared_ptr<PBD::Controllable>(), 0, 13)
+ , _slider (&_adjustment, boost::shared_ptr<PBD::Controllable>(), 0, max(13.f, rintf(13.f * ARDOUR_UI::ui_scale)))
, _slider_persistant_tooltip (&_slider)
, _button (ArdourButton::led_default_elements)
, _ignore_ui_adjustment (false)
_plugin_insert->input_streams().n_audio() < _plugin_insert->natural_input_streams().n_audio()
)
{
- _routing_icon.set_size_request (-1, 7);
+ _routing_icon.set_size_request (-1, std::max (7.f, rintf(7.f * ARDOUR_UI::ui_scale)));
_routing_icon.set_visible(true);
_input_icon.show();
} else {
plugin_insert_splitting_changed ();
}
+ProcessorEntry::PortIcon::PortIcon(bool input) {
+ _input = input;
+ _ports = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1);
+ set_size_request (-1, std::max (2.f, rintf(2.f * ARDOUR_UI::ui_scale)));
+}
bool
ProcessorEntry::PortIcon::on_expose_event (GdkEventExpose* ev)
cairo_rectangle (cr, 0, 0, width, height);
cairo_fill (cr);
+ const double dx = rint(max(2., 2. * ARDOUR_UI::ui_scale));
if (_ports.n_total() > 1) {
for (uint32_t i = 0; i < _ports.n_total(); ++i) {
if (i < _ports.n_midi()) {
UINT_RGBA_B_FLT(audio_port_color));
}
const float x = rintf(width * (.2f + .6f * i / (_ports.n_total() - 1.f)));
- cairo_rectangle (cr, x-1, 0, 3, height);
+ cairo_rectangle (cr, x-dx * .5, 0, 1+dx, height);
cairo_fill(cr);
}
} else if (_ports.n_total() == 1) {
UINT_RGBA_B_FLT(audio_port_color));
}
const float x = rintf(width * .5);
- cairo_rectangle (cr, x-1, 0, 3, height);
+ cairo_rectangle (cr, x-dx * .5, 0, 1+dx, height);
cairo_fill(cr);
cairo_stroke(cr);
}
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, max (1.f, ARDOUR_UI::ui_scale));
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
Gtk::Allocation a = get_allocation();
if (_session->engine().connected()) {
/* XXX giving an error message here is hard, because we may be in the midst of a button press */
- if (!one_processor_can_be_edited ()) return true;
+ if (!one_processor_can_be_edited ()) {
+ return true;
+ }
if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
generic_edit_processor (processor);