Ardour
9.0-pre0-582-g084a23a80d
|
#include <ControlList.h>
Classes | |
struct | LookupCache |
struct | OrderedPoint |
struct | SearchCache |
Public Types | |
enum | InterpolationStyle { Discrete , Linear , Curved , Logarithmic , Exponential } |
typedef std::list< ControlEvent * > | EventList |
typedef EventList::iterator | iterator |
typedef EventList::reverse_iterator | reverse_iterator |
typedef EventList::const_iterator | const_iterator |
typedef EventList::const_reverse_iterator | const_reverse_iterator |
typedef std::vector< OrderedPoint > | OrderedPoints |
Static Public Member Functions | |
static bool | time_comparator (const ControlEvent *a, const ControlEvent *b) |
Public Attributes | |
PBD::Signal< void()> | WritePassStarted |
PBD::Signal< void()> | Dirty |
PBD::Signal< void(InterpolationStyle)> | InterpolationChanged |
Public Attributes inherited from Temporal::TimeDomainProvider | |
PBD::Signal< void()> | TimeDomainChanged |
Public Attributes inherited from PBD::Destructible | |
PBD::Signal< void()> | Destroyed |
PBD::Signal< void()> | DropReferences |
Protected Member Functions | |
double | multipoint_eval (Temporal::timepos_t const &x) const |
void | build_search_cache_if_necessary (Temporal::timepos_t const &start) const |
std::shared_ptr< ControlList > | cut_copy_clear (Temporal::timepos_t const &, Temporal::timepos_t const &, int op) |
bool | erase_range_internal (Temporal::timepos_t const &start, Temporal::timepos_t const &end, EventList &) |
void | maybe_add_insert_guard (Temporal::timepos_t const &when) |
iterator | erase_from_iterator_to (iterator iter, Temporal::timepos_t const &when) |
bool | maybe_insert_straight_line (Temporal::timepos_t const &when, double value) |
virtual void | maybe_signal_changed () |
void | _x_scale (Temporal::ratio_t const &) |
Protected Member Functions inherited from Temporal::TimeDomainProvider | |
void | listen () |
Protected Attributes | |
LookupCache | _lookup_cache |
SearchCache | _search_cache |
Glib::Threads::RWLock | _lock |
Parameter | _parameter |
ParameterDescriptor | _desc |
InterpolationStyle | _interpolation |
EventList | _events |
int8_t | _frozen |
bool | _changed_when_thawed |
bool | _sort_pending |
Curve * | _curve |
Private Member Functions | |
void | unlocked_remove_duplicates () |
void | unlocked_invalidate_insert_iterator () |
void | add_guard_point (Temporal::timepos_t const &when, Temporal::timecnt_t const &offset) |
bool | is_sorted () const |
Temporal::timepos_t | ensure_time_domain (Temporal::timepos_t const &) const |
Private Attributes | |
iterator | most_recent_insert_iterator |
Temporal::timepos_t | insert_position |
bool | new_write_pass |
bool | did_write_during_pass |
bool | _in_write_pass |
A list (sequence) of time-stamped values for a control
Definition at line 89 of file ControlList.h.
typedef EventList::const_iterator Evoral::ControlList::const_iterator |
Definition at line 95 of file ControlList.h.
typedef EventList::const_reverse_iterator Evoral::ControlList::const_reverse_iterator |
Definition at line 96 of file ControlList.h.
typedef std::list<ControlEvent*> Evoral::ControlList::EventList |
Definition at line 92 of file ControlList.h.
typedef EventList::iterator Evoral::ControlList::iterator |
Definition at line 93 of file ControlList.h.
typedef std::vector<OrderedPoint> Evoral::ControlList::OrderedPoints |
Definition at line 178 of file ControlList.h.
typedef EventList::reverse_iterator Evoral::ControlList::reverse_iterator |
Definition at line 94 of file ControlList.h.
Enumerator | |
---|---|
Discrete | |
Linear | |
Curved | |
Logarithmic | |
Exponential |
Definition at line 329 of file ControlList.h.
Evoral::ControlList::ControlList | ( | const Parameter & | id, |
const ParameterDescriptor & | desc, | ||
Temporal::TimeDomainProvider const & | |||
) |
Evoral::ControlList::ControlList | ( | const ControlList & | , |
Temporal::timepos_t const & | start, | ||
Temporal::timepos_t const & | end | ||
) |
Evoral::ControlList::ControlList | ( | const ControlList & | ) |
|
virtual |
|
protected |
|
virtual |
Add an event to this list.
This method is intended to write automation in realtime. If the transport is stopped, guard-points will be added regardless of parameter with_guards.
when | absolute time in samples |
value | parameter value |
with_guards | if true, add guard-points |
with_initial | if true, add an initial point if the list is empty |
|
private |
|
inline |
Definition at line 251 of file ControlList.h.
|
inline |
Definition at line 244 of file ControlList.h.
|
inline |
Definition at line 245 of file ControlList.h.
|
inline |
Definition at line 236 of file ControlList.h.
|
inline |
Definition at line 237 of file ControlList.h.
|
protected |
void Evoral::ControlList::clear | ( | ) |
Remove all events from this list.
void Evoral::ControlList::clear | ( | Temporal::timepos_t const & | start, |
Temporal::timepos_t const & | end | ||
) |
Remove all events in the given time range from this list.
start | start of range (inclusive) in audio samples |
end | end of range (inclusive) in audio samples |
std::pair<ControlList::iterator,ControlList::iterator> Evoral::ControlList::control_points_adjacent | ( | Temporal::timepos_t const & | when | ) |
std::shared_ptr<ControlList> Evoral::ControlList::copy | ( | Temporal::timepos_t const & | , |
Temporal::timepos_t const & | |||
) |
void Evoral::ControlList::copy_events | ( | const ControlList & | ) |
|
virtual |
Reimplemented in ARDOUR::AutomationList.
void Evoral::ControlList::create_curve | ( | ) |
|
inline |
Definition at line 324 of file ControlList.h.
|
inline |
Definition at line 325 of file ControlList.h.
std::shared_ptr<ControlList> Evoral::ControlList::cut | ( | Temporal::timepos_t const & | , |
Temporal::timepos_t const & | |||
) |
|
protected |
|
virtual |
query default interpolation for parameter-descriptor
Reimplemented in ARDOUR::AutomationList.
|
inline |
Definition at line 118 of file ControlList.h.
void Evoral::ControlList::destroy_curve | ( | ) |
void Evoral::ControlList::dump | ( | std::ostream & | ) |
|
virtual |
Add an event to this list.
This method is intended for making manual changes from the GUI. An event will only be created if no other event exists at the given time.
when | absolute time in samples |
value | parameter value |
with_guard | if true, add guard-points |
|
virtual |
|
inline |
Definition at line 136 of file ControlList.h.
|
inline |
Definition at line 238 of file ControlList.h.
|
inline |
Definition at line 239 of file ControlList.h.
|
private |
void Evoral::ControlList::erase | ( | iterator | ) |
void Evoral::ControlList::erase | ( | Temporal::timepos_t const & | , |
double | |||
) |
|
protected |
void Evoral::ControlList::erase_range | ( | Temporal::timepos_t const & | start, |
Temporal::timepos_t const & | end | ||
) |
|
protected |
|
inline |
Queries the event value at the given time (takes a read-lock, not safe while writing automation).
where | absolute time in samples |
Definition at line 262 of file ControlList.h.
|
inline |
Definition at line 304 of file ControlList.h.
bool Evoral::ControlList::extend_to | ( | Temporal::timepos_t const & | ) |
void Evoral::ControlList::fast_simple_add | ( | Temporal::timepos_t const & | when, |
double | value | ||
) |
|
virtual |
Implements Temporal::TimeDomainSwapper.
|
virtual |
|
inline |
Definition at line 246 of file ControlList.h.
|
inline |
Definition at line 247 of file ControlList.h.
|
inline |
Definition at line 113 of file ControlList.h.
|
inline |
Definition at line 363 of file ControlList.h.
bool Evoral::ControlList::in_write_pass | ( | ) | const |
|
inline |
query interpolation style of the automation data
Definition at line 340 of file ControlList.h.
void Evoral::ControlList::invalidate_insert_iterator | ( | ) |
|
private |
|
inline |
Definition at line 132 of file ControlList.h.
void Evoral::ControlList::list_merge | ( | ControlList const & | other, |
std::function< double(double, double)> | callback | ||
) |
|
inline |
Definition at line 307 of file ControlList.h.
|
inline |
Definition at line 308 of file ControlList.h.
void Evoral::ControlList::mark_dirty | ( | ) | const |
|
protected |
|
protected |
|
protectedvirtual |
Reimplemented in ARDOUR::AutomationList.
void Evoral::ControlList::modify | ( | iterator | , |
Temporal::timepos_t const & | , | ||
double | |||
) |
bool Evoral::ControlList::move_ranges | ( | std::list< Temporal::RangeMove > const & | ) |
|
protected |
Called by unlocked_eval() to handle cases of 3 or more control points.
bool Evoral::ControlList::operator!= | ( | ControlList const & | ) | const |
ControlList& Evoral::ControlList::operator= | ( | const ControlList & | ) |
bool Evoral::ControlList::operator== | ( | const ControlList & | ) |
|
inline |
Definition at line 115 of file ControlList.h.
bool Evoral::ControlList::paste | ( | const ControlList & | , |
Temporal::timepos_t const & | |||
) |
|
inline |
Definition at line 240 of file ControlList.h.
|
inline |
Definition at line 241 of file ControlList.h.
|
inline |
Definition at line 242 of file ControlList.h.
|
inline |
Definition at line 243 of file ControlList.h.
bool Evoral::ControlList::rt_safe_earliest_event_discrete_unlocked | ( | Temporal::timepos_t const & | start, |
Temporal::timepos_t & | x, | ||
double & | y, | ||
bool | inclusive | ||
) | const |
bool Evoral::ControlList::rt_safe_earliest_event_linear_unlocked | ( | Temporal::timepos_t const & | start, |
Temporal::timepos_t & | x, | ||
double & | y, | ||
bool | inclusive, | ||
Temporal::timecnt_t | min_x_delta = Temporal::timecnt_t::max() |
||
) | const |
|
inline |
Realtime safe version of eval(). This may fail if a read-lock cannot be taken.
where | absolute time in samples |
ok | boolean reference if returned value is valid |
Definition at line 274 of file ControlList.h.
|
inline |
Definition at line 309 of file ControlList.h.
|
inline |
Definition at line 119 of file ControlList.h.
void Evoral::ControlList::set_in_write_pass | ( | bool | , |
bool | add_point = false , |
||
Temporal::timepos_t | = std::numeric_limits< Temporal::timepos_t >::min() |
||
) |
bool Evoral::ControlList::set_interpolation | ( | InterpolationStyle | is | ) |
Sets the interpolation style of the automation data.
This will fail when asking for Logarithmic scale and min,max crosses 0 or Exponential scale with min != 0.
is | interpolation style |
|
inline |
Definition at line 116 of file ControlList.h.
void Evoral::ControlList::shift | ( | Temporal::timepos_t const & | before, |
Temporal::timecnt_t const & | distance | ||
) |
|
inline |
Definition at line 121 of file ControlList.h.
void Evoral::ControlList::slide | ( | iterator | before, |
Temporal::timecnt_t const & | distance | ||
) |
|
virtual |
Implements Temporal::TimeDomainSwapper.
void Evoral::ControlList::start_write_pass | ( | Temporal::timepos_t const & | ) |
|
virtual |
Reimplemented in ARDOUR::AutomationList.
void Evoral::ControlList::thin | ( | double | thinning_factor | ) |
Thin the number of events in this list.
The thinning factor corresponds to the area of a triangle computed between three points in the list (time-difference * value-difference). If the area is large, it indicates significant non-linearity between the points.
Time is measured in samples, value is usually normalized to 0..1.
During automation recording we thin the recorded points using this value. If a point is sufficiently co-linear with its neighbours (as defined by the area of the triangle formed by three of them), we will not include it in the list. The larger the value, the more points are excluded, so this effectively measures the amount of thinning to be done.
thinning_factor | area-size (default: 20) |
|
inlinestatic |
Definition at line 285 of file ControlList.h.
|
inlinevirtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 357 of file ControlList.h.
|
inlinevirtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 355 of file ControlList.h.
void Evoral::ControlList::truncate_end | ( | Temporal::timepos_t const & | last_coordinate | ) |
Remove all events after the given time from this list.
last_coordinate | time in audio samples of the last event to keep |
void Evoral::ControlList::truncate_start | ( | Temporal::timecnt_t const & | overall_length | ) |
Remove all events up to to the given time from this list.
overall_length | overall length |
double Evoral::ControlList::unlocked_eval | ( | Temporal::timepos_t const & | x | ) | const |
Called by locked entry point and various private locations where we already hold the lock.
FIXME: Should this be private? Curve needs it..
|
private |
|
private |
|
inline |
Definition at line 124 of file ControlList.h.
void Evoral::ControlList::write_pass_finished | ( | Temporal::timepos_t const & | , |
double | thinning_factor = 0.0 |
||
) |
|
inlinevirtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 356 of file ControlList.h.
void Evoral::ControlList::x_scale | ( | Temporal::ratio_t const & | ) |
void Evoral::ControlList::y_transform | ( | std::function< double(double)> | callback | ) |
|
protected |
Definition at line 406 of file ControlList.h.
|
protected |
Definition at line 409 of file ControlList.h.
|
protected |
Definition at line 402 of file ControlList.h.
|
protected |
Definition at line 404 of file ControlList.h.
|
protected |
Definition at line 405 of file ControlList.h.
|
private |
Definition at line 416 of file ControlList.h.
|
protected |
Definition at line 403 of file ControlList.h.
|
mutableprotected |
Definition at line 399 of file ControlList.h.
|
mutableprotected |
Definition at line 396 of file ControlList.h.
|
protected |
Definition at line 401 of file ControlList.h.
|
mutableprotected |
Definition at line 397 of file ControlList.h.
|
protected |
Definition at line 407 of file ControlList.h.
|
private |
Definition at line 415 of file ControlList.h.
|
mutable |
Emitted when mark_dirty() is called on this object
Definition at line 367 of file ControlList.h.
|
private |
Definition at line 413 of file ControlList.h.
PBD::Signal<void(InterpolationStyle)> Evoral::ControlList::InterpolationChanged |
Emitted when our interpolation style changes
Definition at line 369 of file ControlList.h.
|
private |
Definition at line 412 of file ControlList.h.
|
private |
Definition at line 414 of file ControlList.h.
PBD::Signal<void()> Evoral::ControlList::WritePassStarted |
Definition at line 365 of file ControlList.h.