All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.QTSession

java.lang.Object
   |
   +----quicktime.QTSession

public final class QTSession
extends Object
implements QuickTimeLib, QuickTimeVRLib, QuickDraw3DLib
This class will check if QT is present and provides calls for enterMovies. This essentially does any initialisation that QT requires.

QTSession.open will intialize QuickTime, do a gestalt check and call enterMovies. Calls to the initialize routine are accumulative - thus if your code calls QTSession.open (which calls QTSession.initialize) and/or QTSession.initialize, the current session of QuickTime will only be closed down when it gets the same number of calls to QTSession.close (which calls QTSession.terminate) and/or QTSession.terminate.

A typical usage of QTSession calls by an application, applet or bean is: (this gives the applet version)

public class MyApplet extends Applet {
public void init () {
try {
QTSession.open();
...
} catch (QTException e) {
}
}
public void destroy () {
QTSession.close();
}
}
Thus the applet initializes the QTSession in its init method and closes it down in its destroy method. This ensures that if you have other applets (or beans, etc) that are running in the same process that the QuickTime session will only be terminated when all of the current Java QTSessions in that process have been destroyed.


Variable Index

 o kInit3D
Flags that can be passed in to the open call to also initialise these environments.
 o kInitVR
Flags that can be passed in to the open call to also initialise these environments.
 o kMacOS
The list of currently supported operating systems for QTJava.
 o kWin32
The list of currently supported operating systems for QTJava.

Method Index

 o addActiveCanvas(QTCanvas)
Adds a canvas to a registry of active canvases.
 o close()
This call will close down the QTML environment.
 o enterMovies()
Before you call any Movie Toolbox functions, you must initialize the toolbox

QuickTime::EnterMovies()

 o exitMovies()
QuickTime calls the ExitMovies function automatically when your application quits - you only need to call thi function if you finish with the Movie Toolbox long before your application is ready to quit.
 o gestalt(int)
This call will do a gestalt check.
 o getBugFixVersion()
This returns the sub version of QuickTime that is currently present
 o getDeveloperVersion()
This returns the sub version of QuickTime that is currently present
 o getJavaVersion()
Return the Java version in the format of:0xVVVVSSSS.
 o getMajorVersion()
This contains the version of QuickTime that is currently present
 o getMinorVersion()
This returns the sub version of QuickTime that is currently present
 o getQTMajorVersion()
This returns the major version of QuickTime
 o getQTMinorVersion()
This returns the minor version of QuickTime
 o getQTVersion()
This returns the complete version number of QuickTime
 o initialize(int)
This call will open a QTSession and perform any initialisations of the QT environment.
 o initialize3D()
 o initializeVR()
This call will initialize QTVR.
 o is3DInitialized()
This call will return true if the QuickTime Session has been initialized, otherwise false.
 o isCurrentOS(int)
This method returns true if the passed in OS name is the OS upon which the current session of QuickTime is running.
 o isInitialized()
This call will return true if the QuickTime Session has been initialized, otherwise false.
 o isQD3DAvailable()
Determine whether it is safe to call a QuickDraw 3D API.
 o isQTVRAvailable()
Determine whether it is safe to call a QuickTime VR API.
 o isVRInitialized()
This call will return true if the QuickTime Session has been initialized, otherwise false.
 o open()
This call will open a QTSession and perform any initialisations of the QTML environment.
 o open(int)
This call will open a QTSession and perform any initialisations of the QTML environment.
 o open(int, int, int)
This call will open a QTSession and perform any initialisations of the QTML environment.
 o removeActiveCanvas(QTCanvas)
Removes a canvas from a registry of active canvases.
 o terminate()
This call will close down the QTML environment, VR and QD3D.
 o terminate3D()
This call will terminate QuickDraw3D.
 o terminateVR()
This call will terminate QTVR.
 o terminationLock()

Variables

 o kMacOS
 public static final int kMacOS
The list of currently supported operating systems for QTJava.

 o kWin32
 public static final int kWin32
The list of currently supported operating systems for QTJava.

 o kInitVR
 public static final int kInitVR
Flags that can be passed in to the open call to also initialise these environments.

 o kInit3D
 public static final int kInit3D
Flags that can be passed in to the open call to also initialise these environments.

Methods

 o getJavaVersion
 public static int getJavaVersion()
Return the Java version in the format of:0xVVVVSSSS.

Returns:
an int
 o isCurrentOS
 public static boolean isCurrentOS(int osName)
This method returns true if the passed in OS name is the OS upon which the current session of QuickTime is running.

Parameters:
osName - the osName of the system that you want to find out if you are running on.
Returns:
true if the current OS is the one as passed in or false if not.
 o isInitialized
 public static boolean isInitialized()
This call will return true if the QuickTime Session has been initialized, otherwise false. An application should acquire the termination lock if it is possible that the QTSession has been terminated or could be terminated whilst this query is being processed.
 	synchronized (QTSession.terminationLock()) {
		if (QTSession.isInitialized()) {
			//...
		}
	}
 

Returns:
true if still initialized
 o isVRInitialized
 public static boolean isVRInitialized()
This call will return true if the QuickTime Session has been initialized, otherwise false.

 o is3DInitialized
 public static boolean is3DInitialized()
This call will return true if the QuickTime Session has been initialized, otherwise false.

 o initialize
 public static void initialize(int flag) throws QTException
