Package quicktime.sound

Source Code of quicktime.sound.SndHandle

/*     */ package quicktime.sound;
/*     */
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.util.QTHandle;
/*     */ import quicktime.util.QTPointerRef;
/*     */ import quicktime.util.QTUtils;
/*     */
/*     */ public final class SndHandle extends QTHandle
/*     */ {
/*  19 */   private static boolean apriori = QTSession.apriori();
/*     */   private QTPointerRef buf;
/*     */
/*     */   public SndHandle()
/*     */     throws QTException
/*     */   {
/*  26 */     super(200, false);
/*     */   }
/*     */
/*     */   public SndHandle(int paramInt, boolean paramBoolean)
/*     */     throws QTException
/*     */   {
/*  35 */     super(paramInt, paramBoolean);
/*     */   }
/*     */
/*     */   public SndHandle(int paramInt1, float paramFloat, int paramInt2, int paramInt3)
/*     */     throws QTException
/*     */   {
/*  49 */     this(paramInt1, paramFloat, paramInt2, paramInt3, 60);
/*     */   }
/*     */
/*     */   public SndHandle(int paramInt1, float paramFloat, int paramInt2, int paramInt3, int paramInt4)
/*     */     throws QTException
/*     */   {
/*  64 */     super(100, false);
/*  65 */     int i = setupHeader(paramInt1, paramFloat, paramInt2, paramInt3, paramInt4, 0);
/*  66 */     setSize(i);
/*     */   }
/*     */
/*     */   public int setupHeader(int paramInt1, float paramFloat, int paramInt2, int paramInt3, int paramInt4)
/*     */     throws SoundException
/*     */   {
/*  84 */     return setupHeader(paramInt1, paramFloat, paramInt2, paramInt3, 60, paramInt4);
/*     */   }
/*     */
/*     */   public int setupHeader(int paramInt1, float paramFloat, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
/*     */     throws SoundException
/*     */   {
/*  99 */     short[] arrayOfShort = { 0 };
/* 100 */     SoundException.checkError(SetupSndHeader(_ID(), (short)paramInt1, QTUtils.X2UFix(paramFloat), (short)paramInt2, paramInt3, (short)paramInt4, paramInt5, arrayOfShort));
/* 101 */     return arrayOfShort[0];
/*     */   }
/*     */
/*     */   public final int getSoundHeaderOffset()
/*     */     throws SoundException
/*     */   {
/* 110 */     int[] arrayOfInt = { 0 };
/* 111 */     SoundException.checkError(GetSoundHeaderOffset(_ID(), arrayOfInt));
/* 112 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public QTPointerRef getSoundData()
/*     */     throws QTException
/*     */   {
/* 122 */     if (this.buf != null) {
/* 123 */       return this.buf;
/*     */     }
/*     */
/* 126 */     int[] arrayOfInt1 = { 0 };
/* 127 */     int[] arrayOfInt2 = { 0 };
/* 128 */     SoundComponentData localSoundComponentData = new SoundComponentData();
/* 129 */     SoundException.checkError(ParseSndHeader(_ID(), localSoundComponentData.getBytes(), arrayOfInt1, arrayOfInt2));
/*     */
/* 131 */     if (arrayOfInt2[0] >= getSize())
/* 132 */       throw new QTException("No data in SoundHandle yet");
/* 133 */     lock();
/* 134 */     return toQTPointer(arrayOfInt2[0], getSize() - arrayOfInt2[0]);
/*     */   }
/*     */
/*     */   public void appendSoundData(QTPointerRef paramQTPointerRef)
/*     */     throws QTException
/*     */   {
/* 145 */     int[] arrayOfInt1 = { 0 };
/* 146 */     int[] arrayOfInt2 = { 0 };
/* 147 */     SoundComponentData localSoundComponentData = new SoundComponentData();
/* 148 */     SoundException.checkError(ParseSndHeader(_ID(), localSoundComponentData.getBytes(), arrayOfInt1, arrayOfInt2));
/*     */
/* 150 */     if (paramQTPointerRef != null) {
/* 151 */       setSize(arrayOfInt2[0] + paramQTPointerRef.getSize());
/* 152 */       BlockMove(QTObject.ID(paramQTPointerRef), lockAndDeref(arrayOfInt2[0]), paramQTPointerRef.getSize());
/*     */     } else {
/* 154 */       setSize(getSoundHeaderOffset());
/*     */     }
/* 156 */     this.buf = null;
/* 157 */     setIntAt(getSoundHeaderOffset(), 0);
/*     */   }
/*     */
/*     */   public void appendSoundBuffer(int paramInt)
/*     */     throws QTException
/*     */   {
/* 166 */     int[] arrayOfInt1 = { 0 };
/* 167 */     int[] arrayOfInt2 = { 0 };
/* 168 */     SoundComponentData localSoundComponentData = new SoundComponentData();
/* 169 */     SoundException.checkError(ParseSndHeader(_ID(), localSoundComponentData.getBytes(), arrayOfInt1, arrayOfInt2));
/*     */
/* 171 */     setSize(arrayOfInt2[0] + paramInt);
/* 172 */     this.buf = null;
/* 173 */     setIntAt(getSoundHeaderOffset(), 0);
/*     */   }
/*     */
/*     */   public void setSoundData(QTPointerRef paramQTPointerRef)
/*     */     throws QTException
/*     */   {
/* 182 */     int i = getSoundHeaderOffset();
/* 183 */     setIntAt(i, QTObject.ID(paramQTPointerRef));
/* 184 */     this.buf = paramQTPointerRef;
/* 185 */     int[] arrayOfInt1 = { 0 };
/* 186 */     int[] arrayOfInt2 = { 0 };
/* 187 */     SoundComponentData localSoundComponentData = new SoundComponentData();
/* 188 */     SoundException.checkError(ParseSndHeader(_ID(), localSoundComponentData.getBytes(), arrayOfInt1, arrayOfInt2));
/* 189 */     setSize(arrayOfInt2[0]);
/*     */   }
/*     */
/*     */   public final SndInfo parseSndHeader()
/*     */     throws SoundException
/*     */   {
/* 198 */     int[] arrayOfInt1 = { 0 };
/* 199 */     int[] arrayOfInt2 = { 0 };
/* 200 */     SoundComponentData localSoundComponentData = new SoundComponentData();
/* 201 */     SoundException.checkError(ParseSndHeader(_ID(), localSoundComponentData.getBytes(), arrayOfInt1, arrayOfInt2));
/*     */
/* 203 */     return new SndInfo(localSoundComponentData, arrayOfInt1[0], arrayOfInt2[0]);
/*     */   }
/*     */
/*     */   private static native short SetupSndHeader(int paramInt1, short paramShort1, int paramInt2, short paramShort2, int paramInt3, short paramShort3, int paramInt4, short[] paramArrayOfShort);
/*     */
/*     */   private static native short GetSoundHeaderOffset(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native void BlockMove(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native short ParseSndHeader(int paramInt, byte[] paramArrayOfByte, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*     */ }

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

Related Classes of quicktime.sound.SndHandle

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.