if (_session) {
const unsigned int x = _session->get_xrun_count ();
- dsp_load_indicator.set_xrun_count (x);
+ dsp_load_gauge.set_xrun_count (x);
} else {
- dsp_load_indicator.set_xrun_count (UINT_MAX);
+ dsp_load_gauge.set_xrun_count (UINT_MAX);
}
}
*/
double const c = AudioEngine::instance()->get_dsp_load ();
- dsp_load_indicator.set_dsp_load (c);
+ dsp_load_gauge.set_dsp_load (c);
}
void
uint32_t const playback = _session ? _session->playback_load () : 100;
uint32_t const capture = _session ? _session->capture_load () : 100;
uint32_t max_load = std::min ( playback, capture );
- disk_io_indicator.set_disk_io(max_load);
+ disk_io_gauge.set_disk_io(max_load);
}
void
ARDOUR_UI::update_disk_space()
{
if (_session == 0) {
- disk_space_indicator.set_available_disk_sec (-1);
+ disk_space_gauge.set_available_disk_sec (-1);
return;
}
if (fr == 0) {
/* skip update - no SR available */
- disk_space_indicator.set_available_disk_sec (-1);
+ disk_space_gauge.set_available_disk_sec (-1);
return;
}
if (!opt_samples) {
/* Available space is unknown */
- disk_space_indicator.set_available_disk_sec (-1);
+ disk_space_gauge.set_available_disk_sec (-1);
} else if (opt_samples.get_value_or (0) == max_samplecnt) {
- disk_space_indicator.set_available_disk_sec (max_samplecnt);
+ disk_space_gauge.set_available_disk_sec (max_samplecnt);
} else {
rec_enabled_streams = 0;
_session->foreach_route (this, &ARDOUR_UI::count_recenabled_streams, false);
samples /= rec_enabled_streams;
}
- int hrs;
- int mins;
- int secs;
-
- disk_space_indicator.set_available_disk_sec (samples / (float)fr);
+ disk_space_gauge.set_available_disk_sec (samples / (float)fr);
}
}
audition_blink (blink_on);
feedback_blink (blink_on);
- dsp_load_indicator.blink(blink_on);
- disk_space_indicator.blink(blink_on);
+ dsp_load_gauge.blink(blink_on);
+ disk_space_gauge.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();
+ dsp_load_gauge.set_xrun_while_recording();
}
if (_session && Config->get_create_xrun_marker() && _session->actively_recording()) {
#include "add_route_dialog.h"
#include "ardour_dialog.h"
#include "ardour_window.h"
-#include "dsp_load_indicator.h"
-#include "disk_space_indicator.h"
-#include "disk_io_indicator.h"
+#include "dsp_load_gauge.h"
+#include "disk_space_gauge.h"
+#include "disk_io_gauge.h"
#include "editing.h"
#include "enums.h"
#include "mini_timeline.h"
ShuttleControl shuttle_box;
MiniTimeline mini_timeline;
TimeInfoBox* time_info_box;
- DspLoadIndicator dsp_load_indicator;
- DiskIoIndicator disk_io_indicator;
- DiskSpaceIndicator disk_space_indicator;
+
+ DspLoadGauge dsp_load_gauge;
+ DiskIoGauge disk_io_gauge;
+ DiskSpaceGauge disk_space_gauge;
ArdourWidgets::ArdourVSpacer meterbox_spacer;
ArdourWidgets::ArdourVSpacer meterbox_spacer2;
hbox->pack_end (error_alert_button, false, false, 2);
- hbox->pack_end (dsp_load_indicator, false, false, 4);
+ hbox->pack_end (dsp_load_gauge, false, false, 4);
- hbox->pack_end (disk_space_indicator, false, false, 4);
- hbox->pack_end (disk_io_indicator, false, false, 4);
+ hbox->pack_end (disk_space_gauge, false, false, 4);
+ hbox->pack_end (disk_io_gauge, false, false, 4);
hbox->pack_end (sample_rate_label, false, false, 4);
hbox->pack_end (timecode_format_label, false, false, 4);
hbox->pack_end (format_label, false, false, 4);
// OSX provides its own wallclock, thank you very much
_status_bar_visibility.add (&wall_clock_label, X_("WallClock"), _("Wall Clock"), true);
#endif
- _status_bar_visibility.add (&disk_space_indicator, X_("Disk"), _("Disk Space"), !Profile->get_small_screen());
- _status_bar_visibility.add (&dsp_load_indicator, X_("DSP"), _("DSP"), true);
+ _status_bar_visibility.add (&disk_space_gauge, X_("Disk"), _("Disk Space"), !Profile->get_small_screen());
+ _status_bar_visibility.add (&dsp_load_gauge, X_("DSP"), _("DSP"), true);
_status_bar_visibility.add (&peak_thread_work_label,X_("Peakfile"), _("Active Peak-file Work"), false);
- _status_bar_visibility.add (&disk_io_indicator, X_("Buffers"), _("Buffers"), true);
+ _status_bar_visibility.add (&disk_io_gauge, X_("Buffers"), _("Buffers"), true);
_status_bar_visibility.add (&sample_rate_label, X_("Audio"), _("Audio"), true);
_status_bar_visibility.add (&timecode_format_label, X_("TCFormat"), _("Timecode Format"), true);
_status_bar_visibility.add (&format_label, X_("Format"), _("File Format"), true);
--- /dev/null
+/*
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "ardour_ui.h"
+#include "disk_io_gauge.h"
+
+#include "ardour/audioengine.h"
+
+#include "pbd/i18n.h"
+
+#define PADDING 3
+
+DiskIoGauge::DiskIoGauge ()
+ : ArdourGauge ("00.0%")
+ , _disk_io (0)
+{
+}
+
+void
+DiskIoGauge::set_disk_io (const double load)
+{
+ if (load == _disk_io) {
+ return;
+ }
+ _disk_io = load;
+
+ char buf[64];
+ snprintf (buf, sizeof (buf), "Dsk: %.1f%%", _disk_io);
+ update (std::string (buf));
+}
+
+float
+DiskIoGauge::level () const {
+ return (_disk_io / 100.f);
+}
+
+bool
+DiskIoGauge::alert () const
+{
+ return false;
+}
+
+ArdourGauge::Status
+DiskIoGauge::indicator () const
+{
+ if (_disk_io < 50) {
+ return ArdourGauge::Level_CRIT;
+ } else if (_disk_io < 75) {
+ return ArdourGauge::Level_WARN;
+ } else {
+ return ArdourGauge::Level_OK;
+ }
+}
+
+std::string
+DiskIoGauge::tooltip_text ()
+{
+ char buf[64];
+
+ snprintf (buf, sizeof (buf), _("Disk I/O cache: %.1f"), _disk_io);
+
+ return buf;
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __gtkardour_disk_io_gauge_h__
+#define __gtkardour_disk_io_gauge_h__
+
+#include <pangomm.h>
+
+#include "ardour_gauge.h"
+
+class DiskIoGauge : public ArdourGauge
+{
+public:
+ DiskIoGauge ();
+
+ void set_disk_io (const double load);
+
+protected:
+ bool alert () const;
+ ArdourGauge::Status indicator () const;
+ float level () const;
+ std::string tooltip_text ();
+
+private:
+
+ float _disk_io;
+};
+
+#endif
+++ /dev/null
-/*
- * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "ardour_ui.h"
-#include "disk_io_indicator.h"
-
-#include "ardour/audioengine.h"
-
-#include "pbd/i18n.h"
-
-#define PADDING 3
-
-DiskIoIndicator::DiskIoIndicator ()
- : ArdourGauge ("00.0%")
- , _disk_io (0)
-{
-}
-
-void
-DiskIoIndicator::set_disk_io (const double load)
-{
- if (load == _disk_io) {
- return;
- }
- _disk_io = load;
-
- char buf[64];
- snprintf (buf, sizeof (buf), "Dsk: %.1f%%", _disk_io);
- update (std::string (buf));
-}
-
-float
-DiskIoIndicator::level () const {
- return (_disk_io / 100.f);
-}
-
-bool
-DiskIoIndicator::alert () const
-{
- return false;
-}
-
-ArdourGauge::Status
-DiskIoIndicator::indicator () const
-{
- if (_disk_io < 50) {
- return ArdourGauge::Level_CRIT;
- } else if (_disk_io < 75) {
- return ArdourGauge::Level_WARN;
- } else {
- return ArdourGauge::Level_OK;
- }
-}
-
-std::string
-DiskIoIndicator::tooltip_text ()
-{
- char buf[64];
-
- snprintf (buf, sizeof (buf), _("Disk I/O cache: %.1f"), _disk_io);
-
- return buf;
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef __gtkardour_disk_io_indicator_h__
-#define __gtkardour_disk_io_indicator_h__
-
-#include <pangomm.h>
-
-#include "ardour_gauge.h"
-
-class DiskIoIndicator : public ArdourGauge
-{
-public:
- DiskIoIndicator ();
-
- void set_disk_io (const double load);
-
-protected:
- bool alert () const;
- ArdourGauge::Status indicator () const;
- float level () const;
- std::string tooltip_text ();
-
-private:
-
- float _disk_io;
-};
-
-#endif
--- /dev/null
+/*
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "ardour_ui.h"
+#include "dsp_load_gauge.h"
+
+#include "pbd/i18n.h"
+
+#define PADDING 3
+
+DiskSpaceGauge::DiskSpaceGauge ()
+ : ArdourGauge (">24h")
+ , _sec (-1)
+{
+}
+
+void
+DiskSpaceGauge::set_available_disk_sec (float sec)
+{
+ if (_sec == sec) {
+ return;
+ }
+ _sec = sec;
+
+ if (sec < 0) {
+ update (_("N/A"));
+ return;
+ }
+
+ char buf[64];
+ if (_sec > 86400) {
+ update (_("Rec: >24h"));
+ return;
+ } else if (_sec > 32400 /* 9 hours */) {
+ snprintf (buf, sizeof (buf), "Rec: %.0fh", _sec / 3600.f);
+ } else if (_sec > 5940 /* 99 mins */) {
+ snprintf (buf, sizeof (buf), "Rec: %.1fh", _sec / 3600.f);
+ } else {
+ snprintf (buf, sizeof (buf), "Rec: %.0fm", _sec / 60.f);
+ }
+ update (std::string (buf));
+}
+
+float
+DiskSpaceGauge::level () const {
+ static const float lm = 6.f * 3600.f;
+ if (_sec < 0) return 0;
+ if (_sec > lm) return 1.0;
+ return _sec / lm;
+}
+
+bool
+DiskSpaceGauge::alert () const
+{
+ return _sec >=0 && _sec < 60.f * 10.f;
+}
+
+ArdourGauge::Status
+DiskSpaceGauge::indicator () const
+{
+ if (_sec > 3600.f) {
+ return ArdourGauge::Level_OK;
+ } else if (_sec > 1800.f) {
+ return ArdourGauge::Level_WARN;
+ }
+ return ArdourGauge::Level_CRIT;
+}
+
+std::string
+DiskSpaceGauge::tooltip_text ()
+{
+ if (_sec < 0) {
+ return _("Unkown");
+ }
+
+ int sec = floor (_sec);
+ char buf[64];
+ int hrs = sec / 3600;
+ int mins = (sec / 60) % 60;
+ int secs = sec % 60;
+
+ snprintf (buf, sizeof(buf), _("%02dh:%02dm:%02ds"), hrs, mins, secs);
+ return _("Available capture disk-space: ") + std::string (buf);
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __gtkardour_disk_space_gauge_h__
+#define __gtkardour_disk_space_gauge_h__
+
+#include <pangomm.h>
+
+#include "ardour_gauge.h"
+
+class DiskSpaceGauge : public ArdourGauge
+{
+public:
+ DiskSpaceGauge ();
+
+ void set_available_disk_sec (float);
+
+protected:
+ bool alert () const;
+ ArdourGauge::Status indicator () const;
+ float level () const;
+ std::string tooltip_text ();
+
+private:
+ float _sec;
+};
+
+#endif
+++ /dev/null
-/*
- * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "ardour_ui.h"
-#include "dsp_load_indicator.h"
-
-#include "pbd/i18n.h"
-
-#define PADDING 3
-
-DiskSpaceIndicator::DiskSpaceIndicator ()
- : ArdourGauge (">24h")
- , _sec (-1)
-{
-}
-
-void
-DiskSpaceIndicator::set_available_disk_sec (float sec)
-{
- if (_sec == sec) {
- return;
- }
- _sec = sec;
-
- if (sec < 0) {
- update (_("N/A"));
- return;
- }
-
- char buf[64];
- if (_sec > 86400) {
- update (_("Rec: >24h"));
- return;
- } else if (_sec > 32400 /* 9 hours */) {
- snprintf (buf, sizeof (buf), "Rec: %.0fh", _sec / 3600.f);
- } else if (_sec > 5940 /* 99 mins */) {
- snprintf (buf, sizeof (buf), "Rec: %.1fh", _sec / 3600.f);
- } else {
- snprintf (buf, sizeof (buf), "Rec: %.0fm", _sec / 60.f);
- }
- update (std::string (buf));
-}
-
-float
-DiskSpaceIndicator::level () const {
- static const float lm = 6.f * 3600.f;
- if (_sec < 0) return 0;
- if (_sec > lm) return 1.0;
- return _sec / lm;
-}
-
-bool
-DiskSpaceIndicator::alert () const
-{
- return _sec >=0 && _sec < 60.f * 10.f;
-}
-
-ArdourGauge::Status
-DiskSpaceIndicator::indicator () const
-{
- if (_sec > 3600.f) {
- return ArdourGauge::Level_OK;
- } else if (_sec > 1800.f) {
- return ArdourGauge::Level_WARN;
- }
- return ArdourGauge::Level_CRIT;
-}
-
-std::string
-DiskSpaceIndicator::tooltip_text ()
-{
- if (_sec < 0) {
- return _("Unkown");
- }
-
- int sec = floor (_sec);
- char buf[64];
- int hrs = sec / 3600;
- int mins = (sec / 60) % 60;
- int secs = sec % 60;
-
- snprintf (buf, sizeof(buf), _("%02dh:%02dm:%02ds"), hrs, mins, secs);
- return _("Available capture disk-space: ") + std::string (buf);
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef __gtkardour_disk_space_indicator_h__
-#define __gtkardour_disk_space_indicator_h__
-
-#include <pangomm.h>
-
-#include "ardour_gauge.h"
-
-class DiskSpaceIndicator : public ArdourGauge
-{
-public:
- DiskSpaceIndicator ();
-
- void set_available_disk_sec (float);
-
-protected:
- bool alert () const;
- ArdourGauge::Status indicator () const;
- float level () const;
- std::string tooltip_text ();
-
-private:
- float _sec;
-};
-
-#endif
--- /dev/null
+/*
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "ardour_ui.h"
+#include "dsp_load_gauge.h"
+
+#include "ardour/audioengine.h"
+
+#include "pbd/i18n.h"
+
+#define PADDING 3
+
+DspLoadGauge::DspLoadGauge ()
+ : ArdourGauge ("00.0%")
+ , _dsp_load (0)
+ , _xrun_count (0)
+ , _xrun_while_recording (false)
+{
+}
+
+void
+DspLoadGauge::set_xrun_count (const unsigned int xruns)
+{
+ if (xruns == _xrun_count) {
+ return;
+ }
+ _xrun_count = xruns;
+ update ();
+}
+
+void
+DspLoadGauge::set_dsp_load (const double load)
+{
+ if (load == _dsp_load) {
+ return;
+ }
+ _dsp_load = load;
+
+ char buf[64];
+ if (_xrun_count > 0) {
+ snprintf (buf, sizeof (buf), "DSP: %.1f%% (%d)", _dsp_load, _xrun_count);
+ } else {
+ snprintf (buf, sizeof (buf), "DSP: %.1f%%", _dsp_load);
+ }
+ update (std::string (buf));
+}
+
+float
+DspLoadGauge::level () const {
+ return (100.0-_dsp_load) / 100.f;
+}
+
+bool
+DspLoadGauge::alert () const
+{
+ bool ret = false;
+
+ //xrun while recording
+ ret |= _xrun_while_recording;
+
+ //engine OFF
+ ret |= !ARDOUR::AudioEngine::instance()->running();
+
+ return ret;
+}
+
+ArdourGauge::Status
+DspLoadGauge::indicator () const
+{
+ if (_dsp_load > 90) {
+ return ArdourGauge::Level_CRIT;
+ } else if (_dsp_load > 80) {
+ return ArdourGauge::Level_WARN;
+ } else {
+ return ArdourGauge::Level_OK;
+ }
+}
+
+std::string
+DspLoadGauge::tooltip_text ()
+{
+ char buf[64];
+
+ //xruns
+ if (_xrun_count == UINT_MAX) {
+ snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: ?\nClick to clear xruns."), _dsp_load);
+ } else if (_xrun_count > 9999) {
+ snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: >10k\nClick to clear xruns."), _dsp_load);
+ } else {
+ snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: %u\nClick to clear xruns."), _dsp_load, _xrun_count);
+ }
+
+ return buf;
+}
+
+bool
+DspLoadGauge::on_button_release_event (GdkEventButton *ev)
+{
+ ARDOUR::Session* s = ARDOUR_UI::instance ()->the_session ();
+ if (s) {
+ s->reset_xrun_count ();
+ _xrun_while_recording = false;
+ queue_draw();
+ }
+ return true;
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __gtkardour_dsp_load_gauge_h__
+#define __gtkardour_dsp_load_gauge_h__
+
+#include <pangomm.h>
+
+#include "ardour_gauge.h"
+
+class DspLoadGauge : public ArdourGauge
+{
+public:
+ DspLoadGauge ();
+
+ 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 level () const;
+ std::string tooltip_text ();
+
+private:
+ bool on_button_release_event (GdkEventButton*);
+
+ float _dsp_load;
+ unsigned int _xrun_count;
+ bool _xrun_while_recording;
+};
+
+#endif
+++ /dev/null
-/*
- * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "ardour_ui.h"
-#include "dsp_load_indicator.h"
-
-#include "ardour/audioengine.h"
-
-#include "pbd/i18n.h"
-
-#define PADDING 3
-
-DspLoadIndicator::DspLoadIndicator ()
- : ArdourGauge ("00.0%")
- , _dsp_load (0)
- , _xrun_count (0)
- , _xrun_while_recording (false)
-{
-}
-
-void
-DspLoadIndicator::set_xrun_count (const unsigned int xruns)
-{
- if (xruns == _xrun_count) {
- return;
- }
- _xrun_count = xruns;
- update ();
-}
-
-void
-DspLoadIndicator::set_dsp_load (const double load)
-{
- if (load == _dsp_load) {
- return;
- }
- _dsp_load = load;
-
- char buf[64];
- if (_xrun_count > 0) {
- snprintf (buf, sizeof (buf), "DSP: %.1f%% (%d)", _dsp_load, _xrun_count);
- } else {
- snprintf (buf, sizeof (buf), "DSP: %.1f%%", _dsp_load);
- }
- update (std::string (buf));
-}
-
-float
-DspLoadIndicator::level () const {
- return (100.0-_dsp_load) / 100.f;
-}
-
-bool
-DspLoadIndicator::alert () const
-{
- bool ret = false;
-
- //xrun while recording
- ret |= _xrun_while_recording;
-
- //engine OFF
- ret |= !ARDOUR::AudioEngine::instance()->running();
-
- return ret;
-}
-
-ArdourGauge::Status
-DspLoadIndicator::indicator () const
-{
- if (_dsp_load > 90) {
- return ArdourGauge::Level_CRIT;
- } else if (_dsp_load > 80) {
- return ArdourGauge::Level_WARN;
- } else {
- return ArdourGauge::Level_OK;
- }
-}
-
-std::string
-DspLoadIndicator::tooltip_text ()
-{
- char buf[64];
-
- //xruns
- if (_xrun_count == UINT_MAX) {
- snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: ?\nClick to clear xruns."), _dsp_load);
- } else if (_xrun_count > 9999) {
- snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: >10k\nClick to clear xruns."), _dsp_load);
- } else {
- snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: %u\nClick to clear xruns."), _dsp_load, _xrun_count);
- }
-
- return buf;
-}
-
-bool
-DspLoadIndicator::on_button_release_event (GdkEventButton *ev)
-{
- ARDOUR::Session* s = ARDOUR_UI::instance ()->the_session ();
- if (s) {
- s->reset_xrun_count ();
- _xrun_while_recording = false;
- queue_draw();
- }
- return true;
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef __gtkardour_dsp_load_indicator_h__
-#define __gtkardour_dsp_load_indicator_h__
-
-#include <pangomm.h>
-
-#include "ardour_gauge.h"
-
-class DspLoadIndicator : public ArdourGauge
-{
-public:
- DspLoadIndicator ();
-
- 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 level () const;
- std::string tooltip_text ();
-
-private:
- bool on_button_release_event (GdkEventButton*);
-
- float _dsp_load;
- unsigned int _xrun_count;
- bool _xrun_while_recording;
-};
-
-#endif
'cursor_context.cc',
'curvetest.cc',
'debug.cc',
- 'disk_space_indicator.cc',
+ 'disk_space_gauge.cc',
'duplicate_routes_dialog.cc',
- 'disk_io_indicator.cc',
- 'dsp_load_indicator.cc',
+ 'disk_io_gauge.cc',
+ 'dsp_load_gauge.cc',
'edit_note_dialog.cc',
'editing.cc',
'editor.cc',