ardour
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
TimeAxisViewItem Class Reference

#include <time_axis_view_item.h>

Inheritance diagram for TimeAxisViewItem:
Selectable PBD::ScopedConnectionList CrossfadeView RegionView AudioRegionView AutomationRegionView MidiRegionView TapeAudioRegionView

Public Types

enum  Visibility {
  ShowFrame = 0x1, ShowNameHighlight = 0x2, ShowNameText = 0x4, ShowHandles = 0x8,
  HideFrameLeft = 0x10, HideFrameRight = 0x20, HideFrameTB = 0x40, FullWidthNameHighlight = 0x80
}
 

Public Member Functions

virtual ~TimeAxisViewItem ()
 
virtual bool set_position (framepos_t, void *, double *delta=0)
 
framepos_t get_position () const
 
virtual bool set_duration (framecnt_t, void *)
 
framecnt_t get_duration () const
 
virtual void set_max_duration (framecnt_t, void *)
 
framecnt_t get_max_duration () const
 
virtual void set_min_duration (framecnt_t, void *)
 
framecnt_t get_min_duration () const
 
virtual void set_position_locked (bool, void *)
 
bool get_position_locked () const
 
void set_max_duration_active (bool, void *)
 
bool get_max_duration_active () const
 
void set_min_duration_active (bool, void *)
 
bool get_min_duration_active () const
 
void set_item_name (std::string, void *)
 
virtual std::string get_item_name () const
 
virtual void set_selected (bool yn)
 
void set_sensitive (bool yn)
 
bool sensitive () const
 
TimeAxisViewget_time_axis_view () const
 
void set_name_text (const std::string &)
 
virtual void set_height (double h)
 
virtual double height () const
 
void set_y (double)
 
void set_color (uint32_t)
 
void set_name_text_color ()
 
virtual uint32_t get_fill_color () const
 
ArdourCanvas::Item * get_canvas_frame ()
 
ArdourCanvas::Item * get_canvas_group ()
 
ArdourCanvas::Item * get_name_highlight ()
 
virtual void set_samples_per_pixel (double)
 
double get_samples_per_pixel () const
 
virtual void drag_start ()
 
virtual void drag_end ()
 
bool dragging () const
 
virtual void raise ()
 
virtual void raise_to_top ()
 
virtual void lower ()
 
virtual void lower_to_bottom ()
 
bool name_active () const
 
- Public Member Functions inherited from Selectable
 Selectable ()
 
virtual ~Selectable ()
 
bool get_selected () const
 
- Public Member Functions inherited from PBD::ScopedConnectionList
 ScopedConnectionList ()
 
virtual ~ScopedConnectionList ()
 
void add_connection (const UnscopedConnection &c)
 
void drop_connections ()
 

Static Public Member Functions

static void set_constant_heights ()
 

Public Attributes

sigc::signal< void,
std::string, void * > 
ItemRemoved
 
sigc::signal< void,
std::string, std::string, void * > 
NameChanged
 
sigc::signal< void, framepos_t,
void * > 
PositionChanged
 
sigc::signal< void, bool, void * > PositionLockChanged
 
sigc::signal< void, framecnt_t,
void * > 
DurationChanged
 
sigc::signal< void, framecnt_t,
void * > 
MaxDurationChanged
 
sigc::signal< void, framecnt_t,
void * > 
MinDurationChanged
 

Static Public Attributes

static Pango::FontDescription NAME_FONT
 
static const double NAME_X_OFFSET = 15.0
 
static const double GRAB_HANDLE_TOP = 0.0
 
static const double GRAB_HANDLE_WIDTH = 10.0
 
static int NAME_HEIGHT
 
static double NAME_Y_OFFSET
 
static double NAME_HIGHLIGHT_SIZE
 
static double NAME_HIGHLIGHT_THRESH
 

Protected Member Functions

 TimeAxisViewItem (const std::string &, ArdourCanvas::Item &, TimeAxisView &, double, uint32_t fill_color, framepos_t, framecnt_t, bool recording=false, bool automation=false, Visibility v=Visibility(0))
 
 TimeAxisViewItem (const TimeAxisViewItem &)
 
void init (ArdourCanvas::Item *, double, uint32_t, framepos_t, framepos_t, Visibility, bool, bool)
 
virtual bool canvas_group_event (GdkEvent *)
 
virtual void set_colors ()
 
virtual void set_frame_color ()
 
virtual void set_frame_gradient ()
 
void set_trim_handle_colors ()
 
virtual void reset_width_dependent_items (double)
 
bool frame_handle_crossing (GdkEvent *, ArdourCanvas::Rectangle *)
 

Static Protected Member Functions

static gint idle_remove_this_item (TimeAxisViewItem *, void *)
 

Protected Attributes

TimeAxisViewtrackview
 
bool position_locked
 
framepos_t frame_position
 
framecnt_t item_duration
 
framecnt_t max_item_duration
 
framecnt_t min_item_duration
 
bool max_duration_active
 
bool min_duration_active
 
double samples_per_pixel
 
bool _sensitive
 
std::string item_name
 
bool name_connected
 
bool show_vestigial
 
uint32_t fill_color
 
uint32_t last_item_width
 
int name_text_width
 
bool wide_enough_for_name
 
bool high_enough_for_name
 
ArdourCanvas::Container * group
 
ArdourCanvas::Rectangle * vestigial_frame
 
ArdourCanvas::Rectangle * frame
 
ArdourCanvas::Rectangle * selection_frame
 
ArdourCanvas::Text * name_text
 
ArdourCanvas::Rectangle * name_highlight
 
ArdourCanvas::Rectangle * frame_handle_start
 `frame' (fade) handle for the start of the item, or 0 More...
 
ArdourCanvas::Rectangle * frame_handle_end
 `frame' (fade) handle for the end of the item, or 0 More...
 
double _height
 
Visibility visibility
 
std::string fill_color_name
 
bool _recregion
 
bool _automation
 true if this is an automation region view More...
 
bool _dragging
 
- Protected Attributes inherited from Selectable
bool _selected
 

Private Member Functions

void parameter_changed (std::string)
 
void manage_name_highlight ()
 
void manage_name_text ()
 

Private Attributes

double _width
 

Detailed Description

Base class for items that may appear upon a TimeAxisView.

Definition at line 47 of file time_axis_view_item.h.

Member Enumeration Documentation

Enumerator
ShowFrame 
ShowNameHighlight 
ShowNameText 
ShowHandles 
HideFrameLeft 
HideFrameRight 
HideFrameTB 
FullWidthNameHighlight 

Definition at line 144 of file time_axis_view_item.h.

Constructor & Destructor Documentation

TimeAxisViewItem::~TimeAxisViewItem ( )
virtual

Definition at line 278 of file time_axis_view_item.cc.

TimeAxisViewItem::TimeAxisViewItem ( const std::string &  ,
ArdourCanvas::Item &  ,
TimeAxisView ,
double  ,
uint32_t  fill_color,
framepos_t  ,
framecnt_t  ,
bool  recording = false,
bool  automation = false,
Visibility  v = Visibility(0) 
)
protected
TimeAxisViewItem::TimeAxisViewItem ( const TimeAxisViewItem other)
protected

Definition at line 138 of file time_axis_view_item.cc.

Member Function Documentation

bool TimeAxisViewItem::canvas_group_event ( GdkEvent *  )
protectedvirtual

Reimplemented in MidiRegionView, RegionView, and AutomationRegionView.

Definition at line 284 of file time_axis_view_item.cc.

void TimeAxisViewItem::drag_end ( )
virtual

Reimplemented in AudioRegionView.

Definition at line 974 of file time_axis_view_item.cc.

void TimeAxisViewItem::drag_start ( )
virtual

