entagged.audioformats.asf.data
Class GUID

java.lang.Object
  extended by entagged.audioformats.asf.data.GUID

public class GUID
extends Object

This class is used for representation of GUIDs and as a reference list of all Known GUIDs.

Author:
Christian Laireiter

Field Summary
static GUID GUID_AUDIO_ERROR_CONCEALEMENT_ABSENT
          This constant defines the GUID for stream chunks describing audio streams, indicating the the audio stream has no error concealment.
static GUID GUID_AUDIO_ERROR_CONCEALEMENT_INTERLEAVED
          This constant defines the GUID for stream chunks describing audio streams, indicating the the audio stream has interleaved error concealment.
static GUID GUID_AUDIOSTREAM
          This constant stores the GUID indicating that stream type is audio.
static GUID GUID_CONTENTDESCRIPTION
          This constant represents the guid for a chunk which contains Title, author, copyright, description and rating.
static GUID GUID_ENCODING
          This constant stores the GUID for Encoding-Info chunks.
static GUID GUID_EXTENDED_CONTENT_DESCRIPTION
          This constant defines the GUID for a WMA "Extended Content Description" chunk.
static GUID GUID_FILE
          GUID of ASF file header.
static GUID GUID_HEADER
          This constant defines the GUID of a asf header chunk.
static GUID GUID_HEADER_EXTENSION
          This constant stores a GUID whose functionality is unknown.
static int GUID_LENGTH
          This constant stores the length of GUIDs used with ASF streams.
static GUID GUID_STREAM
          This constant stores the GUID indicating a stream object.
static GUID GUID_STREAM_BITRATE_PROPERTIES
          This constant stores a GUID indicating a "stream bitrate properties" chunk.
static GUID GUID_VIDEOSTREAM
          This constant stores the GUID indicating that stream type is video.
static GUID[] KNOWN_GUIDS
          This field stores all knwon GUIDs.
 
Constructor Summary
GUID(int[] value)
          Creates an instance and assigns given guid.
GUID(int[] value, String desc)
          Creates an instance like GUID(int[])and sets the optional description.
 
Method Summary
static boolean assertGUID(int[] value)
          This method checks if the given value is matching the GUID specification of ASF streams.
 boolean equals(Object obj)
          This method compares two objects.
 byte[] getBytes()
          This method returns the guid as an array of bytes.
 String getDescription()
           
 int[] getGUID()
          This method returns the GUID of this object.
static String getGuidDescription(GUID guid)
          This method searches a GUID in KNOWN_GUIDSwhich is equal to the given guid and returns its description.
 boolean isValid()
          This method checks if the currently stored GUID (guid) is correctly filled.
 String toString()
          This method gives a hex formatted representation of getGUID()
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GUID_AUDIO_ERROR_CONCEALEMENT_ABSENT

public static final GUID GUID_AUDIO_ERROR_CONCEALEMENT_ABSENT
This constant defines the GUID for stream chunks describing audio streams, indicating the the audio stream has no error concealment.


GUID_AUDIO_ERROR_CONCEALEMENT_INTERLEAVED

public static final GUID GUID_AUDIO_ERROR_CONCEALEMENT_INTERLEAVED
This constant defines the GUID for stream chunks describing audio streams, indicating the the audio stream has interleaved error concealment.


GUID_AUDIOSTREAM

public static final GUID GUID_AUDIOSTREAM
This constant stores the GUID indicating that stream type is audio.


GUID_CONTENTDESCRIPTION

public static final GUID GUID_CONTENTDESCRIPTION
This constant represents the guid for a chunk which contains Title, author, copyright, description and rating.


GUID_ENCODING

public static final GUID GUID_ENCODING
This constant stores the GUID for Encoding-Info chunks.


GUID_EXTENDED_CONTENT_DESCRIPTION

public static final GUID GUID_EXTENDED_CONTENT_DESCRIPTION
This constant defines the GUID for a WMA "Extended Content Description" chunk.


GUID_FILE

public static final GUID GUID_FILE
GUID of ASF file header.


GUID_HEADER

public static final GUID GUID_HEADER
This constant defines the GUID of a asf header chunk.


GUID_LENGTH

public static final int GUID_LENGTH
This constant stores the length of GUIDs used with ASF streams.

See Also:
Constant Field Values

GUID_STREAM

public static final GUID GUID_STREAM
This constant stores the GUID indicating a stream object.


GUID_HEADER_EXTENSION

public static final GUID GUID_HEADER_EXTENSION
This constant stores a GUID whose functionality is unknown.


GUID_STREAM_BITRATE_PROPERTIES

public static final GUID GUID_STREAM_BITRATE_PROPERTIES
This constant stores a GUID indicating a "stream bitrate properties" chunk.


GUID_VIDEOSTREAM

public static final GUID GUID_VIDEOSTREAM
This constant stores the GUID indicating that stream type is video.


KNOWN_GUIDS

public static final GUID[] KNOWN_GUIDS
This field stores all knwon GUIDs.

Constructor Detail

GUID

public GUID(int[] value)
Creates an instance and assigns given guid.

Parameters:
value - Guid, which should be assigned.

GUID

public GUID(int[] value,
            String desc)
Creates an instance like GUID(int[])and sets the optional description.

Parameters:
value - Guid, which should be assigned.
desc - Description for the guid.
Method Detail

assertGUID

public static boolean assertGUID(int[] value)
This method checks if the given value is matching the GUID specification of ASF streams.

Parameters:
value - possible GUID.
Returns:
true if value matches the specification of a GUID.

getGuidDescription

public static String getGuidDescription(GUID guid)
This method searches a GUID in KNOWN_GUIDSwhich is equal to the given guid and returns its description.
This method is useful if a guid was read out of a file and no identification has been done yet.

Parameters:
guid - guid, which description is needed.
Returns:
description of the guid if found. Else null

equals

public boolean equals(Object obj)
This method compares two objects. If the given Object is a GUID, the stored GUID values are compared.

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

getBytes

public byte[] getBytes()
This method returns the guid as an array of bytes.

Returns:
The guid as a byte array.
See Also:
getGUID()

getDescription

public String getDescription()
Returns:
Returns the description.

getGUID

public int[] getGUID()
This method returns the GUID of this object.

Returns:
stored GUID.

isValid

public boolean isValid()
This method checks if the currently stored GUID (guid) is correctly filled.

Returns:
true if it is.

toString

public String toString()
This method gives a hex formatted representation of getGUID()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2007-2008. All Rights Reserved.