ardour
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
AutomationLine Class Reference

#include <automation_line.h>

Inheritance diagram for AutomationLine:
PBD::StatefulDestructible PBD::Stateful PBD::Destructible AudioRegionGainLine MidiAutomationLine

Classes

class  ContiguousControlPoints
 

Public Types

enum  VisibleAspects { Line = 0x1, ControlPoints = 0x2, SelectedControlPoints = 0x4 }
 

Public Member Functions

 AutomationLine (const std::string &name, TimeAxisView &tv, ArdourCanvas::Item &parent, boost::shared_ptr< ARDOUR::AutomationList > al, const ARDOUR::ParameterDescriptor &desc, Evoral::TimeConverter< double, ARDOUR::framepos_t > *converter=0)
 
virtual ~AutomationLine ()
 
void queue_reset ()
 
void reset ()
 
void clear ()
 
void set_selected_points (PointSelection const &)
 
void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list< Selectable * > &)
 
void get_inverted_selectables (Selection &, std::list< Selectable * > &results)
 
virtual void remove_point (ControlPoint &)
 
bool control_points_adjacent (double xval, uint32_t &before, uint32_t &after)
 
virtual void start_drag_single (ControlPoint *, double, float)
 
virtual void start_drag_line (uint32_t, uint32_t, float)
 
virtual void start_drag_multiple (std::list< ControlPoint * >, float, XMLNode *)
 
virtual std::pair< double, float > drag_motion (double, float, bool, bool with_push, uint32_t &final_index)
 
virtual void end_drag (bool with_push, uint32_t final_index)
 
ControlPointnth (uint32_t)
 
ControlPoint const * nth (uint32_t) const
 
uint32_t npoints () const
 
std::string name () const
 
bool visible () const
 
guint32 height () const
 
void set_line_color (uint32_t)
 
uint32_t get_line_color () const
 
void set_visibility (VisibleAspects)
 
void add_visibility (VisibleAspects)
 
void remove_visibility (VisibleAspects)
 
void hide ()
 
void set_height (guint32)
 
void set_uses_gain_mapping (bool yn)
 
bool get_uses_gain_mapping () const
 
ArdourCanvas::Container & canvas_group () const
 
ArdourCanvas::Item & parent_group () const
 
ArdourCanvas::Item & grab_item () const
 
virtual std::string get_verbose_cursor_string (double) const
 
std::string get_verbose_cursor_relative_string (double, double) const
 
std::string fraction_to_string (double) const
 
std::string fraction_to_relative_string (double, double) const
 
double string_to_fraction (std::string const &) const
 
void view_to_model_coord (double &x, double &y) const
 
void view_to_model_coord_y (double &) const
 
void model_to_view_coord (double &x, double &y) const
 
void model_to_view_coord_y (double &) const
 
void set_list (boost::shared_ptr< ARDOUR::AutomationList > list)
 
boost::shared_ptr
< ARDOUR::AutomationList
the_list () const
 
void track_entered ()
 
void track_exited ()
 
bool is_last_point (ControlPoint &)
 
bool is_first_point (ControlPoint &)
 
XMLNodeget_state (void)
 
int set_state (const XMLNode &, int version)
 
void set_colors ()
 
void modify_point_y (ControlPoint &, double)
 
virtual MementoCommandBinder
< ARDOUR::AutomationList > * 
memento_command_binder ()
 
const Evoral::TimeConverter
< double, ARDOUR::framepos_t > & 
time_converter () const
 
std::pair< ARDOUR::framepos_t,
ARDOUR::framepos_t
get_point_x_range () const
 
void set_maximum_time (ARDOUR::framecnt_t)
 
ARDOUR::framecnt_t maximum_time () const
 
void set_offset (ARDOUR::framecnt_t)
 
void set_width (ARDOUR::framecnt_t)
 
framepos_t session_position (ARDOUR::AutomationList::const_iterator) const
 
- Public Member Functions inherited from PBD::Stateful
 Stateful ()
 
virtual ~Stateful ()
 
virtual bool apply_changes (PropertyBase const &)
 
PropertyChange apply_changes (PropertyList const &)
 
const OwnedPropertyListproperties () const
 
void add_property (PropertyBase &s)
 
void add_extra_xml (XMLNode &)
 
XMLNodeextra_xml (const std::string &str, bool add_if_missing=false)
 
void save_extra_xml (const XMLNode &)
 
const PBD::IDid () const
 
bool set_id (const XMLNode &)
 
void set_id (const std::string &)
 
void reset_id ()
 
void clear_changes ()
 
virtual void clear_owned_changes ()
 
PropertyListget_changes_as_properties (Command *) const
 
virtual void rdiff (std::vector< Command * > &) const
 
bool changed () const
 
virtual PropertyListproperty_factory (const XMLNode &) const
 
virtual void suspend_property_changes ()
 
virtual void resume_property_changes ()
 
bool property_changes_suspended () const
 
- Public Member Functions inherited from PBD::Destructible
 Destructible ()
 
virtual ~Destructible ()
 
void drop_references ()
 

Public Attributes

TimeAxisViewtrackview
 
- Public Attributes inherited from PBD::Stateful
PBD::Signal1< void, const
PropertyChange & > 
PropertyChanged
 
- Public Attributes inherited from PBD::Destructible
PBD::Signal0< void > Destroyed
 
PBD::Signal0< void > DropReferences
 

Protected Types

typedef boost::shared_ptr
< ContiguousControlPoints
CCP
 

Protected Member Functions

bool sync_model_with_view_point (ControlPoint &)
 
bool sync_model_with_view_points (std::list< ControlPoint * >)
 
void start_drag_common (double, float)
 
void reset_callback (const Evoral::ControlList &)
 
void list_changed ()
 
virtual bool event_handler (GdkEvent *)
 
- Protected Member Functions inherited from PBD::Stateful
void add_instant_xml (XMLNode &, const std::string &directory_path)
 
XMLNodeinstant_xml (const std::string &str, const std::string &directory_path)
 
void add_properties (XMLNode &)
 
PropertyChange set_values (XMLNode const &)
 
virtual void post_set (const PropertyChange &)
 
virtual void send_change (const PropertyChange &)
 
virtual void mid_thaw (const PropertyChange &)
 

Protected Attributes

std::string _name
 
guint32 _height
 
uint32_t _line_color
 
boost::shared_ptr
< ARDOUR::AutomationList
alist
 
Evoral::TimeConverter< double,
ARDOUR::framepos_t > * 
_time_converter
 
bool _our_time_converter
 
VisibleAspects _visible
 
bool _uses_gain_mapping
 
bool terminal_points_can_slide
 
bool update_pending
 
bool have_timeout
 
bool no_draw
 
bool _is_boolean
 
bool did_push
 
ArdourCanvas::Item & _parent_group
 
ArdourCanvas::Container * group
 
ArdourCanvas::PolyLine * line
 
ArdourCanvas::Points line_points
 
std::vector< ControlPoint * > control_points
 
std::vector< CCPcontiguous_points
 
- Protected Attributes inherited from PBD::Stateful
XMLNode_extra_xml
 
XMLNode_instant_xml
 
PBD::PropertyChange _pending_changed
 
Glib::Threads::Mutex _lock
 
std::string _xml_node_name
 name of node to use for this object in XML More...
 
OwnedPropertyList_properties
 

Private Member Functions

bool is_stepped () const
 
void update_visibility ()
 
void reset_line_coords (ControlPoint &)
 
void add_visible_control_point (uint32_t, uint32_t, double, double, ARDOUR::AutomationList::iterator, uint32_t)
 
double control_point_box_size ()
 
void connect_to_list ()
 
void interpolation_changed (ARDOUR::AutomationList::InterpolationStyle)
 

Private Attributes

std::list< ControlPoint * > _drag_points
 points we are dragging More...
 
std::list< ControlPoint * > _push_points
 additional points we are dragging if "push" is enabled More...
 
bool _drag_had_movement
 true if the drag has seen movement, otherwise false More...
 
double _drag_x
 last x position of the drag, in units More...
 
double _drag_distance
 total x movement of the drag, in canvas units More...
 
double _last_drag_fraction
 last y position of the drag, as a fraction More...
 
ARDOUR::framecnt_t _offset
 