Reimplemented in AudioRegionView.

Definition at line 967 of file time_axis_view_item.cc.

bool TimeAxisViewItem::dragging ( ) const
inline

Definition at line 91 of file time_axis_view_item.h.

bool TimeAxisViewItem::frame_handle_crossing ( GdkEvent *  ev,
ArdourCanvas::Rectangle *  item 
)
protected

Definition at line 786 of file time_axis_view_item.cc.

ArdourCanvas::Item * TimeAxisViewItem::get_canvas_frame ( )

Definition at line 638 of file time_axis_view_item.cc.

ArdourCanvas::Item * TimeAxisViewItem::get_canvas_group ( )

Definition at line 644 of file time_axis_view_item.cc.

framepos_t TimeAxisViewItem::get_duration ( ) const
Returns
duration of this item

Definition at line 368 of file time_axis_view_item.cc.

ArdourCanvas::Color TimeAxisViewItem::get_fill_color ( ) const
virtual

Reimplemented in MidiRegionView, RegionView, and AutomationRegionView.

Definition at line 697 of file time_axis_view_item.cc.

std::string TimeAxisViewItem::get_item_name ( ) const
virtual
Returns
the name of this item

Definition at line 493 of file time_axis_view_item.cc.

framecnt_t TimeAxisViewItem::get_max_duration ( ) const
Returns
the maximum duration that this item may have

Definition at line 388 of file time_axis_view_item.cc.

bool TimeAxisViewItem::get_max_duration_active ( ) const
Returns
true if the maximum duration constraint is active

Definition at line 449 of file time_axis_view_item.cc.

framecnt_t TimeAxisViewItem::get_min_duration ( ) const
Returns
the minimum duration that this item mey have

Definition at line 408 of file time_axis_view_item.cc.

bool TimeAxisViewItem::get_min_duration_active ( ) const
Returns
true if the maximum duration constraint is active

Definition at line 469 of file time_axis_view_item.cc.

ArdourCanvas::Item * TimeAxisViewItem::get_name_highlight ( )

Definition at line 650 of file time_axis_view_item.cc.

framepos_t TimeAxisViewItem::get_position ( ) const
Returns
position of this item on the timeline

Definition at line 327 of file time_axis_view_item.cc.

bool TimeAxisViewItem::get_position_locked ( ) const
Returns
true if this item is locked to its current position

Definition at line 430 of file time_axis_view_item.cc.

double TimeAxisViewItem::get_samples_per_pixel ( ) const
Returns
the frames per pixel

Definition at line 809 of file time_axis_view_item.cc.

TimeAxisView & TimeAxisViewItem::get_time_axis_view ( ) const
Returns
the TimeAxisView that this item is on

Definition at line 532 of file time_axis_view_item.cc.

virtual double TimeAxisViewItem::height ( ) const
inlinevirtual

Definition at line 74 of file time_axis_view_item.h.

gint TimeAxisViewItem::idle_remove_this_item ( TimeAxisViewItem item,
void *  src 
)
staticprotected

Callback used to remove this time axis item during the gtk idle loop. This is used to avoid deleting the obejct while inside the remove_this_item method.

Parameters
itemthe TimeAxisViewItem to remove.
srcthe identity of the object that initiated the change.

Definition at line 942 of file time_axis_view_item.cc.

void TimeAxisViewItem::init ( ArdourCanvas::Item *  parent,
double  fpp,
uint32_t  base_color,
framepos_t  start,
framepos_t  duration,
Visibility  vis,
bool  wide,
bool  high 
)
protected

Definition at line 163 of file time_axis_view_item.cc.

virtual void TimeAxisViewItem::lower ( )
inlinevirtual

Definition at line 95 of file time_axis_view_item.h.

virtual void TimeAxisViewItem::lower_to_bottom ( )
inlinevirtual

Reimplemented in RegionView.

Definition at line 96 of file time_axis_view_item.h.

