All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.util.QTUtils
java.lang.Object
|
+----quicktime.util.QTUtils
- public final class QTUtils
- extends Object
- implements QuickTimeLib
This provides a set of routines to convert between types that the
QT calls expect and the basic Java classes and types
Some of the structures in QT are kept in their native BigEndian format.
QTStructs with BigEndian formats:
- ToneDescription
- NoteRequest
These conversions are generally done for you where they are required in the
get/set methods of the classes concerned.
-
checkFreeMemory()
- This call will ensure that a reserved amount of application heap memory
on the MacOS is free.
-
convertEventModifier(int)
- Convert the modifier values in java InputEvents to those expected by QT.
-
convertKeyValue(int)
- Convert the key values in java KeyEvents to those expected by QT.
-
CString2String(byte[], int)
- Converts a CString into a java.lang.String.
-
endianFlip(Object, int, EndianDescriptor)
- This will flip the supplied src object's fields according to the characteristics of the supplied
EndianDescriptor.
-
endianFlip(Object, int, Object, int, EndianDescriptor)
- This will flip the supplied src object's fields according to the characteristics of the supplied
EndianDescriptor and copy these flipped values to the destination object.
-
endianFlip16(short)
- This will flip the endian order of a 16bit value
-
endianFlip32(int)
- This will flip the endian order of a 32bit value
-
endianFlip64(long)
- This will flip the endian order of a 64bit value
-
Fix2X(int)
- Convert a float to a 16.16 Fixed format
-
Fract2X(int)
- Convert a 2.30 Fract format to a float
-
fromOSType(int)
- Converts an int into a 4 character string representing an OSType.
-
PString2String(byte[], int)
- Converts a PString into a java.lang.String.
-
reclaimMemory()
- Reclaim as much memory as possible and ensure that all finalize methods are
called on objects which have been collected.
-
ShortFix2X(short)
- Convert a 8.8 Fixed format to a float
-
String2CString(String)
- Convert a java.lang.String to a CString byte array.
-
String2PString(String, int)
- Convert a java.lang.String to a PString byte array.
-
toOSType(char, char, char, char)
- Converts four characters into an OSType int
-
toOSType(String)
- Converts an OSType (4 character) string into an int.
-
UByte2Int(byte)
- converts an unsigned byte to int.
-
UFix2X(int)
- Convert a 16.16 Unsigned Fixed format to a float
-
UInt2Long(int)
- converts an unsigned int to long.
-
UShort2Int(short)
- converts an unsigned short to int.
-
X2Fix(float)
- Convert a float to a 16.16 Fixed format
-
X2Fract(float)
- Converts a float to a 2.30 Fract format
-
X2ShortFix(float)
- Convert a float to a 8.8 Fixed format
-
X2UFix(float)
- Convert a 16.16 Unsigned Fixed format to a float
convertEventModifier
public static int convertEventModifier(int javaEvtMod)
- Convert the modifier values in java InputEvents to those expected by QT.
convertKeyValue
public static int convertKeyValue(int javaKeyValue)
- Convert the key values in java KeyEvents to those expected by QT.
X2Fix
public static int X2Fix(float x)
- Convert a float to a 16.16 Fixed format
Fix2X
public static float Fix2X(int fix)
- Convert a float to a 16.16 Fixed format
X2UFix
public static int X2UFix(float x)
- Convert a 16.16 Unsigned Fixed format to a float
UFix2X
public static float UFix2X(int fix)
- Convert a 16.16 Unsigned Fixed format to a float
X2Fract
public static int X2Fract(float x)
- Converts a float to a 2.30 Fract format
Fract2X
public static float Fract2X(int fract)
- Convert a 2.30 Fract format to a float
X2ShortFix
public static short X2ShortFix(float x)
- Convert a float to a 8.8 Fixed format
ShortFix2X
public static float ShortFix2X(short fix)
- Convert a 8.8 Fixed format to a float
UByte2Int
public static int UByte2Int(byte b)
- converts an unsigned byte to int.
UShort2Int
public static int UShort2Int(short s)
- converts an unsigned short to int.
UInt2Long
public static long UInt2Long(int i)
- converts an unsigned int to long.
String2CString
public static byte[] String2CString(String str)
- Convert a java.lang.String to a CString byte array.
- Parameters:
- str - the String to convert
String2PString
public static byte[] String2PString(String str,
int len)
- Convert a java.lang.String to a PString byte array.
- Parameters:
- str - the String to convert
- len - the maximum length of the Pstring, max length is 255.
CString2String
public static String CString2String(byte str[],
int offset)
- Converts a CString into a java.lang.String. The offset specifies where the C string
begins and it terminates at the first 0 value that it finds.
PString2String
public static String PString2String(byte pString[],
int offset)
- Converts a PString into a java.lang.String. The offset specifies where the count byte
is within the byte array that is passed in - typically 0.
toOSType
public static final int toOSType(String str)
- Converts an OSType (4 character) string into an int.
toOSType
public static final int toOSType(char a,
char b,
char c,
char d)
- Converts four characters into an OSType int
fromOSType
public static String fromOSType(int osType)
- Converts an int into a 4 character string representing an OSType.
The OSType int is presumed to be the right endian layout.
reclaimMemory
public static void reclaimMemory()
- Reclaim as much memory as possible and ensure that all finalize methods are
called on objects which have been collected.
checkFreeMemory
public static void checkFreeMemory() throws UtilException
- This call will ensure that a reserved amount of application heap memory
on the MacOS is free. If this amount of memory is not free a memFullErr
will be thrown.
endianFlip16
public static short endianFlip16(short s)
- This will flip the endian order of a 16bit value
- Parameters:
- s - the value to flip
- Returns:
- the flipped value
- See Also:
- EndianOrder
endianFlip32
public static int endianFlip32(int i)
- This will flip the endian order of a 32bit value
- Parameters:
- i - the value to flip
- Returns:
- the flipped value
- See Also:
- EndianOrder
endianFlip64
public static long endianFlip64(long l)
- This will flip the endian order of a 64bit value
- Parameters:
- l - the value to flip
- Returns:
- the flipped value
- See Also:
- EndianOrder
endianFlip
public static void endianFlip(Object src,
int srcOffset,
EndianDescriptor ed) throws UtilException
- This will flip the supplied src object's fields according to the characteristics of the supplied
EndianDescriptor. The EndianDescriptor will be applied to the src object at the specified (srcOffset)
number of bytes from the beginning of the src object. The flipping is done in place, so the srcObject
will be flipped upon the completion of this method. Any fields that are not described or accounted for
by the EndianDescriptor will not be flipped.
- Parameters:
- src - the object to flip
- srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor
will be applied.
- ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
- See Also:
- EndianOrder
endianFlip
public static void endianFlip(Object src,
int srcOffset,
Object dest,
int destOffset,
EndianDescriptor ed) throws UtilException
- This will flip the supplied src object's fields according to the characteristics of the supplied
EndianDescriptor and copy these flipped values to the destination object.
The EndianDescriptor will be applied to the src object at the specified (srcOffset)
number of bytes from the beginning of the src object and the flipped values will be copied to the specified
(destOffset) number of bytes into the destination object. Any fields that are not described or accounted for
by the EndianDescriptor will not be flipped or copied.
- Parameters:
- src - the object to flip
- srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor
will be applied.
- dest - the object that will be the flipped version of the source object.
- destOffset - the number of bytes from the start of the dest object that the flipped values will be copied too.
- ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
- See Also:
- EndianOrder
All Packages Class Hierarchy This Package Previous Next Index