mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Fix Latency GUI numeric entry
This commit is contained in:
parent
4f9a91cab8
commit
7f2a59ca66
2 changed files with 52 additions and 6 deletions
|
|
@ -59,11 +59,33 @@ LatencyBarController::get_label (double&)
|
||||||
_latency_gui->adjustment.get_value(), _latency_gui->sample_rate, true);
|
_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)
|
LatencyGUI::LatencyGUI (Latent& l, samplepos_t sr, samplepos_t psz)
|
||||||
: _latent (l)
|
: _latent (l)
|
||||||
, sample_rate (sr)
|
, sample_rate (sr)
|
||||||
, period_size (psz)
|
, period_size (psz)
|
||||||
, ignored (new PBD::IgnorableControllable())
|
|
||||||
, _ignore_change (false)
|
, _ignore_change (false)
|
||||||
, adjustment (0, 0.0, sample_rate, 1.0, sample_rate / 1000.0f) /* max 1 second, step by samples, page by msecs */
|
, adjustment (0, 0.0, sample_rate, 1.0, sample_rate / 1000.0f) /* max 1 second, step by samples, page by msecs */
|
||||||
, bc (adjustment, this)
|
, bc (adjustment, this)
|
||||||
|
|
|
||||||
|
|
@ -42,13 +42,38 @@ namespace ARDOUR {
|
||||||
|
|
||||||
class LatencyGUI;
|
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
|
class LatencyBarController : public ArdourWidgets::BarController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g)
|
LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g)
|
||||||
: BarController (adj, boost::shared_ptr<PBD::IgnorableControllable> (new PBD::IgnorableControllable ())),
|
: BarController (adj, boost::shared_ptr<PBD::Controllable> (new LatencyGUIControllable (g)))
|
||||||
_latency_gui (g)
|
, _latency_gui (g)
|
||||||
{}
|
{
|
||||||
|
set_digits (0);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LatencyGUI* _latency_gui;
|
LatencyGUI* _latency_gui;
|
||||||
|
|
@ -72,8 +97,6 @@ private:
|
||||||
samplepos_t sample_rate;
|
samplepos_t sample_rate;
|
||||||
samplepos_t period_size;
|
samplepos_t period_size;
|
||||||
|
|
||||||
boost::shared_ptr<PBD::IgnorableControllable> ignored;
|
|
||||||
|
|
||||||
bool _ignore_change;
|
bool _ignore_change;
|
||||||
Gtk::Adjustment adjustment;
|
Gtk::Adjustment adjustment;
|
||||||
LatencyBarController bc;
|
LatencyBarController bc;
|
||||||
|
|
@ -88,6 +111,7 @@ private:
|
||||||
void change_latency_from_button (int dir);
|
void change_latency_from_button (int dir);
|
||||||
|
|
||||||
friend class LatencyBarController;
|
friend class LatencyBarController;
|
||||||
|
friend class LatencyGUIControllable;
|
||||||
|
|
||||||
static std::vector<std::string> unit_strings;
|
static std::vector<std::string> unit_strings;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue