/* */ package quicktime.app.players;
/* */
/* */ import java.awt.Dimension;
/* */ import quicktime.QTException;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.app.audio.AudioSpec;
/* */ import quicktime.app.display.QTDrawable;
/* */ import quicktime.app.time.TaskThread;
/* */ import quicktime.app.time.Tasking;
/* */ import quicktime.qd.QDDimension;
/* */ import quicktime.qd.QDException;
/* */ 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.MovieController;
/* */
/* */ /** @deprecated */
/* */ public class QTPlayer extends Tasking
/* */ implements QTDrawable, Playable, AudioSpec
/* */ {
/* */ MovieController controller;
/* */ private TaskThread tt;
/* 56 */ private boolean setControllerVisibleFlag = false;
/* 57 */ private boolean reserveSize = true;
/* */ private QTPlayerEventHandler eventHandler;
/* 179 */ private boolean redrawRequired = false;
/* */
/* */ /** @deprecated */
/* */ public QTPlayer(MovieController paramMovieController)
/* */ throws StdQTException
/* */ {
/* 50 */ this.controller = paramMovieController;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void addedTo(Object paramObject)
/* */ {
/* 73 */ if (this.eventHandler == null)
/* 74 */ this.eventHandler = QTPlayerEventHandler.make(this, paramObject);
/* 75 */ if (this.eventHandler != null)
/* 76 */ this.eventHandler.addedTo();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removedFrom(Object paramObject)
/* */ {
/* 91 */ if (this.eventHandler != null)
/* 92 */ this.eventHandler.removedFrom();
/* 93 */ this.eventHandler = null;
/* */ }
/* */
/* */ public MovieController getMovieController()
/* */ {
/* 98 */ return this.controller;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Dimension getInitialSize()
/* */ throws QTException
/* */ {
/* 108 */ QDDimension localQDDimension = getOriginalSize();
/* 109 */ return new Dimension(localQDDimension.getWidth(), localQDDimension.getHeight());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QDDimension getOriginalSize()
/* */ throws QTException
/* */ {
/* 119 */ QDDimension localQDDimension = this.controller.getRequiredSize();
/* 120 */ QDRect localQDRect = this.controller.getMovie().getNaturalBoundsRect();
/* 121 */ return new QDDimension(localQDRect.getWidth() + localQDDimension.getWidth(), localQDRect.getHeight() + localQDDimension.getHeight());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Matrix getMatrix()
/* */ throws StdQTException
/* */ {
/* 131 */ return this.controller.getMovie().getMatrix();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setMatrix(Matrix paramMatrix)
/* */ throws QTException
/* */ {
/* 140 */ this.controller.getMovie().setMatrix(paramMatrix);
/* 141 */ this.controller.movieChanged();
/* 142 */ this.controller.idle();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QDGraphics getGWorld()
/* */ throws StdQTException
/* */ {
/* 151 */ return this.controller.getPort();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void setGWorld(QDGraphics paramQDGraphics)
/* */ throws QDException, StdQTException
/* */ {
/* 164 */ if (getGWorld().equals(paramQDGraphics))
/* 165 */ return;
/* 166 */ this.controller.setPort(paramQDGraphics);
/* 167 */ if (!QDGraphics.scratch.equals(paramQDGraphics)) {
/* 168 */ startTasking();
/* 169 */ this.redrawRequired = true;
/* 170 */ this.controller.getMovie().setActive(true);
/* */ }
/* */ else {
/* 173 */ setRate(0.0F);
/* 174 */ stopTasking();
/* 175 */ this.controller.getMovie().setActive(false);
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public final void redraw(Region paramRegion)
/* */ throws QTException
/* */ {
/* 193 */ if (paramRegion != null)
/* */ try {
/* 195 */ this.controller.invalidate(getGWorld(), paramRegion);
/* 196 */ this.controller.idle();
/* */ } catch (StdQTException localStdQTException) {
/* 198 */ this.controller.draw();
/* */ }
/* */ else
/* 201 */ this.controller.draw();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void setDisplayBounds(QDRect paramQDRect)
/* */ throws QTException
/* */ {
/* 213 */ QDDimension localQDDimension = this.controller.getRequiredSize();
/* 214 */ if ((paramQDRect.getHeight() < localQDDimension.getHeight()) || (paramQDRect.getWidth() < localQDDimension.getWidth())) {
/* 215 */ if (this.controller.getVisible()) {
/* 216 */ this.controller.setVisible(false);
/* 217 */ this.setControllerVisibleFlag = true;
/* */ }
/* 219 */ paramQDRect.setHeight(paramQDRect.getHeight() + localQDDimension.getHeight());
/* 220 */ paramQDRect.setWidth(paramQDRect.getWidth() + localQDDimension.getWidth());
/* */ } else {
/* 222 */ if (this.setControllerVisibleFlag) {
/* 223 */ this.controller.setVisible(true);
/* 224 */ this.setControllerVisibleFlag = false;
/* */ }
/* 226 */ if ((!this.reserveSize) &&
/* 227 */ (!this.controller.getVisible())) {
/* 228 */ paramQDRect.setHeight(paramQDRect.getHeight() + localQDDimension.getHeight());
/* 229 */ paramQDRect.setWidth(paramQDRect.getWidth() + localQDDimension.getWidth());
/* */ }
/* */ }
/* */
/* 233 */ this.controller.setBounds(paramQDRect);
/* 234 */ if (this.redrawRequired) {
/* 235 */ this.redrawRequired = false;
/* 236 */ if (this.controller.getVisible())
/* 237 */ redraw(null);
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setLocation(int paramInt1, int paramInt2)
/* */ throws QTException
/* */ {
/* 248 */ QDRect localQDRect = getDisplayBounds();
/* 249 */ localQDRect.setX(paramInt1);
/* 250 */ localQDRect.setY(paramInt2);
/* 251 */ setDisplayBounds(localQDRect);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QDRect getDisplayBounds()
/* */ throws StdQTException
/* */ {
/* 262 */ return this.reserveSize ? this.controller.getBounds() : this.controller.getVisible() ? this.controller.getBounds() : this.controller.getMovie().getBounds();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public final void task()
/* */ throws QTException
/* */ {
/* 276 */ this.controller.idle();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setClip(Region paramRegion)
/* */ throws QTException
/* */ {
/* 286 */ this.controller.setClip(paramRegion);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Region getClip()
/* */ throws QTException
/* */ {
/* 296 */ return this.controller.getClip();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setTime(int paramInt)
/* */ throws StdQTException
/* */ {
/* 307 */ this.controller.getMovie().setTimeValue(paramInt);
/* 308 */ this.controller.movieChanged();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public int getTime()
/* */ throws StdQTException
/* */ {
/* 316 */ return this.controller.getMovie().getTime();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public int getDuration()
/* */ throws StdQTException
/* */ {
/* 325 */ return this.controller.getMovie().getDuration();
/* */ }
/* */ public TimeBase getTimeBase() throws QTException {
/* 328 */ return this.controller.getMovie().getTimeBase();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setRate(float paramFloat)
/* */ throws StdQTException
/* */ {
/* 339 */ if (paramFloat != 0.0F)
/* 340 */ this.controller.prerollAndPlay(paramFloat);
/* */ else
/* 342 */ this.controller.play(paramFloat);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public float getRate()
/* */ throws StdQTException
/* */ {
/* 350 */ return this.controller.getMovie().getRate();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public int getScale()
/* */ throws QTException
/* */ {
/* 358 */ return this.controller.getMovie().getTimeScale();
/* */ }
/* */
/* */ public float getVolume()
/* */ throws QTException
/* */ {
/* 365 */ float f = this.controller.getVolume();
/* 366 */ return Math.abs(f);
/* */ }
/* */
/* */ public void setVolume(float paramFloat)
/* */ throws QTException
/* */ {
/* 372 */ float f = Math.abs(paramFloat);
/* 373 */ if (isMuted())
/* 374 */ this.controller.setVolume(f * -1.0F);
/* */ else
/* 376 */ this.controller.setVolume(f);
/* */ }
/* */
/* */ public boolean isMuted()
/* */ throws QTException
/* */ {
/* 382 */ return this.controller.getVolume() < 0.0F;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setMuted(boolean paramBoolean)
/* */ throws QTException
/* */ {
/* 392 */ float f = Math.abs(this.controller.getVolume());
/* 393 */ if (paramBoolean)
/* 394 */ this.controller.setVolume(f * -1.0F);
/* */ else
/* 396 */ this.controller.setVolume(f);
/* */ }
/* */
/* */ public void setControllerVisible(boolean paramBoolean)
/* */ throws QTException
/* */ {
/* 402 */ this.controller.setVisible(paramBoolean);
/* 403 */ if ((this.setControllerVisibleFlag) && (!paramBoolean))
/* 404 */ this.setControllerVisibleFlag = false;
/* */ }
/* */
/* */ public boolean isControllerVisible()
/* */ throws QTException
/* */ {
/* 410 */ return this.controller.getVisible();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setControllerSizeReserved(boolean paramBoolean)
/* */ throws QTException
/* */ {
/* 421 */ this.reserveSize = paramBoolean;
/* 422 */ setDisplayBounds(getDisplayBounds());
/* */ }
/* */
/* */ public boolean isControllerSizeReserved()
/* */ {
/* 427 */ return this.reserveSize;
/* */ }
/* */
/* */ static
/* */ {
/* 38 */ if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/* 39 */ throw new QTRuntimeException("Unsupported on Mac OS X and Java 1.4 and higher.");
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.app.players.QTPlayer
* JD-Core Version: 0.6.2
*/