/* */ package quicktime.std.sg;
/* */
/* */ import com.apple.mrj.macos.carbon.CarbonAccess;
/* */ import com.apple.mrj.macos.carbon.CarbonEventClient;
/* */ import quicktime.QTException;
/* */ import quicktime.QTObject;
/* */ import quicktime.QTSession;
/* */ import quicktime.jdirect.QTNative;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.std.comp.Component;
/* */ import quicktime.std.movies.media.SampleDescription;
/* */ import quicktime.std.movies.media.UserData;
/* */ import quicktime.util.QTUtils;
/* */
/* */ public abstract class SGChannel extends Component
/* */ {
/* 38 */ private static boolean apriori = QTSession.apriori();
/* */ private SequenceGrabber owner;
/* */
/* */ SGChannel(int paramInt, SequenceGrabber paramSequenceGrabber)
/* */ throws StdQTException
/* */ {
/* 42 */ super(paramInt, paramSequenceGrabber);
/* 43 */ setOwner(paramSequenceGrabber);
/* */ }
/* */
/* */ SGChannel(SequenceGrabber paramSequenceGrabber, int paramInt)
/* */ throws StdQTException
/* */ {
/* 56 */ super(allocate(paramSequenceGrabber, paramInt), paramSequenceGrabber);
/* 57 */ setOwner(paramSequenceGrabber);
/* */ }
/* */
/* */ private static int allocate(SequenceGrabber paramSequenceGrabber, int paramInt) throws StdQTException {
/* 61 */ int[] arrayOfInt = new int[1];
/* 62 */ int i = SGNewChannel(QTObject.ID(paramSequenceGrabber), paramInt, arrayOfInt);
/* 63 */ StdQTException.checkError(i);
/* 64 */ return arrayOfInt[0];
/* */ }
/* */
/* */ private void setOwner(SequenceGrabber paramSequenceGrabber)
/* */ throws StdQTException
/* */ {
/* 71 */ if (paramSequenceGrabber == null) throw new StdQTException(-50);
/* 72 */ this.owner = paramSequenceGrabber;
/* */ }
/* */
/* */ void disposeChannel(SequenceGrabber paramSequenceGrabber) throws StdQTException {
/* 76 */ if (this.owner != paramSequenceGrabber) {
/* 77 */ throw new StdQTException(-50);
/* */ }
/* 79 */ StdQTException.checkError(SGDisposeChannel(QTObject.ID(this.owner), _ID()));
/* */
/* 82 */ this.owner = null;
/* */ }
/* */
/* */ abstract SampleDescription makeDescription()
/* */ throws QTException;
/* */
/* */ public final SampleDescription getSampleDescription()
/* */ throws QTException
/* */ {
/* 95 */ SampleDescription localSampleDescription = makeDescription();
/* 96 */ int i = SGGetChannelSampleDescription(_ID(), QTObject.ID(localSampleDescription));
/* 97 */ StdQTException.checkError(i);
/* 98 */ return localSampleDescription;
/* */ }
/* */
/* */ public SequenceGrabber getSequenceGrabber()
/* */ {
/* 103 */ return this.owner;
/* */ }
/* */
/* */ public void settingsDialog()
/* */ throws StdQTException
/* */ {
/* 121 */ int[] arrayOfInt = null;
/* 122 */ int i = _ID();
/* */ int j;
/* 132 */ if (QTSession.isCurrentOS(4)) {
/* 133 */ j = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final int val$f_i;
/* */ private final int[] val$panelListPtr;
/* */
/* 135 */ public Object invoke() { int i = SGChannel.SGSettingsDialog(QTObject.ID(SGChannel.this.owner), this.val$f_i, (short)0, this.val$panelListPtr, 0, 0, 0);
/* */
/* 142 */ return new Integer(i);
/* */ }
/* */ })).intValue();
/* */
/* 145 */ StdQTException.checkError(j);
/* */ } else {
/* 147 */ synchronized (QTNative.globalsLock) {
/* 148 */ j = SGSettingsDialog(QTObject.ID(this.owner), _ID(), (short)0, arrayOfInt, 0, 0, 0);
/* */
/* 155 */ StdQTException.checkError(j);
/* */ }
/* */ }
/* */ }
/* */
/* */ public void settingsDialog(int paramInt, Component[] paramArrayOfComponent)
/* */ throws StdQTException
/* */ {
/* 173 */ int i = 0;
/* 174 */ int j = i;
/* 175 */ int[] arrayOfInt1 = null;
/* 176 */ int[] arrayOfInt2 = arrayOfInt1;
/* 177 */ int k = paramInt;
/* 178 */ int m = 0;
/* 179 */ int n = _ID();
/* */
/* 181 */ if (paramArrayOfComponent != null) {
/* 182 */ i = paramArrayOfComponent.length;
/* 183 */ arrayOfInt1 = new int[i];
/* 184 */ for (int i1 = 0; i1 < i; i1++) {
/* 185 */ arrayOfInt1[i1] = QTObject.ID(paramArrayOfComponent[i1]);
/* */ }
/* */ }
/* 188 */ if (QTSession.isCurrentOS(4)) {
/* 189 */ m = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final int val$f_i;
/* */ private final int val$f_numPanels;
/* */ private final int[] val$f_panelListPtr;
/* */ private final int val$f_flags;
/* */
/* 191 */ public Object invoke() { int i = SGChannel.SGSettingsDialog(QTObject.ID(SGChannel.this.owner), this.val$f_i, (short)this.val$f_numPanels, this.val$f_panelListPtr, this.val$f_flags, 0, 0);
/* */
/* 198 */ return new Integer(i);
/* */ }
/* */ })).intValue();
/* */
/* 201 */ StdQTException.checkError(m);
/* */ } else {
/* 203 */ synchronized (QTNative.globalsLock) {
/* 204 */ m = SGSettingsDialog(QTObject.ID(this.owner), _ID(), (short)i, arrayOfInt1, paramInt, 0, 0);
/* */
/* 211 */ StdQTException.checkError(m);
/* */ }
/* */ }
/* */ }
/* */
/* */ public void setDataSourceName(String paramString, int paramInt)
/* */ throws StdQTException
/* */ {
/* 226 */ int i = SGChannelSetDataSourceName(_ID(), QTUtils.String2PString(paramString, 255), paramInt);
/* */
/* 228 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public SGDataSourceInfo getDataSourceName()
/* */ throws StdQTException
/* */ {
/* 238 */ int[] arrayOfInt = new int[1];
/* 239 */ byte[] arrayOfByte = new byte[256];
/* */
/* 241 */ int i = SGChannelGetDataSourceName(_ID(), arrayOfByte, arrayOfInt);
/* */
/* 243 */ StdQTException.checkError(i);
/* */
/* 245 */ return new SGDataSourceInfo(QTUtils.PString2String(arrayOfByte, 0), arrayOfInt[0]);
/* */ }
/* */
/* */ public void setSettings(UserData paramUserData)
/* */ throws StdQTException
/* */ {
/* 256 */ int i = SGSetChannelSettings(QTObject.ID(this.owner), _ID(), QTObject.ID(paramUserData), 0);
/* */
/* 260 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public UserData getSettings()
/* */ throws StdQTException
/* */ {
/* 270 */ return UserData.fromSGChannel(this);
/* */ }
/* */
/* */ public void setUsage(int paramInt)
/* */ throws StdQTException
/* */ {
/* 279 */ StdQTException.checkError(SGSetChannelUsage(_ID(), paramInt));
/* */ }
/* */
/* */ public int getUsage()
/* */ throws StdQTException
/* */ {
/* 290 */ int[] arrayOfInt = { 0 };
/* 291 */ StdQTException.checkError(SGGetChannelUsage(_ID(), arrayOfInt));
/* */
/* 294 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public void setPlayFlags(int paramInt)
/* */ throws StdQTException
/* */ {
/* 304 */ StdQTException.checkError(SGSetChannelPlayFlags(_ID(), paramInt));
/* */ }
/* */
/* */ public int getPlayFlags()
/* */ throws StdQTException
/* */ {
/* 316 */ int[] arrayOfInt = { 0 };
/* 317 */ StdQTException.checkError(SGGetChannelPlayFlags(_ID(), arrayOfInt));
/* */
/* 320 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public void setDevice(String paramString)
/* */ throws StdQTException
/* */ {
/* 329 */ StdQTException.checkError(SGSetChannelDevice(_ID(), QTUtils.String2PString(paramString, 255)));
/* */ }
/* */
/* */ public SGDeviceList getDeviceList(int paramInt)
/* */ throws StdQTException
/* */ {
/* 341 */ int[] arrayOfInt = { 0 };
/* 342 */ paramInt ^= 1;
/* 343 */ int i = SGGetChannelDeviceList(_ID(), paramInt, arrayOfInt);
/* 344 */ StdQTException.checkError(i);
/* 345 */ return new SGDeviceList(arrayOfInt[0], null, this.owner);
/* */ }
/* */
/* */ public int getTimeScale()
/* */ throws StdQTException
/* */ {
/* 354 */ int[] arrayOfInt = { 0 };
/* 355 */ int i = SGGetChannelTimeScale(_ID(), arrayOfInt);
/* 356 */ StdQTException.checkError(i);
/* 357 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public void setOutput(SGOutput paramSGOutput)
/* */ throws StdQTException
/* */ {
/* 365 */ paramSGOutput.setChannel(this);
/* */ }
/* */
/* */ private static native int SGSetChannelDevice(int paramInt, byte[] paramArrayOfByte);
/* */
/* */ private static native int SGNewChannel(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/* */
/* */ private static native int SGSettingsDialog(int paramInt1, int paramInt2, short paramShort, int[] paramArrayOfInt, int paramInt3, int paramInt4, int paramInt5);
/* */
/* */ private static native int SGChannelSetDataSourceName(int paramInt1, byte[] paramArrayOfByte, int paramInt2);
/* */
/* */ private static native int SGChannelGetDataSourceName(int paramInt, byte[] paramArrayOfByte, int[] paramArrayOfInt);
/* */
/* */ private static native int SGSetChannelSettings(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
/* */
/* */ private static native int SGInitChannel(int paramInt1, int paramInt2);
/* */
/* */ private static native int SGSetChannelUsage(int paramInt1, int paramInt2);
/* */
/* */ private static native int SGGetChannelUsage(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int SGSetChannelPlayFlags(int paramInt1, int paramInt2);
/* */
/* */ private static native int SGGetChannelPlayFlags(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int SGGetChannelDeviceList(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/* */
/* */ private static native int SGGetChannelSampleDescription(int paramInt1, int paramInt2);
/* */
/* */ private static native int SGGetChannelTimeScale(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int SGDisposeChannel(int paramInt1, int paramInt2);
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.std.sg.SGChannel
* JD-Core Version: 0.6.2
*/