TimecodeSegmentImpl (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.model.impl

## Class TimecodeSegmentImpl

- java.lang.Object
- - tv.amwa.maj.model.impl.InterchangeObjectImpl
  - - tv.amwa.maj.model.impl.ComponentImpl
    - - tv.amwa.maj.model.impl.SegmentImpl
      - - tv.amwa.maj.model.impl.TimecodeSegmentImpl

- All Implemented Interfaces:
    Serializable, Cloneable, QComponent, QSegment, QTimecode, MediaEntity, MetadataObject, Component, InterchangeObject, Segment, TimecodeSegment

      @MediaClass(uuid1=218169601,
                  uuid2=257,
                  uuid3=5120,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="Timecode",
                  description="The Timecode class stores videotape or audio tape timecode information.",
                  symbol="Timecode")
      public class TimecodeSegmentImpl
      extends SegmentImpl
      implements TimecodeSegment, QTimecode, Serializable, Cloneable

  Implements the storage of video tape or audio tape timecode information.

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class tv.amwa.maj.model.impl.InterchangeObjectImpl

      `ObjectClassPropertyID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimecodeSegmentImpl()`
    `TimecodeSegmentImpl(long length, TimecodeValue timecode)` Creates and initializes a new timecode segment class, which stores videotape or audio tape timecode information.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TimecodeSegment` | `clone()` Create a cloned copy of this interchange object.
    `boolean` | `getDropFrame()` Determines whether the timecode is drop (`true` value) or nondrop (`false` value).
    `short` | `getFramesPerSecond()` Returns the frames per second of the videotape or audio tape of the timecode.
    `long` | `getStartTimecode()` Returns the timecode value by the number of frames offset from the start of the video or audio.
    `TimecodeValue` | `getTimecode()` Returns the timecode value for this timecode segment, which specifies the start timecode for the segment, the frames per second of the tape and whether the timecode is drop or non-drop.
    `int` | `getTimecodeModifiedFlag()`
    `static boolean` | `initializeDropFrame()`
    `static short` | `initializeFramesPerSecond()`
    `static long` | `initializeStartTimecode()`
    `TimecodeValue` | `segmentOffsetToTC(long offset)` Converts the given segment offset to a timecode value.
    `long` | `segmentTCToOffset(TimecodeValue timecode, Rational editrate)` Converts the given timecode and edit rate to a segment offset value.
    `void` | `setDropFrame(boolean dropFrame)`
    `void` | `setFPS(short fps)`
    `void` | `setStartTimecode(long startFrame)`
    `void` | `setTimecode(TimecodeValue timecode)` Set the timecode value for this timecode segment, which specifies the start timecode for the segment, the frames per second of the tape and whether the timecode is drop or non-drop.
    `void` | `setTimecodeModifiedFlag(Integer timecodeModifiedFlag)`

    - ### Methods inherited from class tv.amwa.maj.model.impl.SegmentImpl

      `generateSequence, getCutPoint, getKeyOffset, getPackLayerKeyIndicator, getSegmentBlob, getTrackBlob, getTrackKeyRenderSequence, getTrackName, getTrackRenderSequence, setCutPoint, setKeyOffset, setPackLayerKeyIndicator, setSegmentBlob, setTrackBlob, setTrackKeyRenderSequence, setTrackName, setTrackRenderSequence`

    - ### Methods inherited from class tv.amwa.maj.model.impl.ComponentImpl

      `appendComponentAttribute, appendComponentAttribute, appendComponentKLVData, appendComponentUserComment, appendComponentUserComment, clearComponentAttributes, clearComponentKLVData, clearComponentUserComments, countComponentAttributes, countComponentKLVData, countComponentUserComments, getComment, getComponentAttributes, getComponentDataDefinition, getComponentKLVData, getComponentLength, getComponentUserComments, getEditName, getJupiterClipOffset, getJupiterID, getLengthPresent, initializeComponentDataDefinition, prependComponentAttribute, prependComponentKLVData, prependComponentUserComment, removeComponentAttribute, removeComponentKLVData, removeComponentUserComment, setComponentDataDefinition, setComponentLength, setComponentLengthFromStream, setEditName, setJupiterClipOffset, setJupiterID, setLengthPresent`

    - ### Methods inherited from class tv.amwa.maj.model.impl.InterchangeObjectImpl

      `addApplicationPlugin, appendXMLChildren, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getLinkedGenerationIDString, getObjectClass, getPersistentID, getPersistentIndex, hashCode, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setLinkedGenerationIDString, setObjectClass, setPersistentID, setPersistentIndex, toString`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface tv.amwa.maj.model.Segment

      `generateSequence`

    - ### Methods inherited from interface tv.amwa.maj.model.Component

      `appendComponentAttribute, appendComponentAttribute, appendComponentKLVData, appendComponentUserComment, appendComponentUserComment, clearComponentAttributes, clearComponentKLVData, clearComponentUserComments, countComponentAttributes, countComponentKLVData, countComponentUserComments, getComponentAttributes, getComponentDataDefinition, getComponentKLVData, getComponentLength, getComponentUserComments, getLengthPresent, removeComponentAttribute, removeComponentKLVData, removeComponentUserComment, setComponentDataDefinition, setComponentLength, setLengthPresent`

    - ### Methods inherited from interface tv.amwa.maj.model.InterchangeObject

      `addApplicationPlugin, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getObjectClass, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setObjectClass, toString`

    - ### Methods inherited from interface tv.amwa.maj.industry.MediaEntity

      `getPersistentID, setPersistentIndex`

- - ### Constructor Detail

    - #### TimecodeSegmentImpl

          public TimecodeSegmentImpl()

    - #### TimecodeSegmentImpl

          public TimecodeSegmentImpl(long length,
                                     TimecodeValue timecode)
                              throws NullPointerException,
                                     BadLengthException

      Creates and initializes a new timecode segment class, which stores videotape or audio tape timecode information.

      Parameters:
        `length` - The length of this component.
        `timecode` - Timecode value of the new timecode segment.
      Throws:
        `NullPointerException` - The timecode value is `null`.
        `BadLengthException` - Cannot set the length of a component to a negative value.

  - ### Method Detail

    - #### getTimecode

          public TimecodeValue getTimecode()

      Description copied from interface: `TimecodeSegment`

      Returns the timecode value for this timecode segment, which specifies the start timecode for the segment, the frames per second of the tape and whether the timecode is drop or non-drop.

      Specified by:
        `getTimecode` in interface `TimecodeSegment`
      Returns:
        Timecode value for the timecode segment.
      See Also:
        `TimecodeSegment.getStartTimecode()`, `TimecodeSegment.getFramesPerSecond()`, `TimecodeSegment.getDropFrame()`

    - #### setTimecode

          public void setTimecode(TimecodeValue timecode)
                           throws NullPointerException

      Description copied from interface: `TimecodeSegment`

      Set the timecode value for this timecode segment, which specifies the start timecode for the segment, the frames per second of the tape and whether the timecode is drop or non-drop.

      Specified by:
        `setTimecode` in interface `TimecodeSegment`
      Parameters:
        `timecode` - Timecode value for this timecode segment.
      Throws:
        `NullPointerException` - The given value for the timecode is `null`.
      See Also:
        `Forge.makeTimecode(long, short, boolean)`

    - #### getStartTimecode

          @MediaProperty(uuid1=117571843,
                         uuid2=261,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="StartTimecode",
                         aliases={"Start","TimecodeStart"},
                         typeName="PositionType",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=5377,
                         symbol="StartTimecode")
          public long getStartTimecode()

      Description copied from interface: `TimecodeSegment`

      Returns the timecode value by the number of frames offset from the start of the video or audio.

      Specified by:
        `getStartTimecode` in interface `TimecodeSegment`
      Returns:
        Timecode offset value.
      See Also:
        `TimecodeSegment.getTimecode()`

    - #### setStartTimecode

          @MediaPropertySetter(value="StartTimecode")
          public void setStartTimecode(long startFrame)

    - #### initializeStartTimecode

          public static final long initializeStartTimecode()

    - #### getFramesPerSecond

          @MediaProperty(uuid1=67371265,
                         uuid2=518,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="FramesPerSecond",
                         aliases="FPS",
                         typeName="UInt16",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=5378,
                         symbol="FramesPerSecond")
          public short getFramesPerSecond()

      Description copied from interface: `TimecodeSegment`

      Returns the frames per second of the videotape or audio tape of the timecode.

      Specified by:
        `getFramesPerSecond` in interface `TimecodeSegment`
      Returns:
        Frames per second of the videotape or audiotape of the timecode.
      See Also:
        `TimecodeSegment.getTimecode()`

    - #### setFPS

          @MediaPropertySetter(value="FramesPerSecond")
          public void setFPS(short fps)
                                                                    throws IllegalArgumentException

      Throws:
        `IllegalArgumentException`

    - #### initializeFramesPerSecond

          public static final short initializeFramesPerSecond()

    - #### getDropFrame

          @MediaProperty(uuid1=67371265,
                         uuid2=1280,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,1},
                         definedName="DropFrame",
                         aliases="Drop",
                         typeName="Boolean",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=5379,
                         symbol="DropFrame")
          public boolean getDropFrame()

      Description copied from interface: `TimecodeSegment`

      Determines whether the timecode is drop (`true` value) or nondrop (`false` value).

      If drop is set to `true`, the real frames-per-second rate represented by the timecode is 29.97. Calculations of the real time represented by a timecode or to create a textual representation of the time code drop 108 selected frames per hour.

      Specified by:
        `getDropFrame` in interface `TimecodeSegment`
      Returns:
        Is the timecode a drop value?
      See Also:
        `TimecodeSegment.getTimecode()`

    - #### setDropFrame

          @MediaPropertySetter(value="DropFrame")
          public void setDropFrame(boolean dropFrame)

    - #### getTimecodeModifiedFlag

          @MediaProperty(uuid1=1830128499,
                         uuid2=3398,
                         uuid3=17769,
                         uuid4={-99,88,8,95,69,-8,50,117},
                         definedName="Timecode modified flag",
                         symbol="Timecode_modified_flag",
                         aliases="Timecode_modified_flag",
                         typeName="Int32",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=0,
                         prefix="q",
                         namespace="http://www.quantel.com/genQ/extensions")
           @Int32
          public int getTimecodeModifiedFlag()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       throws PropertyNotPresentException

      Specified by:
        `getTimecodeModifiedFlag` in interface `QTimecode`
      Throws:
        `PropertyNotPresentException`

    - #### setTimecodeModifiedFlag

          @MediaPropertySetter(value="Timecode modified flag")
          public void setTimecodeModifiedFlag(@Int32
                                                                                                   Integer timecodeModifiedFlag)

      Specified by:
        `setTimecodeModifiedFlag` in interface `QTimecode`

    - #### initializeDropFrame

          public static final boolean initializeDropFrame()

    - #### segmentOffsetToTC

          public TimecodeValue segmentOffsetToTC(long offset)

      Description copied from interface: `Segment`

      Converts the given segment offset to a timecode value.

      Specified by:
        `segmentOffsetToTC` in interface `Segment`
      Overrides:
        `segmentOffsetToTC` in class `SegmentImpl`
      Parameters:
        `offset` - Segment offset to be converted to a timecode.
      Returns:
        Converted timecode value.
      See Also:
        `Segment.segmentTCToOffset(TimecodeValue, Rational)`

    - #### segmentTCToOffset

          public long segmentTCToOffset(TimecodeValue timecode,
                                        Rational editrate)
                                 throws NullPointerException,
                                        TimecodeNotFoundException,
                                        BadSampleOffsetException

      Description copied from interface: `Segment`

      Converts the given timecode and edit rate to a segment offset value.

      Specified by:
        `segmentTCToOffset` in interface `Segment`
      Overrides:
        `segmentTCToOffset` in class `SegmentImpl`
      Parameters:
        `timecode` - Timecode to be converted to an offset.
        `editrate` - Edit rate of the given timecode.
      Returns:
        Frame offset into the segment.
      Throws:
        `NullPointerException` - One or both of the given timecode and/or edit rate is/are `null`.
        `TimecodeNotFoundException` - The given timecode is not available in this segment.
        `BadSampleOffsetException` - The given timecode is outside the bounds of the timecode values represented by this segment.
      See Also:
        `Segment.segmentOffsetToTC(long)`

    - #### clone

          public TimecodeSegment clone()

      Description copied from interface: `InterchangeObject`

      Create a cloned copy of this interchange object.

      Specified by:
        `clone` in interface `MediaEntity`
      Specified by:
        `clone` in interface `Component`
      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `Segment`
      Specified by:
        `clone` in interface `TimecodeSegment`
      Overrides:
        `clone` in class `SegmentImpl`
      Returns:
        Cloned copy of this interchange object.

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.