PBD::ScopedConnectionList _list_connections
 
ARDOUR::framecnt_t _maximum_time
 
const ARDOUR::ParameterDescriptor _desc
 

Friends

class ContiguousControlPoints
 
class AudioRegionGainLine
 

Additional Inherited Members

- Static Public Attributes inherited from PBD::Stateful
static int current_state_version = 0
 
static int loading_state_version = 0
 

Detailed Description

A GUI representation of an ARDOUR::AutomationList

Definition at line 55 of file automation_line.h.

Member Typedef Documentation

Definition at line 202 of file automation_line.h.

Member Enumeration Documentation

Enumerator
Line 
ControlPoints 
SelectedControlPoints 

Definition at line 58 of file automation_line.h.

Constructor & Destructor Documentation

AutomationLine::AutomationLine ( const std::string &  name,
TimeAxisView tv,
ArdourCanvas::Item &  parent,
boost::shared_ptr< ARDOUR::AutomationList al,
const ARDOUR::ParameterDescriptor desc,
Evoral::TimeConverter< double, ARDOUR::framepos_t > *  converter = 0 
)
Parameters
converterA TimeConverter whose origin_b is the start time of the AutomationList in session frames. This will not be deleted by AutomationLine.

Definition at line 77 of file automation_line.cc.

AutomationLine::~AutomationLine ( )
virtual

Definition at line 133 of file automation_line.cc.

Member Function Documentation

void AutomationLine::add_visibility ( VisibleAspects  va)

Definition at line 1127 of file automation_line.cc.

void AutomationLine::add_visible_control_point ( uint32_t  ,
uint32_t  ,
double  ,
double  ,
ARDOUR::AutomationList::iterator  ,
uint32_t   
)
private

Definition at line 1266 of file automation_line.cc.

ArdourCanvas::Container& AutomationLine::canvas_group ( ) const
inline

Definition at line 113 of file automation_line.h.

void AutomationLine::clear ( )

Definition at line 1108 of file automation_line.cc.

void AutomationLine::connect_to_list ( )
private

Definition at line 1313 of file automation_line.cc.

double AutomationLine::control_point_box_size ( )
private

Definition at line 212 of file automation_line.cc.

bool AutomationLine::control_points_adjacent ( double  xval,
uint32_t &  before,
uint32_t &  after 
)

Definition at line 825 of file automation_line.cc.

pair< double, float > AutomationLine::drag_motion ( double  x,
float  fraction,
bool  ignore_x,
bool  with_push,
uint32_t &  final_index 
)
virtual

Should be called to indicate motion during a drag.

Parameters
xNew x position of the drag in canvas units, or undefined if ignore_x == true.
fractionNew y fraction.
Returns
x position and y fraction that were actually used (once clamped).

Definition at line 641 of file automation_line.cc.

void AutomationLine::end_drag ( bool  with_push,
uint32_t  final_index 
)
virtual

Should be called to indicate the end of a drag

Reimplemented in AudioRegionGainLine.

Definition at line 749 of file automation_line.cc.

bool AutomationLine::event_handler ( GdkEvent *  event)
protectedvirtual

Definition at line 144 of file automation_line.cc.

string AutomationLine::fraction_to_relative_string ( double  original,
double  fraction 
) const
Parameters
originalan old y-axis fraction
fractionthe new y fraction
Returns
string representation of the difference between original and fraction, using dB if appropriate.

Definition at line 405 of file automation_line.cc.

string AutomationLine::fraction_to_string ( double  fraction) const
Parameters
fractiony fraction
Returns
string representation of this value, using dB if appropriate.

Definition at line 375 of file automation_line.cc.

void AutomationLine::get_inverted_selectables ( Selection ,
std::list< Selectable * > &  results 
)

Definition at line 929 of file automation_line.cc.

uint32_t AutomationLine::get_line_color ( ) const
inline

Definition at line 100 of file automation_line.h.

pair< framepos_t, framepos_t > AutomationLine::get_point_x_range ( ) const
Returns
min and max x positions of points that are in the list, in session frames

Definition at line 1346 of file automation_line.cc.

