Fix Latency GUI numeric entry
This commit is contained in:
parent
4f9a91cab8
commit
7f2a59ca66
|
@ -59,11 +59,33 @@ LatencyBarController::get_label (double&)
|
|||
_latency_gui->adjustment.get_value(), _latency_gui->sample_rate, true);
|
||||
}
|
||||
|
||||
void
|
||||
LatencyGUIControllable::set_value (double v, PBD::Controllable::GroupControlDisposition group_override)
|
||||
{
|
||||
_latency_gui->adjustment.set_value (v);
|
||||
}
|
||||
|
||||
double
|
||||
LatencyGUIControllable::get_value () const
|
||||
{
|
||||
return _latency_gui->adjustment.get_value ();
|
||||
}
|
||||
double
|
||||
LatencyGUIControllable::lower() const
|
||||
{
|
||||
return _latency_gui->adjustment.get_lower ();
|
||||
}
|
||||
|
||||
double
|
||||
LatencyGUIControllable::upper() const
|
||||
{
|
||||
return _latency_gui->adjustment.get_upper ();
|
||||
}
|
||||
|
||||
LatencyGUI::LatencyGUI (Latent& l, samplepos_t sr, samplepos_t psz)
|
||||
: _latent (l)
|
||||
, sample_rate (sr)
|
||||
, period_size (psz)
|
||||
, ignored (new PBD::IgnorableControllable())
|
||||
, _ignore_change (false)
|
||||
, adjustment (0, 0.0, sample_rate, 1.0, sample_rate / 1000.0f) /* max 1 second, step by samples, page by msecs */
|
||||
, bc (adjustment, this)
|
||||
|
|
|
@ -42,13 +42,38 @@ namespace ARDOUR {
|
|||
|
||||
class LatencyGUI;
|
||||
|
||||
class LatencyGUIControllable : public PBD::Controllable
|
||||
{
|
||||
public:
|
||||
LatencyGUIControllable (LatencyGUI* g)
|
||||
: PBD::Controllable ("ignoreMe")
|
||||
, _latency_gui (g)
|
||||
{}
|
||||
|
||||
void set_value (double v, PBD::Controllable::GroupControlDisposition group_override);
|
||||
double get_value () const;
|
||||
double lower() const;
|
||||
double upper() const;
|
||||
double internal_to_interface (double i, bool rotary = false) const {
|
||||
return i;
|
||||
}
|
||||
double interface_to_internal (double i, bool rotary = false) const {
|
||||
return i;
|
||||
}
|
||||
|
||||
private:
|
||||
LatencyGUI* _latency_gui;
|
||||
};
|
||||
|
||||
class LatencyBarController : public ArdourWidgets::BarController
|
||||
{
|
||||
public:
|
||||
LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g)
|
||||
: BarController (adj, boost::shared_ptr<PBD::IgnorableControllable> (new PBD::IgnorableControllable ())),
|
||||
_latency_gui (g)
|
||||
{}
|
||||
: BarController (adj, boost::shared_ptr<PBD::Controllable> (new LatencyGUIControllable (g)))
|
||||
, _latency_gui (g)
|
||||
{
|
||||
set_digits (0);
|
||||
}
|
||||
|
||||
private:
|
||||
LatencyGUI* _latency_gui;
|
||||
|
@ -72,8 +97,6 @@ private:
|
|||
samplepos_t sample_rate;
|
||||
samplepos_t period_size;
|
||||
|
||||
boost::shared_ptr<PBD::IgnorableControllable> ignored;
|
||||
|
||||
bool _ignore_change;
|
||||
Gtk::Adjustment adjustment;
|
||||
LatencyBarController bc;
|
||||
|
@ -88,6 +111,7 @@ private:
|
|||
void change_latency_from_button (int dir);
|
||||
|
||||
friend class LatencyBarController;
|
||||
friend class LatencyGUIControllable;
|
||||
|
||||
static std::vector<std::string> unit_strings;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue