qtsessioncheck.java

来自「FMJ(freedom media for java)是java视频开发的新选择」· Java 代码 · 共 41 行

JAVA
41
字号
package net.sf.fmj.qt.utils;import quicktime.QTException;import quicktime.QTSession;/** * Copied from QTJ Developer's Notebook, Adamson. * @author Ken Larson * */public class QTSessionCheck{	private Thread shutdownHook;	  private static QTSessionCheck instance;	  private QTSessionCheck( ) throws QTException {	      super( );	      // init	      QTSession.open( );	      // create shutdown handler	      shutdownHook = new Thread( ) {	              public void run( ) {	                  QTSession.close( );	              }	          };	      //Runtime.getRuntime( ).addShutdownHook(shutdownHook);	// TODO: this is causing crashes.	  }	  private static QTSessionCheck getInstance( ) throws QTException {	      if (instance == null)	          instance = new QTSessionCheck( );	      return instance;	  }	  	  public static void check( ) throws QTException {	      // gets instance.  if a new one needs to be created,	      // it calls QTSession.open( ) and creates a shutdown hook	      // to call QTSession.close( )	      getInstance( );	  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?