/*********************************************	Copyright © 2001 Jason Lamport.	All rights reserved.----------------------J_OMS was originally a wrapper for all the JDirect calls to the native OMS routines, and for many other MIDI-related utility functions.Not used in current implementation (but we're keeping it for now, it maybe useful later).Notes on MIDI packets:byte 1, low-order nybble:	MIDI channelbyte 1, high-order nybble:	0x9 = note event							0xB = controller event							0xE = pitch bend							0xC = patch changebyte 2:	note/controller/patch number		(for notes: C1 == 0x24)		byte 3:	note-velocity or controller-value------------		typedef struct OMSMIDIPacket {		// offsets:			long 			beatTimeStamp;	// 0			long 			smpteTimeStamp;	// 4			unsigned char	flags;			// 8			unsigned char 	len; 			// 9			unsigned short 	srcIORefNum;	// 10			unsigned short 	appConnRefCon;	// 12			unsigned char 	data[4];		// 14		} OMSMIDIPacket;long:4 short:2 *******************************************/package com.strangelight.v4control;import com.apple.jdirect.*;import java.util.*;public class J_OMS implements V4ControlLib_interface {/*	public static MIDIPacket[] get_MIDI() {			}*/	public static final int MAX_CONTROLLER_NUM = 255;	public static final int MIN_CONTROLLER_NUM = 0;	public static final int MAX_CONTROLLER_VALUE = 127;	public static final int MIN_CONTROLLER_VALUE = 0;	/*	private Vector packet_buffer = new Vector();	private Vector message_buffer = new Vector();	private Vector inputs = new Vector();	private Vector outputs = new Vector();	private J_OMS() {}	//	prevent instantiation	public static class MIDIPacket extends J_NativeMessage {		public static final byte NOTE  			= (byte) 0x90;		public static final byte CONTROLLER 	= (byte) 0xB0;		public static final byte PITCHBEND 		= (byte) 0xE0;		public static final byte PATCH_CHANGE 	= (byte) 0xC0;				public static final int  SIZEOF = 18;				protected static final int	beatTimeStamp_index		= 0;		protected static final int	smpteTimeStamp_index	= 4;		protected static final int	flags_index				= 8;		protected static final int	len_index				= 9;		protected static final int	srcIORefNum_index		= 10;		protected static final int	appConnRefCon_index		= 12;		protected static final int	data_index				= 14;		protected static final int	controller_index		= 15;		protected static final int	value_index				= 16;		protected static final byte	event_type_mask		= (byte) 0xF0;		protected static final byte	channel_mask		= (byte) 0x0F;				public static int object_type() { return OMSMIDI_PACKET; }		public MIDIPacket() {			super( SIZEOF );		}		public MIDIPacket( byte[] b ) {			super( SIZEOF );			for( int i = 0; i < SIZEOF; ++i ) {				bytes[i] = b[i];			}		}				public byte get_event_type() {			return (byte) ( bytes[data_index] & event_type_mask );		}				public byte get_channel() {			return (byte) ( bytes[data_index] & channel_mask );		}				public byte get_controller() {			return bytes[controller_index];		}				public byte get_value() {			return bytes[value_index];		}				public int beatTimeStamp() {			return getIntAt( beatTimeStamp_index );		}				public int smpteTimeStamp() {			return getIntAt( smpteTimeStamp_index );		}				public byte flags() {			return getByteAt( flags_index );		}				public byte len() {			return getByteAt( len_index );		}				public short srcIORefNum() {			return getShortAt( srcIORefNum_index );		}				public short appConnRefCon() {			return getShortAt( appConnRefCon_index );		}				public byte[] data() {			return getBytesAt( data_index, 4 );		}	}*/}/*		typedef struct OMSMIDIPacket {			long 			beatTimeStamp;			long 			smpteTimeStamp;			unsigned char	flags;			unsigned char 	len; 			unsigned short 	srcIORefNum;			unsigned short 	appConnRefCon;			unsigned char 	data[4];		} OMSMIDIPacket;long:4 short:2 beatTimeStampsmpteTimeStampflagslen srcIORefNumappConnRefCondata[4] */