void AutomationLine::get_selectables ( ARDOUR::framepos_t  start,
ARDOUR::framepos_t  end,
double  botfrac,
double  topfrac,
std::list< Selectable * > &  results 
)

Get selectable points within an area.

Parameters
startStart position in session frames.
endEnd position in session frames.
botBottom y range, as a fraction of line height, where 0 is the bottom of the line.
topTop y range, as a fraction of line height, where 0 is the bottom of the line.
resultFilled in with selectable things; in this case, ControlPoints.

Definition at line 907 of file automation_line.cc.

XMLNode & AutomationLine::get_state ( void  )
virtual

Implements PBD::Stateful.

Definition at line 1172 of file automation_line.cc.

bool AutomationLine::get_uses_gain_mapping ( ) const
inline

Definition at line 109 of file automation_line.h.

string AutomationLine::get_verbose_cursor_relative_string ( double  original,
double  fraction 
) const

Definition at line 346 of file automation_line.cc.

string AutomationLine::get_verbose_cursor_string ( double  fraction) const
virtual

Reimplemented in MidiAutomationLine.

Definition at line 335 of file automation_line.cc.

ArdourCanvas::Item& AutomationLine::grab_item ( ) const
inline

Definition at line 115 of file automation_line.h.

guint32 AutomationLine::height ( ) const
inline

Definition at line 97 of file automation_line.h.

void AutomationLine::hide ( )

Definition at line 202 of file automation_line.cc.

void AutomationLine::interpolation_changed ( ARDOUR::AutomationList::InterpolationStyle  )
private

Called when our list has announced that its interpolation style has changed

Definition at line 1258 of file automation_line.cc.

bool AutomationLine::is_first_point ( ControlPoint cp)

Definition at line 872 of file automation_line.cc.

bool AutomationLine::is_last_point ( ControlPoint cp)

Definition at line 853 of file automation_line.cc.

bool AutomationLine::is_stepped ( ) const
private

Definition at line 150 of file automation_line.cc.

void AutomationLine::list_changed ( )
protected

Definition at line 963 of file automation_line.cc.

ARDOUR::framecnt_t AutomationLine::maximum_time ( ) const
inline

Definition at line 151 of file automation_line.h.

MementoCommandBinder< AutomationList > * AutomationLine::memento_command_binder ( )
virtual

Reimplemented in MidiAutomationLine.

Definition at line 1324 of file automation_line.cc.

void AutomationLine::model_to_view_coord ( double &  x,
double &  y 
) const

Definition at line 1250 of file automation_line.cc.

void AutomationLine::model_to_view_coord_y ( double &  y) const

Definition at line 1227 of file automation_line.cc.

void AutomationLine::modify_point_y ( ControlPoint cp,
double  y 
)

Definition at line 275 of file automation_line.cc.

std::string AutomationLine::name ( ) const
inline

Definition at line 95 of file automation_line.h.

uint32_t AutomationLine::npoints ( ) const
inline

Definition at line 93 of file automation_line.h.

ControlPoint * AutomationLine::nth ( uint32_t  n)

Definition at line 255 of file automation_line.cc.

ControlPoint const * AutomationLine::nth ( uint32_t  n) const

Definition at line 265 of file automation_line.cc.

ArdourCanvas::Item& AutomationLine::parent_group ( ) const
inline

Definition at line 114 of file automation_line.h.

void AutomationLine::queue_reset ( )

Definition at line 1087 of file automation_line.cc.

void AutomationLine::remove_point ( ControlPoint cp)
virtual

Reimplemented in AudioRegionGainLine.

Definition at line 885 of file automation_line.cc.

void AutomationLine::remove_visibility ( VisibleAspects  va)

Definition at line 1148 of file automation_line.cc.

void AutomationLine::reset ( )

Definition at line 1073 of file automation_line.cc.

void AutomationLine::reset_callback ( const Evoral::ControlList events)
protected

Definition at line 974 of file automation_line.cc.

void AutomationLine::reset_line_coords ( ControlPoint cp)
private

Definition at line 313 of file automation_line.cc.

framepos_t AutomationLine::session_position ( ARDOUR::AutomationList::const_iterator  ) const

Definition at line 1359 of file automation_line.cc.

