00001
00032 #if LL_QUICKTIME_ENABLED
00033
00034
00035 #ifndef llmediaimplquicktime_h
00036 #define llmediaimplquicktime_h
00037
00038 #include "stdtypes.h"
00039
00040 #include "llmediamoviebase.h"
00041
00042 #if LL_QUICKTIME_ENABLED
00043 #if LL_DARWIN
00044 #include <QuickTime/QuickTime.h>
00045 #else
00046 #include "MacTypes.h"
00047 #include "QTML.h"
00048 #include "Movies.h"
00049 #include "FixMath.h"
00050 #include "QuickTimeStreaming.h"
00051 #endif
00052 #endif
00053
00054
00056
00058 class LLMediaImplQuickTime:
00059 public LLMediaMovieBase
00060 {
00061 public:
00062 LLMediaImplQuickTime ();
00063 virtual ~LLMediaImplQuickTime ();
00064
00066
00067
00068
00069 virtual BOOL setBuffer ( U8* bufferIn );
00070 virtual BOOL init ();
00071 virtual BOOL load ( const LLString& urlIn );
00072 virtual BOOL unload ();
00073
00074
00075 virtual BOOL stop ();
00076 virtual BOOL play ();
00077 virtual BOOL loop ( S32 howMany );
00078 virtual BOOL pause ();
00079 virtual BOOL seek ( F64 time );
00080
00081
00082 virtual BOOL setVolume ( F32 volumeIn );
00083 virtual F32 getVolume ();
00084
00085
00086 virtual BOOL isIdle () const;
00087 virtual BOOL isBuffering () const;
00088 virtual BOOL isError () const;
00089 virtual BOOL isLoaded () const;
00090 virtual BOOL isStopped () const;
00091 virtual BOOL isPaused () const;
00092 virtual BOOL isPlaying () const;
00093 virtual BOOL isLooping () const;
00094 virtual F64 getTime () const;
00095
00096
00097 virtual S32 updateMedia ();
00098 virtual void setAutoScaled ( BOOL autoScaledIn );
00099 virtual U8* getMediaData ();
00100 virtual F64 getMediaDuration () const;
00101
00102 private:
00103
00104 Movie theMovie;
00105 ComponentInstance theController;
00106 PixMapHandle pixmapHandle;
00107 GWorldPtr theGWorld;
00108 Rect movieRect;
00109 U8* mediaData;
00110 BOOL movieLoaded;
00111 BOOL ownBuffer;
00112 short curVolume;
00113 S32 loopsLeft;
00114
00115 BOOL autoScaled;
00116 BOOL sizeChangeInProgress;
00117 BOOL initialStartDone;
00118 BOOL isQTLoaded ();
00119 BOOL isQTPlaythroughOK ();
00120 void setupDummyBuffer ();
00121
00122 static OSErr myFrameDrawnCallback ( Movie callbackMovie, long refCon );
00123 static Boolean myMCActionFilterProc (MovieController theMC, short theAction, void *theParams, long theRefCon);
00124
00125 void rewind();
00126 void sizeChanged();
00127 void updateMediaSize();
00128
00129 enum { ModeNone, ModeIdle, ModeError, ModeBuffering, ModeLoaded, ModeStopped, ModePaused, ModePlaying, ModeLooping } currentMode;
00130 };
00131
00132
00133 #endif // llmediaimplquicktime_h
00134
00135 #endif