void TimeAxisViewItem::manage_name_highlight ( )
private

Definition at line 600 of file time_axis_view_item.cc.

void TimeAxisViewItem::manage_name_text ( )
private

Definition at line 902 of file time_axis_view_item.cc.

bool TimeAxisViewItem::name_active ( ) const
inline
Returns
true if the name area should respond to events

Definition at line 99 of file time_axis_view_item.h.

void TimeAxisViewItem::parameter_changed ( std::string  )
private

Definition at line 957 of file time_axis_view_item.cc.

virtual void TimeAxisViewItem::raise ( )
inlinevirtual

Definition at line 93 of file time_axis_view_item.h.

virtual void TimeAxisViewItem::raise_to_top ( )
inlinevirtual

Reimplemented in RegionView.

Definition at line 94 of file time_axis_view_item.h.

void TimeAxisViewItem::reset_width_dependent_items ( double  pixel_width)
protectedvirtual
bool TimeAxisViewItem::sensitive ( ) const
inline

Definition at line 70 of file time_axis_view_item.h.

void TimeAxisViewItem::set_color ( uint32_t  base_color)

Definition at line 631 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_colors ( )
protectedvirtual

Convenience method to set the various canvas item colors

Reimplemented in AudioRegionView, and RegionView.

Definition at line 659 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_constant_heights ( )
static

Definition at line 73 of file time_axis_view_item.cc.

bool TimeAxisViewItem::set_duration ( framecnt_t  ,
void *   
)
virtual

Set the duration of this item.

Parameters
durthe new duration of this item
srcthe identity of the object that initiated the change
Returns
true on success

Reimplemented in RegionView.

Definition at line 341 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_frame_color ( )
protectedvirtual

Sets the frame color depending on whether this item is selected

Reimplemented in AudioRegionView.

Definition at line 716 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_frame_gradient ( )
protectedvirtual

Definition at line 731 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_height ( double  height)
virtual

Set the height of this item.

Parameters
hnew height

Reimplemented in MidiRegionView, AudioRegionView, AutomationRegionView, and RegionView.

Definition at line 562 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_item_name ( std::string  new_name,
void *  src 
)

Set the name of this item.

Parameters
new_namethe new name of this item
srcthe identity of the object that initiated the change

Definition at line 482 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_max_duration ( framecnt_t  ,
void *   
)
virtual

Set the maximum duration that this item can have.

Parameters
durthe new maximum duration
srcthe identity of the object that initiated the change

Definition at line 380 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_max_duration_active ( bool  active,
void *   
)

Set whether the maximum duration constraint is active.

Parameters
activeset true to enforce the max duration constraint
srcthe identity of the object that initiated the change

Definition at line 442 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_min_duration ( framecnt_t  ,
void *   
)
virtual

Set the minimum duration that this item may have.

Parameters
theminimum duration that this item may be set to
srcthe identity of the object that initiated the change

Definition at line 400 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_min_duration_active ( bool  active,
void *   
)

Set whether the minimum duration constraint is active.

Parameters
activeset true to enforce the min duration constraint
srcthe identity of the object that initiated the change

Definition at line 462 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_name_text ( const std::string &  )

Set the displayed item text. This item is the visual text name displayed on the canvas item, this can be different to the name of the item.

Parameters
new_namethe new name text to display

Definition at line 545 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_name_text_color ( )

Definition at line 672 of file time_axis_view_item.cc.

bool TimeAxisViewItem::set_position ( framepos_t  pos,
void *  src,
double *  delta = 0 
)
virtual

Set the position of this item on the timeline.

Parameters
posthe new position
srcthe identity of the object that initiated the change
Returns
true on success

Reimplemented in RegionView, and AutomationRegionView.

Definition at line 298 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_position_locked ( bool  yn,
void *  src 
)
virtual

Set whether this item is locked to its current position. Locked items cannot be moved until the item is unlocked again.

Parameters
yntrue to lock this item to its current position
srcthe identity of the object that initiated the change

Definition at line 421 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_samples_per_pixel ( double  fpp)
virtual

Set the frames per pixel of this item. This item is used to determine the relative visual size and position of this item based upon its duration and start value.

Parameters
fppthe new frames per pixel

Reimplemented in AudioRegionView, and RegionView.

Definition at line 821 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_selected ( bool  yn)
virtual

Set selection status.

Parameters
yntrue if this item is currently selected

Reimplemented from Selectable.

Definition at line 504 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_sensitive ( bool  yn)
inline

Definition at line 69 of file time_axis_view_item.h.

void TimeAxisViewItem::set_trim_handle_colors ( )
protected

Set the colors of the start and end trim handle depending on object state

Definition at line 764 of file time_axis_view_item.cc.

void TimeAxisViewItem::set_y ( double  y)

Definition at line 951 of file time_axis_view_item.cc.

Member Data Documentation

bool TimeAxisViewItem::_automation
protected

true if this is an automation region view

Definition at line 240 of file time_axis_view_item.h.

bool TimeAxisViewItem::_dragging
protected

Definition at line 241 of file time_axis_view_item.h.

double TimeAxisViewItem::_height
protected

Definition at line 236 of file time_axis_view_item.h.

bool TimeAxisViewItem::_recregion
protected

Definition at line 239 of file time_axis_view_item.h.

bool TimeAxisViewItem::_sensitive
protected

should the item respond to events

Definition at line 202 of file time_axis_view_item.h.

double TimeAxisViewItem::_width
private

Definition at line 244 of file time_axis_view_item.h.

sigc::signal<void,framecnt_t,void*> TimeAxisViewItem::DurationChanged

Emitted when the duration of this item changes

Definition at line 136 of file time_axis_view_item.h.

uint32_t TimeAxisViewItem::fill_color
protected

Definition at line 216 of file time_axis_view_item.h.

std::string TimeAxisViewItem::fill_color_name
protected

Definition at line 238 of file time_axis_view_item.h.

ArdourCanvas::Rectangle* TimeAxisViewItem::frame
protected

Definition at line 225 of file time_axis_view_item.h.

ArdourCanvas::Rectangle* TimeAxisViewItem::frame_handle_end
protected

`frame' (fade) handle for the end of the item, or 0

Definition at line 232 of file time_axis_view_item.h.

ArdourCanvas::Rectangle* TimeAxisViewItem::frame_handle_start
protected

`frame' (fade) handle for the start of the item, or 0

Definition at line 231 of file time_axis_view_item.h.

framepos_t TimeAxisViewItem::frame_position
protected

position of this item on the timeline

Definition at line 181 of file time_axis_view_item.h.

const double TimeAxisViewItem::GRAB_HANDLE_TOP = 0.0
static

Definition at line 105 of file time_axis_view_item.h.

const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 10.0
static

Definition at line 106 of file time_axis_view_item.h.

ArdourCanvas::Container* TimeAxisViewItem::group
protected

Definition at line 223 of file time_axis_view_item.h.

bool TimeAxisViewItem::high_enough_for_name
protected

Definition at line 221 of file time_axis_view_item.h.

framecnt_t TimeAxisViewItem::item_duration
protected

duration of this item upon the timeline

Definition at line 184 of file time_axis_view_item.h.

std::string TimeAxisViewItem::item_name
protected

The unique item name of this Item. Each item upon a time axis must have a unique id.

Definition at line 208 of file time_axis_view_item.h.

sigc::signal<void,std::string,void*> TimeAxisViewItem::ItemRemoved

Emitted when this Group has been removed. This is different to the CatchDeletion signal in that this signal is emitted during the deletion of this Time Axis, and not during the destructor, this allows us to capture the source of the deletion event

Definition at line 124 of file time_axis_view_item.h.

uint32_t TimeAxisViewItem::last_item_width
protected

