ardour
|
#include <ControlList.hpp>
Classes | |
struct | LookupCache |
struct | SearchCache |
Public Types | |
enum | InterpolationStyle { Discrete, Linear, Curved } |
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 |
Public Member Functions | |
ControlList (const Parameter &id, const ParameterDescriptor &desc) | |
ControlList (const ControlList &) | |
ControlList (const ControlList &, double start, double end) | |
virtual | ~ControlList () |
virtual boost::shared_ptr < ControlList > | create (const Parameter &id, const ParameterDescriptor &desc) |
void | dump (std::ostream &) |
ControlList & | operator= (const ControlList &) |
bool | operator== (const ControlList &) |
void | copy_events (const ControlList &) |
virtual void | freeze () |
virtual void | thaw () |
bool | frozen () const |
const Parameter & | parameter () const |
void | set_parameter (const Parameter &p) |
const ParameterDescriptor & | descriptor () const |
void | set_descriptor (const ParameterDescriptor &d) |
EventList::size_type | size () const |
double | length () const |
bool | empty () const |
void | reset_default (double val) |
void | clear () |
void | x_scale (double factor) |
bool | extend_to (double) |
void | slide (iterator before, double distance) |
void | shift (double before, double distance) |
virtual void | add (double when, double value, bool with_guards=true, bool with_default=true) |
virtual void | editor_add (double when, double value) |
void | fast_simple_add (double when, double value) |
void | erase_range (double start, double end) |
void | erase (iterator) |
void | erase (iterator, iterator) |
void | erase (double, double) |
bool | move_ranges (std::list< RangeMove< double > > const &) |
void | modify (iterator, double, double) |
void | thin (double thinning_factor) |
boost::shared_ptr< ControlList > | cut (double, double) |
boost::shared_ptr< ControlList > | copy (double, double) |
void | clear (double, double) |
bool | paste (const ControlList &, double position, float times) |
void | set_yrange (double min, double max) |
double | get_max_y () const |
double | get_min_y () const |
void | truncate_end (double length) |
void | truncate_start (double length) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
ControlEvent * | back () |
const ControlEvent * | back () const |
ControlEvent * | front () |
const ControlEvent * | front () const |
std::pair < ControlList::iterator, ControlList::iterator > | control_points_adjacent (double when) |
template<class T > | |
void | apply_to_points (T &obj, void(T::*method)(const ControlList &)) |
double | eval (double where) |
double | rt_safe_eval (double where, bool &ok) |
const EventList & | events () const |
double | default_value () const |
Glib::Threads::RWLock & | lock () const |
LookupCache & | lookup_cache () const |
SearchCache & | search_cache () const |
double | unlocked_eval (double x) const |
bool | rt_safe_earliest_event (double start, double &x, double &y, bool start_inclusive=false) const |
bool | rt_safe_earliest_event_unlocked (double start, double &x, double &y, bool start_inclusive=false) const |
bool | rt_safe_earliest_event_linear_unlocked (double start, double &x, double &y, bool inclusive) const |
bool | rt_safe_earliest_event_discrete_unlocked (double start, double &x, double &y, bool inclusive) const |
void | create_curve () |
void | destroy_curve () |
Curve & | curve () |
const Curve & | curve () const |
void | mark_dirty () const |
InterpolationStyle | interpolation () const |
void | set_interpolation (InterpolationStyle) |
virtual bool | touching () const |
virtual bool | writing () const |
virtual bool | touch_enabled () const |
void | start_write_pass (double time) |
void | write_pass_finished (double when, double thinning_factor=0.0) |
void | set_in_write_pass (bool, bool add_point=false, double when=0.0) |
bool | in_write_pass () const |
bool | operator!= (ControlList const &) const |
void | invalidate_insert_iterator () |
Static Public Member Functions | |
static bool | time_comparator (const ControlEvent *a, const ControlEvent *b) |
Public Attributes | |
PBD::Signal0< void > | Dirty |
PBD::Signal1< void, InterpolationStyle > | InterpolationChanged |
Protected Member Functions | |
double | multipoint_eval (double x) const |
void | build_search_cache_if_necessary (double start) const |
boost::shared_ptr< ControlList > | cut_copy_clear (double, double, int op) |
bool | erase_range_internal (double start, double end, EventList &) |
void | maybe_add_insert_guard (double when) |
iterator | erase_from_iterator_to (iterator iter, double when) |
bool | maybe_insert_straight_line (double when, double value) |
virtual void | maybe_signal_changed () |
void | _x_scale (double factor) |
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 |
double | _min_yval |
double | _max_yval |
double | _default_value |
bool | _sort_pending |
Curve * | _curve |
Private Member Functions | |
void | unlocked_invalidate_insert_iterator () |
void | add_guard_point (double when) |
Private Attributes | |
iterator | most_recent_insert_iterator |
double | 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 78 of file ControlList.hpp.
typedef EventList::const_iterator Evoral::ControlList::const_iterator |
Definition at line 84 of file ControlList.hpp.
typedef EventList::const_reverse_iterator Evoral::ControlList::const_reverse_iterator |
Definition at line 85 of file ControlList.hpp.
typedef std::list<ControlEvent*> Evoral::ControlList::EventList |
Definition at line 81 of file ControlList.hpp.
typedef EventList::iterator Evoral::ControlList::iterator |
Definition at line 82 of file ControlList.hpp.
typedef EventList::reverse_iterator Evoral::ControlList::reverse_iterator |
Definition at line 83 of file ControlList.hpp.
Enumerator | |
---|---|
Discrete | |
Linear | |
Curved |
Definition at line 253 of file ControlList.hpp.
Evoral::ControlList::ControlList | ( | const Parameter & | id, |
const ParameterDescriptor & | desc | ||
) |
Definition at line 53 of file ControlList.cpp.
Evoral::ControlList::ControlList | ( | const ControlList & | other | ) |
Definition at line 77 of file ControlList.cpp.
Evoral::ControlList::ControlList | ( | const ControlList & | other, |
double | start, | ||
double | end | ||
) |
Definition at line 103 of file ControlList.cpp.
|
virtual |
Definition at line 136 of file ControlList.cpp.
|
protected |
Definition at line 246 of file ControlList.cpp.
|
virtual |
Definition at line 549 of file ControlList.cpp.
|
private |
Definition at line 396 of file ControlList.cpp.
|
inline |
Definition at line 186 of file ControlList.hpp.
|
inline |
Definition at line 179 of file ControlList.hpp.
|
inline |
Definition at line 180 of file ControlList.hpp.
|
inline |
Definition at line 171 of file ControlList.hpp.
|
inline |
Definition at line 172 of file ControlList.hpp.
|
protected |
Definition at line 1243 of file ControlList.cpp.
void Evoral::ControlList::clear | ( | ) |
Definition at line 214 of file ControlList.cpp.
void Evoral::ControlList::clear | ( | double | start, |
double | end | ||
) |
Definition at line 1585 of file ControlList.cpp.
std::pair< ControlList::iterator, ControlList::iterator > Evoral::ControlList::control_points_adjacent | ( | double | when | ) |
Definition at line 833 of file ControlList.cpp.
boost::shared_ptr< ControlList > Evoral::ControlList::copy | ( | double | start, |
double | end | ||
) |
Definition at line 1579 of file ControlList.cpp.
void Evoral::ControlList::copy_events | ( | const ControlList & | other | ) |
Definition at line 176 of file ControlList.cpp.
|
virtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 146 of file ControlList.cpp.
void Evoral::ControlList::create_curve | ( | ) |
Definition at line 191 of file ControlList.cpp.
|
inline |
Definition at line 248 of file ControlList.hpp.
|
inline |
Definition at line 249 of file ControlList.hpp.
boost::shared_ptr< ControlList > Evoral::ControlList::cut | ( | double | start, |
double | end | ||
) |
Definition at line 1573 of file ControlList.cpp.
|
protected |
start | Start position in model coordinates. |
end | End position in model coordinates. |
op | 0 = cut, 1 = copy, 2 = clear. |
Definition at line 1476 of file ControlList.cpp.
|
inline |
Definition at line 226 of file ControlList.hpp.
|
inline |
Definition at line 107 of file ControlList.hpp.
void Evoral::ControlList::destroy_curve | ( | ) |
Definition at line 197 of file ControlList.cpp.
void Evoral::ControlList::dump | ( | std::ostream & | ) |
Definition at line 1748 of file ControlList.cpp.
|
virtual |
Definition at line 455 of file ControlList.cpp.
|
inline |
Definition at line 115 of file ControlList.hpp.
|
inline |
Definition at line 173 of file ControlList.hpp.
|
inline |
Definition at line 174 of file ControlList.hpp.
void Evoral::ControlList::erase | ( | iterator | i | ) |
Definition at line 672 of file ControlList.cpp.
Definition at line 686 of file ControlList.cpp.
void Evoral::ControlList::erase | ( | double | when, |
double | value | ||
) |
Erase the first event which matches the given time and value
Definition at line 699 of file ControlList.cpp.
|
protected |
Definition at line 532 of file ControlList.cpp.
void Evoral::ControlList::erase_range | ( | double | start, |
double | end | ||
) |
Definition at line 723 of file ControlList.cpp.
|
protected |
Definition at line 743 of file ControlList.cpp.
|
inline |
Definition at line 191 of file ControlList.hpp.
|
inline |
Definition at line 225 of file ControlList.hpp.
bool Evoral::ControlList::extend_to | ( | double | when | ) |
Definition at line 234 of file ControlList.cpp.
void Evoral::ControlList::fast_simple_add | ( | double | when, |
double | value | ||
) |
Definition at line 329 of file ControlList.cpp.
|
virtual |
Definition at line 866 of file ControlList.cpp.
|
inline |
Definition at line 181 of file ControlList.hpp.
|
inline |
Definition at line 182 of file ControlList.hpp.
|
inline |
Definition at line 102 of file ControlList.hpp.
|
inline |
Definition at line 165 of file ControlList.hpp.
|
inline |
Definition at line 166 of file ControlList.hpp.
bool Evoral::ControlList::in_write_pass | ( | ) | const |
Definition at line 449 of file ControlList.cpp.
|
inline |
Definition at line 259 of file ControlList.hpp.
void Evoral::ControlList::invalidate_insert_iterator | ( | ) |
Definition at line 339 of file ControlList.cpp.
|
inline |
Definition at line 111 of file ControlList.hpp.
|
inline |
Definition at line 229 of file ControlList.hpp.
|
inline |
Definition at line 230 of file ControlList.hpp.
void Evoral::ControlList::mark_dirty | ( | ) | const |
Definition at line 892 of file ControlList.cpp.
|
protected |
Definition at line 484 of file ControlList.cpp.
|
protected |
If we would just be adding to a straight line, move the previous point instead.
Definition at line 504 of file ControlList.cpp.
|
protectedvirtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 204 of file ControlList.cpp.
void Evoral::ControlList::modify | ( | iterator | iter, |
double | when, | ||
double | val | ||
) |
Definition at line 803 of file ControlList.cpp.
bool Evoral::ControlList::move_ranges | ( | std::list< RangeMove< double > > const & | movements | ) |
Move automation around according to a list of region movements.
return | true if anything was changed, otherwise false (ie nothing needed changing) |
Definition at line 1651 of file ControlList.cpp.
|
protected |
Called by unlocked_eval() to handle cases of 3 or more control points.
Definition at line 1169 of file ControlList.cpp.
bool Evoral::ControlList::operator!= | ( | ControlList const & | other | ) | const |
Definition at line 1720 of file ControlList.cpp.
ControlList & Evoral::ControlList::operator= | ( | const ControlList & | other | ) |
Definition at line 158 of file ControlList.cpp.
bool Evoral::ControlList::operator== | ( | const ControlList & | other | ) |
Definition at line 152 of file ControlList.cpp.
|
inline |
Definition at line 104 of file ControlList.hpp.
bool Evoral::ControlList::paste | ( | const ControlList & | alist, |
double | pos, | ||
float | times | ||
) |
pos | Position in model coordinates |
Definition at line 1592 of file ControlList.cpp.
|
inline |
Definition at line 175 of file ControlList.hpp.
|
inline |
Definition at line 176 of file ControlList.hpp.
|
inline |
Definition at line 177 of file ControlList.hpp.
|
inline |
Definition at line 178 of file ControlList.hpp.
|
inline |
Definition at line 117 of file ControlList.hpp.
bool Evoral::ControlList::rt_safe_earliest_event | ( | double | start, |
double & | x, | ||
double & | y, | ||
bool | inclusive = false |
||
) | const |
Get the earliest event after start using the current interpolation style.
If an event is found, x and y are set to its coordinates.
inclusive | Include events with timestamp exactly equal to start |
Definition at line 1276 of file ControlList.cpp.
bool Evoral::ControlList::rt_safe_earliest_event_discrete_unlocked | ( | double | start, |
double & | x, | ||
double & | y, | ||
bool | inclusive | ||
) | const |
Get the earliest event after start without interpolation.
If an event is found, x and y are set to its coordinates.
inclusive | Include events with timestamp exactly equal to start |
Definition at line 1314 of file ControlList.cpp.
bool Evoral::ControlList::rt_safe_earliest_event_linear_unlocked | ( | double | start, |
double & | x, | ||
double & | y, | ||
bool | inclusive | ||
) | const |
Get the earliest time the line crosses an integer (Linear interpolation).
If an event is found, x and y are set to its coordinates.
inclusive | Include events with timestamp exactly equal to start |
Definition at line 1355 of file ControlList.cpp.
bool Evoral::ControlList::rt_safe_earliest_event_unlocked | ( | double | start, |
double & | x, | ||
double & | y, | ||
bool | inclusive = false |
||
) | const |
Get the earliest event after start using the current interpolation style.
If an event is found, x and y are set to its coordinates.
inclusive | Include events with timestamp exactly equal to start |
Definition at line 1296 of file ControlList.cpp.
|
inline |
Definition at line 196 of file ControlList.hpp.
|
inline |
Definition at line 231 of file ControlList.hpp.
|
inline |
Definition at line 108 of file ControlList.hpp.
void Evoral::ControlList::set_in_write_pass | ( | bool | yn, |
bool | add_point = false , |
||
double | when = 0.0 |
||
) |
Definition at line 384 of file ControlList.cpp.
void Evoral::ControlList::set_interpolation | ( | InterpolationStyle | s | ) |
Definition at line 1709 of file ControlList.cpp.
|
inline |
Definition at line 105 of file ControlList.hpp.
|
inline |
Definition at line 160 of file ControlList.hpp.
void Evoral::ControlList::shift | ( | double | before, |
double | distance | ||
) |
Definition at line 785 of file ControlList.cpp.
|
inline |
Definition at line 110 of file ControlList.hpp.
void Evoral::ControlList::slide | ( | iterator | before, |
double | distance | ||
) |
Definition at line 764 of file ControlList.cpp.
void Evoral::ControlList::start_write_pass | ( | double | time | ) |
Definition at line 352 of file ControlList.cpp.
|
virtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 872 of file ControlList.cpp.
void Evoral::ControlList::thin | ( | double | thinning_factor | ) |
Thin the number of events in this list.
The thinning factor has no units but corresponds to the area of a triangle computed between three points in the list. If the area is large, it indicates significant non-linearity between the points.
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.
Definition at line 262 of file ControlList.cpp.
|
inlinestatic |
Definition at line 207 of file ControlList.hpp.
|
inlinevirtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 264 of file ControlList.hpp.
|
inlinevirtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 262 of file ControlList.hpp.
void Evoral::ControlList::truncate_end | ( | double | length | ) |
Definition at line 908 of file ControlList.cpp.
void Evoral::ControlList::truncate_start | ( | double | length | ) |
Definition at line 1011 of file ControlList.cpp.
double Evoral::ControlList::unlocked_eval | ( | double | 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..
Definition at line 1112 of file ControlList.cpp.
|
private |
Definition at line 346 of file ControlList.cpp.
void Evoral::ControlList::write_pass_finished | ( | double | when, |
double | thinning_factor = 0.0 |
||
) |
Definition at line 371 of file ControlList.cpp.
|
inlinevirtual |
Reimplemented in ARDOUR::AutomationList.
Definition at line 263 of file ControlList.hpp.
void Evoral::ControlList::x_scale | ( | double | factor | ) |
Definition at line 227 of file ControlList.cpp.
|
protected |
Definition at line 307 of file ControlList.hpp.
|
protected |
Definition at line 313 of file ControlList.hpp.
|
protected |
Definition at line 310 of file ControlList.hpp.
|
protected |
Definition at line 303 of file ControlList.hpp.
|
protected |
Definition at line 305 of file ControlList.hpp.
|
protected |
Definition at line 306 of file ControlList.hpp.
|
private |
Definition at line 320 of file ControlList.hpp.
|
protected |
Definition at line 304 of file ControlList.hpp.
|
mutableprotected |
Definition at line 300 of file ControlList.hpp.
|
mutableprotected |
Definition at line 297 of file ControlList.hpp.
|
protected |
Definition at line 309 of file ControlList.hpp.
|
protected |
Definition at line 308 of file ControlList.hpp.
|
protected |
Definition at line 302 of file ControlList.hpp.
|
mutableprotected |
Definition at line 298 of file ControlList.hpp.
|
protected |
Definition at line 311 of file ControlList.hpp.
|
private |
Definition at line 319 of file ControlList.hpp.
|
mutable |
Emitted when mark_dirty() is called on this object
Definition at line 271 of file ControlList.hpp.
|
private |
Definition at line 317 of file ControlList.hpp.
PBD::Signal1<void, InterpolationStyle> Evoral::ControlList::InterpolationChanged |
Emitted when our interpolation style changes
Definition at line 273 of file ControlList.hpp.
|
private |
Definition at line 316 of file ControlList.hpp.
|
private |
Definition at line 318 of file ControlList.hpp.