Package

Source Code of Phoenix

//----- Quicktime Imports ------------------------------------------------------
import quicktime.QTException;
import quicktime.io.OpenMovieFile;
import quicktime.io.QTFile;
import quicktime.std.movies.Movie;

//----- Phoenix Imports --------------------------------------------------------
import controller.PhoenixController;
import controller.SchemeController;

/**
* Video Phoenix
* Version 0.2.0
* Copyright (c) 2007 Lunderskov, Ian; Pan, Jiabei; Rebelsky, Samuel;
* Whisenhunt, Heather; Young, Ian; Zuleta Benavides, Luis.
* All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* @author  Lunderskov, Ian; Pan, Jiabei; Rebelsky, Samuel; Whisenhunt, Heather;
*          Young, Ian; Zuleta Benavides, Luis
* @author  Glimmer Labs 2006-2007
* @version 0.2.0
*/
public class Phoenix
{
  /*--------*-------------------------------------------------------------------
   * Fields *
   *--------*/

  static PhoenixController controller;

  /**
   * Entry point of Phoenix. Initialize UI, Scheme environment and all
   * functionalities
   */
  public static void main(String args[])
  {   
    // create a PhoenixController that will make all other controllers
    // and windows
    Phoenix.controller = new PhoenixController();

    // load the Phoenix commands library
    SchemeController.schemeCall("(include \"resources/InitialScheme.scm\")",
      false);
  } // main(String args[])


  /*---------*------------------------------------------------------------------
   * Methods *
   *---------*/

  /**
   * Get the PhoenixController for this instance of Phoenix
   *
   * @return phoenixController  PhoenixController for this instance
   */
  public static PhoenixController getController()
  {
    return Phoenix.controller;
  } // getController()

  /**
   * Test if Phoenix is fully functional
   *
   * @return result  Whether or not Phoenix is functioning correctly
   */
  public static String test()
  {
    // get a standard file chooser
    Movie mov = null;
    QTFile file = null;
    try
    {
      file = QTFile.standardGetFilePreview(QTFile.kStandardQTFileTypes);
      mov = Movie.fromFile(OpenMovieFile.asRead(file));
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)

    // retrieve a pict at time 0 (int time on mov's QT timescale) of all
    // enabled video tracks
    try
    {
      quicktime.qd.Pict pic = mov.getPict(0);
      System.out.println("width = " + pic.getPictFrame().getWidth()
        + ", height = " + pic.getPictFrame().getHeight());
      if ((pic.getPictFrame().getWidth() < 0)
          || (pic.getPictFrame().getHeight() < 0))
      {
        return "Test failed. Please update to the most recent version of" +
        " QuickTime.";
      } // if ((pic.getPictFrame().getWidth() < 0) ...
      else
      {
        return "Test succeeded.";
      } // else
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)
    return "";
  } // test()
} // class Phoenix
TOP

Related Classes of Phoenix

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.