View Javadoc

1   package com.melloware.jukes.gui.tool;
2   
3   import java.awt.Color;
4   import java.io.File;
5   import java.util.Locale;
6   import java.util.prefs.Preferences;
7   
8   import org.apache.commons.io.FilenameUtils;
9   import org.apache.commons.lang.SystemUtils;
10  import org.apache.log4j.Level;
11  
12  import com.jgoodies.binding.beans.Model;
13  import com.melloware.jukes.file.filter.XspfFilter;
14  import com.melloware.jukes.gui.view.component.SpectrumTimeAnalyzer;
15  
16  /**
17   * Provides bound properties for application related settings.
18   * <p>
19   * Copyright (c) 1999-2007 Melloware, Inc. <http://www.melloware.com>
20   * @author Emil A. Lefkof III <info@melloware.com>
21   * @version 4.0
22   *
23   * @see java.util.prefs.Preferences
24   */
25  public final class Settings
26      extends Model {
27  
28      public static final String PROPERTYNAME_FADE_IN_ON_PLAY = "fadeInOnPlay";
29      public static final String PROPERTYNAME_FADE_OUT_ON_PAUSE = "fadeOutOnPause";
30      public static final String PROPERTYNAME_FADE_OUT_ON_STOP = "fadeOutOnStop";
31      public static final String PROPERTYNAME_FADE_OUT_ON_CHANGE = "fadeOutOnChange";
32      public static final String PROPERTYNAME_UPDATE_TAGS = "updateTags";
33      public static final String PROPERTYNAME_DISPLAY_FORMAT_DISC = "displayFormatDisc";
34      public static final String PROPERTYNAME_DISPLAY_FORMAT_TRACK = "displayFormatTrack";
35      public static final String PROPERTYNAME_DIRECTORY_START_IN = "startInDirectory";
36      public static final String PROPERTYNAME_DIRECTORY_DB_LOCATION = "databaseLocation";
37      public static final String PROPERTYNAME_FILE_FORMAT_MUSIC = "fileFormatMusic";
38      public static final String PROPERTYNAME_FILE_FORMAT_IMAGE = "fileFormatImage";
39      public static final String PROPERTYNAME_NEW_FILE_IN_DAYS = "newFileInDays";
40      public static final String PROPERTYNAME_LOCALE = "locale";
41      public static final String PROPERTYNAME_ROW_COLOR_EVEN = "rowColorEven";
42      public static final String PROPERTYNAME_ROW_COLOR_ODD = "rowColorOdd";
43      public static final String PROPERTYNAME_PLAYLIST_TYPE = "playlistType";
44      public static final String PROPERTYNAME_LOG_LEVEL = "logLevel";
45      public static final String PROPERTYNAME_PLAYER_BUFFER_SIZE = "playerBufferSize";
46      public static final String PROPERTYNAME_FILE_BACKUP = "fileBackup";
47      public static final String PROPERTYNAME_COVER_SIZE_SMALL = "coverSizeSmall";
48      public static final String PROPERTYNAME_COVER_SIZE_LARGE = "coverSizeLarge";
49      public static final String PROPERTYNAME_AUDIT_INFO = "auditInfo";
50      public static final String PROPERTYNAME_REMOTE_DATABASE_URL = "remoteDatabaseURL";
51      public static final String PROPERTYNAME_CATALOG_SCROLL_UNITS = "catalogScrollUnits";
52      public static final String PROPERTYNAME_ANALYZER_MODE = "analyzerMode";
53  
54      /**
55       * URL of remote database location.
56       */
57      public static final String DEFAULT_REMOTE_DATABASE_URL = "jdbc:hsqldb:hsql://127.0.0.1/jukes";
58  
59      /**
60       * The default value (true) for fading properties.
61       */
62      private static final boolean DEFAULT_FADING = true;
63  
64      /**
65       * The default value (false) for property 'updateTags'.
66       */
67      private static final boolean DEFAULT_UPDATE_TAGS = false;
68  
69      /**
70       * The default value (false) for property 'auditInfo'.
71       */
72      private static final boolean DEFAULT_AUDIT_INFO = true;
73  
74      /**
75       * The default value for property 'startInDirectory'.
76       */
77      private static final File DEFAULT_DIRECTORY_START_IN = new File(FilenameUtils.normalizeNoEndSeparator(SystemUtils.USER_HOME
78                                                                                                            + SystemUtils.FILE_SEPARATOR
79                                                                                                            + "."
80                                                                                                            + Resources.APPLICATION_LOCATION));
81  
82      /**
83       * The default value for property 'databaseLocation'.
84       */
85      private static final File DEFAULT_DIRECTORY_DB_LOCATION = new File(FilenameUtils.normalizeNoEndSeparator(SystemUtils.USER_HOME
86                                                                                                               + SystemUtils.FILE_SEPARATOR
87                                                                                                               + "."
88                                                                                                               + Resources.APPLICATION_LOCATION
89                                                                                                               + SystemUtils.FILE_SEPARATOR
90                                                                                                               + "db"));
91  
92      /**
93       * The default value for property 'fileBackup'.
94       */
95      private static final File DEFAULT_FILE_BACKUP = new File(FilenameUtils.normalizeNoEndSeparator(SystemUtils.USER_HOME
96                                                                                                     + SystemUtils.FILE_SEPARATOR
97                                                                                                     + "."
98                                                                                                     + Resources.APPLICATION_LOCATION
99                                                                                                     + SystemUtils.FILE_SEPARATOR
100                                                                                                    + "backup"
101                                                                                                    + SystemUtils.FILE_SEPARATOR
102                                                                                                    + Resources.APPLICATION_LOCATION
103                                                                                                    + "-backup.zip"));
104 
105     /**
106      * The default value for property 'fileFormatMusic'.
107      */
108     private static final String DEFAULT_FILE_FORMAT_MUSIC = "%n - %t";
109 
110     /**
111      * The default value for property 'fileFormatImage'.
112      */
113     private static final String DEFAULT_FILE_FORMAT_IMAGE = "%a - %d";
114 
115     /**
116      * The default value for property 'fileFormatMusic'.
117      */
118     private static final String DEFAULT_DISPLAY_FORMAT_DISC = "[%y] %d (%r)";
119 
120     /**
121      * The default value for property 'fileFormatMusic'.
122      */
123     private static final String DEFAULT_DISPLAY_FORMAT_TRACK = "%n. %t  (%r)";
124 
125     /**
126      * The default value for property 'locale'.
127      */
128     private static final String DEFAULT_LOCALE = Locale.getDefault().getLanguage();
129 
130     /**
131      * The default value for property 'rowColorEven'.
132      */
133     private static final Color DEFAULT_ROW_COLOR_EVEN = Color.WHITE;
134 
135     /**
136      * The default value for property 'rowColorOdd'.
137      */
138     private static final Color DEFAULT_ROW_COLOR_ODD = new Color(0xee, 0xee, 0xff);
139 
140     /**
141      * The default value for property 'newFileInDays'.
142      */
143     private static final int DEFAULT_NEW_FILE_IN_DAYS = 30;
144     
145     /**
146      * The default value for property 'analyzerMode'.
147      */
148     private static final String DEFAULT_ANALYZER_MODE = SpectrumTimeAnalyzer.ANALYZER;
149 
150     /**
151      * The default value for property 'catalogScrollUnits'.
152      */
153     private static final int DEFAULT_CATALOG_SCROLL_UNITS = 5;
154 
155     /**
156      * The default value for property 'coverSizeSmall'.
157      */
158     private static final int DEFAULT_COVER_SIZE_SMALL = 91;
159 
160     /**
161      * The default value for property 'coverSizeLarge'.
162      */
163     private static final int DEFAULT_COVER_SIZE_LARGE = 300;
164 
165     /**
166      * The default value for property 'playerBufferSize'.
167      */
168     private static final int DEFAULT_PLAYER_BUFFER_SIZE = 512000;
169 
170     /**
171      * The default value for property 'playlistType'.
172      */
173     private static final String DEFAULT_PLAYLIST_TYPE = XspfFilter.XSPF;
174 
175     /**
176      * The default value for property 'logLevel'.
177      */
178     private static final String DEFAULT_LOG_LEVEL = Level.INFO.toString();
179 
180     private static final String KEY_FADE_IN_ON_PLAY = "state.fadeInOnPlay";
181     private static final String KEY_FADE_OUT_ON_STOP = "state.fadeOutOnStop";
182     private static final String KEY_FADE_OUT_ON_PAUSE = "state.fadeOutOnPause";
183     private static final String KEY_FADE_OUT_ON_CHANGE = "state.fadeOutOnChange";
184     private static final String KEY_DIRECTORY_START_IN = "state.startInDirectory";
185     private static final String KEY_DIRECTORY_DB_LOCATION = "state.databaseLocation";
186     private static final String KEY_FILE_FORMAT_MUSIC = "state.fileFormatMusic";
187     private static final String KEY_FILE_FORMAT_IMAGE = "state.fileFormatImage";
188     private static final String KEY_NEW_FILE_IN_DAYS = "state.newFileInDays";
189     private static final String KEY_DISPLAY_FORMAT_TRACK = "state.displayFormatTrack";
190     private static final String KEY_DISPLAY_FORMAT_DISC = "state.displayFormatDisc";
191     private static final String KEY_LOCALE = "state.locale";
192     private static final String KEY_UPDATE_TAGS = "state.updateTags";
193     private static final String KEY_ROW_COLOR_EVEN = "state.rowColorEven";
194     private static final String KEY_ROW_COLOR_ODD = "state.rowColorOdd";
195     private static final String KEY_PLAYLIST_TYPE = "state.playlistType";
196     private static final String KEY_LOG_LEVEL = "state.logLevel";
197     private static final String KEY_PLAYER_BUFFER_SIZE = "state.playerBufferSize";
198     private static final String KEY_FILE_BACKUP = "state.fileBackup";
199     private static final String KEY_COVER_SIZE_SMALL = "state.coverSizeSmall";
200     private static final String KEY_COVER_SIZE_LARGE = "state.coverSizeLarge";
201     private static final String KEY_AUDIT_INFO = "state.auditInfo";
202     private static final String KEY_REMOTE_DATABASE_URL = "state.remoteDatabaseURL";
203     private static final String KEY_CATALOG_SCROLL_UNITS = "state.catalogScrollUnits";
204     private static final String KEY_ANALYZER_MODE = "state.analyzerMode";
205 
206     /**
207      * Whether to show Audit Info or not
208      */
209     private boolean auditInfo = DEFAULT_AUDIT_INFO;
210 
211     /**
212      * Describes whether a a song shall be faded out or not
213      */
214     private boolean fadeInOnPlay = DEFAULT_FADING;
215     private boolean fadeOutOnChange = DEFAULT_FADING;
216     private boolean fadeOutOnPause = DEFAULT_FADING;
217     private boolean fadeOutOnStop = DEFAULT_FADING;
218 
219     /**
220      * Whether to update the tags on a Disc Find (slow).
221      */
222     private boolean updateTags = DEFAULT_UPDATE_TAGS;
223 
224     /**
225      * Describes the alternating row color.
226      */
227     private Color rowColorEven = DEFAULT_ROW_COLOR_EVEN;
228 
229     /**
230      * Describes the alternating row color.
231      */
232     private Color rowColorOdd = DEFAULT_ROW_COLOR_ODD;
233 
234     /**
235      * Describes where the HSQLDB database location is.
236      */
237     private File databaseLocation = DEFAULT_DIRECTORY_DB_LOCATION;
238 
239     /**
240      * Describes the file to backup to.
241      */
242     private File fileBackup = DEFAULT_FILE_BACKUP;
243 
244     /**
245      * Describes what the start in directory is for all Find Dialogs.
246      */
247     private File startInDirectory = DEFAULT_DIRECTORY_START_IN;
248 
249     /**
250      * Describes scroll speed of the catalog tree view
251      */
252     private int catalogScrollUnits = DEFAULT_CATALOG_SCROLL_UNITS;
253 
254     /**
255      * Describes cover size of the large covers
256      */
257     private int coverSizeLarge = DEFAULT_COVER_SIZE_LARGE;
258 
259     /**
260      * Describes cover size of the small covers
261      */
262     private int coverSizeSmall = DEFAULT_COVER_SIZE_SMALL;
263 
264     /**
265      * Describes the number of days a file is considered 'new'
266      */
267     private int newFileInDays = DEFAULT_NEW_FILE_IN_DAYS;
268     
269     /**
270      * Describes the mode to start the spectrum analyzer in
271      */
272     private String analyzerMode = DEFAULT_ANALYZER_MODE;
273 
274     /**
275      * Describes the buffer size of the audio player
276      */
277     private int playerBufferSize = DEFAULT_PLAYER_BUFFER_SIZE;
278 
279     /**
280      * Describes the format to display discs.
281      */
282     private String displayFormatDisc = DEFAULT_DISPLAY_FORMAT_DISC;
283 
284     /**
285      * Describes the format to display tracks
286      */
287     private String displayFormatTrack = DEFAULT_DISPLAY_FORMAT_TRACK;
288 
289     /**
290      * Describes what the image file renaming convention is.
291      */
292     private String fileFormatImage = DEFAULT_FILE_FORMAT_IMAGE;
293 
294     /**
295      * Describes what the music file renaming convention is.
296      */
297     private String fileFormatMusic = DEFAULT_FILE_FORMAT_MUSIC;
298 
299     /**
300      * Describes what the current filter is.
301      */
302     private String filter = "";
303 
304     /**
305      * Describes the country locale
306      */
307     private String locale = DEFAULT_LOCALE;
308 
309     /**
310      * Describes the logger level
311      */
312     private String logLevel = DEFAULT_LOG_LEVEL;
313 
314     /**
315      * Describes the country locale
316      */
317     private String playlistType = DEFAULT_PLAYLIST_TYPE;
318 
319     /**
320      * Describes the location of the remote database if connecting to one
321      */
322     private String remoteDatabaseURL = DEFAULT_REMOTE_DATABASE_URL;
323 
324     /**
325      * Gets the catalogScrollUnits.
326      * <p>
327      * @return Returns the catalogScrollUnits.
328      */
329     public int getCatalogScrollUnits() {
330         return this.catalogScrollUnits;
331     }
332 
333     /**
334      * Gets the coverSizeLarge.
335      * <p>
336      * @return Returns the coverSizeLarge.
337      */
338     public int getCoverSizeLarge() {
339         return this.coverSizeLarge;
340     }
341 
342     /**
343      * Gets the coverSizeSmall.
344      * <p>
345      * @return Returns the coverSizeSmall.
346      */
347     public int getCoverSizeSmall() {
348         return this.coverSizeSmall;
349     }
350 
351     /**
352      * Gets the databaseLocation.
353      * <p>
354      * @return Returns the databaseLocation.
355      */
356     public File getDatabaseLocation() {
357         return this.databaseLocation;
358     }
359 
360     /**
361      * Gets the displayFormatDisc.
362      * <p>
363      * @return Returns the displayFormatDisc.
364      */
365     public String getDisplayFormatDisc() {
366         return this.displayFormatDisc;
367     }
368 
369     /**
370      * Gets the displayFormatTrack.
371      * <p>
372      * @return Returns the displayFormatTrack.
373      */
374     public String getDisplayFormatTrack() {
375         return this.displayFormatTrack;
376     }
377 
378     /**
379      * Gets the fileBackup.
380      * <p>
381      * @return Returns the fileBackup.
382      */
383     public File getFileBackup() {
384         return this.fileBackup;
385     }
386 
387     /**
388      * Gets the fileFormatImage.
389      * <p>
390      * @return Returns the fileFormatImage.
391      */
392     public String getFileFormatImage() {
393         return this.fileFormatImage;
394     }
395 
396     /**
397      * Gets the fileFormatMusic.
398      * <p>
399      * @return Returns the fileFormatMusic.
400      */
401     public String getFileFormatMusic() {
402         return this.fileFormatMusic;
403     }
404 
405     /**
406      * Gets the filter.
407      * <p>
408      * @return Returns the filter.
409      */
410     public String getFilter() {
411         return this.filter;
412     }
413 
414     /**
415      * Gets the locale.
416      * <p>
417      * @return Returns the locale.
418      */
419     public String getLocale() {
420         return this.locale;
421     }
422 
423     /**
424      * Gets the logLevel.
425      * <p>
426      * @return Returns the logLevel.
427      */
428     public String getLogLevel() {
429         return this.logLevel;
430     }
431 
432     /**
433      * Gets the newFileInDays.
434      * <p>
435      * @return Returns the newFileInDays.
436      */
437     public int getNewFileInDays() {
438         return this.newFileInDays;
439     }
440 
441     /**
442      * Gets the playerBufferSize.
443      * <p>
444      * @return Returns the playerBufferSize.
445      */
446     public int getPlayerBufferSize() {
447         return this.playerBufferSize;
448     }
449 
450     /**
451      * Gets the playlistType.
452      * <p>
453      * @return Returns the playlistType.
454      */
455     public String getPlaylistType() {
456         return this.playlistType;
457     }
458 
459     /**
460      * Gets the remoteDatabaseURL.
461      * <p>
462      * @return Returns the remoteDatabaseURL.
463      */
464     public String getRemoteDatabaseURL() {
465         return this.remoteDatabaseURL;
466     }
467 
468     /**
469      * Gets the rowColorEven.
470      * <p>
471      * @return Returns the rowColorEven.
472      */
473     public Color getRowColorEven() {
474         return this.rowColorEven;
475     }
476 
477     /**
478      * Gets the rowColorOdd.
479      * <p>
480      * @return Returns the rowColorOdd.
481      */
482     public Color getRowColorOdd() {
483         return this.rowColorOdd;
484     }
485 
486     /**
487      * Gets the startInDirectory.
488      * <p>
489      * @return Returns the startInDirectory.
490      */
491     public File getStartInDirectory() {
492         return this.startInDirectory;
493     }
494     
495     /**
496      * Gets the analyzerMode.
497      * <p>
498      * @return Returns the analyzerMode.
499      */
500     public String getAnalyzerMode() {
501        return this.analyzerMode;
502     }
503 
504     /**
505      * Sets the auditInfo.
506      * <p>
507      * @param aAuditInfo The auditInfo to set.
508      */
509     public void setAuditInfo(boolean aAuditInfo) {
510         boolean oldValue = isAuditInfo();
511         this.auditInfo = aAuditInfo;
512         firePropertyChange(PROPERTYNAME_AUDIT_INFO, oldValue, aAuditInfo);
513     }
514 
515     /**
516      * Sets the catalogScrollUnits.
517      * <p>
518      * @param aCatalogScrollUnits The catalogScrollUnits to set.
519      */
520     public void setCatalogScrollUnits(int aCatalogScrollUnits) {
521         int oldValue = getCatalogScrollUnits();
522         this.catalogScrollUnits = aCatalogScrollUnits;
523         firePropertyChange(PROPERTYNAME_CATALOG_SCROLL_UNITS, oldValue, aCatalogScrollUnits);
524     }
525 
526     /**
527      * Sets the coverSizeLarge.
528      * <p>
529      * @param aCoverSizeLarge The coverSizeLarge to set.
530      */
531     public void setCoverSizeLarge(int aCoverSizeLarge) {
532         int oldValue = getCoverSizeLarge();
533         this.coverSizeLarge = aCoverSizeLarge;
534         firePropertyChange(PROPERTYNAME_COVER_SIZE_LARGE, oldValue, aCoverSizeLarge);
535     }
536 
537     /**
538      * Sets the coverSizeSmall.
539      * <p>
540      * @param aCoverSizeSmall The coverSizeSmall to set.
541      */
542     public void setCoverSizeSmall(int aCoverSizeSmall) {
543         int oldValue = getCoverSizeSmall();
544         this.coverSizeSmall = aCoverSizeSmall;
545         firePropertyChange(PROPERTYNAME_COVER_SIZE_SMALL, oldValue, aCoverSizeSmall);
546 
547     }
548 
549     /**
550      * Sets the databaseLocation.
551      * <p>
552      * @param aDatabaseLocation The databaseLocation to set.
553      */
554     public void setDatabaseLocation(File aDatabaseLocation) {
555         File oldValue = getDatabaseLocation();
556         this.databaseLocation = aDatabaseLocation;
557         firePropertyChange(PROPERTYNAME_DIRECTORY_DB_LOCATION, oldValue, aDatabaseLocation);
558     }
559 
560     /**
561      * Sets the displayFormatDisc.
562      * <p>
563      * @param aDisplayFormatDisc The displayFormatDisc to set.
564      */
565     public void setDisplayFormatDisc(String aDisplayFormatDisc) {
566         String oldValue = getDisplayFormatDisc();
567         this.displayFormatDisc = aDisplayFormatDisc;
568         firePropertyChange(PROPERTYNAME_DISPLAY_FORMAT_DISC, oldValue, aDisplayFormatDisc);
569     }
570 
571     /**
572      * Sets the displayFormatTrack.
573      * <p>
574      * @param aDisplayFormatTrack The displayFormatTrack to set.
575      */
576     public void setDisplayFormatTrack(String aDisplayFormatTrack) {
577         String oldValue = getDisplayFormatTrack();
578         this.displayFormatTrack = aDisplayFormatTrack;
579         firePropertyChange(PROPERTYNAME_DISPLAY_FORMAT_TRACK, oldValue, aDisplayFormatTrack);
580     }
581 
582     /**
583      * Sets the fadeInOnPlay.
584      * <p>
585      * @param aFadeInOnPlay The fadeInOnPlay to set.
586      */
587     public void setFadeInOnPlay(boolean aFadeInOnPlay) {
588         boolean oldValue = isFadeInOnPlay();
589         this.fadeInOnPlay = aFadeInOnPlay;
590         firePropertyChange(PROPERTYNAME_FADE_IN_ON_PLAY, oldValue, aFadeInOnPlay);
591     }
592 
593     /**
594      * Sets the fadeOutOnChange.
595      * <p>
596      * @param aFadeOutOnChange The fadeOutOnChange to set.
597      */
598     public void setFadeOutOnChange(boolean aFadeOutOnChange) {
599         boolean oldValue = isFadeOutOnChange();
600         this.fadeOutOnChange = aFadeOutOnChange;
601         firePropertyChange(PROPERTYNAME_FADE_OUT_ON_CHANGE, oldValue, aFadeOutOnChange);
602     }
603 
604     /**
605      * Sets the fadeOutOnPause.
606      * <p>
607      * @param aFadeOutOnPause The fadeOutOnPause to set.
608      */
609     public void setFadeOutOnPause(boolean aFadeOutOnPause) {
610         boolean oldValue = isFadeOutOnPause();
611         this.fadeOutOnPause = aFadeOutOnPause;
612         firePropertyChange(PROPERTYNAME_FADE_OUT_ON_PAUSE, oldValue, aFadeOutOnPause);
613     }
614 
615     /**
616      * Sets the fadeOutOnStop.
617      * <p>
618      * @param aFadeOutOnStop The fadeOutOnStop to set.
619      */
620     public void setFadeOutOnStop(boolean aFadeOutOnStop) {
621         boolean oldValue = isFadeOutOnStop();
622         this.fadeOutOnStop = aFadeOutOnStop;
623         firePropertyChange(PROPERTYNAME_FADE_OUT_ON_STOP, oldValue, aFadeOutOnStop);
624     }
625 
626     /**
627      * Sets the fileBackup.
628      * <p>
629      * @param aFileBackup The fileBackup to set.
630      */
631     public void setFileBackup(File aFileBackup) {
632         File oldValue = getFileBackup();
633         this.fileBackup = aFileBackup;
634         firePropertyChange(PROPERTYNAME_FILE_BACKUP, oldValue, aFileBackup);
635     }
636 
637     /**
638      * Sets the fileFormatImage.
639      * <p>
640      * @param aFileFormatImage The fileFormatImage to set.
641      */
642     public void setFileFormatImage(String aFileFormatImage) {
643         String oldValue = getFileFormatImage();
644         this.fileFormatImage = aFileFormatImage;
645         firePropertyChange(PROPERTYNAME_FILE_FORMAT_IMAGE, oldValue, aFileFormatImage);
646     }
647 
648     /**
649      * Sets the fileFormatMusic.
650      * <p>
651      * @param aFileFormat The fileFormatMusic to set.
652      */
653     public void setFileFormatMusic(String aFileFormat) {
654         String oldValue = getFileFormatMusic();
655         this.fileFormatMusic = aFileFormat;
656         firePropertyChange(PROPERTYNAME_FILE_FORMAT_MUSIC, oldValue, aFileFormat);
657     }
658 
659     /**
660      * Sets the filter.
661      * <p>
662      * @param aFilter The filter to set.
663      */
664     public void setFilter(String aFilter) {
665         this.filter = aFilter;
666     }
667 
668     /**
669      * Sets the locale.
670      * <p>
671      * @param aLocale The locale to set.
672      */
673     public void setLocale(String aLocale) {
674         String oldValue = getLocale();
675         this.locale = aLocale;
676         firePropertyChange(PROPERTYNAME_LOCALE, oldValue, aLocale);
677 
678     }
679 
680     /**
681      * Sets the logLevel.
682      * <p>
683      * @param aLogLevel The logLevel to set.
684      */
685     public void setLogLevel(String aLogLevel) {
686         String oldValue = getLogLevel();
687         this.logLevel = aLogLevel;
688         firePropertyChange(PROPERTYNAME_LOG_LEVEL, oldValue, aLogLevel);
689     }
690 
691     /**
692      * Sets the newFileInDays.
693      * <p>
694      * @param aNewFileInDays The newFileInDays to set.
695      */
696     public void setNewFileInDays(int aNewFileInDays) {
697         int oldValue = getNewFileInDays();
698         this.newFileInDays = aNewFileInDays;
699         firePropertyChange(PROPERTYNAME_NEW_FILE_IN_DAYS, oldValue, aNewFileInDays);
700 
701     }
702 
703     /**
704      * Sets the playerBufferSize.
705      * <p>
706      * @param aPlayerBufferSize The playerBufferSize to set.
707      */
708     public void setPlayerBufferSize(int aPlayerBufferSize) {
709         int oldValue = getPlayerBufferSize();
710         this.playerBufferSize = aPlayerBufferSize;
711         firePropertyChange(PROPERTYNAME_PLAYER_BUFFER_SIZE, oldValue, aPlayerBufferSize);
712     }
713     
714     /**
715      * Sets the analyzerMode.
716      * <p>
717      * @param aAnalyzerMode The analyzerMode to set.
718      */
719     public void setAnalyzerMode(String aAnalyzerMode) {
720        String oldValue = getAnalyzerMode();
721        this.analyzerMode = aAnalyzerMode;
722        firePropertyChange(PROPERTYNAME_ANALYZER_MODE, oldValue, aAnalyzerMode);
723     }
724 
725     /**
726      * Sets the playlistType.
727      * <p>
728      * @param aPlaylistType The playlistType to set.
729      */
730     public void setPlaylistType(String aPlaylistType) {
731         String oldValue = getPlaylistType();
732         this.playlistType = aPlaylistType;
733         firePropertyChange(PROPERTYNAME_PLAYLIST_TYPE, oldValue, aPlaylistType);
734     }
735 
736     /**
737      * Sets the remoteDatabaseURL.
738      * <p>
739      * @param aRemoteDatabaseURL The remoteDatabaseURL to set.
740      */
741     public void setRemoteDatabaseURL(String aRemoteDatabaseURL) {
742         String oldValue = getRemoteDatabaseURL();
743         this.remoteDatabaseURL = aRemoteDatabaseURL;
744         firePropertyChange(PROPERTYNAME_REMOTE_DATABASE_URL, oldValue, aRemoteDatabaseURL);
745 
746     }
747 
748     /**
749      * Sets the rowColorEven.
750      * <p>
751      * @param aRowColorEven The rowColorEven to set.
752      */
753     public void setRowColorEven(Color aRowColorEven) {
754         Color oldValue = getRowColorEven();
755         this.rowColorEven = aRowColorEven;
756         firePropertyChange(PROPERTYNAME_ROW_COLOR_EVEN, oldValue, aRowColorEven);
757     }
758 
759     /**
760      * Sets the rowColorOdd.
761      * <p>
762      * @param aRowColorOdd The rowColorOdd to set.
763      */
764     public void setRowColorOdd(Color aRowColorOdd) {
765         Color oldValue = getRowColorOdd();
766         this.rowColorOdd = aRowColorOdd;
767         firePropertyChange(PROPERTYNAME_ROW_COLOR_ODD, oldValue, aRowColorOdd);
768     }
769 
770     /**
771      * Sets the startInDirectory.
772      * <p>
773      * @param aStartInDirectory The startInDirectory to set.
774      */
775     public void setStartInDirectory(File aStartInDirectory) {
776         File oldValue = getStartInDirectory();
777         startInDirectory = aStartInDirectory;
778         firePropertyChange(PROPERTYNAME_DIRECTORY_START_IN, oldValue, aStartInDirectory);
779     }
780 
781     /**
782      * Sets the updateTags.
783      * <p>
784      * @param aUpdateTags The updateTags to set.
785      */
786     public void setUpdateTags(boolean aUpdateTags) {
787         boolean oldValue = isUpdateTags();
788         this.updateTags = aUpdateTags;
789         firePropertyChange(PROPERTYNAME_UPDATE_TAGS, oldValue, aUpdateTags);
790     }
791     
792     
793 
794     /**
795      * Gets the auditInfo.
796      * <p>
797      * @return Returns the auditInfo.
798      */
799     public boolean isAuditInfo() {
800         return this.auditInfo;
801     }
802 
803     /**
804      * Gets the fadeInOnPlay.
805      * <p>
806      * @return Returns the fadeInOnPlay.
807      */
808     public boolean isFadeInOnPlay() {
809         return this.fadeInOnPlay;
810     }
811 
812     /**
813      * Gets the fadeOutOnChange.
814      * <p>
815      * @return Returns the fadeOutOnChange.
816      */
817     public boolean isFadeOutOnChange() {
818         return this.fadeOutOnChange;
819     }
820 
821     /**
822      * Gets the fadeOutOnPause.
823      * <p>
824      * @return Returns the fadeOutOnPause.
825      */
826     public boolean isFadeOutOnPause() {
827         return this.fadeOutOnPause;
828     }
829 
830     /**
831      * Gets the fadeOutOnStop.
832      * <p>
833      * @return Returns the fadeOutOnStop.
834      */
835     public boolean isFadeOutOnStop() {
836         return this.fadeOutOnStop;
837     }
838 
839     /**
840      * Gets the updateTags.
841      * <p>
842      * @return Returns the updateTags.
843      */
844     public boolean isUpdateTags() {
845         return this.updateTags;
846     }
847 
848     /**
849      * Restores the persistent properties from the specified Preferences.
850      *
851      * @param prefs   the Preferences object that holds the property values
852      */
853     public void restoreFrom(Preferences prefs) {
854         setFadeInOnPlay(prefs.getBoolean(KEY_FADE_IN_ON_PLAY, DEFAULT_FADING));
855         setFadeOutOnChange(prefs.getBoolean(KEY_FADE_OUT_ON_CHANGE, DEFAULT_FADING));
856         setFadeOutOnPause(prefs.getBoolean(KEY_FADE_OUT_ON_PAUSE, DEFAULT_FADING));
857         setFadeOutOnStop(prefs.getBoolean(KEY_FADE_OUT_ON_STOP, DEFAULT_FADING));
858         setUpdateTags(prefs.getBoolean(KEY_UPDATE_TAGS, DEFAULT_UPDATE_TAGS));
859         setStartInDirectory(new File(prefs.get(KEY_DIRECTORY_START_IN, DEFAULT_DIRECTORY_START_IN.getAbsolutePath())));
860         setDatabaseLocation(new File(prefs.get(KEY_DIRECTORY_DB_LOCATION,
861                                                DEFAULT_DIRECTORY_DB_LOCATION.getAbsolutePath())));
862         setFileBackup(new File(prefs.get(KEY_FILE_BACKUP, DEFAULT_FILE_BACKUP.getAbsolutePath())));
863         setFileFormatMusic(prefs.get(KEY_FILE_FORMAT_MUSIC, DEFAULT_FILE_FORMAT_MUSIC));
864         setFileFormatImage(prefs.get(KEY_FILE_FORMAT_IMAGE, DEFAULT_FILE_FORMAT_IMAGE));
865         setNewFileInDays(prefs.getInt(KEY_NEW_FILE_IN_DAYS, DEFAULT_NEW_FILE_IN_DAYS));
866         setAnalyzerMode(prefs.get(KEY_ANALYZER_MODE, DEFAULT_ANALYZER_MODE));
867         setDisplayFormatDisc(prefs.get(KEY_DISPLAY_FORMAT_DISC, DEFAULT_DISPLAY_FORMAT_DISC));
868         setDisplayFormatTrack(prefs.get(KEY_DISPLAY_FORMAT_TRACK, DEFAULT_DISPLAY_FORMAT_TRACK));
869         setLocale(prefs.get(KEY_LOCALE, DEFAULT_LOCALE));
870         setRowColorEven(new Color(prefs.getInt(KEY_ROW_COLOR_EVEN, DEFAULT_ROW_COLOR_EVEN.getRGB())));
871         setRowColorOdd(new Color(prefs.getInt(KEY_ROW_COLOR_ODD, DEFAULT_ROW_COLOR_ODD.getRGB())));
872         setPlaylistType(prefs.get(KEY_PLAYLIST_TYPE, DEFAULT_PLAYLIST_TYPE));
873         setLogLevel(prefs.get(KEY_LOG_LEVEL, DEFAULT_LOG_LEVEL));
874         setPlayerBufferSize(prefs.getInt(KEY_PLAYER_BUFFER_SIZE, DEFAULT_PLAYER_BUFFER_SIZE));
875         setAuditInfo(prefs.getBoolean(KEY_AUDIT_INFO, DEFAULT_AUDIT_INFO));
876         setCoverSizeSmall(prefs.getInt(KEY_COVER_SIZE_SMALL, DEFAULT_COVER_SIZE_SMALL));
877         setCoverSizeLarge(prefs.getInt(KEY_COVER_SIZE_LARGE, DEFAULT_COVER_SIZE_LARGE));
878         setRemoteDatabaseURL(prefs.get(KEY_REMOTE_DATABASE_URL, DEFAULT_REMOTE_DATABASE_URL));
879         setCatalogScrollUnits(prefs.getInt(KEY_CATALOG_SCROLL_UNITS, DEFAULT_CATALOG_SCROLL_UNITS));
880     }
881 
882     /**
883      * Stores the persistent properties in the specified Preferences.
884      *
885      * @param prefs   the Preferences object that holds the property values
886      */
887     void storeIn(Preferences prefs) {
888         prefs.putBoolean(KEY_FADE_IN_ON_PLAY, isFadeInOnPlay());
889         prefs.putBoolean(KEY_FADE_OUT_ON_STOP, isFadeOutOnStop());
890         prefs.putBoolean(KEY_FADE_OUT_ON_PAUSE, isFadeOutOnPause());
891         prefs.putBoolean(KEY_FADE_OUT_ON_CHANGE, isFadeOutOnChange());
892         prefs.putBoolean(KEY_UPDATE_TAGS, isUpdateTags());
893         prefs.put(KEY_DIRECTORY_START_IN, getStartInDirectory().getAbsolutePath());
894         prefs.put(KEY_DIRECTORY_DB_LOCATION, getDatabaseLocation().getAbsolutePath());
895         prefs.put(KEY_FILE_BACKUP, getFileBackup().getAbsolutePath());
896         prefs.put(KEY_FILE_FORMAT_MUSIC, getFileFormatMusic());
897         prefs.put(KEY_FILE_FORMAT_IMAGE, getFileFormatImage());
898         prefs.putInt(KEY_NEW_FILE_IN_DAYS, getNewFileInDays());
899         prefs.put(KEY_ANALYZER_MODE, getAnalyzerMode());
900         prefs.put(KEY_DISPLAY_FORMAT_DISC, getDisplayFormatDisc());
901         prefs.put(KEY_DISPLAY_FORMAT_TRACK, getDisplayFormatTrack());
902         prefs.put(KEY_LOCALE, getLocale());
903         prefs.putInt(KEY_ROW_COLOR_EVEN, getRowColorEven().getRGB());
904         prefs.putInt(KEY_ROW_COLOR_ODD, getRowColorOdd().getRGB());
905         prefs.put(KEY_PLAYLIST_TYPE, getPlaylistType());
906         prefs.put(KEY_LOG_LEVEL, getLogLevel());
907         prefs.putInt(KEY_PLAYER_BUFFER_SIZE, getPlayerBufferSize());
908         prefs.putBoolean(KEY_AUDIT_INFO, isAuditInfo());
909         prefs.putInt(KEY_COVER_SIZE_SMALL, getCoverSizeSmall());
910         prefs.putInt(KEY_COVER_SIZE_LARGE, getCoverSizeLarge());
911         prefs.put(KEY_REMOTE_DATABASE_URL, getRemoteDatabaseURL());
912         prefs.putInt(KEY_CATALOG_SCROLL_UNITS, getCatalogScrollUnits());
913     }
914 
915    
916 
917    
918 
919 }