1 /*
   2  * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #import <Foundation/Foundation.h>
  27 #import <QTKit/QTKit.h>
  28 
  29 #import "OSXPlayerProtocol.h"
  30 #import <jni/JavaPlayerEventDispatcher.h>
  31 
  32 @interface QTKMediaPlayer : NSObject<OSXPlayerProtocol>
  33 {
  34     NSURL *movieURL;
  35 
  36     QTMovie *movie;
  37     BOOL movieReady;
  38     id frameHandler;
  39 
  40     NSMutableSet *notificationCookies; // need these to deregister from the notification center
  41 
  42     CJavaPlayerEventDispatcher *eventHandler;
  43 
  44     int64_t audioSyncDelay;
  45 
  46     BOOL isLiveStream; // YES if the stream is indeterminate
  47 
  48     int requestedState; // 0 - stop, 1 - play, 2 - pause
  49     float requestedRate;
  50 
  51     uint64_t hostTimeBase; // Host time for media time 0.0, updated every time we get a time changed notification
  52     double hostTimeFreq;   // frequency of the host clock, for conversion to seconds
  53     BOOL updateHostTimeBase;
  54 
  55     double currentTime;
  56 
  57     BOOL suppressDurationEvents;
  58 
  59     BOOL mute;
  60     float volume;
  61     float balance;
  62 
  63     int previousWidth;
  64     int previousHeight;
  65 
  66     int previousPlayerState; // avoid repeated states
  67 
  68     BOOL isDisposed;
  69 
  70     CAudioEqualizer *_audioEqualizer;
  71     CAudioSpectrum *_audioSpectrum;
  72 }
  73 
  74 - (id) initWithURL:(NSURL *)source eventHandler:(CJavaPlayerEventDispatcher*)hdlr;
  75 
  76 - (void) rateChanged:(float)newRate;
  77 - (void) setPlayerState:(int)newState;
  78 - (void) setMovieReady;
  79 - (void) createMovie;
  80 
  81 @end