Definition at line 218 of file time_axis_view_item.h.

bool TimeAxisViewItem::max_duration_active
protected

indicates whether the max duration constraint is active

Definition at line 193 of file time_axis_view_item.h.

framecnt_t TimeAxisViewItem::max_item_duration
protected

maximum duration that this item can have

Definition at line 187 of file time_axis_view_item.h.

sigc::signal<void,framecnt_t,void*> TimeAxisViewItem::MaxDurationChanged

Emitted when the maximum item duration is changed

Definition at line 139 of file time_axis_view_item.h.

bool TimeAxisViewItem::min_duration_active
protected

indicates whether the min duration constraint is active

Definition at line 196 of file time_axis_view_item.h.

framecnt_t TimeAxisViewItem::min_item_duration
protected

minimum duration that this item can have

Definition at line 190 of file time_axis_view_item.h.

sigc::signal<void,framecnt_t,void*> TimeAxisViewItem::MinDurationChanged

Emitted when the mionimum item duration is changed

Definition at line 142 of file time_axis_view_item.h.

bool TimeAxisViewItem::name_connected
protected

true if the name should respond to events

Definition at line 211 of file time_axis_view_item.h.

Pango::FontDescription TimeAxisViewItem::NAME_FONT
static

Definition at line 102 of file time_axis_view_item.h.

int TimeAxisViewItem::NAME_HEIGHT
static

Definition at line 111 of file time_axis_view_item.h.

ArdourCanvas::Rectangle* TimeAxisViewItem::name_highlight
protected

Definition at line 228 of file time_axis_view_item.h.

double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE
static

Definition at line 113 of file time_axis_view_item.h.

double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH
static

Definition at line 114 of file time_axis_view_item.h.

ArdourCanvas::Text* TimeAxisViewItem::name_text
protected

Definition at line 227 of file time_axis_view_item.h.

int TimeAxisViewItem::name_text_width
protected

Definition at line 219 of file time_axis_view_item.h.

const double TimeAxisViewItem::NAME_X_OFFSET = 15.0
static

Definition at line 104 of file time_axis_view_item.h.

double TimeAxisViewItem::NAME_Y_OFFSET
static

Definition at line 112 of file time_axis_view_item.h.

sigc::signal<void,std::string,std::string,void*> TimeAxisViewItem::NameChanged

Emitted when the name of this item is changed

Definition at line 127 of file time_axis_view_item.h.

bool TimeAxisViewItem::position_locked
protected

indicates whether this item is locked to its current position

Definition at line 178 of file time_axis_view_item.h.

sigc::signal<void,framepos_t,void*> TimeAxisViewItem::PositionChanged

Emiited when the position of this item changes

Definition at line 130 of file time_axis_view_item.h.

sigc::signal<void,bool,void*> TimeAxisViewItem::PositionLockChanged

Emitted when the position lock of this item is changed

Definition at line 133 of file time_axis_view_item.h.

double TimeAxisViewItem::samples_per_pixel
protected

frames per canvas pixel

Definition at line 199 of file time_axis_view_item.h.

ArdourCanvas::Rectangle* TimeAxisViewItem::selection_frame
protected

Definition at line 226 of file time_axis_view_item.h.

bool TimeAxisViewItem::show_vestigial
protected

true if a small vestigial rect should be shown when the item gets very narrow

Definition at line 214 of file time_axis_view_item.h.

TimeAxisView& TimeAxisViewItem::trackview
protected

time axis that this item is on

Definition at line 175 of file time_axis_view_item.h.

ArdourCanvas::Rectangle* TimeAxisViewItem::vestigial_frame
protected

Definition at line 224 of file time_axis_view_item.h.

Visibility TimeAxisViewItem::visibility
protected

Definition at line 237 of file time_axis_view_item.h.

bool TimeAxisViewItem::wide_enough_for_name
protected

Definition at line 220 of file time_axis_view_item.h.


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