mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-03 20:29:35 +01:00
Consistently use Gauge to avoid the overloaded term Indicator.
This commit is contained in:
parent
cfed95fd0b
commit
fa22689b70
10 changed files with 63 additions and 66 deletions
|
|
@ -1684,9 +1684,9 @@ ARDOUR_UI::update_xrun_count ()
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1698,7 +1698,7 @@ ARDOUR_UI::update_cpu_load ()
|
|||
*/
|
||||
|
||||
double const c = AudioEngine::instance()->get_dsp_load ();
|
||||
dsp_load_indicator.set_dsp_load (c);
|
||||
dsp_load_gauge.set_dsp_load (c);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1720,7 +1720,7 @@ ARDOUR_UI::update_buffer_load ()
|
|||
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
|
||||
|
|
@ -1736,7 +1736,7 @@ 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;
|
||||
}
|
||||
|
||||
|
|
@ -1745,15 +1745,15 @@ ARDOUR_UI::update_disk_space()
|
|||
|
||||
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);
|
||||
|
|
@ -1764,11 +1764,7 @@ ARDOUR_UI::update_disk_space()
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2583,8 +2579,8 @@ ARDOUR_UI::blink_handler (bool blink_on)
|
|||
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
|
||||
|
|
@ -4873,7 +4869,7 @@ ARDOUR_UI::xrun_handler (samplepos_t where)
|
|||
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()) {
|
||||
|
|
|
|||
|
|
@ -74,9 +74,9 @@
|
|||
#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"
|
||||
|
|
@ -491,9 +491,10 @@ private:
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -696,10 +696,10 @@ ARDOUR_UI::build_menu_bar ()
|
|||
|
||||
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);
|
||||
|
|
@ -715,10 +715,10 @@ ARDOUR_UI::build_menu_bar ()
|
|||
// 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);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
#include "ardour_ui.h"
|
||||
#include "disk_io_indicator.h"
|
||||
#include "disk_io_gauge.h"
|
||||
|
||||
#include "ardour/audioengine.h"
|
||||
|
||||
|
|
@ -25,14 +25,14 @@
|
|||
|
||||
#define PADDING 3
|
||||
|
||||
DiskIoIndicator::DiskIoIndicator ()
|
||||
DiskIoGauge::DiskIoGauge ()
|
||||
: ArdourGauge ("00.0%")
|
||||
, _disk_io (0)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
DiskIoIndicator::set_disk_io (const double load)
|
||||
DiskIoGauge::set_disk_io (const double load)
|
||||
{
|
||||
if (load == _disk_io) {
|
||||
return;
|
||||
|
|
@ -45,18 +45,18 @@ DiskIoIndicator::set_disk_io (const double load)
|
|||
}
|
||||
|
||||
float
|
||||
DiskIoIndicator::level () const {
|
||||
DiskIoGauge::level () const {
|
||||
return (_disk_io / 100.f);
|
||||
}
|
||||
|
||||
bool
|
||||
DiskIoIndicator::alert () const
|
||||
DiskIoGauge::alert () const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ArdourGauge::Status
|
||||
DiskIoIndicator::indicator () const
|
||||
DiskIoGauge::indicator () const
|
||||
{
|
||||
if (_disk_io < 50) {
|
||||
return ArdourGauge::Level_CRIT;
|
||||
|
|
@ -68,7 +68,7 @@ DiskIoIndicator::indicator () const
|
|||
}
|
||||
|
||||
std::string
|
||||
DiskIoIndicator::tooltip_text ()
|
||||
DiskIoGauge::tooltip_text ()
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
|
|
@ -16,17 +16,17 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __gtkardour_disk_io_indicator_h__
|
||||
#define __gtkardour_disk_io_indicator_h__
|
||||
#ifndef __gtkardour_disk_io_gauge_h__
|
||||
#define __gtkardour_disk_io_gauge_h__
|
||||
|
||||
#include <pangomm.h>
|
||||
|
||||
#include "ardour_gauge.h"
|
||||
|
||||
class DiskIoIndicator : public ArdourGauge
|
||||
class DiskIoGauge : public ArdourGauge
|
||||
{
|
||||
public:
|
||||
DiskIoIndicator ();
|
||||
DiskIoGauge ();
|
||||
|
||||
void set_disk_io (const double load);
|
||||
|
||||
|
|
@ -17,20 +17,20 @@
|
|||
*/
|
||||
|
||||
#include "ardour_ui.h"
|
||||
#include "dsp_load_indicator.h"
|
||||
#include "dsp_load_gauge.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
#define PADDING 3
|
||||
|
||||
DiskSpaceIndicator::DiskSpaceIndicator ()
|
||||
DiskSpaceGauge::DiskSpaceGauge ()
|
||||
: ArdourGauge (">24h")
|
||||
, _sec (-1)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
DiskSpaceIndicator::set_available_disk_sec (float sec)
|
||||
DiskSpaceGauge::set_available_disk_sec (float sec)
|
||||
{
|
||||
if (_sec == sec) {
|
||||
return;
|
||||
|
|
@ -57,7 +57,7 @@ DiskSpaceIndicator::set_available_disk_sec (float sec)
|
|||
}
|
||||
|
||||
float
|
||||
DiskSpaceIndicator::level () const {
|
||||
DiskSpaceGauge::level () const {
|
||||
static const float lm = 6.f * 3600.f;
|
||||
if (_sec < 0) return 0;
|
||||
if (_sec > lm) return 1.0;
|
||||
|
|
@ -65,13 +65,13 @@ DiskSpaceIndicator::level () const {
|
|||
}
|
||||
|
||||
bool
|
||||
DiskSpaceIndicator::alert () const
|
||||
DiskSpaceGauge::alert () const
|
||||
{
|
||||
return _sec >=0 && _sec < 60.f * 10.f;
|
||||
}
|
||||
|
||||
ArdourGauge::Status
|
||||
DiskSpaceIndicator::indicator () const
|
||||
DiskSpaceGauge::indicator () const
|
||||
{
|
||||
if (_sec > 3600.f) {
|
||||
return ArdourGauge::Level_OK;
|
||||
|
|
@ -82,7 +82,7 @@ DiskSpaceIndicator::indicator () const
|
|||
}
|
||||
|
||||
std::string
|
||||
DiskSpaceIndicator::tooltip_text ()
|
||||
DiskSpaceGauge::tooltip_text ()
|
||||
{
|
||||
if (_sec < 0) {
|
||||
return _("Unkown");
|
||||
|
|
@ -16,17 +16,17 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __gtkardour_disk_space_indicator_h__
|
||||
#define __gtkardour_disk_space_indicator_h__
|
||||
#ifndef __gtkardour_disk_space_gauge_h__
|
||||
#define __gtkardour_disk_space_gauge_h__
|
||||
|
||||
#include <pangomm.h>
|
||||
|
||||
#include "ardour_gauge.h"
|
||||
|
||||
class DiskSpaceIndicator : public ArdourGauge
|
||||
class DiskSpaceGauge : public ArdourGauge
|
||||
{
|
||||
public:
|
||||
DiskSpaceIndicator ();
|
||||
DiskSpaceGauge ();
|
||||
|
||||
void set_available_disk_sec (float);
|
||||
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
#include "ardour_ui.h"
|
||||
#include "dsp_load_indicator.h"
|
||||
#include "dsp_load_gauge.h"
|
||||
|
||||
#include "ardour/audioengine.h"
|
||||
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#define PADDING 3
|
||||
|
||||
DspLoadIndicator::DspLoadIndicator ()
|
||||
DspLoadGauge::DspLoadGauge ()
|
||||
: ArdourGauge ("00.0%")
|
||||
, _dsp_load (0)
|
||||
, _xrun_count (0)
|
||||
|
|
@ -34,7 +34,7 @@ DspLoadIndicator::DspLoadIndicator ()
|
|||
}
|
||||
|
||||
void
|
||||
DspLoadIndicator::set_xrun_count (const unsigned int xruns)
|
||||
DspLoadGauge::set_xrun_count (const unsigned int xruns)
|
||||
{
|
||||
if (xruns == _xrun_count) {
|
||||
return;
|
||||
|
|
@ -44,7 +44,7 @@ DspLoadIndicator::set_xrun_count (const unsigned int xruns)
|
|||
}
|
||||
|
||||
void
|
||||
DspLoadIndicator::set_dsp_load (const double load)
|
||||
DspLoadGauge::set_dsp_load (const double load)
|
||||
{
|
||||
if (load == _dsp_load) {
|
||||
return;
|
||||
|
|
@ -61,12 +61,12 @@ DspLoadIndicator::set_dsp_load (const double load)
|
|||
}
|
||||
|
||||
float
|
||||
DspLoadIndicator::level () const {
|
||||
DspLoadGauge::level () const {
|
||||
return (100.0-_dsp_load) / 100.f;
|
||||
}
|
||||
|
||||
bool
|
||||
DspLoadIndicator::alert () const
|
||||
DspLoadGauge::alert () const
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ DspLoadIndicator::alert () const
|
|||
}
|
||||
|
||||
ArdourGauge::Status
|
||||
DspLoadIndicator::indicator () const
|
||||
DspLoadGauge::indicator () const
|
||||
{
|
||||
if (_dsp_load > 90) {
|
||||
return ArdourGauge::Level_CRIT;
|
||||
|
|
@ -92,7 +92,7 @@ DspLoadIndicator::indicator () const
|
|||
}
|
||||
|
||||
std::string
|
||||
DspLoadIndicator::tooltip_text ()
|
||||
DspLoadGauge::tooltip_text ()
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ DspLoadIndicator::tooltip_text ()
|
|||
}
|
||||
|
||||
bool
|
||||
DspLoadIndicator::on_button_release_event (GdkEventButton *ev)
|
||||
DspLoadGauge::on_button_release_event (GdkEventButton *ev)
|
||||
{
|
||||
ARDOUR::Session* s = ARDOUR_UI::instance ()->the_session ();
|
||||
if (s) {
|
||||
|
|
@ -16,17 +16,17 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __gtkardour_dsp_load_indicator_h__
|
||||
#define __gtkardour_dsp_load_indicator_h__
|
||||
#ifndef __gtkardour_dsp_load_gauge_h__
|
||||
#define __gtkardour_dsp_load_gauge_h__
|
||||
|
||||
#include <pangomm.h>
|
||||
|
||||
#include "ardour_gauge.h"
|
||||
|
||||
class DspLoadIndicator : public ArdourGauge
|
||||
class DspLoadGauge : public ArdourGauge
|
||||
{
|
||||
public:
|
||||
DspLoadIndicator ();
|
||||
DspLoadGauge ();
|
||||
|
||||
void set_xrun_count (const unsigned int xruns);
|
||||
void set_dsp_load (const double load);
|
||||
|
|
@ -65,10 +65,10 @@ gtk2_ardour_sources = [
|
|||
'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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue