usb.devices
Class Rio500

java.lang.Object
  |
  +--usb.devices.Rio500

public final class Rio500
extends java.lang.Object

This provides access Rio500 status, and potentially to the full range of functionality supported by this device. It's been created using the Rio500.sourceforge.net resources ... many thanks to the folk there! At this writing, this class exposes roughly the functionality that the rio_stat program provides.


Be very sure to invoke finish() (if you'll be using the device again) or close() (so other drivers can use it), after you start() to use the Rio. If you don't, a power cycle of the player may be needed to recover. Use a finally clause to make sure you clean up before you switch to another task. Only the thread which invokes start may perform subsequent operations with this object, until finish.

Do not use your Rio when its battery indicator is so low that none of the solid segments are showing. It's been seen to behave quite poorly when it's got that little power. You could need to reformat your storage media; some users have even had to have their Rio units replaced by Diamond. (This is evidently a known Rio firmware bug.)


Inner Class Summary
static class Rio500.Data
          This class is a base class that wraps a data buffer; subclasses expose the fields in that data.
static class Rio500.FolderEntry
          Exposes the fields desribing a folder.
static class Rio500.MemoryStatus
          Exposes the fields of a memory status record.
static class Rio500.SongEntry
          Represents the information known about each song.
 
Constructor Summary
Rio500(Device dev)
          Initializes to talk to the specified device.
 
Method Summary
 void close()
          After you close this object, other drivers can access this particular MP3 player.
protected  void finalize()
          If you didn't finish and close this device, they'll be done here.
 void finish()
          When you finish with this object, it can normally be used to play back audio until you start to use it again.
 java.lang.String getFirmwareRevision()
          Returns the frmware revision of this MP3 player.
 Rio500.FolderEntry[] getFolders(boolean external)
          Returns an array of the folders in internal or external memory.
 int getFreeMemory(boolean external)
          Returns the number of bytes of free memory in the player's internal or external memory.
 Rio500.MemoryStatus getMemoryStatus(boolean external)
          Returns information about the internal or external memory.
 boolean hasExternalMemory()
          Returns true if a removable SmartMedia memory card is available for song storage.
 void start()
          You must say you are going to start talking to the player, since it can't be used while your thread is doing so.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rio500

public Rio500(Device dev)
       throws java.io.IOException
Initializes to talk to the specified device. Claims ownership of the bulk interface.
Method Detail

finalize

protected void finalize()
                 throws java.io.IOException
If you didn't finish and close this device, they'll be done here. Since finalization won't always be invoked, don't rely on this.
Overrides:
finalize in class java.lang.Object

close

public void close()
           throws java.io.IOException
After you close this object, other drivers can access this particular MP3 player. Java code will see it as a disconnect followed by a reconnect, with those other drivers competing to claim the interface.

start

public void start()
           throws java.io.IOException
You must say you are going to start talking to the player, since it can't be used while your thread is doing so. If the player is now in use, it typically stops playing.

finish

public void finish()
When you finish with this object, it can normally be used to play back audio until you start to use it again. Use this in a "finally" clause around any block where you start().

getFreeMemory

public int getFreeMemory(boolean external)
                  throws java.io.IOException
Returns the number of bytes of free memory in the player's internal or external memory.

getFirmwareRevision

public java.lang.String getFirmwareRevision()
                                     throws java.io.IOException
Returns the frmware revision of this MP3 player.

hasExternalMemory

public boolean hasExternalMemory()
                          throws java.io.IOException
Returns true if a removable SmartMedia memory card is available for song storage.

getMemoryStatus

public Rio500.MemoryStatus getMemoryStatus(boolean external)
                                    throws java.io.IOException
Returns information about the internal or external memory.
Parameters:
external - when true, the external memory is checked.

getFolders

public Rio500.FolderEntry[] getFolders(boolean external)
                                throws java.io.IOException
Returns an array of the folders in internal or external memory.


Associated source code is licenced under the LGPL.
See http://jusb.sourceforge.net
This documentation was derived from that source code on 24-Jul-2002.