From: WiESi <wi...@us...> - 2006-03-25 21:28:29
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26415/src Modified Files: PlayQueue.java Settings.java SpectrumLabel.java Log Message: Little changes again (i. e. settings, ...) Index: SpectrumLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/SpectrumLabel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- SpectrumLabel.java 22 Mar 2006 18:26:59 -0000 1.6 +++ SpectrumLabel.java 25 Mar 2006 21:28:25 -0000 1.7 @@ -115,8 +115,7 @@ } ofg.setColor(Color.GREEN); String duration = "--:--"; - if(owner.playDialog.pq != null && owner.playDialog.pq.stream != null && - owner.playDialog.pq.running) + if(owner.playDialog.pq != null && owner.playDialog.pq.running) if(owner.playDialog.pq.pause == 1 && pt < 25) duration = "##:##"; else Index: PlayQueue.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayQueue.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- PlayQueue.java 22 Mar 2006 18:26:59 -0000 1.17 +++ PlayQueue.java 25 Mar 2006 21:28:25 -0000 1.18 @@ -118,6 +118,7 @@ FMusic.FMUSIC_SetPaused(module, true); pause = 1; } + position = FMusic.FMUSIC_GetTime(module); // TODO: prbTrack.setValue try { Thread.sleep(50); Index: Settings.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/Settings.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Settings.java 25 Mar 2006 21:11:40 -0000 1.2 +++ Settings.java 25 Mar 2006 21:28:25 -0000 1.3 @@ -63,108 +63,69 @@ static int playlistDialogHeight; static { + Properties p = new Properties(); try { - Properties p = new Properties(); p.load(new FileInputStream(new File(System.getProperty("user.dir"), "config.ini"))); - language = getStringValue(p.get("Language"), "English"); - proxyHost = getStringValue(p.get("ProxyHost"), ""); - proxyPort = getIntValue(p.get("ProxyPort"), -1); - if(proxyPort < 0 || proxyPort > 65535) - proxyPort = -1; - splash = getBooleanValue(p.get("Splash"), true); - multiple = getBooleanValue(p.get("Multiple"), true); - update = getBooleanValue(p.get("Update"), true); - showInTaskbar = getBooleanValue(p.get("ShowInTaskbar"), true); - showInSysTray = getBooleanValue(p.get("ShowInSysTray"), false); - scrollTitle = getBooleanValue(p.get("ScrollTitle"), false); - docking = getBooleanValue(p.get("Docking"), true); - dockingd = getIntValue(p.get("DockingDistance"), 10); - if(dockingd < 0) - dockingd = 0; - else if(dockingd > 50) - dockingd = 50; - mixrate = getIntValue(p.get("MixRate"), 44100); - if(mixrate < 4000) - mixrate = 4000; - else if(mixrate > 65535) - mixrate = 65535; - maxchannels = getIntValue(p.get("MaxChannels"), 16); - if(maxchannels < 1) - maxchannels = 1; - else if(maxchannels > 1024) - maxchannels = 1024; - buffersize = getIntValue(p.get("BufferSize"), 400); - if(buffersize < 50) - buffersize = 50; - else if(buffersize > 5000) - buffersize = 5000; - - - int speakermode; // TODO - int mixertype; - String driver; - - - int x = (Toolkit.getDefaultToolkit().getScreenSize().width - 275) / - 2; - int y = (Toolkit.getDefaultToolkit().getScreenSize().height - 345) / - 2; - playDialogVisible = getBooleanValue(p.get("PlayDialogVisible"), - true); - playDialogX = getIntValue(p.get("PlayDialogX"), x); - playDialogY = getIntValue(p.get("PlayDialogY"), y); - equalizerDialogVisible = getBooleanValue(p.get( - "EqualizerDialogVisible"), true); - equalizerDialogX = getIntValue(p.get("EqualizerDialogX"), x); - equalizerDialogY = getIntValue(p.get("EqualizerDialogX"), y + 115); - playlistDialogVisible = getBooleanValue(p.get( - "PlaylistDialogVisible"), true); - playlistDialogX = getIntValue(p.get("PlaylistDialogX"), x); - playlistDialogY = getIntValue(p.get("PlaylistDialogY"), y + 230); - playlistDialogWidth = getIntValue(p.get("PlaylistDialogWidth"), - 275); - if(playlistDialogWidth < 275) - playlistDialogWidth = 275; - playlistDialogHeight = getIntValue(p.get("PlaylistDialogHeight"), - 115); - if(playlistDialogHeight < 115) - playlistDialogHeight = 115; - } catch(Exception e) { - e.printStackTrace(); - language = "English"; - proxyHost = ""; + } + language = getStringValue(p.get("Language"), "English"); + proxyHost = getStringValue(p.get("ProxyHost"), ""); + proxyPort = getIntValue(p.get("ProxyPort"), -1); + if(proxyPort < 0 || proxyPort > 65535) proxyPort = -1; - splash = true; - multiple = true; - update = true; - showInTaskbar = true; - showInSysTray = false; - scrollTitle = false; - docking = true; - dockingd = 10; - - int x = (Toolkit.getDefaultToolkit().getScreenSize().width - 275) / - 2; - int y = (Toolkit.getDefaultToolkit().getScreenSize().height - 345) / - 2; - - playDialogVisible = true; - playDialogX = x; - playDialogY = y; - - equalizerDialogVisible = true; - equalizerDialogX = x; - equalizerDialogY = y + 115; - - playlistDialogVisible = true; - playlistDialogX = x; - playlistDialogY = y + 230; + splash = getBooleanValue(p.get("Splash"), true); + multiple = getBooleanValue(p.get("Multiple"), true); + update = getBooleanValue(p.get("Update"), true); + showInTaskbar = getBooleanValue(p.get("ShowInTaskbar"), true); + showInSysTray = getBooleanValue(p.get("ShowInSysTray"), false); + scrollTitle = getBooleanValue(p.get("ScrollTitle"), false); + docking = getBooleanValue(p.get("Docking"), true); + dockingd = getIntValue(p.get("DockingDistance"), 10); + if(dockingd < 0) + dockingd = 0; + else if(dockingd > 50) + dockingd = 50; + mixrate = getIntValue(p.get("MixRate"), 44100); + if(mixrate < 4000) + mixrate = 4000; + else if(mixrate > 65535) + mixrate = 65535; + maxchannels = getIntValue(p.get("MaxChannels"), 16); + if(maxchannels < 1) + maxchannels = 1; + else if(maxchannels > 1024) + maxchannels = 1024; + buffersize = getIntValue(p.get("BufferSize"), 400); + if(buffersize < 50) + buffersize = 50; + else if(buffersize > 5000) + buffersize = 5000; + speakermode = getValueByString(p.get("SpeakerMode"), SPEAKER_MODES, + SPEAKER_MODES_VALS, FSound.FSOUND_SPEAKERMODE_STEREO); + mixertype = getValueByString(p.get("MixerType"), MIXER_TYPES, + MIXER_TYPES_VALS, FSound.FSOUND_MIXER_AUTODETECT); + driver = getStringValue(p.get("Driver"), ""); + int x = (Toolkit.getDefaultToolkit().getScreenSize().width - 275) / 2; + int y = (Toolkit.getDefaultToolkit().getScreenSize().height - 345) / 2; + playDialogVisible = getBooleanValue(p.get("PlayDialogVisible"), true); + playDialogX = getIntValue(p.get("PlayDialogX"), x); + playDialogY = getIntValue(p.get("PlayDialogY"), y); + equalizerDialogVisible = getBooleanValue(p.get( + "EqualizerDialogVisible"), true); + equalizerDialogX = getIntValue(p.get("EqualizerDialogX"), x); + equalizerDialogY = getIntValue(p.get("EqualizerDialogX"), y + 115); + playlistDialogVisible = getBooleanValue(p.get("PlaylistDialogVisible"), + true); + playlistDialogX = getIntValue(p.get("PlaylistDialogX"), x); + playlistDialogY = getIntValue(p.get("PlaylistDialogY"), y + 230); + playlistDialogWidth = getIntValue(p.get("PlaylistDialogWidth"), 275); + if(playlistDialogWidth < 275) playlistDialogWidth = 275; + playlistDialogHeight = getIntValue(p.get("PlaylistDialogHeight"), 115); + if(playlistDialogHeight < 115) playlistDialogHeight = 115; - } } private final static boolean getBooleanValue(Object o, boolean def) { @@ -206,11 +167,11 @@ return def; } - private final static int getValueByString(String key, String[] keys, + private final static int getValueByString(Object key, String[] keys, int[] values, int def) { try { for(int i = 0; i < keys.length; i++) - if(keys[i].equalsIgnoreCase(key)) + if(keys[i].equalsIgnoreCase(key.toString())) return values[i]; } catch(Exception e) { |