/* */ package quicktime.std.music;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTObject;
/* */ import quicktime.QTSession;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.std.clocks.TimeBase;
/* */ import quicktime.std.comp.Component;
/* */ import quicktime.std.movies.media.MusicMediaHandler;
/* */ import quicktime.util.QTUtils;
/* */
/* */ public final class TunePlayer extends Component
/* */ {
/* 25 */ private static boolean apriori = QTSession.apriori();
/* */ Object noteChannels;
/* */
/* */ public static TunePlayer fromMusicMediaHandler(MusicMediaHandler paramMusicMediaHandler, int paramInt)
/* */ throws StdQTException
/* */ {
/* 37 */ int[] arrayOfInt = { 0 };
/* 38 */ StdQTException.checkError(MusicMediaGetIndexedTunePlayer(QTObject.ID(paramMusicMediaHandler), paramInt, arrayOfInt));
/* */
/* 41 */ return new TunePlayer(arrayOfInt[0], paramMusicMediaHandler);
/* */ }
/* */
/* */ private TunePlayer(int paramInt, Object paramObject) {
/* 45 */ super(paramInt, paramObject);
/* */ }
/* */
/* */ public TunePlayer()
/* */ throws QTException
/* */ {
/* 53 */ super(1953853029, 0);
/* */ }
/* */
/* */ public void setHeader(MusicData paramMusicData)
/* */ throws StdQTException
/* */ {
/* 67 */ paramMusicData.lock();
/* 68 */ int i = getIntFromPointer(QTObject.ID(paramMusicData), 0);
/* 69 */ StdQTException.checkError(TuneSetHeader(_ID(), i));
/* */ }
/* */
/* */ public TimeBase getTimeBase()
/* */ throws StdQTException
/* */ {
/* 80 */ return TimeBase.fromTunePlayer(this);
/* */ }
/* */
/* */ public void setTimeScale(int paramInt)
/* */ throws StdQTException
/* */ {
/* 89 */ StdQTException.checkError(TuneSetTimeScale(_ID(), paramInt));
/* */ }
/* */
/* */ public int getTimeScale()
/* */ throws StdQTException
/* */ {
/* 100 */ int[] arrayOfInt = { 0 };
/* 101 */ StdQTException.checkError(TuneGetTimeScale(_ID(), arrayOfInt));
/* */
/* 104 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public int getNumberOfNoteChannels()
/* */ throws StdQTException
/* */ {
/* 113 */ int i = TuneGetIndexedNoteChannel(_ID(), 0, null);
/* 114 */ if (i < 0) throw new StdQTException(i);
/* 115 */ return i;
/* */ }
/* */
/* */ public NoteChannel getIndexedNoteChannel(int paramInt)
/* */ throws StdQTException
/* */ {
/* 125 */ if (paramInt > 0) {
/* 126 */ int[] arrayOfInt = { 0 };
/* 127 */ int i = TuneGetIndexedNoteChannel(_ID(), paramInt, arrayOfInt);
/* 128 */ if (i < 0) throw new StdQTException(i);
/* 129 */ return new NoteChannel(getNoteAllocator(), arrayOfInt[0], this);
/* */ }
/* 131 */ throw new StdQTException(-2075);
/* */ }
/* */
/* */ public void queue(MusicData paramMusicData, float paramFloat, int paramInt1, int paramInt2, int paramInt3)
/* */ throws StdQTException
/* */ {
/* 145 */ paramMusicData.lock();
/* 146 */ int i = getIntFromPointer(QTObject.ID(paramMusicData), 0);
/* 147 */ StdQTException.checkError(TuneQueue(_ID(), i, QTUtils.X2Fix(paramFloat), paramInt1, paramInt2, paramInt3, 0, 0));
/* */ }
/* */
/* */ public void instant(TuneStatus paramTuneStatus, int paramInt)
/* */ throws StdQTException
/* */ {
/* 163 */ StdQTException.checkError(TuneInstant(_ID(), paramTuneStatus.getTuneDataPtr(), paramInt));
/* */ }
/* */
/* */ public TuneStatus getStatus()
/* */ throws StdQTException
/* */ {
/* 174 */ TuneStatus localTuneStatus = new TuneStatus();
/* 175 */ StdQTException.checkError(TuneGetStatus(_ID(), localTuneStatus.getBytes()));
/* */
/* 178 */ return localTuneStatus;
/* */ }
/* */
/* */ public void stop()
/* */ throws StdQTException
/* */ {
/* 185 */ StdQTException.checkError(TuneStop(_ID(), 0));
/* */ }
/* */
/* */ public void setVolume(float paramFloat)
/* */ throws StdQTException
/* */ {
/* 196 */ StdQTException.checkError(TuneSetVolume(_ID(), QTUtils.X2Fix(paramFloat)));
/* */ }
/* */
/* */ public float getVolume()
/* */ throws StdQTException
/* */ {
/* 207 */ int i = TuneGetVolume(_ID());
/* 208 */ if (i < 0) throw new StdQTException(i);
/* 209 */ return QTUtils.Fix2X(i);
/* */ }
/* */
/* */ public void preroll()
/* */ throws StdQTException
/* */ {
/* 217 */ StdQTException.checkError(TunePreroll(_ID()));
/* */ }
/* */
/* */ public void unroll()
/* */ throws StdQTException
/* */ {
/* 227 */ StdQTException.checkError(TuneUnroll(_ID()));
/* */ }
/* */
/* */ public void setNoteChannels(NoteChannel[] paramArrayOfNoteChannel)
/* */ throws StdQTException
/* */ {
/* 238 */ int i = paramArrayOfNoteChannel.length;
/* 239 */ int[] arrayOfInt = new int[i];
/* 240 */ for (int j = 0; j < i; j++)
/* 241 */ arrayOfInt[j] = QTObject.ID(paramArrayOfNoteChannel[j]);
/* 242 */ StdQTException.checkError(TuneSetNoteChannels(_ID(), i, arrayOfInt, 0, 0));
/* */
/* 245 */ this.noteChannels = paramArrayOfNoteChannel;
/* */ }
/* */
/* */ public void setPartTranspose(int paramInt1, float paramFloat, int paramInt2)
/* */ throws StdQTException
/* */ {
/* 256 */ StdQTException.checkError(TuneSetPartTranspose(_ID(), paramInt1, QTUtils.X2Fix(paramFloat), paramInt2));
/* */ }
/* */
/* */ public NoteAllocator getNoteAllocator()
/* */ {
/* 267 */ return new NoteAllocator(TuneGetNoteAllocator(_ID()), this);
/* */ }
/* */
/* */ public void setSofter(boolean paramBoolean)
/* */ throws StdQTException
/* */ {
/* 277 */ StdQTException.checkError(TuneSetSofter(_ID(), paramBoolean ? 1 : 0));
/* */ }
/* */
/* */ public void task()
/* */ throws StdQTException
/* */ {
/* 288 */ StdQTException.checkError(TuneTask(_ID()));
/* */ }
/* */
/* */ public void setBalance(int paramInt)
/* */ throws StdQTException
/* */ {
/* 299 */ StdQTException.checkError(TuneSetBalance(_ID(), paramInt));
/* */ }
/* */
/* */ public void setSoundLocalization(SoundLocalization paramSoundLocalization)
/* */ throws StdQTException
/* */ {
/* 310 */ StdQTException.checkError(TuneSetSoundLocalization(_ID(), QTObject.ID(paramSoundLocalization)));
/* */ }
/* */
/* */ public void setHeaderWithSize(MusicData paramMusicData, int paramInt)
/* */ throws StdQTException
/* */ {
/* 324 */ paramMusicData.lock();
/* 325 */ int i = getIntFromPointer(QTObject.ID(paramMusicData), 0);
/* 326 */ StdQTException.checkError(TuneSetHeaderWithSize(_ID(), i, paramInt));
/* */ }
/* */
/* */ public void setPartMix(int paramInt1, float paramFloat1, float paramFloat2, int paramInt2)
/* */ throws StdQTException
/* */ {
/* 340 */ StdQTException.checkError(TuneSetPartMix(_ID(), paramInt1, QTUtils.X2Fix(paramFloat1), QTUtils.X2Fix(paramFloat2), paramInt2));
/* */ }
/* */
/* */ public MixStateInfo getPartMix(int paramInt)
/* */ throws StdQTException
/* */ {
/* 352 */ int[] arrayOfInt1 = { 0 };
/* 353 */ int[] arrayOfInt2 = { 0 };
/* 354 */ int[] arrayOfInt3 = { 0 };
/* 355 */ StdQTException.checkError(TuneGetPartMix(_ID(), paramInt, arrayOfInt1, arrayOfInt2, arrayOfInt3));
/* */
/* 358 */ return new MixStateInfo(paramInt, QTUtils.Fix2X(arrayOfInt1[0]), QTUtils.Fix2X(arrayOfInt2[0]), arrayOfInt3[0]);
/* */ }
/* */
/* */ private static native int getIntFromPointer(int paramInt1, int paramInt2);
/* */
/* */ private static native int MusicMediaGetIndexedTunePlayer(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/* */
/* */ private static native int TuneSetHeader(int paramInt1, int paramInt2);
/* */
/* */ private static native int TuneSetTimeScale(int paramInt1, int paramInt2);
/* */
/* */ private static native int TuneGetTimeScale(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int TuneGetIndexedNoteChannel(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/* */
/* */ private static native int TuneQueue(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8);
/* */
/* */ private static native int TuneInstant(int paramInt1, int paramInt2, int paramInt3);
/* */
/* */ private static native int TuneGetStatus(int paramInt, byte[] paramArrayOfByte);
/* */
/* */ private static native int TuneStop(int paramInt1, int paramInt2);
/* */
/* */ private static native int TuneSetVolume(int paramInt1, int paramInt2);
/* */
/* */ private static native int TuneGetVolume(int paramInt);
/* */
/* */ private static native int TunePreroll(int paramInt);
/* */
/* */ private static native int TuneUnroll(int paramInt);
/* */
/* */ private static native int TuneSetNoteChannels(int paramInt1, int paramInt2, int[] paramArrayOfInt, int paramInt3, int paramInt4);
/* */
/* */ private static native int TuneSetPartTranspose(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
/* */
/* */ private static native int TuneGetNoteAllocator(int paramInt);
/* */
/* */ private static native int TuneSetSofter(int paramInt1, int paramInt2);
/* */
/* */ private static native int TuneTask(int paramInt);
/* */
/* */ private static native int TuneSetBalance(int paramInt1, int paramInt2);
/* */
/* */ private static native int TuneSetSoundLocalization(int paramInt1, int paramInt2);
/* */
/* */ private static native int TuneSetHeaderWithSize(int paramInt1, int paramInt2, int paramInt3);
/* */
/* */ private static native int TuneSetPartMix(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
/* */
/* */ private static native int TuneGetPartMix(int paramInt1, int paramInt2, int[] paramArrayOfInt1, int[] paramArrayOfInt2, int[] paramArrayOfInt3);
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.std.music.TunePlayer
* JD-Core Version: 0.6.2
*/