Package quicktime.app.players

Source Code of quicktime.app.players.MoviePlayer

/*     */ package quicktime.app.players;
/*     */
/*     */ import java.awt.Dimension;
/*     */ import java.util.Vector;
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTRuntimeException;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.app.audio.AudioSpec;
/*     */ import quicktime.app.display.DrawingListener;
/*     */ import quicktime.app.display.DrawingNotifier;
/*     */ import quicktime.app.display.QTDrawable;
/*     */ import quicktime.app.time.TaskAllMovies;
/*     */ import quicktime.qd.QDDimension;
/*     */ import quicktime.qd.QDGraphics;
/*     */ import quicktime.qd.QDRect;
/*     */ import quicktime.qd.Region;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.std.clocks.TimeBase;
/*     */ import quicktime.std.image.Matrix;
/*     */ import quicktime.std.movies.Movie;
/*     */ import quicktime.std.movies.MovieDrawingComplete;
/*     */ import quicktime.std.movies.MoviePrePreroll;
/*     */
/*     */ /** @deprecated */
/*     */ public class MoviePlayer
/*     */   implements QTDrawable, Playable, AudioSpec, DrawingNotifier
/*     */ {
/*     */   private Movie mMovie;
/*     */   private Vector listenerList;
/*     */   private MovieComplete mComplete;
/* 289 */   private float lastRate = 0.0F;
/*     */
/*     */   /** @deprecated */
/*     */   public MoviePlayer(Movie paramMovie)
/*     */     throws StdQTException
/*     */   {
/*  51 */     this.mMovie = paramMovie;
/*  52 */     paramMovie.setPlayHints(256, 256);
/*     */   }
/*     */
/*     */   public Movie getMovie()
/*     */   {
/*  64 */     return this.mMovie;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void addedTo(Object paramObject)
/*     */   {
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void removedFrom(Object paramObject)
/*     */   {
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDGraphics getGWorld()
/*     */     throws StdQTException
/*     */   {
/*  92 */     return this.mMovie.getGWorld();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void setGWorld(QDGraphics paramQDGraphics)
/*     */     throws StdQTException
/*     */   {
/* 105 */     if (getGWorld().equals(paramQDGraphics))
/* 106 */       return;
/* 107 */     this.mMovie.setGWorld(paramQDGraphics, null);
/* 108 */     if (QDGraphics.scratch.equals(paramQDGraphics)) {
/* 109 */       TaskAllMovies.removeMovie();
/* 110 */       setRate(0.0F);
/* 111 */       this.mMovie.setActive(false);
/*     */     }
/*     */     else {
/* 114 */       TaskAllMovies.addMovieAndStart();
/* 115 */       this.mMovie.setActive(true);
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Dimension getInitialSize()
/*     */     throws QTException
/*     */   {
/* 127 */     QDRect localQDRect = this.mMovie.getNaturalBoundsRect();
/* 128 */     return new Dimension(localQDRect.getWidth(), localQDRect.getHeight());
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDDimension getOriginalSize()
/*     */     throws QTException
/*     */   {
/* 138 */     QDRect localQDRect = this.mMovie.getNaturalBoundsRect();
/* 139 */     return new QDDimension(localQDRect.getWidth(), localQDRect.getHeight());
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Matrix getMatrix()
/*     */     throws StdQTException
/*     */   {
/* 149 */     return this.mMovie.getMatrix();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setMatrix(Matrix paramMatrix)
/*     */     throws QTException
/*     */   {
/* 158 */     this.mMovie.setMatrix(paramMatrix);
/* 159 */     this.mMovie.task(0);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public final void redraw(Region paramRegion)
/*     */     throws QTException
/*     */   {
/* 173 */     if (paramRegion != null)
/* 174 */       this.mMovie.invalidateRegion(paramRegion);
/*     */     else {
/* 176 */       this.mMovie.invalidateRegion(new Region(this.mMovie.getBounds()));
/*     */     }
/* 178 */     this.mMovie.task(0);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void setDisplayBounds(QDRect paramQDRect)
/*     */     throws StdQTException
/*     */   {
/* 189 */     this.mMovie.setBounds(paramQDRect);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setLocation(int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 199 */     QDRect localQDRect = getDisplayBounds();
/* 200 */     localQDRect.setX(paramInt1);
/* 201 */     localQDRect.setY(paramInt2);
/* 202 */     setDisplayBounds(localQDRect);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDRect getDisplayBounds()
/*     */     throws StdQTException
/*     */   {
/* 213 */     return this.mMovie.getBounds();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setClip(Region paramRegion)
/*     */     throws QTException
/*     */   {
/* 223 */     this.mMovie.setDisplayClipRgn(paramRegion);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Region getClip()
/*     */     throws QTException
/*     */   {
/* 233 */     return this.mMovie.getDisplayClipRgn();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setTime(int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 244 */     this.mMovie.setTimeValue(paramInt);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int getTime()
/*     */     throws StdQTException
/*     */   {
/* 251 */     return this.mMovie.getTime();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int getDuration()
/*     */     throws StdQTException
/*     */   {
/* 260 */     return this.mMovie.getDuration();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public TimeBase getTimeBase()
/*     */     throws QTException
/*     */   {
/* 269 */     return this.mMovie.getTimeBase();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setRate(float paramFloat)
/*     */     throws StdQTException
/*     */   {
/* 280 */     synchronized (this) {
/* 281 */       this.lastRate = paramFloat;
/*     */     }
/* 283 */     if (paramFloat == 0.0F)
/* 284 */       this.mMovie.stop();
/*     */     else
/* 286 */       this.mMovie.prePreroll(this.mMovie.getTime(), paramFloat, new PrerollCallback(paramFloat));
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void addDrawingListener(DrawingListener paramDrawingListener)
/*     */   {
/* 330 */     if (this.listenerList == null) {
/* 331 */       this.listenerList = new Vector();
/*     */     }
/* 333 */     if (this.listenerList.contains(paramDrawingListener)) {
/* 334 */       return;
/*     */     }
/* 336 */     this.listenerList.addElement(paramDrawingListener);
/*     */
/* 338 */     if (this.mComplete == null)
/*     */       try {
/* 340 */         this.mComplete = new MovieComplete();
/* 341 */         this.mMovie.setDrawingCompleteProc(0, this.mComplete);
/*     */       } catch (StdQTException localStdQTException) {
/* 343 */         this.mComplete = null;
/*     */       }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void removeDrawingListener(DrawingListener paramDrawingListener)
/*     */   {
/* 353 */     this.listenerList.removeElement(paramDrawingListener);
/*     */
/* 355 */     if (this.listenerList.isEmpty()) {
/*     */       try {
/* 357 */         this.mMovie.removeDrawingCompleteProc(); } catch (StdQTException localStdQTException) {
/*     */       }
/* 359 */       this.mComplete = null;
/* 360 */       this.listenerList = null;
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public float getRate()
/*     */     throws StdQTException
/*     */   {
/* 369 */     return this.mMovie.getRate();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int getScale()
/*     */     throws QTException
/*     */   {
/* 376 */     return this.mMovie.getTimeScale();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public float getVolume()
/*     */     throws QTException
/*     */   {
/* 384 */     float f = this.mMovie.getVolume();
/* 385 */     return Math.abs(f);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setVolume(float paramFloat)
/*     */     throws QTException
/*     */   {
/* 393 */     float f = Math.abs(paramFloat);
/* 394 */     if (isMuted())
/* 395 */       this.mMovie.setVolume(f * -1.0F);
/*     */     else
/* 397 */       this.mMovie.setVolume(f);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean isMuted()
/*     */     throws QTException
/*     */   {
/* 405 */     return this.mMovie.getVolume() < 0.0F;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setMuted(boolean paramBoolean)
/*     */     throws QTException
/*     */   {
/* 415 */     float f = Math.abs(this.mMovie.getVolume());
/* 416 */     if (paramBoolean)
/* 417 */       this.mMovie.setVolume(f * -1.0F);
/*     */     else
/* 419 */       this.mMovie.setVolume(f);
/*     */   }
/*     */
/*     */   static
/*     */   {
/*  39 */     if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/*  40 */       throw new QTRuntimeException("Unsupported on Mac OS X and Java 1.4 and higher.");
/*     */   }
/*     */
/*     */   class MovieComplete
/*     */     implements MovieDrawingComplete
/*     */   {
/*     */     MovieComplete()
/*     */     {
/*     */     }
/*     */
/*     */     public int execute(Movie paramMovie)
/*     */     {
/* 317 */       synchronized (MoviePlayer.this) {
/* 318 */         for (int i = 0; i < MoviePlayer.this.listenerList.size(); i++)
/* 319 */           ((DrawingListener)MoviePlayer.this.listenerList.elementAt(i)).drawingComplete(MoviePlayer.this);
/*     */       }
/* 321 */       return 0;
/*     */     }
/*     */   }
/*     */
/*     */   class PrerollCallback
/*     */     implements MoviePrePreroll
/*     */   {
/*     */     private float r;
/*     */
/*     */     PrerollCallback(float arg2)
/*     */     {
/*     */       Object localObject;
/* 293 */       this.r = localObject;
/*     */     }
/*     */
/*     */     public void execute(Movie paramMovie, int paramInt)
/*     */     {
/* 298 */       synchronized (MoviePlayer.this) {
/* 299 */         if (MoviePlayer.this.lastRate == 0.0F) {
/* 300 */           return;
/*     */         }
/* 302 */         if (paramInt == 0)
/*     */           try {
/* 304 */             paramMovie.preroll(paramMovie.getTime(), this.r);
/* 305 */             paramMovie.setRate(this.r);
/*     */           } catch (QTException localQTException) {
/* 307 */             QTRuntimeException.handleOrThrow(new QTRuntimeException(localQTException), paramMovie, "preroll");
/*     */           }
/*     */         else
/* 310 */           QTRuntimeException.handleOrThrow(new QTRuntimeException(paramInt), paramMovie, "prePreroll");
/*     */       }
/*     */     }
/*     */   }
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name:     quicktime.app.players.MoviePlayer
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.app.players.MoviePlayer

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.