Examples of Movie


Examples of quicktime.std.movies.Movie

      // copy the audio into the new movie
      Track sound = mov.getIndTrackType(1,
        StdQTConstants.audioMediaCharacteristic,
        StdQTConstants.movieTrackCharacteristic);
      Movie video = MovieUtils.compileFrames(result.toArray(res),
        (int)MovieUtils.countFrames(mov, 0, 1), mov.getTimeScale());
      if (sound != null)
      {
        MovieUtils.addAudioTrack(sound, video);
      } // if (sound != null)
View Full Code Here

Examples of quicktime.std.movies.Movie

   * @param mov    Movie to copy
   * @return copy  Copy of mov
   */
  public static Movie cloneMovie(Movie mov)
  {
    Movie movie = null;
    try
    {
      movie = new Movie();
      mov.insertSegment(movie, 0, mov.getDuration(), 0);
      movie.setDefaultDataRef(new DataRef(new QTHandle()));
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)
View Full Code Here

Examples of quicktime.std.movies.Movie

  public static Movie addTextTrack(Movie mov, String text, String fontName,
    String fontOptions, int fontSize, int[] fgColor, int[] bgColor, int x,
    int y, float start, float duration)
  {
    // make a copy of the original movie
    Movie movie = MovieUtils.cloneMovie(mov);
    try
    {
      movie = new Movie();
      mov.insertSegment(movie, 0, mov.getDuration(), 0);
      movie.setDefaultDataRef(new DataRef(new QTHandle()));
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)

    // determine opaque / transparent background color; transparency is
    // indicated by a -1 in the first cell of bgColor
    int dfFlag = 0;
    if (bgColor[0] == -1)
    {
      dfFlag = StdQTConstants.dfAntiAlias | StdQTConstants.dfKeyedText;
    } // if (bgColor[0] == -1)
    else
    {
      dfFlag = StdQTConstants.dfAntiAlias;
    } // else

    // set up the Java font to estimate dimensions of the actual text
    // track using QDFont
    Font font = null;
    int style = 0;
    if (fontOptions.equalsIgnoreCase("plain"))
    {
      style = QDConstants.normal;
      font = new Font(fontName, Font.PLAIN, fontSize);
    } // if (fontOptions.equalsIgnoreCase("plain"))
    else if (fontOptions.equalsIgnoreCase("bold"))
    {
      style = QDConstants.bold;
      font = new Font(fontName, Font.BOLD, fontSize);
    } // else if (fontOptions.equalsIgnoreCase("bold"))
    else if (fontOptions.equalsIgnoreCase("italic"))
    {
      style = QDConstants.italic;
      font = new Font(fontName, Font.ITALIC, fontSize + 2);
    } // else if (fontOptions.equalsIgnoreCase("italic"))
    else if (fontOptions.equalsIgnoreCase("bolditalic"))
    {
      style = QDConstants.bold | QDConstants.italic;
      font = new Font(fontName, Font.PLAIN + Font.ITALIC, fontSize + 5);
    } // else if (fontOptions.equalsIgnoreCase("bolditalic"))
    else if (fontOptions.equalsIgnoreCase("underline"))
    {
      style = QDConstants.underlined;
      font = new Font(fontName, Font.ITALIC + Font.BOLD, fontSize);
    } // else if (fontOptions.equalsIgnoreCase("underline"))
    else if (fontOptions.equalsIgnoreCase("boldunderline"))
    {
      style = QDConstants.underlined | QDConstants.bold;
      font = new Font(fontName, Font.ITALIC + Font.BOLD, fontSize + 1);
    } // else if (fontOptions.equalsIgnoreCase("boldunderline"))
    else if (fontOptions.equalsIgnoreCase("italicunderline"))
    {
      style = QDConstants.underlined | QDConstants.italic;
      font = new Font(fontName, Font.ITALIC + Font.BOLD, fontSize + 1);
    } // else if (fontOptions.equalsIgnoreCase("italicunderline"))
    else if (fontOptions.equalsIgnoreCase("bolditalicunderline"))
    {
      style = QDConstants.underlined| QDConstants.italic | QDConstants.bold;
      font = new Font(fontName, Font.ITALIC + Font.BOLD, fontSize + 1);
    } // else if (fontOptions.equalsIgnoreCase("bolditalicunderline"))
    JDialog tempF = new JDialog();
    JPanel temp = new JPanel();
    temp.setFont(font);
    tempF.add(temp);

    // must be visible, otherwise g2 is null
    tempF.setVisible(true);
    temp.setVisible(true);
    Graphics2D g2 = (Graphics2D)temp.getGraphics();
    g2.setFont(font);
    g2.drawString(text, 0, 0);
    tempF.setVisible(false);
    FontRenderContext context = g2.getFontRenderContext();
    Rectangle2D rect = font.getStringBounds(text, context);
    int TEXT_TRACK_WIDTH = (int)rect.getWidth();
    int TEXT_TRACK_HEIGHT = (int)rect.getHeight();
    temp = null;
    tempF = null;
    QDRect textBox = new QDRect(0, 0, TEXT_TRACK_WIDTH, TEXT_TRACK_HEIGHT);

    // add text track
    Track textTrack;
    try
    {
      textTrack = movie.addTrack(TEXT_TRACK_WIDTH, TEXT_TRACK_HEIGHT, 0);
      Media textMedia = new TextMedia(textTrack, movie.getTimeScale());
      TextMediaHandler handler = (TextMediaHandler)textMedia.getHandler();
      textMedia.beginEdits();
      byte[] msgBytes = text.getBytes();
      QTPointer msgPoint = new QTPointer(msgBytes);
      handler.addTextSample(msgPoint, QDFont.getFNum(fontName), fontSize, style,
        new QDColor(fgColor[0] / 255f, fgColor[1] / 255f, fgColor[2] / 255f),
        new QDColor(bgColor[0] / 255f, bgColor[1] / 255f, bgColor[2] / 255f),
        QDConstants.teJustLeft, textBox, dfFlag, QDFont.getFNum(fontName), 0, 0,
        QDColor.white, Math.round(duration * movie.getTimeScale()));
      textMedia.endEdits();
      textTrack.insertMedia(Math.round(start * movie.getTimeScale()), 0,
        textMedia.getDuration(), 1);

      // position the text track to (x, y)
      Matrix mat = new Matrix();
      mat.rect(new QDRect(0, 0, TEXT_TRACK_WIDTH, TEXT_TRACK_HEIGHT),
View Full Code Here

Examples of quicktime.std.movies.Movie

    String fontOptions, int fontSize, int[] fgColor, int[] bgColor, int x,
    int y, int width, int height)
  throws QTException
  {
    // make a new copy of mov
    Movie movie = cloneMovie(mov);
    int timescale = movie.getTimeScale();

    TimeCodeDef tcDef = new TimeCodeDef();
    tcDef.setTimeScale(movie.getTimeScale());
    int fps = MovieUtils.countFrames(movie, 0, 1);

    tcDef.setFrameDuration(movie.getTimeScale() / fps);
    tcDef.setFramesPerSecond(fps);
    tcDef.setFlags(StdQTConstants.tcDropFrame);

    // first record at 0 hrs, 0 min, 0 sec, 0 frames
    TimeCodeTime tcTime = new TimeCodeTime (0, 0, 0, 0);

    // create time code track and media
    Track tcTrack = movie.addTrack (width, height, 0);
    TimeCodeMedia tcMedia = new TimeCodeMedia (tcTrack, timescale);
    TimeCoder timeCoder = tcMedia.getTimeCodeHandler();

    int style = 0;
    if (fontOptions.equalsIgnoreCase("plain"))
    {
      style = QDConstants.normal;
    } // if (fontOptions.equalsIgnoreCase("plain"))
    else if (fontOptions.equalsIgnoreCase("bold"))
    {
      style = QDConstants.bold;
    } // else if (fontOptions.equalsIgnoreCase("bold"))
    else if (fontOptions.equalsIgnoreCase("italic"))
    {
      style = QDConstants.italic;
    } // else if (fontOptions.equalsIgnoreCase("italic"))
    else if (fontOptions.equalsIgnoreCase("bolditalic"))
    {
      style = QDConstants.bold | QDConstants.italic;
    } // else if (fontOptions.equalsIgnoreCase("bolditalic"))
    else if (fontOptions.equalsIgnoreCase("underline"))
    {
      style = QDConstants.underlined;
    } // else if (fontOptions.equalsIgnoreCase("underline"))
    else if (fontOptions.equalsIgnoreCase("boldunderline"))
    {
      style = QDConstants.underlined | QDConstants.bold;
    } // else if (fontOptions.equalsIgnoreCase("boldunderline"))
    else if (fontOptions.equalsIgnoreCase("italicunderline"))
    {
      style = QDConstants.underlined | QDConstants.italic;
    } // else if (fontOptions.equalsIgnoreCase("italicunderline"))
    else if (fontOptions.equalsIgnoreCase("bolditalicunderline"))
    {
      style = QDConstants.underlined| QDConstants.italic | QDConstants.bold;
    } // else if (fontOptions.equalsIgnoreCase("bolditalicunderline"))

    // turn on time code display, set colors
    timeCoder.setFlags(timeCoder.getFlags() | StdQTConstants.tcdfShowTimeCode,
      StdQTConstants.tcdfShowTimeCode);
    TCTextOptions tcTextOptions = timeCoder.getDisplayOptions();
    tcTextOptions.setTXSize(fontSize);
    tcTextOptions.setTXFace(style);
    tcTextOptions.setTXFont(QDFont.getFNum(fontName));
    tcTextOptions.setForeColor(new QDColor(fgColor[0] / 255f, fgColor[1] / 255f,
      fgColor[2] / 255f));

    // if transparency is indicated, set background color to a special value
    if (bgColor[0] == -1)
    {
      tcTextOptions.setBackColor(new QDColor(0.1f, 0.7f, 0.43f));
    } // if (bgColor[0] == -1)
    else
    {
      tcTextOptions.setBackColor(new QDColor(bgColor[0] / 255f,
        bgColor[1] / 255f, bgColor[2] / 255f));
    } // else
    timeCoder.setDisplayOptions(tcTextOptions);

    // set up a sample as a 4-byte array in a QTHandle
    int frameNumber = timeCoder.toFrameNumber(tcTime, tcDef);
    int frameNums[] = new int[1];

    // BOOK ERRATA: this is buggy on Windows for time codes other
    // than 00:00:00;00.  You need to adjust for endianness, as
    // seen in the revised (uncommented) line.
    // frameNums[0] = frameNumber;
    frameNums[0] = EndianOrder.flipNativeToBigEndian32(frameNumber);
    QTHandle frameNumHandle = new QTHandle (4, false);
    frameNumHandle.copyFromArray(0, frameNums, 0, 1);

    // create a time code description (sample to be added)
    TimeCodeDescription tcDesc = new TimeCodeDescription();
    tcDesc.setTimeCodeDef (tcDef);

    // add the sample to the TimeCodeMedia
    tcMedia.beginEdits();
    tcMedia.addSample(frameNumHandle, 0, frameNumHandle.getSize(),
      movie.getDuration(), tcDesc, 1, 0);
    tcMedia.endEdits();

    // insert media into track
    tcTrack.insertMedia(0, 0, tcMedia.getDuration(), 1);
View Full Code Here

Examples of quicktime.std.movies.Movie

   * @param mov2     Movie to append
   * @return result  mov2 appended to end of mov1
   */
  public static Movie movieAppend(Movie mov1, Movie mov2)
  {
    Movie composite = null;
    Movie movie1 = null;
    Movie movie2 = null;
    try
    {
      QDRect box1 = mov1.getBox();
      QDRect box2 = mov2.getBox();
      int height1 = box1.getHeight();
      int height2 = box2.getHeight();
      int width1 = box1.getWidth();
      int width2 = box2.getWidth();

      // variables for the matrix translations
      float a = 0, b = 0, c = 0, d = 0;
      movie1 = new Movie();
      movie2 = new Movie();
      composite = new Movie();

      // insert the movies to new movie files, in order to resize without
      // affecting originals
      mov1.insertSegment(movie1, 0, mov1.getDuration(), 0);
      mov2.insertSegment(movie2, 0, mov2.getDuration(), 0);
      Track track1 = movie1.getIndTrackType(1,
        StdQTConstants.videoMediaType,
        StdQTConstants.movieTrackMediaType);
      Track track2 = movie2.getIndTrackType(1,
        StdQTConstants.videoMediaType,
        StdQTConstants.movieTrackMediaType);
      Matrix matrix1 = track1.getMatrix();
      Matrix matrix2 = track2.getMatrix();

      // translate tracks based on size
      if (box1.equals(box2))
      {
        // do nothing - no resizing needed
      } // if (box1.equals(box2))
      else if ((height1 >= height2) && (width1 >= width2))
      {
        c = (width1 - width2) / 2;
        d = (height1 - height2) / 2;
      } // else if ((height1 >= height2) && (width1 >= width2))
      else if ((height2 >= height1) && (width2 >= width1))
      {
        a = (width2 - width1) / 2;
        b = (height2 - height1) / 2;
      } // else if ((height2 >= height1) && (width2 >= width1))
      else if ((height1 >= height2) && (width2 >= width1))
      {
        a = (width2 - width1) / 2;
        d = (height1 - height2) / 2;
      } // else if ((height1 >= height2) && (width2 >= width1))
      else if ((height2 >= height1) && (width1 >= width2))
      {
        b = (height2 - height1) / 2;
        c = (width1 - width2) / 2;
      } // else if ((height2 >= height1) && (width1 >= width2))

      // modify matrices based on changes made in the if-clause above
      matrix1.translate(a, b);
      matrix2.translate(c, d);

      // set tracks to changed matrices
      track1.setMatrix(matrix1);
      track2.setMatrix(matrix2);

      // add the two movies with translated video tracks to the returned
      // composite
      movie2.insertSegment(composite, 0, movie2.getDuration(), 0);
      movie1.insertSegment(composite, 0, movie1.getDuration(), 0);
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
View Full Code Here

Examples of quicktime.std.movies.Movie

   * @param end       Time in mov to stop extracting
   * @return segment  Segment of mov from start to end
   */
  public static Movie extractSegment(Movie mov, float start, float end)
  {
    Movie section = null;
    try
    {
      section = new Movie();
      int begin = Math.round(start * mov.getTimeScale());
      int finish = Math.round(end * mov.getTimeScale());
      mov.insertSegment(section, begin, finish - begin, 0);
      section.setTimeScale(mov.getTimeScale());
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)
View Full Code Here

Examples of quicktime.std.movies.Movie

   * @param time     Time in dest to insert src
   * @return result  dest with src inserted at time
   */
  public static Movie insertSegment(Movie src, Movie dest, float time)
  {
    Movie union = null;
    try
    {
      // create a new movie
      union = new Movie();

      // convert time from seconds to a time in dest's time scale
      int there = Math.round(time * dest.getTimeScale());

      // copy dest into new movie up until the time of insertion
      dest.insertSegment(union, 0, there, 0);

      // copy src, in its entirety, into new movie
      src.insertSegment(union, 0, src.getDuration(), union.getDuration());

      // copy rest of dest into new movie
      dest.insertSegment(union, there, dest.getDuration(), union.getDuration());
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)
View Full Code Here

Examples of reserv.entity.Movie

            movie.setName(name);           
            em.persist(movie);
            em.getTransaction().commit();   
            em.close();

            this.movie = new Movie();
            this.name = "";
            PixTomMessages.addFlash("Film został dodany pomyślnie.");
           
          
        }
View Full Code Here

Examples of su.litvak.moviedb.entity.Movie

            fld.setPreferredSize(new Dimension(150, fld.getPreferredSize().height));
        }
    }

    public MoviePanel() {
        movie = new Movie();

        performLayout();
    }
View Full Code Here

Examples of tripleplay.flump.Movie

        if (listener.onVisit(parentLayer, root, depth)) {
            return true;
        }

        if (root instanceof Movie) {
            Movie movie = (Movie) root;
            depth ++;
            for (String layer : movie.namedLayers().keySet()) {
                for (Instance instance : movie.getInstances(layer)) {
                    if (applyToHierarchy0(layer, instance, listener, depth)) {
                        return true;
                    }
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.