LayerTimeContext
A LayerTimeContext instance represents a time segment into a TimelineTimeContext.
It must be attached to a TimelineTimeContext (the one of the timeline it
belongs to). It relies on its parent's timeToPixel (time to pixel transfert
function) to create the time to pixel representation of the Layer (the view) it is attached to.
The layerTimeContext has four important attributes:
startrepresent the time at which temporal data must be represented in the timeline (for instance the begining of a soundfile in a DAW).offsetrepresents offset time of the data in the context of a Layer. (@TODO give a use case example here "crop ?", and/or explain that it's not a common use case).durationis the duration of the view on the data.stretchRatiois the stretch applyed to the temporal data contained in the view (this value can be seen as a local zoom on the data, or as a stretch on the time components of the data). When applyed, the stretch ratio maintain the start position of the view in the timeline.
+ timeline -----------------------------------------------------------------
0 5 10 15 20 25 30 seconds
+---+*****************+------------------------------------------+*******+--
|*** soundfile ***|Layer (view on the sound file) |*******|
+*****************+------------------------------------------+*******+
<---- offset ----><--------------- duration ----------------->
<-------- start ----->
The parts of the sound file represented with '*' are hidden from the view
Constructor Summary
| Public Constructor | ||
| public |
constructor(parent: TimelineTimeContext) |
|
Member Summary
| Public Members | ||
| public get |
Returns the duration of the time context (in seconds). |
|
| public set |
Sets the duration of the time context (in seconds). |
|
| public get |
Returns the offset of the time context (in seconds). |
|
| public set |
Sets the offset of the time context (in seconds). |
|
| public |
The |
|
| public get |
Returns the start position of the time context (in seconds). |
|
| public set |
Sets the start position of the time context (in seconds). |
|
| public get |
Returns the stretch ratio of the time context. |
|
| public set |
Sets the stretch ratio of the time context. |
|
| public get |
Returns the time to pixel transfert function of the time context. |
|
Method Summary
| Public Methods | ||
| public |
Creates a clone of the current time context. |
|
| public |
pixelToTime(px: Number): Number Helper function to convert pixel to time. |
|
Public Constructors
public constructor(parent: TimelineTimeContext) source
Params:
| Name | Type | Attribute | Description |
| parent | TimelineTimeContext | The |