com.groovemanager.spi.rex
Class REXAudioFileFormat

java.lang.Object
  extended by javax.sound.sampled.AudioFileFormat
      extended by com.groovemanager.spi.rex.REXAudioFileFormat

public class REXAudioFileFormat
extends javax.sound.sampled.AudioFileFormat

This class specifies the AudioFileFormat of a REX file. The following properties are accesible via the getProperty()-method if they could be found in the file:
- duration: The duration of this file in microseconds (Long)
- author (optional): name, email and URL of the author (String)
- copyright (optional): a string containing the copyright information (String)
- comment (optional): a free text (String)
- slice_count: The number of slices found in this file (Integer)
- bpm: The Tempo of the file (Float)
- time_signature: An int-Array containing the nominator of the time signature at position [0] and the denominator at position [1] (int[])
- slices: A two-dimensional int-Array which contains information about the slices in this file. Sor each slice there is one entry in the first dimension two entries in the second dimension describing the position and the length of the slice in sample frames. For example the position of the third slice can be found at slices[2][0] and the duration of the first slice at slices[0][1].

Author:
Manu Robledo

Nested Class Summary
static class REXAudioFileFormat.Type
           
 
Field Summary
protected  java.util.Map properties
          Map of properties assigned to this AudioFileFormat
 
Constructor Summary
REXAudioFileFormat(REXAudioFormat format, int length, java.util.Map properties)
          Constructs a new REXAudioFileFormat
REXAudioFileFormat(REXInfo info, REXCreatorInfo cInfo, REXSliceInfo[] sliceInfos)
          Constructs a new REXAudioFileFormat
 
Method Summary
private static java.util.Map createProperties(REXInfo info, REXCreatorInfo cInfo, REXSliceInfo[] sInfos)
          Create and return the properties Map out of the given data
 java.lang.Object getProperty(java.lang.String key)
           
 java.util.Map properties()
           
 
Methods inherited from class javax.sound.sampled.AudioFileFormat
getByteLength, getFormat, getFrameLength, getType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

properties

protected java.util.Map properties
Map of properties assigned to this AudioFileFormat

Constructor Detail

REXAudioFileFormat

public REXAudioFileFormat(REXAudioFormat format,
                          int length,
                          java.util.Map properties)
Constructs a new REXAudioFileFormat

Parameters:
format - The Format of the audio data
length - The length in sample frames of the audio data
properties - The Map of properties

REXAudioFileFormat

public REXAudioFileFormat(REXInfo info,
                          REXCreatorInfo cInfo,
                          REXSliceInfo[] sliceInfos)
Constructs a new REXAudioFileFormat

Parameters:
info - The RexInfo obtained from REXGetInfo()
cInfo - The REXCreatorInfo obtained from REXGetCreatorInfo(), may be null if no creator info is available
sliceInfos - Array of REXSliceInfo-objects obtained from REXGetSliceInfo()
Method Detail

createProperties

private static java.util.Map createProperties(REXInfo info,
                                              REXCreatorInfo cInfo,
                                              REXSliceInfo[] sInfos)
Create and return the properties Map out of the given data

Parameters:
info - The RexInfo obtained from REXGetInfo()
cInfo - The REXCreatorInfo obtained from REXGetCreatorInfo(), may be null if no creator info is available
sInfos - Array of REXSliceInfo-objects obtained from
Returns:
The Map with the properties of this REX file

getProperty

public java.lang.Object getProperty(java.lang.String key)
Overrides:
getProperty in class javax.sound.sampled.AudioFileFormat
See Also:
AudioFileFormat.getProperty(java.lang.String)

properties

public java.util.Map properties()
Overrides:
properties in class javax.sound.sampled.AudioFileFormat
See Also:
AudioFileFormat.properties()