|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.axelwernicke.mypod.Backend
Contains all the application logic for myPod
Constructor Summary | |
Backend()
Creates a new instance of Backend - deserialize preferences - initialize datapool & ipod - deserialize playlists - validate playlists - initialize list view table model |
Method Summary | |
void |
addPlaylist(Playlist playlist)
Adds a playlist to the list of playlists |
Playlist |
createAutoPlaylist(java.lang.String name)
creates a new auto playlist |
Playlist |
createPlaylist(java.lang.String name)
creates a new playlist. |
void |
deleteClips(java.util.Vector oids)
Deletes clips from myPod and filesystem. |
protected ClipsTableModel |
getClipsListTableModel(Playlist playlist)
get the TableModel with data for a specific playlist |
long |
getClipsTotalCount()
Gets the total count of clips known by myPods data pool - get the size of a list of oids for all clips |
long |
getClipsTotalSize()
Gets the total size of all clips known by myPods data pool - get a list of oids for all clips - summarize the size of each clip |
long |
getClipsTotalSize(java.util.Vector oids)
Gets the summarized filesize for all clips. |
long |
getClipsTotalTime()
Gets the total duration of all clips known by myPods data pool - get a list of oids for all clips - summarize the duration of each clip |
protected DataPool |
getDataPool()
Gets the data pool. |
IPod |
getIPod()
Getter for property iPod. |
protected Playlist |
getPlaylist(int index)
Gets a playlist by its index |
Playlist |
getPlaylist(java.lang.String name)
Gets a playlist by its name, or null if it not exists... |
protected javax.swing.DefaultListModel |
getPlaylistList()
get list of playlists |
Preferences |
getPreferences()
Gets the myPod preferences |
protected javax.swing.DefaultListModel |
getSpreaderListModel(int columnCode,
int playlistIdx)
get spreader list model |
long |
getTotalFilesize(java.util.Vector oids)
Gets the total filesize of a couple clips. |
int |
getTotalTime(java.util.Vector oids)
Gets the total time of a couple of clips |
Playlist |
loadPlaylistM3U(java.io.File file)
creates a new playlist from an m3u file. |
void |
playExtern(Playlist playlist,
boolean append)
Sends a playlist to an external player - determine parameter (add or append) - check that tmp directory exists to store playlist in - check that configured player can be found - store playlist - call player |
void |
relocateClips(ProgressDialog dialog,
java.util.Collection missingClips)
Relocates clips if their media files where moved. |
void |
removeClipsFromMyPod(java.util.Vector oids)
Removes clips from myPod First the clip is removed from all playlist, the from data pool. |
void |
removeClipsFromPlaylist(Playlist playlist,
java.util.Vector oids)
Removes a list of clips vom a playlist |
void |
removePlaylist(int index)
deletes a playlist |
void |
removePlaylist(Playlist playlist)
Removes a playlist |
void |
reorganizeClips(ReorganizeClipsProgressDialog dialog,
java.lang.String baseDirectory,
int dirStructureIndex,
int filenameStructureIndex,
boolean removeEmptyDirectories)
Reorganizes filestructure and renames files based on id3 tags determine clips that are below base directory for all clips to reorganize: determine new pathname for all clips to reorganize: determine new filename for all clips to reorganize: create new file |
void |
savePlaylistM3U(java.lang.String filename,
Playlist playlist)
Saves a playlist as m3u file. |
int |
scanFiles(java.io.File[] selection,
ScanDialog dialog)
Scans a list of files and directories for mp3 files. |
java.util.Vector |
scanForMissingMediaFiles(ProgressDialog dialog)
Gets all clips that are missing. |
void |
serializeIPodMapper(java.util.Hashtable mapper)
serializes iPod mapper. |
void |
setClipsProperties(MP3MetaV2 newMeta,
java.util.Vector oids)
Set new id3 tags for a couple of clips |
void |
setClipsProperties(ProgressDialog dialog,
MP3MetaV2 newMeta,
java.util.Vector oids)
Set new id3 tags for a couple of clips |
void |
setIPod(IPod iPod)
Setter for property iPod. |
void |
setPreferences(Preferences prefs)
Sets myPod preferences |
void |
shutdown()
shuts the backend down. |
long |
synchronizeIPod(IPodSyncDialog dialog)
Synchronizes myPod playlists with iPod. |
void |
updateAllAutoplaylists()
Update all autoplaylists - iterate over all playlists and update the autoplaylists - additionally total time and total filesize are validated |
void |
updateAutoplaylist(int index)
Applies the filters to an autoplaylist - get the playlist - check if we have an autoplaylist - get all enabled filters - remove clips from the playlist if they not apply to the filter (anymore) - find all clips that apply to the filter - add found clips, if they are not in the playlist yet - update playtime for the playlist |
void |
updateAutoplaylist(Playlist playlist,
java.util.List oids)
Applies the filters to an autoplaylist - get the playlist - check if we have an autoplaylist - get all enabled filters - remove clips from the playlist if they not apply to the filter (anymore) - find all clips that apply to the filter - add found clips, if they are not in the playlist yet - update playtime for the playlist |
void |
validatePlaylists()
Validates all playlists. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Backend()
Method Detail |
public void shutdown()
protected DataPool getDataPool()
protected javax.swing.DefaultListModel getPlaylistList()
protected javax.swing.DefaultListModel getSpreaderListModel(int columnCode, int playlistIdx)
columnCode
- for the column to get a model forplaylistIdx
- index of playlist to collect list items from
protected ClipsTableModel getClipsListTableModel(Playlist playlist)
playlist
- to get the model for
public void addPlaylist(Playlist playlist)
playlist
- to addpublic Playlist createPlaylist(java.lang.String name)
name
- name of the new playlist
public Playlist createAutoPlaylist(java.lang.String name)
name
- name of the new autoplaylist
public void removePlaylist(int index)
index
- index of the playlist to delete in the list of playlistspublic void removePlaylist(Playlist playlist)
playlist
- to removeprotected Playlist getPlaylist(int index)
index
- index of the playlist in the list of playlists
public Playlist getPlaylist(java.lang.String name)
name
- of the playlist to get
public void updateAutoplaylist(int index)
index
- index of the playlist in the list of playlistspublic void updateAutoplaylist(Playlist playlist, java.util.List oids)
playlist
- to updateoids
- to update the playlist topublic void updateAllAutoplaylists()
public void validatePlaylists()
public int getTotalTime(java.util.Vector oids)
oids
- of the clips to summarize duration for
public long getTotalFilesize(java.util.Vector oids)
oids
- to summarize filesize
public int scanFiles(java.io.File[] selection, ScanDialog dialog)
dialog
- scan progress dialogselection
- list of files and directories
public Preferences getPreferences()
public void setPreferences(Preferences prefs)
prefs
- to setpublic Playlist loadPlaylistM3U(java.io.File file)
file
- m3u playlist
public void savePlaylistM3U(java.lang.String filename, Playlist playlist)
filename
- of the playlistplaylist
- to savepublic void removeClipsFromMyPod(java.util.Vector oids)
oids
- of the clips to deletepublic void deleteClips(java.util.Vector oids)
oids
- to delete media files forpublic void removeClipsFromPlaylist(Playlist playlist, java.util.Vector oids)
playlist
- to remove clips fromoids
- of the clips to removepublic java.util.Vector scanForMissingMediaFiles(ProgressDialog dialog)
dialog
- to show the progress of the action
public void serializeIPodMapper(java.util.Hashtable mapper)
mapper
- to serializepublic long synchronizeIPod(IPodSyncDialog dialog)
dialog
- to show progress
public long getClipsTotalCount()
public long getClipsTotalSize()
public long getClipsTotalTime()
public long getClipsTotalSize(java.util.Vector oids)
oids
- vector of oids to summarize filesizes
public void playExtern(Playlist playlist, boolean append)
playlist
- to playappend
- if true, playlist is appended to the clips on the playerpublic IPod getIPod()
public void setIPod(IPod iPod)
iPod
- New value of property iPod.public void reorganizeClips(ReorganizeClipsProgressDialog dialog, java.lang.String baseDirectory, int dirStructureIndex, int filenameStructureIndex, boolean removeEmptyDirectories)
dialog
- reorganizing progress dialogremoveEmptyDirectories
- flag, if true - empty directories are removedbaseDirectory
- all files below are reorganizeddirStructureIndex
- index that determines how the filestructure is reorganizedfilenameStructureIndex
- index that determines how the files are renamedpublic void setClipsProperties(ProgressDialog dialog, MP3MetaV2 newMeta, java.util.Vector oids)
dialog
- to visualize progressnewMeta
- mp3 meta data to setoids
- of the clips to update id3 tagspublic void setClipsProperties(MP3MetaV2 newMeta, java.util.Vector oids)
newMeta
- mp3 meta data to setoids
- of the clips to update id3 tagspublic void relocateClips(ProgressDialog dialog, java.util.Collection missingClips)
dialog
- to show progressmissingClips
- clips where media file is missing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |