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

tv.amwa.maj.example

## Class CompositionExample

- java.lang.Object
- - tv.amwa.maj.example.CompositionExample

-     public class CompositionExample
      extends Object

  Example of a class that creates some instances of AAF classes and writes them either to an XML or AAF structured storage file. To run the class, try:

       java tv.amwa.maj.example.CompositionExample <filename(.aaf|.isr|.xml)>

  The type of file to save is determined from the extension, where `.isr` and `.aaf` both produce a structured storage file.

  Note that you need the MAJ API on your classpath, either as a jar file or the compiled classes. To write a structured storage file, you must also have the POIFS library from Apache on the classpath.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositionExample()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(String[] args)` Create some AAF classes representing a package hierarchy, from top level composition down to top-level file packages, with a tape descriptor at the end of the source-reference chain.
    `static Preface` | `makeExamplePreface()` Create all the AAF objects required to represent the example top level composition.
    `static CDCIDescriptor` | `makeIMX50VideoDescriptor(long essenceLength, int linkedTrackID)` Example utility method to tidy up making an IMX50 picture descriptor.
    `static SourceClip` | `makeSourceClip(String trackType, Package sourcePackage, int sourceTrackID, long startPosition, long componentLength)` Example utility method useful to speed up the making of source clips.
    `static TimelineTrack` | `makeTimelineTrack(String trackType, Package sourceChainReference, int sourceTrackID, long startPosition, int localTrackID, long componentLength)` Example utility method to speed up making a timeline track.
    `static WAVEPCMDescriptor` | `makeWAVEPCMDescriptor(long essenceLength, int linledTrackID)` Example utility method to tidy up the making of a WAVE PCM descriptor.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CompositionExample

          public CompositionExample()

  - ### Method Detail

    - #### main

          public static final void main(String[] args)

      Create some AAF classes representing a package hierarchy, from top level composition down to top-level file packages, with a tape descriptor at the end of the source-reference chain. Write these packages to an XML or AAF structured storage file.

      Parameters:
        `args` - The filename to write the file to relative to the present working directory.

    - #### makeExamplePreface

          public static final Preface makeExamplePreface()
                                                  throws Exception

      Create all the AAF objects required to represent the example top level composition.

      Throws:
        `Exception`

    - #### makeIMX50VideoDescriptor

          public static final CDCIDescriptor makeIMX50VideoDescriptor(long essenceLength,
                                                                      int linkedTrackID)

      Example utility method to tidy up making an IMX50 picture descriptor.

    - #### makeWAVEPCMDescriptor

          public static final WAVEPCMDescriptor makeWAVEPCMDescriptor(long essenceLength,
                                                                      int linledTrackID)

      Example utility method to tidy up the making of a WAVE PCM descriptor.

    - #### makeTimelineTrack

          public static final TimelineTrack makeTimelineTrack(String trackType,
                                                              Package sourceChainReference,
                                                              int sourceTrackID,
                                                              long startPosition,
                                                              int localTrackID,
                                                              long componentLength)

      Example utility method to speed up making a timeline track.

    - #### makeSourceClip

          public static final SourceClip makeSourceClip(String trackType,
                                                        Package sourcePackage,
                                                        int sourceTrackID,
                                                        long startPosition,
                                                        long componentLength)

      Example utility method useful to speed up the making of source clips.

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