jreceiver.common.rpc
Interface Tunes

All Superinterfaces:
RpcBase, ServerTable

public interface Tunes
extends ServerTable

Tune-related queries and updates for a (possibly-remote) JRec server

Version:
$Revision: 1.8 $ $Date: 2002/07/31 11:29:41 $
Author:
Reed Esau

Field Summary
static java.lang.String ENCODE_BINARY
           
static java.lang.String ENCODE_TEXT
           
static java.lang.String GET_KEYCOUNT_FOR_PLAYLIST
           
static java.lang.String GET_KEYCOUNT_FOR_QUERY
           
static java.lang.String GET_KEYS_FOR_FOLDER
           
static java.lang.String GET_KEYS_FOR_PLAYLIST
           
static java.lang.String GET_KEYS_FOR_QUERY
           
static java.lang.String HANDLER_NAME
           
 
Fields inherited from interface jreceiver.common.rpc.ServerTable
DELETE_RECS, GET_KEY_COUNT, GET_KEYS, GET_REC, GET_RECS, STORE_REC, STORE_RECS
 
Fields inherited from interface jreceiver.common.rpc.RpcBase
DETECT
 
Method Summary
 byte[] encodeBinary(TuneQuery tune_query, int driver_id, byte[] pattern, int rec_offset, int rec_count)
          Obtain a BINARY list of tunes for a hash query, custom formatted with a caller-specified pattern, typically for use in building an internal playlist in an embedded device where memory is at a premium.
 java.lang.String encodeText(TuneQuery tune_query, int driver_id, java.lang.String pattern, int rec_offset, int rec_count)
          Obtain a TEXT list of tunes for a hash query, custom formatted with a caller-specified pattern, for use in displaying a menu to the user.
 int getKeyCountForPlaylist(int pl_src_id, int driver_id)
          Return a count of Tune ids for a particular playlist, filtering out mime-types not supported by the specified driver.
 int getKeyCountForQuery(TuneQuery tune_query, int driver_id)
          Return a count of Tune ids for a hash query, filtering out mime-types not supported by the specified driver.
 java.util.Vector getKeysForFolder(int folder_id, int driver_id, java.lang.String order_by, int rec_offset, int rec_count)
          Return a list of Tune ids for a particular folder, filtering out mime-types not supported by the specified driver.
 java.util.Vector getKeysForPlaylist(int pl_src_id, int driver_id, java.lang.String order_by, int rec_offset, int rec_count)
          Return a list of Tune ids for a particular playlist, filtering out mime-types not supported by the specified driver.
 java.util.Vector getKeysForQuery(TuneQuery tune_query, int driver_id, java.lang.String order_by, int rec_offset, int rec_count)
          Return a list of Tune ids for a hash query, filtering out mime-types not supported by the specified driver.
 
Methods inherited from interface jreceiver.common.rpc.ServerTable
deleteRecs, getKeyCount, getKeys, getRec, getRec, getRecs, getRecs, storeRec, storeRecs
 
Methods inherited from interface jreceiver.common.rpc.RpcBase
detect
 

Field Detail

HANDLER_NAME

public static final java.lang.String HANDLER_NAME

GET_KEYS_FOR_FOLDER

public static final java.lang.String GET_KEYS_FOR_FOLDER

GET_KEYS_FOR_PLAYLIST

public static final java.lang.String GET_KEYS_FOR_PLAYLIST

GET_KEYCOUNT_FOR_PLAYLIST

public static final java.lang.String GET_KEYCOUNT_FOR_PLAYLIST

GET_KEYS_FOR_QUERY

public static final java.lang.String GET_KEYS_FOR_QUERY

GET_KEYCOUNT_FOR_QUERY

public static final java.lang.String GET_KEYCOUNT_FOR_QUERY

ENCODE_TEXT

public static final java.lang.String ENCODE_TEXT

ENCODE_BINARY

public static final java.lang.String ENCODE_BINARY
Method Detail

getKeysForFolder

public java.util.Vector getKeysForFolder(int folder_id,
                                         int driver_id,
                                         java.lang.String order_by,
                                         int rec_offset,
                                         int rec_count)
                                  throws RpcException