void AutomationLine::set_colors ( )

Definition at line 954 of file automation_line.cc.

void AutomationLine::set_height ( guint32  h)

Definition at line 223 of file automation_line.cc.

void AutomationLine::set_line_color ( uint32_t  color)

Definition at line 239 of file automation_line.cc.

void AutomationLine::set_list ( boost::shared_ptr< ARDOUR::AutomationList list)

Definition at line 1119 of file automation_line.cc.

void AutomationLine::set_maximum_time ( ARDOUR::framecnt_t  t)

Set the maximum time that points on this line can be at, relative to the start of the track or region that it is on.

Definition at line 1333 of file automation_line.cc.

void AutomationLine::set_offset ( ARDOUR::framecnt_t  off)

Definition at line 1365 of file automation_line.cc.

void AutomationLine::set_selected_points ( PointSelection const &  points)

Definition at line 935 of file automation_line.cc.

int AutomationLine::set_state ( const XMLNode node,
int  version 
)
virtual

Implements PBD::Stateful.

Definition at line 1179 of file automation_line.cc.

void AutomationLine::set_uses_gain_mapping ( bool  yn)

Definition at line 246 of file automation_line.cc.

void AutomationLine::set_visibility ( VisibleAspects  va)

Definition at line 1139 of file automation_line.cc.

void AutomationLine::set_width ( ARDOUR::framecnt_t  )
void AutomationLine::start_drag_common ( double  x,
float  fraction 
)
protected

Common parts of starting a drag.

Parameters
xStarting x position in units, or 0 if x is being ignored.
fractionStarting y position (as a fraction of the track height, where 0 is the bottom and 1 the top)

Definition at line 621 of file automation_line.cc.

void AutomationLine::start_drag_line ( uint32_t  i1,
uint32_t  i2,
float  fraction 
)
virtual

Start dragging a line vertically (with no change in x)

Parameters
i1Control point index of the `left' point on the line.
i2Control point index of the `right' point on the line.
fractionInitial y position (as a fraction of the track height, where 0 is the bottom and 1 the top)

Definition at line 493 of file automation_line.cc.

void AutomationLine::start_drag_multiple ( std::list< ControlPoint * >  cp,
float  fraction,
XMLNode state 
)
virtual

Start dragging multiple points (with no change in x)

Parameters
cpPoints to drag.
fractionInitial y position (as a fraction of the track height, where 0 is the bottom and 1 the top)

Definition at line 513 of file automation_line.cc.

void AutomationLine::start_drag_single ( ControlPoint cp,
double  x,
float  fraction 
)
virtual

Start dragging a single point, possibly adding others if the supplied point is selected and there are other selected points.

Parameters
cpPoint to drag.
xInitial x position (units).
fractionInitial y position (as a fraction of the track height, where 0 is the bottom and 1 the top)

Reimplemented in AudioRegionGainLine.

Definition at line 467 of file automation_line.cc.

double AutomationLine::string_to_fraction ( std::string const &  ) const
Parameters
sValue string in the form as returned by fraction_to_string.
Returns
Corresponding y fraction.

Definition at line 440 of file automation_line.cc.

bool AutomationLine::sync_model_with_view_point ( ControlPoint cp)
protected

Definition at line 787 of file automation_line.cc.

bool AutomationLine::sync_model_with_view_points ( std::list< ControlPoint * >  cp)
protected

Definition at line 322 of file automation_line.cc.

boost::shared_ptr<ARDOUR::AutomationList> AutomationLine::the_list ( ) const
inline

Definition at line 128 of file automation_line.h.

const Evoral::TimeConverter<double, ARDOUR::framepos_t>& AutomationLine::time_converter ( ) const
inline

Definition at line 144 of file automation_line.h.

void AutomationLine::track_entered ( )

Definition at line 1160 of file automation_line.cc.

void AutomationLine::track_exited ( )

Definition at line 1166 of file automation_line.cc.

void AutomationLine::update_visibility ( )
private

Definition at line 157 of file automation_line.cc.

void AutomationLine::view_to_model_coord ( double &  x,
double &  y 
) const

Definition at line 1186 of file automation_line.cc.

