update ();
}
+void
+ArdourGauge::blink (bool onoff)
+{
+ _blink = onoff;
+ queue_draw ();
+}
+
void
ArdourGauge::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t*)
{
Gtkmm2ext::set_source_rgba (cr, base);
cairo_fill (cr);
- if (alert ()) {
+ if (alert () && _blink) {
Gtkmm2ext::rounded_rectangle (cr, 1, 1, width - 2, height - 2, PADDING + 1);
cairo_set_source_rgba (cr, 0.5, 0, 0, 1.0);
cairo_fill (cr);
ArdourGauge (std::string const& max_text = "00.0%");
virtual ~ArdourGauge ();
+ void blink (bool onoff);
+
protected:
enum Status {
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
Glib::RefPtr<Pango::Layout> _layout;
+
+ bool _blink;
};
#endif
solo_blink (blink_on);
audition_blink (blink_on);
feedback_blink (blink_on);
+
+ dsp_load_indicator.blink(blink_on);
+ disk_space_indicator.blink(blink_on);
}
void
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::xrun_handler, where)
+ if (_session && _session->actively_recording()) {
+ dsp_load_indicator.set_xrun_while_recording();
+ }
+
if (_session && Config->get_create_xrun_marker() && _session->actively_recording()) {
create_xrun_marker(where);
}
#include "ardour_ui.h"
#include "dsp_load_indicator.h"
+#include "ardour/audioengine.h"
+
#include "pbd/i18n.h"
#define PADDING 3
: ArdourGauge ("00.0%")
, _dsp_load (0)
, _xrun_count (0)
+ , _xrun_while_recording (false)
{
}
bool
DspLoadIndicator::alert () const
{
- return _xrun_count > 0;
+ bool ret = false;
+
+ //xrun while recording
+ ret |= _xrun_while_recording;
+
+ //engine OFF
+ ret |= !ARDOUR::AudioEngine::instance()->running();
}
ArdourGauge::Status
DspLoadIndicator::tooltip_text ()
{
char buf[64];
+
+ //xruns
if (_xrun_count == UINT_MAX) {
snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: ?"), _dsp_load);
} else if (_xrun_count > 9999) {
} else {
snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: %u"), _dsp_load, _xrun_count);
}
+
return buf;
}
ARDOUR::Session* s = ARDOUR_UI::instance ()->the_session ();
if (s) {
s->reset_xrun_count ();
+ _xrun_while_recording = false;
}
return true;
}
void set_xrun_count (const unsigned int xruns);
void set_dsp_load (const double load);
+ void set_xrun_while_recording () {_xrun_while_recording = true;}
+
protected:
bool alert () const;
ArdourGauge::Status indicator () const;
float _dsp_load;
unsigned int _xrun_count;
+ bool _xrun_while_recording;
};
#endif