2013-01-16 13:37:48 -05:00
|
|
|
/*
|
|
|
|
Copyright (C) 2012 Paul Davis
|
|
|
|
|
|
|
|
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
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) {}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-21 22:00:25 -04:00
|
|
|
private:
|
|
|
|
LatencyGUI* _latency_gui;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-01-27 20:04:33 -05:00
|
|
|
std::string get_label (double&);
|
2009-10-14 12:10:01 -04:00
|
|
|
};
|
2009-06-21 22:00:25 -04:00
|
|
|
|
2007-06-27 18:06:35 -04:00
|
|
|
class LatencyGUI : public Gtk::VBox
|
|
|
|
{
|
|
|
|
public:
|
2010-09-17 14:20:37 -04:00
|
|
|
LatencyGUI (ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size);
|
2007-06-27 18:06:35 -04:00
|
|
|
~LatencyGUI() { }
|
|
|
|
|
|
|
|
void finish ();
|
|
|
|
void reset ();
|
|
|
|
void refresh ();
|
|
|
|
|
|
|
|
private:
|
|
|
|
ARDOUR::Latent& _latent;
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t initial_value;
|
|
|
|
framepos_t sample_rate;
|
|
|
|
framepos_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:
|
2010-09-17 14:20:37 -04:00
|
|
|
LatencyDialog (const std::string& title, ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size);
|
2007-06-27 18:06:35 -04:00
|
|
|
~LatencyDialog() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
LatencyGUI lwidget;
|
|
|
|
};
|
2007-06-28 15:35:48 -04:00
|
|
|
|
|
|
|
#endif /* __gtk2_ardour_latency_gui_h__ */
|