org.mmbase.util.media.audio
Class RawAudioDef

java.lang.Object
  |
  +--org.mmbase.util.media.audio.RawAudioDef
All Implemented Interfaces:
java.lang.Comparable, CompareInterface, Sortable

public class RawAudioDef
extends java.lang.Object
implements java.lang.Comparable, CompareInterface, Sortable

The main function of this class is to provide a means to sort through a collection of RawAudio objects (from the rawaudios builder). MMObjectNodes can not easily be sorted (unless through sql querying). This class is, essentially, a wrapper that provides this sorting functionality.

Version:
$Id: RawAudioDef.java,v 1.13 2002/07/23 14:03:52 vpro Exp $
Author:
Daniel Ockeloen, David van Zeventer, Rico Jansen

Field Summary
static java.lang.String AUDIO_DIR
           
 int channels
          Rawaudio nr of channels, used for sorting
 java.lang.String cpu
          Deprecated. not used?
 int format
          Deprecated. should be retrieved from node reference
static int FORMAT_G2
          G2 (surestream) audio format
static int FORMAT_PCM
          PCM (MP2?) audio format
static int FORMAT_R5
          Real (.ra) audio format
static int FORMAT_WAV
          WAV audio format
static int G2_MAXSPEED
          Maximum speed for surestream audio
static int G2_MINSPEED
          Minimum speed for surestream audio (currently unused)
 int id
          Rawaudio id, used for sorting
static int MAXCHANNELS
          Maximum channels for audio
static int MAXSPEED
          Maximum speed for audio
static int MINCHANNELS
          Minimum channels for audio
static int MINSPEED
          Minimum speed for audio
 int number
          Deprecated. should be retrieved from node reference
 int otype
          Deprecated. not used?
 java.lang.String owner
          Deprecated. not used?
 int speed
          Rawaudio speed, used for sorting
 int status
          Deprecated. should be retrieved from node reference
static int STATUS_BUSY
           
static int STATUS_DONE
           
static int STATUS_GEDAAN
          Deprecated. use STATUS_DONE
static int STATUS_ONDERWEG
          Deprecated. use STATUS_BUSY
static int STATUS_REQUEST
           
static int STATUS_VERZOEK
          Deprecated. use STATUS_REQUEST
static int STORAGE_MONO
          storage of raw media: mono
static int STORAGE_MONO_NOBACKUP
          storage of raw media: mono, no backup
static int STORAGE_STEREO
          storage of raw media: stereo
static int STORAGE_STEREO_NOBACKUP
          storage of raw media: stereo, no backup
 java.lang.String url
          Deprecated. should be retrieved from node reference
static int WAV_MAXSPEED
          Maximum speed for wav audio
 
Constructor Summary
RawAudioDef(MMObjectNode node)
          Creates an instance of the sortable wrapper for an MMObjectNode.
 
Method Summary
 int compare(java.lang.Object thisO, java.lang.Object otherO)
          Deprecated. use compareTo(java.lang.Object) instead
 int compare(Sortable otherItem)
          Deprecated. use compareTo(java.lang.Object) instead
 int compareTo(java.lang.Object o)
          Compares this RawAudio object to the passed RawAudio object RawAudio objects are compared (and ordered) by their id, speed, and channel.
 boolean equals(java.lang.Object o)
          Compares whether this object and the passed object are the same.
 java.lang.String getRealAudioUrl(scanpage sp)
          Retrieves the url for an raw audio, based on info in the format and url fields of a wrapped rawaudio node.
static java.util.Vector sort(java.util.Vector unsorted)
          Deprecated. use Collections.sort()
 java.lang.String toString()
          Returns a string representation of this object, for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_VERZOEK

public static final int STATUS_VERZOEK
Deprecated. use STATUS_REQUEST


STATUS_REQUEST

public static final int STATUS_REQUEST

STATUS_ONDERWEG

public static final int STATUS_ONDERWEG
Deprecated. use STATUS_BUSY


STATUS_BUSY

public static final int STATUS_BUSY

STATUS_GEDAAN

public static final int STATUS_GEDAAN
Deprecated. use STATUS_DONE


STATUS_DONE

public static final int STATUS_DONE

FORMAT_R5

public static final int FORMAT_R5
Real (.ra) audio format

