|
HikoGUI
A low latency retained GUI
|
Public Types | |
| using | super = observable_base<T> |
Public Types inherited from tt::detail::observable_base< T > | |
| using | value_type = T |
| using | notifier_type = notifier<void()> |
| using | callback_type = typename notifier_type::callback_type |
| using | callback_ptr_type = typename notifier_type::callback_ptr_type |
| using | time_point = typename hires_utc_clock::time_point |
| using | duration = typename hires_utc_clock::duration |
Public Member Functions | |
| observable_value (T const &value) noexcept | |
| T | load () const noexcept override |
| Get the current value. | |
| bool | store (T const &new_value) noexcept override |
| Set the value. | |
Public Member Functions inherited from tt::detail::observable_base< T > | |
| observable_base (observable_base const &)=delete | |
| observable_base (observable_base &&)=delete | |
| observable_base & | operator= (observable_base const &)=delete |
| observable_base & | operator= (observable_base &&)=delete |
| observable_base () noexcept | |
| Constructor. | |
| value_type | previous_value () const noexcept |
| Get the previous value. | |
| time_point | time_when_last_modified () const noexcept |
| Time when the value was modified last. | |
| duration | duration_since_last_modified () const noexcept |
| Duration since the value was last modified. | |
| float | animation_progress (duration animation_duration) const noexcept |
| The relative time since the start of the animation. | |
| value_type | load (duration animation_duration) const noexcept |
| Get the current value animated over the animation_duration. | |
| template<typename Callback > | |
| callback_ptr_type | subscribe (Callback &&callback) noexcept |
| Add a callback as a listener. | |
| void | unsubscribe (callback_ptr_type callback_ptr) noexcept |
| Remove a callback. | |
|
inlineoverridevirtualnoexcept |
Get the current value.
The value is often calculated directly from the cached values retrieved from notifications down the chain.
Implements tt::detail::observable_base< T >.
|
inlineoverridevirtualnoexcept |
Set the value.
The value is often not directly stored, but instead forwarded up the chain of observables. And then let the notifications flowing backward updated the cached values so that loads() will be quick.
| new_value | The new value |
Implements tt::detail::observable_base< T >.