DCT Lightfoot v3 API specification

com.dctl.hardware.mp3
Class Decoder

java.lang.Object
  |
  +--com.dctl.hardware.mp3.Decoder

public class Decoder
extends Object

This represents an MP3 decoder. The MP3 decoder has a number of fixed size buffers that are used to transmit data to the decoder without having to allocate any buffers while running.


Nested Class Summary
 class Decoder.Buffer
          The buffer class
 
Field Summary
static int DCT_CONST_MP3_NORMAL_DATA
          Normal data packet
 
Constructor Summary
Decoder(int numBuffers, int bufferSize)
          Create a new decoder that has the specified number of buffers of the specified size
 
Method Summary
 void clearBuffers()
          Clear the buffers
 void endTrack()
          Finish a track
 int getBitRate()
          Get the bit rate in kbits/sec
 Decoder.Buffer getEmptyBuffer()
          Get an empty buffer
 int getLeftVolume()
          Get the left volume
 int getRightVolume()
          Get the right volume
 int getTrackTime()
          Get the track time
 void sendFullBuffer(Decoder.Buffer buffer)
          Send a full buffer to the player
 void setLeftVolume(int left)
          Set the left volume
 void setRightVolume(int right)
          Set the right volume
 void start()
          Start the decoder running
 void startTrack()
          Start a new track
 void stop()
          Stop the decoder running
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DCT_CONST_MP3_NORMAL_DATA

public static final int DCT_CONST_MP3_NORMAL_DATA
Normal data packet

See Also:
Constant Field Values
Constructor Detail

Decoder

public Decoder(int numBuffers,
               int bufferSize)
        throws SystemException
Create a new decoder that has the specified number of buffers of the specified size

Parameters:
numBuffers - The number of buffers
bufferSize - The size of the buffers
Throws:
SystemException - if there is an error doing this
Method Detail

startTrack

public void startTrack()
                throws SystemException
Start a new track

Throws:
SystemException - if there is an error

endTrack

public void endTrack()
              throws SystemException
Finish a track

Throws:
SystemException - if there is an error

start

public void start()
           throws SystemException
Start the decoder running

Throws:
SystemException - if there is an error

stop

public void stop()
          throws SystemException
Stop the decoder running

Throws:
SystemException - if there is an error

getLeftVolume

public int getLeftVolume()
                  throws SystemException
Get the left volume

Returns:
the left volume between 0 (highest) and 255 (lowest)
Throws:
SystemException - if there is an error

getRightVolume

public int getRightVolume()
                   throws SystemException
Get the right volume

Returns:
the right volume between 0 (highest) and 255 (lowest)
Throws:
SystemException - if there is an error

setLeftVolume

public void setLeftVolume(int left)
                   throws SystemException
Set the left volume

Throws:
SystemException - if there is an error

setRightVolume

public void setRightVolume(int right)
                    throws SystemException
Set the right volume

Throws:
SystemException - if there is an error

getTrackTime

public int getTrackTime()
                 throws SystemException
Get the track time

Returns:
the track time
Throws:
SystemException - if there is an error

getBitRate

public int getBitRate()
               throws SystemException
Get the bit rate in kbits/sec

Returns:
the rate
Throws:
SystemException - if there is an error

getEmptyBuffer

public Decoder.Buffer getEmptyBuffer()
                              throws SystemException
Get an empty buffer

Returns:
the empty buffer
Throws:
SystemException - if there is an error getting the buffer

sendFullBuffer

public void sendFullBuffer(Decoder.Buffer buffer)
                    throws SystemException
Send a full buffer to the player

Parameters:
buffer - The populated buffer to send
Throws:
SystemException - if there is an error sending the buffer

clearBuffers

public void clearBuffers()
                  throws SystemException
Clear the buffers

Throws:
SystemException - if there is an error clearing the buffers

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification