2018-09-24 17:20:15 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
2019-08-02 17:26:43 -04:00
|
|
|
* 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.
|
2018-09-24 17:20:15 -04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
2019-08-02 17:26:43 -04:00
|
|
|
* 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.
|
2018-09-24 17:20:15 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _gtkardour_plugin_dspload_ui_h_
|
|
|
|
#define _gtkardour_plugin_dspload_ui_h_
|
|
|
|
|
|
|
|
#include <gtkmm/widget.h>
|
|
|
|
#include <gtkmm/table.h>
|
|
|
|
#include <gtkmm/label.h>
|
|
|
|
#include <gtkmm/drawingarea.h>
|
|
|
|
#include <gtkmm/separator.h>
|
|
|
|
|
|
|
|
#include "widgets/ardour_button.h"
|
|
|
|
|
2022-04-04 14:48:56 -04:00
|
|
|
#include "ardour/plug_insert_base.h"
|
2018-09-24 17:20:15 -04:00
|
|
|
|
|
|
|
class PluginLoadStatsGui : public Gtk::Table
|
|
|
|
{
|
|
|
|
public:
|
2022-04-04 14:48:56 -04:00
|
|
|
PluginLoadStatsGui (boost::shared_ptr<ARDOUR::PlugInsertBase>);
|
2018-09-24 17:20:15 -04:00
|
|
|
|
|
|
|
void start_updating ();
|
|
|
|
void stop_updating ();
|
|
|
|
|
2019-12-17 18:54:11 -05:00
|
|
|
double dsp_avg () const { return _valid ? _avg : -1; }
|
|
|
|
uint64_t dsp_max () const { return _valid ? _max : 0; }
|
2019-12-14 05:44:28 -05:00
|
|
|
|
2018-09-24 17:20:15 -04:00
|
|
|
private:
|
|
|
|
void update_cpu_label ();
|
|
|
|
bool draw_bar (GdkEventExpose*);
|
|
|
|
void clear_stats () {
|
2022-04-04 14:48:56 -04:00
|
|
|
_pib->clear_stats ();
|
2018-09-24 17:20:15 -04:00
|
|
|
}
|
|
|
|
|
2022-04-04 14:48:56 -04:00
|
|
|
boost::shared_ptr<ARDOUR::PlugInsertBase> _pib;
|
2018-09-24 17:20:15 -04:00
|
|
|
sigc::connection update_cpu_label_connection;
|
|
|
|
|
|
|
|
Gtk::Label _lbl_min;
|
|
|
|
Gtk::Label _lbl_max;
|
|
|
|
Gtk::Label _lbl_avg;
|
|
|
|
Gtk::Label _lbl_dev;
|
|
|
|
|
|
|
|
ArdourWidgets::ArdourButton _reset_button;
|
|
|
|
Gtk::DrawingArea _darea;
|
|
|
|
|
2021-06-28 16:47:39 -04:00
|
|
|
PBD::microseconds_t _min, _max;
|
2018-09-24 17:20:15 -04:00
|
|
|
double _avg, _dev;
|
|
|
|
bool _valid;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|