jreceiver.common.rec.source
Class PlaylistRec

java.lang.Object
  |
  +--jreceiver.common.rec.BaseRec
        |
        +--jreceiver.common.rec.source.SourceRec
              |
              +--jreceiver.common.rec.source.PlaylistRec
All Implemented Interfaces:
Hashable, Playlist, Rec, Selectable, Sortable, Source
Direct Known Subclasses:
DplaylistRec, FplaylistRec, HplaylistRec, SplaylistRec

public abstract class PlaylistRec
extends SourceRec
implements Playlist

Abstract class to provide basic implementation of Playlist interface

Version:
$Revision: 1.4 $ $Date: 2003/04/27 23:14:31 $
Author:
Reed Esau

Field Summary
protected  boolean m_is_checked
          is the item selected in the form?
protected  java.lang.String m_order_by
          how the playlist will be sorted
protected  int m_pl_type
          File(1), Dynamic(2), Tree(4) or Station(8)
protected  int m_tune_count
          the number of tunes in the playlist, as of the time it was last queried for its count
 
Fields inherited from class jreceiver.common.rec.source.SourceRec
m_content_url, m_direct_uri, m_dst_mime, m_duration, m_mime, m_site_id, m_src_id, m_src_type, m_title
 
Fields inherited from interface jreceiver.common.rec.source.Playlist
HKEY_PL_TYPE, HKEY_TUNE_COUNT, PLAYLIST_TYPE_ALL, PLAYLIST_TYPE_DYNAMIC, PLAYLIST_TYPE_FILE, PLAYLIST_TYPE_STATION, PLAYLIST_TYPE_TREE, POPULATE_FILTERABLE, POPULATE_FOLDERLIST, POPULATE_SOURCELIST
 
Fields inherited from interface jreceiver.common.rec.source.Source
DEFAULT_URL, FORCE_PLAYLIST_URL, HKEY_CONTENT_URL, HKEY_DIRECT_URI, HKEY_DST_MIME, HKEY_DURATION, HKEY_MIME, HKEY_SITE_ID, HKEY_SRC_ID, HKEY_SRC_TYPE, HKEY_TITLE, MAX_SRC_ID, MIN_SRC_ID, POPULATE_CONTENT_URL, POPULATE_DIRECT_URI, POPULATE_MEXTERNAL, POPULATE_MFILE, SRCTYPE_PLAYLIST, SRCTYPE_TUNE, SRCTYPE_UNDEFINED
 
Fields inherited from interface jreceiver.common.rec.Rec
HKEY_KEY, NO_LIMIT
 
Fields inherited from interface jreceiver.common.rec.Sortable
HKEY_ORDER_BY
 
Fields inherited from interface jreceiver.common.rec.Selectable
HKEY_CHECKED
 
Constructor Summary
protected PlaylistRec(java.util.Hashtable hash)
          ctor - construct from a hashtable, usually retrieved via XML-RPC
protected PlaylistRec(int src_id, int pl_type)
          ctor - minimalist
protected PlaylistRec(int src_id, java.lang.String mime, int duration, org.esau.ptarmigan.util.PtarURI direct_uri, java.net.URL content_url, int pl_type, java.lang.String name, java.lang.String order_by, int tune_count)
          ctor
 
Method Summary
static SourceRec createInstance(java.util.Hashtable hash)
          Create a PlaylistRec object preserved as a hash that has arrived over an XML-RPC connection or similar.
static SourceRec createInstance(int pl_type, java.lang.String name, java.lang.String order_by, int duration, int tune_count)
          Create a basic PlaylistRec object of the specified type.
 boolean getChecked()
          get the current select state
 boolean getIsDynamicPlaylist()
           
 boolean getIsFilePlaylist()
           
 boolean getIsStationPlaylist()
           
 boolean getIsTreePlaylist()
           
 java.lang.String getOrderBy()
          Obtain the sort order
 int getPlaylistType()
          obtain the 'type' of the playlist (Playlist.PLAYLIST_TYPE_*)
 int getTuneCount()
          Obtain the number of media files (not lines!) specified in a playlist file.
 void setChecked(boolean is_checked)
          set the select state
 void setOrderBy(java.lang.String order_by)
          Assign the sort order
 void setPlaylistType(int pl_type)
          assign the 'type' of the playlist (Playlist.PLAYLIST_TYPE_*)
 void setTuneCount(int tune_count)
          Assign the number of media files (not lines!) specified in a playlist file.
 java.util.Hashtable toHash()
          Store the object as a hash suitable for transport over an XML-RPC connection or similar.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class jreceiver.common.rec.source.SourceRec
getContentSystemId, getContentURL, getDirectSystemId, getDirectURI, getDstMime, getDuration, getFile, getFileExtension, getFileName, getFilePath, getIsLocal, getIsOffsite, getIsPlaylist, getIsTune, getKey, getMime, getSiteId, getSrcId, getTitle, getType, setContentURL, setDirectURI, setDirectURI, setDuration, setKey, setMime, setSrcId, setTitle
 