FORMAT_WAV

public static final int FORMAT_WAV
WAV audio format

FORMAT_PCM

public static final int FORMAT_PCM
PCM (MP2?) audio format

FORMAT_G2

public static final int FORMAT_G2
G2 (surestream) audio format

STORAGE_STEREO

public static final int STORAGE_STEREO
storage of raw media: stereo

STORAGE_STEREO_NOBACKUP

public static final int STORAGE_STEREO_NOBACKUP
storage of raw media: stereo, no backup

STORAGE_MONO

public static final int STORAGE_MONO
storage of raw media: mono

STORAGE_MONO_NOBACKUP

public static final int STORAGE_MONO_NOBACKUP
storage of raw media: mono, no backup

MINSPEED

public static final int MINSPEED
Minimum speed for audio

MAXSPEED

public static final int MAXSPEED
Maximum speed for audio

MINCHANNELS

public static final int MINCHANNELS
Minimum channels for audio

MAXCHANNELS

public static final int MAXCHANNELS
Maximum channels for audio

WAV_MAXSPEED

public static final int WAV_MAXSPEED
Maximum speed for wav audio

G2_MINSPEED

public static final int G2_MINSPEED
Minimum speed for surestream audio (currently unused)

G2_MAXSPEED

public static final int G2_MAXSPEED
Maximum speed for surestream audio

AUDIO_DIR

public static final java.lang.String AUDIO_DIR

number

public int number
Deprecated. should be retrieved from node reference

Rawaudio object number

otype

public int otype
Deprecated. not used?

Rawaudio object type

owner

public java.lang.String owner
Deprecated. not used?

Rawaudio object owner

id

public int id
Rawaudio id, used for sorting

status

public int status
Deprecated. should be retrieved from node reference


format

public int format
Deprecated. should be retrieved from node reference

Rawaudio format, determines audio url protocol

speed

public int speed
Rawaudio speed, used for sorting

channels

public int channels
Rawaudio nr of channels, used for sorting

url

public java.lang.String url
Deprecated. should be retrieved from node reference

Rawaudio url

cpu

public java.lang.String cpu
Deprecated. not used?

Rawaudio cpu (?)
Constructor Detail

RawAudioDef

public RawAudioDef(MMObjectNode node)
Creates an instance of the sortable wrapper for an MMObjectNode. This class copies a node's values to speed up the sorting process.
Parameters:
node - the node to wrap
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Compares this RawAudio object to the passed RawAudio object RawAudio objects are compared (and ordered) by their id, speed, and channel.
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the object to compare this object to
Returns:
0 if the objects are the same, -1 if the passed object is greater than this object, 1 passed if the object is smaller than this object.
Since:
MMBase-1.6

equals

public boolean equals(java.lang.Object o)
Compares whether this object and the passed object are the same. Objects are the same if they have the same id, speed, and nr of channels
Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare this object to
Returns:
true if the objects are the same, false otherwise
Since:
MMBase-1.6

compare

public int compare(Sortable otherItem)
Deprecated. use compareTo(java.lang.Object) instead

Compares this object to the passed object
Specified by:
compare in interface Sortable
Parameters:
otherItem - the object to compare this object to
Returns:
0 if the objects are the same, -1 if the passed object is greater than this object, 1 passed if the object is smaller than this object.

compare

public int compare(java.lang.Object thisO,
                   java.lang.Object otherO)
Deprecated. use compareTo(java.lang.Object) instead

Compares two objects
Specified by:
compare in interface CompareInterface
Parameters:
thisO - the first object to compare
otherO - the second object to compare
Returns:
0 if the objects are the same, -1 if the second object is greater than the first, 1 passed if the second object is smaller than the first.

sort

public static java.util.Vector sort(java.util.Vector unsorted)
Deprecated. use Collections.sort()

Sort vector with RawAudios
Parameters:
unsorted - the Vector to stor

getRealAudioUrl

public java.lang.String getRealAudioUrl(scanpage sp)
Retrieves the url for an raw audio, based on info in the format and url fields of a wrapped rawaudio node.
Parameters:
sp - scanpage parameter.

toString

public java.lang.String toString()
Returns a string representation of this object, for debugging purposes.
Overrides:
toString in class java.lang.Object


MMBase build 1.6.5.20030923