|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.neurosdbm.db.Database
Nested Class Summary | |
class |
Database.SyncStats
|
Field Summary | |
private AudioDB |
audioDB
|
static int |
DB_AA_ALL
|
static int |
DB_AA_ARTISTS
|
static int |
DB_ALBUMS
|
static int |
DB_ARTISTS
|
static int |
DB_AUDIO
|
static int |
DB_FAILEDHISI
|
static int |
DB_GENRES
|
static int |
DB_HISI
|
static int |
DB_IDEDHISI
|
static int |
DB_PCAUDIO
|
static int |
DB_PLAYLISTS
|
static int |
DB_RECORDINGS
|
static int |
DB_TRACKS
|
static int |
DB_UNIDEDHISI
|
protected java.util.ArrayList |
deleteQueue
|
protected NeurosDevice |
device
|
private FailedHiSiDB |
failedhisiDB
|
private IdedHiSiDB |
idedhisiDB
|
private boolean |
modifiedPlaylists
|
protected java.util.ArrayList |
modifyQueue
|
(package private) java.io.File |
music
|
protected boolean |
needForPlaylist
|
protected java.lang.String |
path
|
private PCAudioDB |
pcaudioDB
|
protected java.util.ArrayList |
playlistQueue
|
private static java.lang.String |
RECORDING_REGEX
The regular expression to determine the recording directory. |
private java.lang.String |
SearchPath
|
protected java.util.ArrayList |
syncQueue
|
private UnidedHiSiDB |
unidedhisiDB
|
Constructor Summary | |
protected |
Database()
This constuctor should only be called by the AdvDatabase subclass. |
|
Database(java.lang.String _path,
boolean createNew,
int _device)
|
|
Database(java.lang.String _path,
int _device)
|
Method Summary | |
int |
addFilesToPlaylist(java.io.File[] files,
int playListKey)
Add files directly to playlist. |
void |
addToPlaylist(java.util.ArrayList tracks,
int playlistKey)
|
void |
addToPlaylist(int audioKey,
int playlistKey)
|
void |
addToPlaylist(int audioKey,
int playlistKey,
boolean disableSave)
|
void |
autoBackup()
|
void |
backup(java.io.File targetDirectory)
This function makes a backup of the database to the specified target directory. |
static void |
backupError(java.lang.String databaseDirectory)
This function is called if an error has occured during database parsing. |
private void |
checkForRecording(NewTrack newTrack)
Check to see if this track is in the recording directory. |
private void |
checkParents(java.io.File file)
|
void |
computeMDBPointers()
|
void |
createEmptyDatabase()
|
int |
createPlaylist(java.lang.String name)
|
int |
createPlaylist(java.lang.String name,
boolean disableSave)
Creates a new playlist. |
void |
deleteDatabase()
This function deletes all the database files from the Neuros device. |
void |
deleteFromPlaylist(java.util.ArrayList tracks,
int playlistKey)
|
boolean |
deleteQueueContains(AudioRecord record)
|
static void |
fixDBDir(java.lang.String path)
|
NeurosDevice |
getDevice()
|
NewTrack |
getNewTrackFromSyncQueue(AudioRecord record)
|
int |
getNumberDeleted()
|
int |
getNumberModified()
|
int |
getNumberQueued()
|
java.lang.String |
getPath()
|
boolean |
hasModifiedPlaylists()
|
private void |
loadExistingDatabase()
|
void |
markTracksForDeletion(java.util.ArrayList tracks)
|
boolean |
modifyQueueContains(AudioRecord record)
|
void |
modifyTrack(int audioKey,
NewTrack newTrack)
The purpose of this function is to modify the Neuros tags of given track. |
DisplayRecord |
query(DisplayIndex index)
|
java.util.ArrayList |
query(int database,
int type)
|
java.util.ArrayList |
query(int database,
int type,
int key)
|
java.util.ArrayList |
queryTracksForAlbum(int albumKey)
|
java.util.ArrayList |
queryTracksForArtist(int artistKey)
|
java.util.ArrayList |
queryTracksForGenre(int genreKey)
|
java.util.ArrayList |
queryTracksForPlaylist(int playlistKey)
|
java.util.ArrayList |
queryTracksForRecordings(int recordingKey)
|
boolean |
queueMP3TrackAdd(java.io.File trackToAdd)
|
boolean |
queueMP3TrackAdd(java.io.File trackToAdd,
boolean rebuild)
|
private boolean |
queueOGGTrackAdd(java.io.File trackToAdd)
|
private boolean |
queueOGGTrackAdd(java.io.File trackToAdd,
boolean rebuild)
|
boolean |
queueTrackAdd(NewTrack newTrack)
Queues the new track for copying over to the Neuros. |
int |
queueTracksRecurseDirectories(java.io.File[] files)
|
boolean |
queueWAVTrackAdd(java.io.File trackToAdd)
|
boolean |
queueWAVTrackAdd(java.io.File trackToAdd,
boolean rebuild)
|
boolean |
queueWMATrackAdd(java.io.File trackToAdd)
|
boolean |
queueWMATrackAdd(java.io.File trackToAdd,
boolean rebuild)
|
void |
rearrangePlaylist(java.util.ArrayList tracks,
int playlistKey)
|
int |
rebuild()
|
int |
rebuild(RebuildDatabase.RebuildDialog dialog)
|
private int |
rebuildTracks(int numberRebuilt,
java.io.File[] files,
RebuildDatabase.RebuildDialog dialog)
|
void |
refreshDatabase()
|
void |
refreshDatabase(java.lang.String _path,
int _device)
|
void |
removePlaylist(int playlistKey)
|
void |
renamePlaylist(java.lang.String newName,
int playlistKey)
|
void |
restore(java.io.File restorePathFile)
This function restores the database from a previously peformed backup. |
private void |
setIsModifiedBit(java.io.File mdbFileName)
This function sets the "isModifiedBit" in the passed in MDB file. |
void |
sort()
|
void |
sort(java.util.ArrayList list)
|
Database.SyncStats |
synchronize(Listener progress)
|
boolean |
syncQueueContains(AudioRecord record)
|
void |
testTrackAdd1()
|
void |
testTrackAdd2()
|
void |
testTrackAddRandom()
|
java.lang.String |
toString()
|
void |
write()
This function writes the current in memory database to the Neuros device. |
void |
write(boolean disableAutoBackup)
This function writes the current in memory database to the Neuros device. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected NeurosDevice device
private AudioDB audioDB
private UnidedHiSiDB unidedhisiDB
private IdedHiSiDB idedhisiDB
private FailedHiSiDB failedhisiDB
private PCAudioDB pcaudioDB
protected java.lang.String path
private java.lang.String SearchPath
private boolean modifiedPlaylists
protected java.util.ArrayList syncQueue
protected java.util.ArrayList deleteQueue
protected java.util.ArrayList modifyQueue
protected boolean needForPlaylist
protected java.util.ArrayList playlistQueue
public static final int DB_AUDIO
public static final int DB_FAILEDHISI
public static final int DB_IDEDHISI
public static final int DB_PCAUDIO
public static final int DB_UNIDEDHISI
public static final int DB_AA_ALL
public static final int DB_AA_ARTISTS
public static final int DB_TRACKS
public static final int DB_PLAYLISTS
public static final int DB_ARTISTS
public static final int DB_ALBUMS
public static final int DB_GENRES
public static final int DB_RECORDINGS
public static final int DB_HISI
private static java.lang.String RECORDING_REGEX
java.io.File music
Constructor Detail |
public Database(java.lang.String _path, boolean createNew, int _device) throws java.io.FileNotFoundException, java.io.IOException, DatabaseCorruptException, DatabaseDoesNotExistException
public Database(java.lang.String _path, int _device) throws java.io.FileNotFoundException, java.io.IOException, DatabaseCorruptException, DatabaseDoesNotExistException
protected Database()
Method Detail |
private void loadExistingDatabase() throws java.io.FileNotFoundException, java.io.IOException, DatabaseCorruptException, DatabaseDoesNotExistException
java.io.FileNotFoundException
java.io.IOException
DatabaseCorruptException
DatabaseDoesNotExistException
public void createEmptyDatabase() throws java.io.FileNotFoundException, java.io.IOException, DatabaseCorruptException
java.io.FileNotFoundException
java.io.IOException
DatabaseCorruptException
public void refreshDatabase() throws java.io.FileNotFoundException, java.io.IOException, DatabaseCorruptException, DatabaseDoesNotExistException
java.io.FileNotFoundException
java.io.IOException
DatabaseCorruptException
DatabaseDoesNotExistException
public void refreshDatabase(java.lang.String _path, int _device) throws java.io.FileNotFoundException, java.io.IOException, DatabaseCorruptException, DatabaseDoesNotExistException
java.io.FileNotFoundException
java.io.IOException
DatabaseCorruptException
DatabaseDoesNotExistException
public void deleteDatabase()
public void write() throws java.io.IOException, DatabaseInternalCorruptionException
java.io.IOException
DatabaseInternalCorruptionException
public void write(boolean disableAutoBackup) throws java.io.IOException, DatabaseInternalCorruptionException
disableAutoBackup
- true if you don't want to write a autobackup
java.io.IOException
DatabaseInternalCorruptionException
public java.util.ArrayList query(int database, int type)
public java.util.ArrayList query(int database, int type, int key)
public DisplayRecord query(DisplayIndex index)
public void sort(java.util.ArrayList list)
public java.lang.String getPath()
public static void backupError(java.lang.String databaseDirectory)
public void backup(java.io.File targetDirectory) throws java.io.FileNotFoundException, java.io.IOException
targetDirectory
- The target directory for the backup.
java.io.FileNotFoundException
java.io.IOException
public void restore(java.io.File restorePathFile) throws java.io.FileNotFoundException, java.io.IOException
restorePathFile
- The directory of the backup to restore
java.io.FileNotFoundException
java.io.IOException
private void setIsModifiedBit(java.io.File mdbFileName) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public int rebuild() throws DatabaseInternalCorruptionException, DatabaseCorruptException, java.io.FileNotFoundException, java.io.IOException
DatabaseInternalCorruptionException
DatabaseCorruptException
java.io.FileNotFoundException
java.io.IOException
public int rebuild(RebuildDatabase.RebuildDialog dialog) throws DatabaseInternalCorruptionException, DatabaseCorruptException, java.io.FileNotFoundException, java.io.IOException
DatabaseInternalCorruptionException
DatabaseCorruptException
java.io.FileNotFoundException
java.io.IOException
private int rebuildTracks(int numberRebuilt, java.io.File[] files, RebuildDatabase.RebuildDialog dialog)
private void checkForRecording(NewTrack newTrack)
public boolean queueMP3TrackAdd(java.io.File trackToAdd) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public boolean queueMP3TrackAdd(java.io.File trackToAdd, boolean rebuild) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
private boolean queueOGGTrackAdd(java.io.File trackToAdd) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
private boolean queueOGGTrackAdd(java.io.File trackToAdd, boolean rebuild) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public boolean queueWMATrackAdd(java.io.File trackToAdd) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public boolean queueWMATrackAdd(java.io.File trackToAdd, boolean rebuild) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public boolean queueWAVTrackAdd(java.io.File trackToAdd) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public boolean queueWAVTrackAdd(java.io.File trackToAdd, boolean rebuild) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public int queueTracksRecurseDirectories(java.io.File[] files) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public boolean queueTrackAdd(NewTrack newTrack) throws DatabaseInternalCorruptionException
newTrack
- The track to add.
DatabaseInternalCorruptionException
- Database is corrupted.public void sort()
private void checkParents(java.io.File file)
public Database.SyncStats synchronize(Listener progress)
public void autoBackup() throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public void testTrackAdd1() throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public void testTrackAdd2() throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public void testTrackAddRandom() throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public int getNumberQueued()
public int getNumberDeleted()
public int getNumberModified()
public void markTracksForDeletion(java.util.ArrayList tracks)
public int createPlaylist(java.lang.String name)
public int createPlaylist(java.lang.String name, boolean disableSave)
name
- The name of this playlist.
public void removePlaylist(int playlistKey)
public void addToPlaylist(int audioKey, int playlistKey) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public void addToPlaylist(int audioKey, int playlistKey, boolean disableSave) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public void addToPlaylist(java.util.ArrayList tracks, int playlistKey) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public void deleteFromPlaylist(java.util.ArrayList tracks, int playlistKey) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public void rearrangePlaylist(java.util.ArrayList tracks, int playlistKey)
public void renamePlaylist(java.lang.String newName, int playlistKey)
public int addFilesToPlaylist(java.io.File[] files, int playListKey) throws DatabaseInternalCorruptionException
DatabaseInternalCorruptionException
public NeurosDevice getDevice()
public java.lang.String toString()
public boolean deleteQueueContains(AudioRecord record)
public boolean syncQueueContains(AudioRecord record)
public boolean modifyQueueContains(AudioRecord record)
public java.util.ArrayList queryTracksForArtist(int artistKey)
public java.util.ArrayList queryTracksForAlbum(int albumKey)
public java.util.ArrayList queryTracksForGenre(int genreKey)
public java.util.ArrayList queryTracksForRecordings(int recordingKey)
public java.util.ArrayList queryTracksForPlaylist(int playlistKey)
public boolean hasModifiedPlaylists()
public static void fixDBDir(java.lang.String path)
public void modifyTrack(int audioKey, NewTrack newTrack)
audioKey
- The key of the track to be changed in the audio
database.newTrack
- The new information.public void computeMDBPointers()
public NewTrack getNewTrackFromSyncQueue(AudioRecord record)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |