Skip to content

src.core.trackevent

secretrobotron edited this page Dec 10, 2012 · 3 revisions

#TrackEvent (module)

Provides Popcorn-wrapping TrackEvent functionality to Butter.

Usage:

var TrackEvent = require('path/to/module/trackevent.js');

#TrackEvent::TrackEvent (public class)

Wraps Popcorn events and fits into Butter's Media/Track driven structure.

  • options: [ Object ]: Options for initialization:

type [ String ] Popcorn event type
name [ String ] Name of this TrackEvent
popcornOptions [ Dictionary ] Popcorn event initialization options.

Usage:

var t = new TrackEvent(options);

##TrackEvent::TrackEvent::dragging (read-only property)

This TrackEvent's dragging state. True when TrackEvent is being dragged.

@return [ Boolean ]

##TrackEvent::TrackEvent::id (read-only property)

Name of this TrackEvent.

@return [ String ]

##TrackEvent::TrackEvent::json (read-write property)

Represents this TrackEvent in a portable JSON format.

@event: trackeventupdated When this property is set, the TrackEvent's data will change, so a trackeventupdated event will be dispatched.

##TrackEvent::TrackEvent::name (read-only property)

Name of this TrackEvent.

@return [ String ]

##TrackEvent::TrackEvent::resizing (read-only property)

This TrackEvent's resizing state. True when TrackEvent is being resized.

@return [ Boolean ]

##TrackEvent::TrackEvent::selected (read-write property)

Specifies the state of selection. When true, this TrackEvent is selected.

@event: trackeventselected Dispatched when selected state changes to true.
@event: trackeventdeselected Dispatched when selected state changes to false.

##TrackEvent::TrackEvent::track (read-only property)

Specifies the Track on which this TrackEvent currently sits.

@return [ Track ]

##TrackEvent::TrackEvent::type (read-only property)

The type representing the popcorn plugin created and manipulated by this TrackEvent.

@return [ String ]

##TrackEvent::TrackEvent::uiInUse (read-only property)

This TrackEvent's resizing state. True when TrackEvent is being resized.

@return [ Boolean ]

##TrackEvent::TrackEvent::view (read-only property)

A reference to the view object generated for this TrackEvent.

@return [ TrackEventView ]

##TrackEvent::TrackEvent::bind (member function)

Binds the TrackEvent to its dependencies.

  • track [ Track ]: The track this TrackEvent will inhabit.
  • popcornWrapper [ PopcornWrapper ]: A reference to a PopcornWrapper object that wraps various functionality for modifying Popcorn data.

Usage:

t.bind(track, popcornWrapper);

##TrackEvent::TrackEvent::unbind (member function)

Kills references to PopcornWrapper and Track which are necessary to function. TrackEvent becomes a husk for popcorn data at this point.

Usage:

t.unbind();

##TrackEvent::TrackEvent::update (member function)

Updates Popcorn event properties and runs sanity checks on input.

  • updateOptions [ Object ]: Object containing plugin-specific properties to be updated for this TrackEvent.

@event: trackeventupdated Occurs when an update operation succeeded.
@throws [ TrackEventUpdateException ]: When an update operation failed because of conflicting times or other serious property problems.

Usage:

t.update(updateOptions, applyDefaults);

#TrackEvent::TrackEventUpdateException (private class)

TrackEvent-specific exception system. When something goes wrong during an update or creation, TrackEventUpdateExceptions can be raised to provide more context than a basic Error.

  • reason [ String ]: Reason for exception.

Usage:

var t = new TrackEventUpdateException(reason);
Clone this wiki locally