/* */ package quicktime.std.music;
/* */
/* */ 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.io.QTFile;
/* */ import quicktime.jdirect.QTNative;
/* */ import quicktime.qd.Pict;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.std.comp.Component;
/* */ import quicktime.std.movies.Track;
/* */ import quicktime.util.QTUtils;
/* */
/* */ public final class NoteAllocator extends Component
/* */ {
/* 31 */ private static boolean apriori = QTSession.apriori();
/* */
/* 34 */ static NoteAllocator defaultNA = null;
/* */ int res;
/* */
/* */ public static NoteAllocator getDefault()
/* */ throws QTException
/* */ {
/* 45 */ if (defaultNA == null)
/* 46 */ defaultNA = new NoteAllocator();
/* 47 */ else if (!defaultNA.stillValid()) {
/* 48 */ defaultNA = new NoteAllocator();
/* */ }
/* 50 */ return defaultNA;
/* */ }
/* */
/* */ public NoteAllocator()
/* */ throws QTException
/* */ {
/* 58 */ this(0);
/* */ }
/* */
/* */ public NoteAllocator(int paramInt)
/* */ throws QTException
/* */ {
/* 66 */ super(1852798049, paramInt);
/* */ }
/* */
/* */ NoteAllocator(int paramInt, Object paramObject) {
/* 70 */ super(paramInt, paramObject);
/* */ }
/* */
/* */ public int numNoteChannels()
/* */ throws StdQTException
/* */ {
/* 79 */ int i = NAGetIndNoteChannel(_ID(), 0, null, null);
/* 80 */ if (i < 0) StdQTException.checkError(i);
/* 81 */ return i;
/* */ }
/* */
/* */ public NoteChannel getIndNoteChannel(int paramInt)
/* */ throws StdQTException
/* */ {
/* 91 */ int[] arrayOfInt1 = new int[1];
/* 92 */ int[] arrayOfInt2 = new int[1];
/* 93 */ int i = NAGetIndNoteChannel(_ID(), paramInt, arrayOfInt1, arrayOfInt2);
/* 94 */ if (i < 0) StdQTException.checkError(i);
/* 95 */ return new NoteChannel(this, arrayOfInt1[0], this);
/* */ }
/* */
/* */ public void task()
/* */ throws StdQTException
/* */ {
/* 103 */ StdQTException.checkError(NATask(_ID()));
/* */ }
/* */
/* */ public void pickArrangement(String paramString1, Track paramTrack, String paramString2)
/* */ throws StdQTException
/* */ {
/* 114 */ String str1 = paramString1;
/* 115 */ Track localTrack = paramTrack;
/* 116 */ String str2 = paramString2;
/* 117 */ int i = _ID();
/* */
/* 119 */ if (QTSession.isCurrentOS(4)) {
/* 120 */ this.res = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final int val$f_i;
/* */ private final String val$f_prompt;
/* */ private final Track val$f_track;
/* */ private final String val$f_songName;
/* */
/* 122 */ public Object invoke() { NoteAllocator.this.res = NoteAllocator.NAPickArrangement(this.val$f_i, 0, QTUtils.String2PString(this.val$f_prompt, 255), 0, 0, QTObject.ID(this.val$f_track), QTUtils.String2PString(this.val$f_songName, 255));
/* */
/* 126 */ return new Integer(NoteAllocator.this.res);
/* */ }
/* */ })).intValue();
/* */
/* 129 */ StdQTException.checkError(this.res);
/* */ } else {
/* 131 */ synchronized (QTNative.globalsLock) {
/* 132 */ StdQTException.checkError(NAPickArrangement(_ID(), 0, QTUtils.String2PString(paramString1, 255), 0, 0, QTObject.ID(paramTrack), QTUtils.String2PString(paramString2, 255)));
/* */ }
/* */ }
/* */ }
/* */
/* */ public void copyrightDialog(Pict paramPict, String paramString1, String paramString2, String paramString3, String paramString4)
/* */ throws StdQTException
/* */ {
/* 153 */ String str1 = paramString1;
/* 154 */ String str2 = paramString2;
/* 155 */ String str3 = paramString3;
/* 156 */ Pict localPict = paramPict;
/* 157 */ String str4 = paramString4;
/* 158 */ int i = _ID();
/* */
/* 160 */ if (QTSession.isCurrentOS(4)) {
/* 161 */ this.res = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final int val$f_i;
/* */ private final Pict val$f_p;
/* */ private final String val$f_author;
/* */ private final String val$f_copyright;
/* */ private final String val$f_other;
/* */ private final String val$f_title;
/* */
/* 163 */ public Object invoke() { NoteAllocator.this.res = NoteAllocator.NACopyrightDialog(this.val$f_i, QTObject.ID(this.val$f_p), QTUtils.String2PString(this.val$f_author, 255), QTUtils.String2PString(this.val$f_copyright, 255), QTUtils.String2PString(this.val$f_other, 255), QTUtils.String2PString(this.val$f_title, 255), 0, 0);
/* */
/* 169 */ return new Integer(NoteAllocator.this.res);
/* */ }
/* */ })).intValue();
/* */
/* 172 */ StdQTException.checkError(this.res);
/* */ } else {
/* 174 */ synchronized (QTNative.globalsLock) {
/* 175 */ StdQTException.checkError(NACopyrightDialog(_ID(), QTObject.ID(paramPict), QTUtils.String2PString(paramString1, 255), QTUtils.String2PString(paramString2, 255), QTUtils.String2PString(paramString3, 255), QTUtils.String2PString(paramString4, 255), 0, 0));
/* */ }
/* */ }
/* */ }
/* */
/* */ public int numMusicComponents()
/* */ throws StdQTException
/* */ {
/* 194 */ int i = NAGetRegisteredMusicDevice(_ID(), 0, null, null, null, null);
/* 195 */ if (i < 0) StdQTException.checkError(i);
/* 196 */ return i;
/* */ }
/* */
/* */ public String registerMusicDevice_SoundBank(QTFile paramQTFile)
/* */ throws QTException
/* */ {
/* 210 */ byte[] arrayOfByte = new byte[32];
/* 211 */ StdQTException.checkError(NARegisterMusicDevice(_ID(), 0, arrayOfByte, new SynthesizerConnections(paramQTFile).getBytes()));
/* */
/* 214 */ return QTUtils.PString2String(arrayOfByte, 0);
/* */ }
/* */
/* */ public void registerMusicDevice(int paramInt, String paramString, SynthesizerConnections paramSynthesizerConnections)
/* */ throws StdQTException
/* */ {
/* 226 */ StdQTException.checkError(NARegisterMusicDevice(_ID(), paramInt, QTUtils.String2PString(paramString, 31), paramSynthesizerConnections.getBytes()));
/* */ }
/* */
/* */ public void unregisterMusicDevice(int paramInt)
/* */ throws StdQTException
/* */ {
/* 237 */ StdQTException.checkError(NAUnregisterMusicDevice(_ID(), paramInt));
/* */ }
/* */
/* */ public MusicComponentInfo getRegisteredMusicDevice(int paramInt)
/* */ throws StdQTException
/* */ {
/* 247 */ byte[] arrayOfByte = new byte[256];
/* 248 */ int[] arrayOfInt1 = new int[1];
/* 249 */ SynthesizerConnections localSynthesizerConnections = new SynthesizerConnections();
/* 250 */ int[] arrayOfInt2 = new int[1];
/* 251 */ int i = NAGetRegisteredMusicDevice(_ID(), paramInt, arrayOfInt1, arrayOfByte, localSynthesizerConnections.getBytes(), arrayOfInt2);
/* 252 */ if (i < 0) StdQTException.checkError(i);
/* 253 */ MusicComponentInfo localMusicComponentInfo = new MusicComponentInfo();
/* 254 */ localMusicComponentInfo.synthType = arrayOfInt1[0];
/* 255 */ localMusicComponentInfo.name = new String(arrayOfByte, 1, arrayOfByte[0]);
/* 256 */ localMusicComponentInfo.mc = new MusicComponent(arrayOfInt2[0], null);
/* 257 */ localMusicComponentInfo.connections = localSynthesizerConnections;
/* 258 */ return localMusicComponentInfo;
/* */ }
/* */
/* */ public SynthesizerConnections getDefaultMIDIInput()
/* */ throws StdQTException
/* */ {
/* 267 */ SynthesizerConnections localSynthesizerConnections = new SynthesizerConnections();
/* 268 */ StdQTException.checkError(NAGetDefaultMIDIInput(_ID(), localSynthesizerConnections.getBytes()));
/* 269 */ return localSynthesizerConnections;
/* */ }
/* */
/* */ public void setDefaultMIDIInput(SynthesizerConnections paramSynthesizerConnections)
/* */ throws StdQTException
/* */ {
/* 278 */ StdQTException.checkError(NASetDefaultMIDIInput(_ID(), paramSynthesizerConnections.getBytes()));
/* */ }
/* */
/* */ public void saveMusicConfiguration()
/* */ throws StdQTException
/* */ {
/* 285 */ StdQTException.checkError(NASaveMusicConfiguration(_ID()));
/* */ }
/* */
/* */ public QTMIDIPortList getMIDIInPorts()
/* */ throws QTException
/* */ {
/* 294 */ int[] arrayOfInt = new int[1];
/* 295 */ StdQTException.checkError(NAGetMIDIPorts(_ID(), arrayOfInt, null));
/* */
/* 298 */ return new QTMIDIPortList(arrayOfInt[0]);
/* */ }
/* */
/* */ public QTMIDIPortList getMIDIOutPorts()
/* */ throws QTException
/* */ {
/* 307 */ int[] arrayOfInt = new int[1];
/* 308 */ StdQTException.checkError(NAGetMIDIPorts(_ID(), null, arrayOfInt));
/* */
/* 311 */ return new QTMIDIPortList(arrayOfInt[0]);
/* */ }
/* */
/* */ public void loseDefaultMIDIInput()
/* */ throws StdQTException
/* */ {
/* 320 */ StdQTException.checkError(NALoseDefaultMIDIInput(_ID()));
/* */ }
/* */
/* */ private static native int NAGetIndNoteChannel(int paramInt1, int paramInt2, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/* */
/* */ private static native int NATask(int paramInt);
/* */
/* */ private static native int NAPickArrangement(int paramInt1, int paramInt2, byte[] paramArrayOfByte1, int paramInt3, int paramInt4, int paramInt5, byte[] paramArrayOfByte2);
/* */
/* */ private static native int NACopyrightDialog(int paramInt1, int paramInt2, byte[] paramArrayOfByte1, byte[] paramArrayOfByte2, byte[] paramArrayOfByte3, byte[] paramArrayOfByte4, int paramInt3, int paramInt4);
/* */
/* */ private static native int NAGetRegisteredMusicDevice(int paramInt1, int paramInt2, int[] paramArrayOfInt1, byte[] paramArrayOfByte1, byte[] paramArrayOfByte2, int[] paramArrayOfInt2);
/* */
/* */ private static native int NARegisterMusicDevice(int paramInt1, int paramInt2, byte[] paramArrayOfByte1, byte[] paramArrayOfByte2);
/* */
/* */ private static native int NAUnregisterMusicDevice(int paramInt1, int paramInt2);
/* */
/* */ private static native int NAGetDefaultMIDIInput(int paramInt, byte[] paramArrayOfByte);
/* */
/* */ private static native int NASetDefaultMIDIInput(int paramInt, byte[] paramArrayOfByte);
/* */
/* */ private static native int NASaveMusicConfiguration(int paramInt);
/* */
/* */ private static native int NAGetMIDIPorts(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/* */
/* */ private static native int NALoseDefaultMIDIInput(int paramInt);
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.std.music.NoteAllocator
* JD-Core Version: 0.6.2
*/