net.sf.zekr.engine.audio
Interface IPlaylistProvider

All Known Implementing Classes:
OfflinePlaylistProvider, OnlinePlaylistProvider, PlaylistProvider

public interface IPlaylistProvider


Field Summary
static java.lang.String SPECIAL_END
          SadaqAllah...
static java.lang.String SPECIAL_PRESTART
          A'oodho billah...
static java.lang.String SPECIAL_START
          Bismillah...
 
Method Summary
 AudioData getAudioData()
           
 int getItem(int sura, int aya)
          Playlists can be in two modes: `sura' or `collection' mode.
 int getSpecialItem(java.lang.String name)
          This method is to lookup some special audio file index in the playlist.
 java.lang.String providePlaylist()
          Provides playlist file path.
 

Field Detail

SPECIAL_PRESTART

static final java.lang.String SPECIAL_PRESTART
A'oodho billah...

See Also:
Constant Field Values

SPECIAL_START

static final java.lang.String SPECIAL_START
Bismillah...

See Also:
Constant Field Values

SPECIAL_END

static final java.lang.String SPECIAL_END
SadaqAllah...

See Also:
Constant Field Values
Method Detail

providePlaylist

java.lang.String providePlaylist()
                                 throws PlaylistProvisionException
Provides playlist file path. If this is an online provider, it just returns the absolute URL to playlist. If offline, and playlist doesn't already exist, first creates the playlist and returns URL to that.

Returns:
URL for provided playlist
Throws:
PlaylistProvisionException

getItem

int getItem(int sura,
            int aya)
Playlists can be in two modes: `sura' or `collection' mode. For the former (aya), provider should always return aya - 1;, regardless of sura/aya number, since in sura mode every sura has a corresponding playlist in which each playling item (counted from 0) is mapped exactly to its corresponding aya (counted from 1).
The latter (collection) mode, on the other hand, is a single playlist in which there are all playing items, so playlist provider should provide the exact item number for each aya in a sura.

Parameters:
sura - sura number in which corresponding aya should be returned as a playlist item. This parameter is 1-based.
aya - aya number to be resolved to an item. This parameter is 1-based.
Returns:
playlist item to be played, corresponding to the given sura/aya number. This number is 0-based.

getAudioData

AudioData getAudioData()
Returns:
AudioData object for the playlist

getSpecialItem

int getSpecialItem(java.lang.String name)
This method is to lookup some special audio file index in the playlist.

Parameters:
name - name of the special item (bismillah for example is SPECIAL_START)
Returns:
item index in the playlist