Return a list of Tune ids for a particular folder, filtering out mime-types not supported by the specified driver.

getKeysForPlaylist

public java.util.Vector getKeysForPlaylist(int pl_src_id,
                                           int driver_id,
                                           java.lang.String order_by,
                                           int rec_offset,
                                           int rec_count)
                                    throws RpcException
Return a list of Tune ids for a particular playlist, filtering out mime-types not supported by the specified driver.

getKeyCountForPlaylist

public int getKeyCountForPlaylist(int pl_src_id,
                                  int driver_id)
                           throws RpcException
Return a count of Tune ids for a particular playlist, filtering out mime-types not supported by the specified driver.

getKeyCountForQuery

public int getKeyCountForQuery(TuneQuery tune_query,
                               int driver_id)
                        throws RpcException
Return a count of Tune ids for a hash query, filtering out mime-types not supported by the specified driver.

Important note: this may be deprecated at some point in the future and be replaced by a full-featured interface.

Parameters:
filter - String any filter that you'd specify in a dynamic playlist

getKeysForQuery

public java.util.Vector getKeysForQuery(TuneQuery tune_query,
                                        int driver_id,
                                        java.lang.String order_by,
                                        int rec_offset,
                                        int rec_count)
                                 throws RpcException
Return a list of Tune ids for a hash query, filtering out mime-types not supported by the specified driver.

Important note: this may be deprecated at some point in the future and be replaced by a full-featured interface.

Parameters:
filter - String any filter that you'd specify in a dynamic playlist

encodeBinary

public byte[] encodeBinary(TuneQuery tune_query,
                           int driver_id,
                           byte[] pattern,
                           int rec_offset,
                           int rec_count)
                    throws RpcException
Obtain a BINARY list of tunes for a hash query, custom formatted with a caller-specified pattern, typically for use in building an internal playlist in an embedded device where memory is at a premium.

Data is returned as a byte array. All results are concatenated. Any record separators needed must be specified in the pattern.

Formatting of each record is done through a MessageFormatB (binary) pattern. As an example, the following

     String pattern = "{0,word,le}{1,word,le}{2,word,le}";
 
will return each query result as
     c001000 e5655000 b5010000
 
where each result is encoded as a 12-byte record, where {0,word,le} will be replaced with the source identifier (src_id) as a 4-byte word in little-endian order; {1...} will be replaced with the filesize and {2...} replaced with the offset in the tune file of the first MPEG frame.

This method provides a wrapper for the remote call to the server.

Parameters:
tune_query - Hashtable TODO: point to documentation
pattern - byte[] a MessageFormatB pattern where {0} will be replaced with the src_id and {1} will be replaced with the filesize and {2} replaced with the MPEG data offset.
begin - int the index of the first item of the results to return
end - int the index of the final item of the results to return
Returns:
byte[] concatenated binary records
Throws:
RpcException -  

encodeText

public java.lang.String encodeText(TuneQuery tune_query,
                                   int driver_id,
                                   java.lang.String pattern,
                                   int rec_offset,
                                   int rec_count)
                            throws RpcException
Obtain a TEXT list of tunes for a hash query, custom formatted with a caller-specified pattern, for use in displaying a menu to the user.

Data is returned as a String. All results are concatenated. Any record separators needed must be specified in the pattern.

Formatting of each record is done through a MessageFormat pattern. As an example, the following

     String pattern = "{0,hex}=T{1}\r\n";
 
will format each result matching the filter as
     1d0=TSenses Working Overtime\r\n
 
where {0,hex} will be replaced with the source identifier (src_id), in hexadecimal; {1} will be replaced with the tune title.

Note that the 'hex' element format isn't a standard formatter of MessageFormat, but it is supported here in a minor kludge.

This method provides a wrapper for the remote call to the server.

Parameters:
tune_query - Hashtable TODO: point to documentation
pattern - String a MessageFormat pattern where {0} will be replaced with the src_id and {1} will be replaced with the tune title.
begin - int the index of the first item of the results to return
end - int the index of the final item of the results to return
Returns:
String concatenated String records.
Throws:
RpcException -  


Copyright © 2001-2002 Reed Esau, All Rights Reserved.