2007-06-28 15:35:48 -04:00
|
|
|
#ifndef __gtk2_ardour_latency_gui_h__
|
|
|
|
#define __gtk2_ardour_latency_gui_h__
|
|
|
|
|
2007-06-27 18:06:35 -04:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <gtkmm/dialog.h>
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/adjustment.h>
|
|
|
|
|
|
|
|
#include <gtkmm2ext/barcontroller.h>
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/controllable.h"
|
2007-06-27 18:06:35 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/types.h"
|
2007-06-27 18:06:35 -04:00
|
|
|
|
|
|
|
#include "ardour_dialog.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Latent;
|
|
|
|
}
|
|
|
|
|
2009-06-21 22:00:25 -04:00
|
|
|
class LatencyGUI;
|
|
|
|
|
|
|
|
class LatencyBarController : public Gtkmm2ext::BarController
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g)
|
|
|
|
: BarController (adj, boost::shared_ptr<PBD::IgnorableControllable> (new PBD::IgnorableControllable ())),
|
|
|
|
_latency_gui (g) {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
LatencyGUI* _latency_gui;
|
|
|
|
|
|
|
|
std::string get_label (int&);
|
|
|
|
};
|
|
|
|
|
2007-06-27 18:06:35 -04:00
|
|
|
class LatencyGUI : public Gtk::VBox
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LatencyGUI (ARDOUR::Latent&, nframes64_t sample_rate, nframes64_t period_size);
|
|
|
|
~LatencyGUI() { }
|
|
|
|
|
|
|
|
void finish ();
|
|
|
|
void reset ();
|
|
|
|
void refresh ();
|
|
|
|
|
|
|
|
private:
|
|
|
|
ARDOUR::Latent& _latent;
|
|
|
|
nframes64_t initial_value;
|
|
|
|
nframes64_t sample_rate;
|
|
|
|
nframes64_t period_size;
|
2008-09-10 11:03:30 -04:00
|
|
|
boost::shared_ptr<PBD::IgnorableControllable> ignored;
|
2007-06-27 18:06:35 -04:00
|
|
|
|
|
|
|
Gtk::Adjustment adjustment;
|
2009-06-21 22:00:25 -04:00
|
|
|
LatencyBarController bc;
|
2007-06-27 18:06:35 -04:00
|
|
|
Gtk::HBox hbox1;
|
|
|
|
Gtk::HBox hbox2;
|
|
|
|
Gtk::HButtonBox hbbox;
|
|
|
|
Gtk::Button minus_button;
|
|
|
|
Gtk::Button plus_button;
|
|
|
|
Gtk::Button reset_button;
|
|
|
|
Gtk::ComboBoxText units_combo;
|
|
|
|
|
|
|
|
void change_latency_from_button (int dir);
|
|
|
|
|
2009-06-21 22:00:25 -04:00
|
|
|
friend class LatencyBarController;
|
|
|
|
|
2007-06-27 18:06:35 -04:00
|
|
|
static std::vector<std::string> unit_strings;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LatencyDialog : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LatencyDialog (const Glib::ustring& title, ARDOUR::Latent&, nframes64_t sample_rate, nframes64_t period_size);
|
|
|
|
~LatencyDialog() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
LatencyGUI lwidget;
|
|
|
|
};
|
2007-06-28 15:35:48 -04:00
|
|
|
|
|
|
|
#endif /* __gtk2_ardour_latency_gui_h__ */
|