Methods inherited from class jreceiver.common.rec.BaseRec
dissolve, dissolveMap, find, find, find, find
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jreceiver.common.rec.source.Source
getContentSystemId, getContentURL, getDirectSystemId, getDirectURI, getDstMime, getDuration, getFile, getFileExtension, getFileName, getFilePath, getIsLocal, getIsOffsite, getIsPlaylist, getIsTune, getMime, getSiteId, getSrcId, getTitle, getType, setContentURL, setDirectURI, setDirectURI, setDuration, setMime, setSrcId, setTitle
 
Methods inherited from interface jreceiver.common.rec.Rec
getKey, setKey
 

Field Detail

m_pl_type

protected int m_pl_type
File(1), Dynamic(2), Tree(4) or Station(8)

m_tune_count

protected int m_tune_count
the number of tunes in the playlist, as of the time it was last queried for its count

m_order_by

protected java.lang.String m_order_by
how the playlist will be sorted

m_is_checked

protected boolean m_is_checked
is the item selected in the form?
Constructor Detail

PlaylistRec

protected PlaylistRec(int src_id,
                      int pl_type)
ctor - minimalist

PlaylistRec

protected PlaylistRec(int src_id,
                      java.lang.String mime,
                      int duration,
                      org.esau.ptarmigan.util.PtarURI direct_uri,
                      java.net.URL content_url,
                      int pl_type,
                      java.lang.String name,
                      java.lang.String order_by,
                      int tune_count)
ctor

PlaylistRec

protected PlaylistRec(java.util.Hashtable hash)
               throws RecException
ctor - construct from a hashtable, usually retrieved via XML-RPC
Method Detail

toHash

public java.util.Hashtable toHash()
Store the object as a hash suitable for transport over an XML-RPC connection or similar.
Specified by:
toHash in interface Playlist
Overrides:
toHash in class SourceRec
Following copied from interface: jreceiver.common.rec.Hashable
Returns:
 

getPlaylistType

public int getPlaylistType()
obtain the 'type' of the playlist (Playlist.PLAYLIST_TYPE_*)
Specified by:
getPlaylistType in interface Playlist

setPlaylistType

public void setPlaylistType(int pl_type)
assign the 'type' of the playlist (Playlist.PLAYLIST_TYPE_*)
Specified by:
setPlaylistType in interface Playlist

getTuneCount

public int getTuneCount()
Description copied from interface: Playlist
Obtain the number of media files (not lines!) specified in a playlist file.
Specified by:
getTuneCount in interface Playlist

setTuneCount

public void setTuneCount(int tune_count)
Description copied from interface: Playlist
Assign the number of media files (not lines!) specified in a playlist file.
Specified by:
setTuneCount in interface Playlist

getOrderBy

public java.lang.String getOrderBy()
Description copied from interface: Sortable
Obtain the sort order
Specified by:
getOrderBy in interface Sortable
Following copied from interface: jreceiver.common.rec.Sortable
Returns:
 

setOrderBy

public void setOrderBy(java.lang.String order_by)
Description copied from interface: Sortable
Assign the sort order
Specified by:
setOrderBy in interface Sortable

getChecked

public boolean getChecked()
Description copied from interface: Selectable
get the current select state
Specified by:
getChecked in interface Selectable
Following copied from interface: jreceiver.common.rec.Selectable
Returns:
boolean true if the item has been selected by the user; false otherwise

setChecked

public void setChecked(boolean is_checked)
Description copied from interface: Selectable
set the select state
Specified by:
setChecked in interface Selectable
Following copied from interface: jreceiver.common.rec.Selectable
Parameters:
is_checked -  

getIsDynamicPlaylist

public boolean getIsDynamicPlaylist()
Specified by:
getIsDynamicPlaylist in interface Playlist

getIsTreePlaylist

public boolean getIsTreePlaylist()
Specified by:
getIsTreePlaylist in interface Playlist

getIsFilePlaylist

public boolean getIsFilePlaylist()
Specified by:
getIsFilePlaylist in interface Playlist

getIsStationPlaylist

public boolean getIsStationPlaylist()
Specified by:
getIsStationPlaylist in interface Playlist

toString

public java.lang.String toString()
Description copied from interface: Hashable
Returns a string representation of the object.
Specified by:
toString in interface Hashable
Overrides:
toString in class SourceRec

createInstance

public static SourceRec createInstance(java.util.Hashtable hash)
                                throws RecException
Create a PlaylistRec object preserved as a hash that has arrived over an XML-RPC connection or similar.

The hash should have been created with toHash().


createInstance

public static SourceRec createInstance(int pl_type,
                                       java.lang.String name,
                                       java.lang.String order_by,
                                       int duration,
                                       int tune_count)
                                throws RecException
Create a basic PlaylistRec object of the specified type.

Parameters:
pl_type -  
Returns:
 


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