de.humatic.dsj
Class MovieTrack

java.lang.Object
  extended by de.humatic.dsj.MovieTrack

public class MovieTrack
extends java.lang.Object

MovieTrack represents a single piece of footage on an editable movie's timeline.


Field Summary
static int SM_CROP
           
static int SM_PA_NOLETTERBOX
           
static int SM_PRESERVEASPECT
           
static int SM_STRETCH
           
 
Method Summary
 void addEffect(EffectDescription ed, int from, int to)
          Adds an effect to the track between the given times.
 void cut(int in, int out)
          Cuts out this track's timeline portion between the given (timeline) times.
 int getDuration()
          Returns this track's timeline out point in msec.
 int getEffectCount()
          Returns the number of effects currently asigned to this track.
 boolean getEnabled()
           
 int getID()
          Returns the unique ID of the track.
 TrackEffect getIndTrackEffect(int index)
          Returns the effect at the given index.
 int getLayer()
           
 boolean getLocked()
           
 int getMediaMajorType()
          Returns the major type of the media referenced by this track.
 java.lang.String getMediaPath()
          Returns the absolute path to this track's mediafile
 java.lang.String getName()
           
 int getOffset()
          Returns this track's timeline in point in msec
 int getSourceDuration()
          Returns this track's media out point in msec.
 int getSourceOffset()
          Returns this track's media in point in msec.
 TrackEffect getTrackEffect(int tfxType, java.lang.String GUID)
          Returns the effect with the given subtype or GUID.
 void lockTrack(boolean lock)
          Locks a track and excludes it from all kinds of editing operations.
 void removeEffect(TrackEffect effect)
          Removes the given effect from this track
 void setDuration(int duration)
          Sets this track's timeline out point in msec.
 void setEffectStartStop(TrackEffect effect, int startTime, int stopTime)
           
 void setEnabled(boolean isEnabled)
          Disables a track for output, i.e.: excludes it from rendering.
 void setLayer(int layer)
          Sets the z-order of videotracks.
 void setName(java.lang.String name)
           
 void setOffset(int offset)
          Sets this track's timeline in point in msec.
 void setSourceDuration(int srcDur)
          Sets this track's media out point in msec.
 void setSourceOffset(int srcOffset)
          Sets this track's media in point in msec.
 void setStretchMode(int sm)
          Determines how video that does not match project size will be rendered.
 void setVolume(float vol)
          Sets a fixed volume for an audio track.
 void setVolume(float vol, int from, int to, int curve)
          Sets the volume of an audiotrack to %vol (0 - mute, 1.0 - full volume) in the timespan defined by the given timeline times and with the given transition characteristics.
If any of the given times is invalid, it will be set to either the track's timeline in (%from) or out (%to) points.
This creates a volume effect for the track or - if one is already present - internally operates on that effect's automation settings, overwriting all cue points, that might be present for the given timespan.
To create more sophisticated volume curves, work with the effect's CuePoints directly and call updateEffectAutomation(TrackEffect fx).
You should be aware that this method results in some heavy action taking place behind the scenes.
 java.lang.String toString()
           
 void trim(int in, int out)
          Trims this track's timeline portion to the given span of (timeline) time.
 void updateEffectAutomation(TrackEffect forEffect)
          Updates effect settings and automation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SM_STRETCH

public static final int SM_STRETCH
See Also:
Constant Field Values

SM_CROP

public static final int SM_CROP
See Also:
Constant Field Values

SM_PRESERVEASPECT

public static final int SM_PRESERVEASPECT
See Also:
Constant Field Values

SM_PA_NOLETTERBOX

public static final int SM_PA_NOLETTERBOX
See Also:
Constant Field Values
Method Detail

getMediaMajorType

public int getMediaMajorType()
Returns the major type of the media referenced by this track. See DSMediaType.


getOffset

public int getOffset()
Returns this track's timeline in point in msec


setOffset

public void setOffset(int offset)
               throws DSJException
Sets this track's timeline in point in msec. This will move the track and not change its length on the timeline

Throws:
DSJException

getDuration

public int getDuration()
Returns this track's timeline out point in msec. To determine a track's absolute length use getDuration()-getOffset().


setDuration

public void setDuration(int duration)
                 throws DSJException
Sets this track's timeline out point in msec. This will change the track's length on the timeline and not move it.

Throws:
DSJException

getSourceOffset

public int getSourceOffset()
Returns this track's media in point in msec. That is: The time in the mediafile holding this track's data, that will play at the track's timeline in point.


setSourceOffset

public void setSourceOffset(int srcOffset)
                     throws DSJException
Sets this track's media in point in msec. This alters the part of a track's media file that is represented by the track on the timeline. This method also changes the source out point, i.e. it moves the represented source snippet through the file without altering the total length.

Throws:
DSJException

getSourceDuration

public int getSourceDuration()
Returns this track's media out point in msec. That is: The time in the mediafile holding this track's data, that will play at the track's timeline out point.


setSourceDuration

public void setSourceDuration(int srcDur)
                       throws DSJException
Sets this track's media out point in msec. This alters the part of a track's media file that is represented by the track on the timeline. This method changes the length of the represented source snippet Changing source duration without also changing timeline times results in the track's playback speed being altered.

Throws:
DSJException

getMediaPath

public java.lang.String getMediaPath()
Returns the absolute path to this track's mediafile


getID

public int getID()
Returns the unique ID of the track. IDs of tracks that got removed from a movie will not appear again.


setEnabled

public void setEnabled(boolean isEnabled)
Disables a track for output, i.e.: excludes it from rendering. Editing operations will still affect the track.


getEnabled

public boolean getEnabled()

lockTrack

public void lockTrack(boolean lock)
Locks a track and excludes it from all kinds of editing operations.


getLocked

public boolean getLocked()

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

setLayer

public void setLayer(int layer)
Sets the z-order of videotracks. The higher the layer number, the more upfront the track will appear. When a layernumber is passed in that's greater than the number of videotracks, the resulting layer will be number of videotracks.
This method does nothing for audiotracks.


getLayer

public int getLayer()

setStretchMode

public void setStretchMode(int sm)
Determines how video that does not match project size will be rendered. %sm - one of the SM_ constants.Default is SM_STRETCH.
This method does nothing for audiotracks.


setVolume

public void setVolume(float vol)
Sets a fixed volume for an audio track. Any volume automation, that might have been set, will be cleared.
You should be aware that this method - easy as its purpose may sound like - results in some heavy action taking place behind the scenes. It is not usable for realtime mixing of multiple tracks and should not be called from GUI elements like sliders that would call it repeatedly.


setVolume

public void setVolume(float vol,
                      int from,
                      int to,
                      int curve)
               throws DSJException
Sets the volume of an audiotrack to %vol (0 - mute, 1.0 - full volume) in the timespan defined by the given timeline times and with the given transition characteristics.
If any of the given times is invalid, it will be set to either the track's timeline in (%from) or out (%to) points.
This creates a volume effect for the track or - if one is already present - internally operates on that effect's automation settings, overwriting all cue points, that might be present for the given timespan.
To create more sophisticated volume curves, work with the effect's CuePoints directly and call updateEffectAutomation(TrackEffect fx).
You should be aware that this method results in some heavy action taking place behind the scenes. It is not usable for realtime mixing of multiple tracks and should not be called from GUI elements like sliders that would call it repeatedly.

Throws:
DSJException

addEffect

public void addEffect(EffectDescription ed,
                      int from,
                      int to)
               throws DSJException
Adds an effect to the track between the given times.

Throws:
DSJException

setEffectStartStop

public void setEffectStartStop(TrackEffect effect,
                               int startTime,
                               int stopTime)

removeEffect

public void removeEffect(TrackEffect effect)
                  throws DSJException
Removes the given effect from this track

Throws:
DSJException

updateEffectAutomation

public void updateEffectAutomation(TrackEffect forEffect)
                            throws DSJException
Updates effect settings and automation. Call this after manually altering an effect's cue points.

Throws:
DSJException

getEffectCount

public int getEffectCount()
Returns the number of effects currently asigned to this track.


getIndTrackEffect

public TrackEffect getIndTrackEffect(int index)
Returns the effect at the given index. Call getEffectCount() to see how many effects are currently active.


getTrackEffect

public TrackEffect getTrackEffect(int tfxType,
                                  java.lang.String GUID)
Returns the effect with the given subtype or GUID. %tfxType may be -1, %GUID may be null for either / or searches.


cut

public void cut(int in,
                int out)
         throws DSJException
Cuts out this track's timeline portion between the given (timeline) times. If in == out this simply cuts the track in two.

Throws:
DSJException

trim

public void trim(int in,
                 int out)
          throws DSJException
Trims this track's timeline portion to the given span of (timeline) time. Media times are adjusted accordingly.

Throws:
DSJException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object