Class Media
Timeline track media event (range-based). Can be added to the timeline track.
Implements
Namespace: FlaxEditor.GUI.Timeline
Assembly: FlaxEngine.CSharp.dll
Syntax
public abstract class Media : ContainerControl, IComparable, IDrawableConstructors
Media()
Fields
CanDelete
Gets a value indicating whether this media can be removed.
Declaration
public bool CanDeleteField Value
| System.Boolean 
 | 
CanResize
Gets a value indicating whether this media can be resized (duration changed).
Declaration
public bool CanResizeField Value
| System.Boolean 
 | 
CanSplit
Gets a value indicating whether this media can be split.
Declaration
public bool CanSplitField Value
| System.Boolean 
 | 
PropertiesEditObject
The track properties editing proxy object. Assign it to add media properties editing support.
Declaration
public object PropertiesEditObjectField Value
| System.Object 
 | 
Properties
Duration
Get or sets the media duration in seconds.
Declaration
public float Duration { get; set; }Property Value
| System.Single 
 | 
See Also
DurationFrames
Gets or sets the total duration of the media event in the timeline sequence frames amount.
Declaration
public int DurationFrames { get; set; }Property Value
| System.Int32 
 | 
EndFrame
Gets the end frame of the media (start + duration).
Declaration
public int EndFrame { get; }Property Value
| System.Int32 
 | 
Start
Get or sets the media start time in seconds.
Declaration
public float Start { get; set; }Property Value
| System.Single 
 | 
See Also
StartFrame
Gets or sets the start frame of the media event.
Declaration
public int StartFrame { get; set; }Property Value
| System.Int32 
 | 
Timeline
Gets the parent timeline.
Declaration
public Timeline Timeline { get; }Property Value
| FlaxEditor.GUI.Timeline.Timeline 
 | 
Track
Gets the track.
Declaration
public Track Track { get; }Property Value
| FlaxEditor.GUI.Timeline.Track 
 | 
Methods
Delete()
Deletes this media.
Declaration
public void Delete()Draw()
Draw the control and the children.
Declaration
public override void Draw()Overrides
GetDesireClientArea(out Rectangle)
Gets the desire client area rectangle for all the controls.
Declaration
public override void GetDesireClientArea(out Rectangle rect)Parameters
| Rectangle
        rect The client area rectangle for child controls. | 
Overrides
OnDeleted()
Called when media gets removed by the user.
Declaration
public virtual void OnDeleted()OnDestroy()
Method called when managed instance should be destroyed
Declaration
public override void OnDestroy()Overrides
OnDurationFramesChanged()
Called when media duration in frames gets changed.
Declaration
protected virtual void OnDurationFramesChanged()OnEndMouseCapture()
When mouse goes up/down not over the control but it has user focus so remove that focus from it (used by scroll bars, sliders etc.)
Declaration
public override void OnEndMouseCapture()Overrides
OnLostFocus()
When control losts input focus
Declaration
public override void OnLostFocus()Overrides
OnMouseDoubleClick(Float2, MouseButton)
When mouse double clicks over control's area
Declaration
public override bool OnMouseDoubleClick(Float2 location, MouseButton button)Parameters
| Float2
        location Mouse location in Control Space | 
| MouseButton
        button Mouse buttons state (flags) | 
Returns
| System.Boolean True if event has been handled, otherwise false | 
Overrides
OnMouseDown(Float2, MouseButton)
When mouse goes down over control's area
Declaration
public override bool OnMouseDown(Float2 location, MouseButton button)Parameters
| Float2
        location Mouse location in Control Space | 
| MouseButton
        button Mouse buttons state (flags) | 
Returns
| System.Boolean True if event has been handled, otherwise false | 
Overrides
OnMouseEnter(Float2)
When mouse enters control's area
Declaration
public override void OnMouseEnter(Float2 location)Parameters
| Float2
        location Mouse location in Control Space | 
Overrides
OnMouseLeave()
When mouse leaves control's area
Declaration
public override void OnMouseLeave()Overrides
OnMouseMove(Float2)
When mouse moves over control's area
Declaration
public override void OnMouseMove(Float2 location)Parameters
| Float2
        location Mouse location in Control Space | 
Overrides
OnMouseUp(Float2, MouseButton)
When mouse goes up over control's area
Declaration
public override bool OnMouseUp(Float2 location, MouseButton button)Parameters
| Float2
        location Mouse location in Control Space | 
| MouseButton
        button Mouse buttons state (flags) | 
Returns
| System.Boolean True if event has been handled, otherwise false | 
Overrides
OnStartFrameChanged()
Called when media start frame gets changed.
Declaration
protected virtual void OnStartFrameChanged()OnTimelineChanged(Track)
Called when parent track gets changed.
Declaration
public virtual void OnTimelineChanged(Track track)Parameters
| FlaxEditor.GUI.Timeline.Track
        track The track. | 
OnTimelineContextMenu(ContextMenu, Single, Control)
Called when showing timeline context menu to the user. Can be used to add custom buttons.
Declaration
public virtual void OnTimelineContextMenu(ContextMenu menu, float time, Control controlUnderMouse)Parameters
| FlaxEditor.GUI.ContextMenu.ContextMenu
        menu The menu. | 
| System.Single
        time The time (in seconds) at which context menu is shown (user clicked on a timeline). | 
| Control
        controlUnderMouse The found control under the mouse cursor. | 
OnTimelineFpsChanged(Single, Single)
Called when timeline FPS gets changed.
Declaration
public virtual void OnTimelineFpsChanged(float before, float after)Parameters
| System.Single
        before The before value. | 
| System.Single
        after The after value. | 
OnTimelineZoomChanged()
Called when timeline zoom gets changed.
Declaration
public virtual void OnTimelineZoomChanged()OnUndo()
Called when undo action gets reverted or applied for this media parent track data. Can be used to update UI.
Declaration
public virtual void OnUndo()Split(Int32)
Splits the media at the specified frame.
Declaration
public virtual Media Split(int frame)Parameters
| System.Int32
        frame The frame to split at. | 
Returns
| Media The another media created after this media split. | 
Events
DurationFramesChanged
Occurs when media duration gets changed.
Declaration
public event Action DurationFramesChangedEvent Type
| System.Action 
 | 
StartFrameChanged
Occurs when start frame gets changed.
Declaration
public event Action StartFrameChangedEvent Type
| System.Action 
 |