void AutomationLine::view_to_model_coord_y ( double &  y) const

Definition at line 1193 of file automation_line.cc.

bool AutomationLine::visible ( ) const
inline

Definition at line 96 of file automation_line.h.

Friends And Related Function Documentation

friend class AudioRegionGainLine
friend

Definition at line 241 of file automation_line.h.

friend class ContiguousControlPoints
friend

Definition at line 200 of file automation_line.h.

Member Data Documentation

const ARDOUR::ParameterDescriptor AutomationLine::_desc
private

Definition at line 239 of file automation_line.h.

double AutomationLine::_drag_distance
private

total x movement of the drag, in canvas units

Definition at line 219 of file automation_line.h.

bool AutomationLine::_drag_had_movement
private

true if the drag has seen movement, otherwise false

Definition at line 217 of file automation_line.h.

std::list<ControlPoint*> AutomationLine::_drag_points
private

points we are dragging

Definition at line 215 of file automation_line.h.

double AutomationLine::_drag_x
private

last x position of the drag, in units

Definition at line 218 of file automation_line.h.

guint32 AutomationLine::_height
protected

Definition at line 163 of file automation_line.h.

bool AutomationLine::_is_boolean
protected

Definition at line 178 of file automation_line.h.

double AutomationLine::_last_drag_fraction
private

last y position of the drag, as a fraction

Definition at line 220 of file automation_line.h.

uint32_t AutomationLine::_line_color
protected

Definition at line 164 of file automation_line.h.

PBD::ScopedConnectionList AutomationLine::_list_connections
private

Definition at line 234 of file automation_line.h.

ARDOUR::framecnt_t AutomationLine::_maximum_time
private

maximum time that a point on this line can be at, relative to the position of its region or start of its track

Definition at line 237 of file automation_line.h.

std::string AutomationLine::_name
protected

Definition at line 162 of file automation_line.h.

ARDOUR::framecnt_t AutomationLine::_offset
private

offset from the start of the automation list to the start of the line, so that a +ve offset means that the 0 on the line is at _offset in the list

Definition at line 224 of file automation_line.h.

bool AutomationLine::_our_time_converter
protected

true if _time_converter belongs to us (ie we should delete it on destruction)

Definition at line 169 of file automation_line.h.

ArdourCanvas::Item& AutomationLine::_parent_group
protected

Definition at line 182 of file automation_line.h.

std::list<ControlPoint*> AutomationLine::_push_points
private

additional points we are dragging if "push" is enabled

Definition at line 216 of file automation_line.h.

Evoral::TimeConverter<double, ARDOUR::framepos_t>* AutomationLine::_time_converter
protected

Definition at line 167 of file automation_line.h.

bool AutomationLine::_uses_gain_mapping
protected

Definition at line 173 of file automation_line.h.

VisibleAspects AutomationLine::_visible
protected

Definition at line 171 of file automation_line.h.

boost::shared_ptr<ARDOUR::AutomationList> AutomationLine::alist
protected

Definition at line 166 of file automation_line.h.

std::vector<CCP> AutomationLine::contiguous_points
protected

Definition at line 203 of file automation_line.h.

std::vector<ControlPoint*> AutomationLine::control_points
protected

Definition at line 186 of file automation_line.h.

bool AutomationLine::did_push
protected

true if we did a push at any point during the current drag

Definition at line 180 of file automation_line.h.

ArdourCanvas::Container* AutomationLine::group
protected

Definition at line 183 of file automation_line.h.

bool AutomationLine::have_timeout
protected

Definition at line 176 of file automation_line.h.

ArdourCanvas::PolyLine* AutomationLine::line
protected

Definition at line 184 of file automation_line.h.

ArdourCanvas::Points AutomationLine::line_points
protected

Definition at line 185 of file automation_line.h.

bool AutomationLine::no_draw
protected

Definition at line 177 of file automation_line.h.

bool AutomationLine::terminal_points_can_slide
protected

Definition at line 174 of file automation_line.h.

TimeAxisView& AutomationLine::trackview

Definition at line 111 of file automation_line.h.

bool AutomationLine::update_pending
protected

Definition at line 175 of file automation_line.h.


The documentation for this class was generated from the following files: