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

tv.amwa.maj.model

## Interface Segment

- All Superinterfaces:
    Component, InterchangeObject, MediaEntity, MetadataObject
  All Known Subinterfaces:
    CommentMarker, DescriptiveClip, DescriptiveMarker, EdgeCodeSegment, EssenceGroup, Event, Filler, GPITrigger, HTMLClip, NestedScope, OperationGroup, Pulldown, QOperationGroup, QSegment, QSequence, QSourceClip, QTimecode, ScopeReference, Selector, Sequence, SourceClip, SourceReferenceSegment, TextClip, TimecodeSegment, TimecodeStream, TimecodeStream12M
  All Known Implementing Classes:
    CommentMarkerImpl, DescriptiveClipImpl, DescriptiveMarkerImpl, EdgeCodeSegmentImpl, EssenceGroupImpl, EventImpl, FillerImpl, GPITriggerImpl, HTMLClipImpl, NestedScopeImpl, OperationGroupImpl, PulldownImpl, ScopeReferenceImpl, SegmentImpl, SelectorImpl, SequenceImpl, SourceClipImpl, SourceReferenceSegmentImpl, TextClipImpl, TimecodeSegmentImpl, TimecodeStream12MImpl, TimecodeStreamImpl

      public interface Segment
      extends Component

  Specifies a component that is independent of any surrounding object. Contrast this to a transition which is a component that depends on other components to establish its value.

  See Also:
    `Track.getTrackSegment()`, `Pulldown.getInputSegment()`, `TypeDefinitions.SegmentStrongReference`, `TypeDefinitions.SegmentStrongReferenceVector`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Segment` | `clone()` Create a cloned copy of this segment.
    `Sequence` | `generateSequence()` Create a sequence containing just this segment.
    `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.

    - ### 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`

- - ### Method Detail

    - #### segmentOffsetToTC

          TimecodeValue segmentOffsetToTC(@PositionType
                                          long offset)
                                   throws TimecodeNotFoundException

      Converts the given segment offset to a timecode value.

      Parameters:
        `offset` - Segment offset to be converted to a timecode.
      Returns:
        Converted timecode value.
      Throws:
        `TimecodeNotFoundException` - The given offset is not available as a timecode value in this segment.
      See Also:
        `segmentTCToOffset(TimecodeValue, Rational)`

    - #### segmentTCToOffset

          @FrameOffset
          long segmentTCToOffset(TimecodeValue timecode,
                                              Rational editRate)
                                       throws NullPointerException,
                                              TimecodeNotFoundException,
                                              BadSampleOffsetException

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

      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:
        `segmentOffsetToTC(long)`

    - #### generateSequence

          Sequence generateSequence()

      Create a sequence containing just this segment.

      Returns:
        Sequence containing just this segment.

    - #### clone

          Segment clone()

      Create a cloned copy of this segment.

      Specified by:
        `clone` in interface `Component`
      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `MediaEntity`
      Returns:
        Cloned copy of this segment.

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