This call will open a QTSession and perform any initialisations of the QT environment. If you use this call (and not the open calls) then you should also ensure that you check that QT is present through the gestalt call and call enterMovies to initialize the movie toolbox.

QuickTime::InitializeQTML()

Parameters:
flag - flag that are valid for this call.
 o initializeVR
 public static void initializeVR() throws QTException
This call will initialize QTVR. It must be called before any of the QTVR API calls are made.

QuickTime::InitializeQTVR()

 o initialize3D
 public static void initialize3D() throws QTException
 o open
 public static void open() throws QTException
This call will open a QTSession and perform any initialisations of the QTML environment. This will ensure that any required initialisations are performed, and that the required version of QuickTime is present. The minimal version of QT that is required is version 3. This will also call EnterMovies.

QuickTime::InitializeQTML()



QuickTime::Gestalt()



QuickTime::EnterMovies()

 o open
 public static void open(int initFlag) throws QTException
This call will open a QTSession and perform any initialisations of the QTML environment. This will ensure that any required initialisations are performed, and that the required version of QuickTime is present. The minimal version of QT that is required is version 3. You can set the initialisation options to also have this call initialise QuickTimeVR and/or QuickDraw3D.

Parameters:
initFlag - can also initialise VR or 3D. This will also call EnterMovies.

QuickTime::InitializeQTML()



QuickTime::Gestalt()



QuickTime::EnterMovies()

 o open
 public static void open(int version,
                         int minorVersion,
                         int initFlag) throws QTException
This call will open a QTSession and perform any initialisations of the QTML environment. You can optionally open a session where the specified minimal version and minorVersion of QT must be present or an exception will be thrown. This will also call EnterMovies for you.

QuickTime::InitializeQTML()



QuickTime::Gestalt()



QuickTime::EnterMovies()

Parameters:
version - the minimal version of QT that must be present
minorVersion - the minimal minorVersion of QT that must be present
initFlag - can also initialise VR or 3D.
 o close
 public static void close()
This call will close down the QTML environment. This call should not be called from one of the quicktime.app.time.TaskThread objects as a side effect of this call is stopping all thread that belong to the TaskThread group.

See Also:
terminate
 o terminate
 public static void terminate()
This call will close down the QTML environment, VR and QD3D. This will mean that the QTML environment will need to be reinitialised before it can be used again. This call should not be called from one of the quicktime.app.time.TaskThread objects as a side effect of this call is stopping all thread that belong to the TaskThread group.

QuickTime::TerminateQTML()

 o terminationLock
 public static Object terminationLock()
 o terminateVR
 public static void terminateVR()
This call will terminate QTVR. You cannot call QTVR API's after you make this call unless you reinitialize QTVR first. QTSession.close will terminate VR if it has been initialized.

QuickTime::TerminateQTVR()

 o terminate3D
 public static void terminate3D()
This call will terminate QuickDraw3D. You cannot call QD3D API's after you make this call unless you reinitialize QD3D first. QTSession.close will terminate 3D if it has been initialized.

QuickTime::Q3Exit()

 o isQD3DAvailable
 public static boolean isQD3DAvailable() throws StdQTException
Determine whether it is safe to call a QuickDraw 3D API.

QuickTime::Gestalt(gestaltQD3D,result)

 o isQTVRAvailable
 public static boolean isQTVRAvailable() throws StdQTException
Determine whether it is safe to call a QuickTime VR API.

QuickTime::Gestalt(gestaltQTVRMgrAttr,result)

 o gestalt
 public static final int gestalt(int selector) throws StdQTException
This call will do a gestalt check. If you are on a non-Macintosh machine this call will also initialise QTML if that has not already been done. It will return the result value if the gestalt check is successful,

QuickTime::Gestalt()

Parameters:
selector - the selector code for the information you need.
 o enterMovies
 public static final void enterMovies() throws QTException
Before you call any Movie Toolbox functions, you must initialize the toolbox

QuickTime::EnterMovies()

 o exitMovies
 public static final void exitMovies()
QuickTime calls the ExitMovies function automatically when your application quits - you only need to call thi function if you finish with the Movie Toolbox long before your application is ready to quit.

QuickTime::ExitMovies()

 o getMajorVersion
 public static final int getMajorVersion()
This contains the version of QuickTime that is currently present

 o getMinorVersion
 public static final int getMinorVersion()
This returns the sub version of QuickTime that is currently present

 o getBugFixVersion
 public static final int getBugFixVersion()
This returns the sub version of QuickTime that is currently present

 o getDeveloperVersion
 public static final int getDeveloperVersion()
This returns the sub version of QuickTime that is currently present

 o getQTVersion
 public static int getQTVersion()
This returns the complete version number of QuickTime

 o getQTMajorVersion
 public static int getQTMajorVersion()
This returns the major version of QuickTime

 o getQTMinorVersion
 public static int getQTMinorVersion()
This returns the minor version of QuickTime

 o addActiveCanvas
 public static void addActiveCanvas(QTCanvas c)
Adds a canvas to a registry of active canvases. You should not need to call this method.

 o removeActiveCanvas
 public static void removeActiveCanvas(QTCanvas c)
Removes a canvas from a registry of active canvases. You should not need to call this method.


All Packages  Class Hierarchy  This Package  Previous  Next  Index