You can subscribe to this list here.
2006 |
Jan
|
Feb
(7) |
Mar
(28) |
Apr
(24) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: WiESi <wi...@us...> - 2006-03-26 15:14:39
|
Update of /cvsroot/javaamp/javaamp/unstable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24544/unstable Modified Files: JavaAmp.jar Log Message: Built on 2006-03-26 Index: JavaAmp.jar =================================================================== RCS file: /cvsroot/javaamp/javaamp/unstable/JavaAmp.jar,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 Binary files /tmp/cvsn86aqz and /tmp/cvswggUwh differ |
From: WiESi <wi...@us...> - 2006-03-26 15:13:16
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24057/src Modified Files: JavaAmp.java Added Files: JavaAmpSplash.java Log Message: Splash --- NEW FILE: JavaAmpSplash.java --- import java.awt.*; import java.awt.image.*; import java.util.*; public class JavaAmpSplash extends Frame { Image splash, offscreen; Graphics ofg; int i; boolean ip; Timer timer; public JavaAmpSplash() throws Exception { splash = getToolkit().getImage(getClass().getResource("jasplash.png")); MediaTracker mt = new MediaTracker(this); mt.addImage(splash, 0); setTitle("JavaAmp"); setSize(400, 150); setResizable(false); setUndecorated(true); setLocation((getToolkit().getScreenSize().width - getWidth()) / 2, (getToolkit().getScreenSize().height - getHeight()) / 2); offscreen = new BufferedImage(400, 150, BufferedImage.TYPE_INT_RGB); ofg = offscreen.getGraphics(); i = 0; ip = true; timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { if(ip) i++; else i--; if(i < 0) { i = 0; ip = true; } else if(i > 350) { i = 350; ip = false; } paint(getGraphics()); } }, 0, 5); mt.waitForAll(); } public void paint(Graphics g) { if(g == null || ofg == null) return; ofg.drawImage(splash, 0, 0, this); ofg.copyArea(7, 130, 36, 5, i, 8); ofg.setColor(Color.WHITE); ofg.fillRect(7, 129, 36, 7); g.drawImage(offscreen, 0, 0, this); } } Index: JavaAmp.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmp.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- JavaAmp.java 26 Mar 2006 11:18:05 -0000 1.16 +++ JavaAmp.java 26 Mar 2006 15:13:13 -0000 1.17 @@ -107,6 +107,14 @@ public final static void main(String[] args) { Toolkit.getDefaultToolkit().setDynamicLayout(false); System.setProperty("sun.awt.noerasebackground", "true"); + JavaAmpSplash jasplash = null; + if(Settings.splash) + try { + jasplash = new JavaAmpSplash(); + jasplash.setVisible(true); + } + catch(Exception e) { + } try { UIManager.setLookAndFeel( "com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); @@ -119,5 +127,10 @@ catch(Exception e) { error(e); } + if(jasplash != null) { + jasplash.setVisible(false); + jasplash.timer.cancel(); + jasplash = null; + } } } \ No newline at end of file |
From: WiESi <wi...@us...> - 2006-03-26 15:12:36
|
Update of /cvsroot/javaamp/javaamp/res In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23691/res Added Files: jasplash.png Log Message: --- NEW FILE: jasplash.png --- (This appears to be a binary file; contents omitted.) |
From: WiESi <wi...@us...> - 2006-03-26 11:18:09
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17475/src Modified Files: EqualizerDialog.java JavaAmp.java PlayDialog.java PlaylistDialog.java Settings.java Log Message: Settings update Index: PlayDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayDialog.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- PlayDialog.java 25 Mar 2006 10:35:19 -0000 1.14 +++ PlayDialog.java 26 Mar 2006 11:18:05 -0000 1.15 @@ -54,7 +54,6 @@ setUndecorated(true); setSize(275, 115); - setLocation(50, 50); dockedEqualizer = dockedEqualizer2 = true; dockedPlaylist = dockedPlaylist2 = false; Index: PlaylistDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlaylistDialog.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- PlaylistDialog.java 25 Mar 2006 10:35:19 -0000 1.24 +++ PlaylistDialog.java 26 Mar 2006 11:18:05 -0000 1.25 @@ -67,7 +67,6 @@ setUndecorated(true); setSize(275, 115); - setLocation(50, 280); addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { Index: JavaAmp.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmp.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- JavaAmp.java 25 Mar 2006 21:11:40 -0000 1.15 +++ JavaAmp.java 26 Mar 2006 11:18:05 -0000 1.16 @@ -42,7 +42,11 @@ GraphicsLoader.startLoading(this); FMOD.create(); - FSound.FSOUND_Init(44100, 16, 0); + FSound.FSOUND_SetMixer(Settings.mixertype); + FSound.FSOUND_SetBufferSize(Settings.buffersize); + FSound.FSOUND_SetSpeakerMode(Settings.speakermode); + FSound.FSOUND_SetDriver(Settings.getDriver()); + FSound.FSOUND_Init(Settings.mixrate, Settings.maxchannels, 0); FSound.FSOUND_DSP_SetActive(FSound.FSOUND_DSP_GetFFTUnit(), true); fchChooser = new JFileChooser(); @@ -60,20 +64,19 @@ equalizerDialog = new EqualizerDialog(this); playlistDialog = new PlaylistDialog(this); preferencesDialog = new PreferencesDialog(this); - Dimension si = getToolkit().getScreenSize(); - Insets in = getToolkit().getScreenInsets(getGraphicsConfiguration()); - int x = (si.width + in.left - in.right - 275) / 2; - int y = (si.height + in.top - in.bottom - 345) / 2; - playDialog.setLocation(x, y); - equalizerDialog.setLocation(x, y + 115); - playlistDialog.setLocation(x, y + 230); + playDialog.setLocation(Settings.playDialogX, Settings.playDialogY); + equalizerDialog.setLocation(Settings.equalizerDialogX, + Settings.equalizerDialogY); + playlistDialog.setBounds(Settings.playlistDialogX, + Settings.playlistDialogY, Settings.playlistDialogWidth, + Settings.playlistDialogHeight); if(!GraphicsLoader.finishLoading()) throw new Exception(Language.get("ERROR_LOADING_GRAPHICS")); - playDialog.setVisible(true); - equalizerDialog.setVisible(true); - playlistDialog.setVisible(true); + playDialog.setVisible(Settings.playDialogVisible); + equalizerDialog.setVisible(Settings.equalizerDialogVisible); + playlistDialog.setVisible(Settings.playlistDialogVisible); } public final static void error(Exception e) { Index: EqualizerDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/EqualizerDialog.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- EqualizerDialog.java 25 Mar 2006 10:35:19 -0000 1.16 +++ EqualizerDialog.java 26 Mar 2006 11:18:05 -0000 1.17 @@ -43,7 +43,6 @@ setUndecorated(true); setSize(275, 115); - setLocation(50, 165); dockedPlaylist = dockedPlaylist2 = true; addMouseListener(new MouseAdapter() { Index: Settings.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/Settings.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Settings.java 25 Mar 2006 21:28:25 -0000 1.3 +++ Settings.java 26 Mar 2006 11:18:05 -0000 1.4 @@ -115,7 +115,7 @@ equalizerDialogVisible = getBooleanValue(p.get( "EqualizerDialogVisible"), true); equalizerDialogX = getIntValue(p.get("EqualizerDialogX"), x); - equalizerDialogY = getIntValue(p.get("EqualizerDialogX"), y + 115); + equalizerDialogY = getIntValue(p.get("EqualizerDialogY"), y + 115); playlistDialogVisible = getBooleanValue(p.get("PlaylistDialogVisible"), true); playlistDialogX = getIntValue(p.get("PlaylistDialogX"), x); @@ -179,6 +179,13 @@ return def; } + public final static int getDriver() { + for(int i = 0; i < FSound.FSOUND_GetNumDrivers(); i++) + if(FSound.FSOUND_GetDriverName(i).equalsIgnoreCase(driver)) + return i; + return 0; + } + public final static void storeSettings() throws Exception { Properties p = new Properties(); p.put("Language", language); |
From: WiESi <wi...@us...> - 2006-03-25 21:29:30
|
Update of /cvsroot/javaamp/javaamp/unstable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26945/unstable Modified Files: JavaAmp.jar Log Message: Built on 2006-03-25 Index: JavaAmp.jar =================================================================== RCS file: /cvsroot/javaamp/javaamp/unstable/JavaAmp.jar,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 Binary files /tmp/cvsmoPrAm and /tmp/cvsDt7Vy2 differ |
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) { |
From: WiESi <wi...@us...> - 2006-03-25 21:11:49
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17256/src Modified Files: JavaAmp.java Settings.java Log Message: Changes in settings Index: JavaAmp.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmp.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- JavaAmp.java 25 Mar 2006 10:35:19 -0000 1.14 +++ JavaAmp.java 25 Mar 2006 21:11:40 -0000 1.15 @@ -32,7 +32,7 @@ }); try { - Language.loadLanguage(getClass(), "English"); + Language.loadLanguage(getClass(), Settings.language); } catch(Exception e) { String[] langs = Language.getAvailableLanguages(getClass()); Index: Settings.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/Settings.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Settings.java 25 Mar 2006 10:35:19 -0000 1.1 +++ Settings.java 25 Mar 2006 21:11:40 -0000 1.2 @@ -1,9 +1,34 @@ import java.awt.*; import java.io.*; import java.util.*; +import org.lwjgl.fmod3.*; public class Settings { + private final static String[] SPEAKER_MODES = new String[] { + "DOLBYDIGITAL", "HEADPHONES", "MONO", "QUAD", "STEREO", "SURROUND", + "DTS", "PROLOGIC2", "PROLOGIC2_INTERIOR" + }; + private final static int[] SPEAKER_MODES_VALS = new int[] { + FSound.FSOUND_SPEAKERMODE_DOLBYDIGITAL, + FSound.FSOUND_SPEAKERMODE_HEADPHONES, FSound.FSOUND_SPEAKERMODE_MONO, + FSound.FSOUND_SPEAKERMODE_QUAD, FSound.FSOUND_SPEAKERMODE_STEREO, + FSound.FSOUND_SPEAKERMODE_SURROUND, FSound.FSOUND_SPEAKERMODE_DTS, + FSound.FSOUND_SPEAKERMODE_PROLOGIC2, + FSound.FSOUND_SPEAKERMODE_PROLOGIC2_INTERIOR + }; + + private final static String[] MIXER_TYPES = new String[] { + "AUTODETECT", "QUALITY_AUTODETECT", "QUALITY_MMXP5", "QUALITY_MMXP6", + "MONO", "QUALITY_MONO", "MAX" + }; + private final static int[] MIXER_TYPES_VALS = new int[] { + FSound.FSOUND_MIXER_AUTODETECT, FSound.FSOUND_MIXER_QUALITY_AUTODETECT, + FSound.FSOUND_MIXER_QUALITY_MMXP5, FSound.FSOUND_MIXER_QUALITY_MMXP6, + FSound.FSOUND_MIXER_MONO, FSound.FSOUND_MIXER_QUALITY_MONO, + FSound.FSOUND_MIXER_MAX + }; + static String language; static String proxyHost; static int proxyPort; @@ -16,6 +41,13 @@ static boolean docking; static int dockingd; + static int mixrate; + static int maxchannels; + static int buffersize; + static int speakermode; + static int mixertype; + static String driver; + static boolean playDialogVisible; static int playDialogX; static int playDialogY; @@ -35,75 +67,73 @@ Properties p = new Properties(); p.load(new FileInputStream(new File(System.getProperty("user.dir"), "config.ini"))); - language = p.get("Language").toString(); - if(language == null) - language = "English"; - proxyHost = p.get("ProxyHost").toString(); - if(proxyHost == null) - proxyHost = ""; - String t = p.get("ProxyPort").toString(); - if(t == null) + language = getStringValue(p.get("Language"), "English"); + proxyHost = getStringValue(p.get("ProxyHost"), ""); + proxyPort = getIntValue(p.get("ProxyPort"), -1); + if(proxyPort < 0 || proxyPort > 65535) proxyPort = -1; - else - try { - proxyPort = Integer.parseInt(t); - if(proxyPort < 0 || proxyPort > 65535) - proxyPort = -1; - } - catch(Exception e) { - proxyPort = -1; - } - t = p.get("Splash").toString(); - if(t == null) - splash = true; - else - splash = Boolean.valueOf(t); - t = p.get("Multiple").toString(); - if(t == null) - multiple = true; - else - multiple = Boolean.valueOf(t); - t = p.get("Update").toString(); - if(t == null) - update = true; - else - update = Boolean.valueOf(t); - t = p.get("ShowInTaskbar").toString(); - if(t == null) - showInTaskbar = true; - else - showInTaskbar = Boolean.valueOf(t); - t = p.get("ShowInSysTray").toString(); - if(t == null) - showInSysTray = false; - else - showInSysTray = Boolean.valueOf(t); - t = p.get("ScrollTitle").toString(); - if(t == null) - scrollTitle = false; - else - scrollTitle = Boolean.valueOf(t); - t = p.get("Docking").toString(); - if(t == null) - docking = true; - else - docking = Boolean.valueOf(t); - t = p.get("DockingDistance").toString(); - if(t == null) - dockingd = 10; - else - try { - dockingd = Integer.parseInt(t); - if(dockingd < 0) - dockingd = 0; - else if(dockingd > 50) - dockingd = 50; - } - catch(Exception e) { - dockingd = 10; - } + 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 = ""; proxyPort = -1; @@ -137,9 +167,60 @@ } } + private final static boolean getBooleanValue(Object o, boolean def) { + try { + return Boolean.valueOf(o.toString()); + } + catch(Exception e) { + } + return def; + } + + private final static int getIntValue(Object o, int def) { + try { + return Integer.parseInt(o.toString()); + } + catch(Exception e) { + } + return def; + } + + private final static String getStringValue(Object o, String def) { + try { + return o.toString(); + } + catch(Exception e) { + } + return def; + } + + private final static String getStringByValue(int value, String[] keys, + int[] values, String def) { + try { + for(int i = 0; i < keys.length; i++) + if(values[i] == value) + return keys[i]; + } + catch(Exception e) { + } + return def; + } + + private final static int getValueByString(String key, String[] keys, + int[] values, int def) { + try { + for(int i = 0; i < keys.length; i++) + if(keys[i].equalsIgnoreCase(key)) + return values[i]; + } + catch(Exception e) { + } + return def; + } + public final static void storeSettings() throws Exception { Properties p = new Properties(); - p.put("Lanuage", language); + p.put("Language", language); p.put("ProxyHost", proxyHost); p.put("ProxyPort", "" + proxyPort); p.put("Splash", Boolean.toString(splash)); @@ -150,6 +231,26 @@ p.put("ScrollTitle", Boolean.toString(scrollTitle)); p.put("Docking", Boolean.toString(docking)); p.put("DockingDistance", "" + dockingd); + p.put("MixRate", "" + mixrate); + p.put("MaxChannels", "" + maxchannels); + p.put("BufferSize", "" + buffersize); + p.put("SpeakerMode", getStringByValue(speakermode, SPEAKER_MODES, + SPEAKER_MODES_VALS, "STEREO")); + p.put("MixerType", getStringByValue(mixertype, MIXER_TYPES, + MIXER_TYPES_VALS, "AUTODETECT")); + p.put("Driver", driver); + p.put("PlayDialogVisible", Boolean.toString(playDialogVisible)); + p.put("PlayDialogX", "" + playDialogX); + p.put("PlayDialogY", "" + playDialogY); + p.put("EqualizerDialogVisible", Boolean.toString( + equalizerDialogVisible)); + p.put("EqualizerDialogX", "" + equalizerDialogX); + p.put("EqualizerDialogY", "" + equalizerDialogY); + p.put("PlaylistDialogVisible", Boolean.toString(playlistDialogVisible)); + p.put("PlaylistDialogX", "" + playlistDialogX); + p.put("PlaylistDialogY", "" + playlistDialogY); + p.put("PlaylistDialogWidth", "" + playlistDialogWidth); + p.put("PlaylistDialogHeight", "" + playlistDialogHeight); p.store(new FileOutputStream(new File(System.getProperty("user.dir"), "config.ini")), null); } |
From: WiESi <wi...@us...> - 2006-03-25 21:11:05
|
Update of /cvsroot/javaamp/javaamp/res In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16792/res Added Files: fmod.png lwjgl.png opengl.png Log Message: --- NEW FILE: lwjgl.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: opengl.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: fmod.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13275/src Modified Files: EqualizerDialog.java GraphicsLoader.java JavaAmp.java PlayDialog.java PlaylistDialog.java PreferencesDialog.java Added Files: Settings.java Log Message: Settings Index: EqualizerDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/EqualizerDialog.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- EqualizerDialog.java 19 Mar 2006 10:17:39 -0000 1.15 +++ EqualizerDialog.java 25 Mar 2006 10:35:19 -0000 1.16 @@ -101,27 +101,27 @@ return; ow += e.getX() - mx; oh += e.getY() - my; - if(owner.docking) { + if(Settings.docking) { Point p = new Point(ow, oh); - Docker.dockScreen(owner.dockingd, p, new Rectangle(ow, oh, + Docker.dockScreen(Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), getToolkit().getScreenInsets( getGraphicsConfiguration())); ow = p.x; oh = p.y; owner.playDialog.dockedEqualizer = Docker.dock( - owner.dockingd, p, new Rectangle(ow, oh, getWidth(), + Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), owner.playDialog.getBounds()); ow = p.x; oh = p.y; if(owner.playlistDialog.isVisible()) { - dockedPlaylist = Docker.dock(owner.dockingd, p, + dockedPlaylist = Docker.dock(Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), owner.playlistDialog.getBounds()); ow = p.x; oh = p.y; } else - dockedPlaylist = Docker.isDocked(owner.dockingd, p, + dockedPlaylist = Docker.isDocked(Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), owner.playlistDialog.getBounds()); } --- NEW FILE: Settings.java --- import java.awt.*; import java.io.*; import java.util.*; public class Settings { static String language; static String proxyHost; static int proxyPort; static boolean splash; static boolean multiple; static boolean update; static boolean showInTaskbar; static boolean showInSysTray; static boolean scrollTitle; static boolean docking; static int dockingd; static boolean playDialogVisible; static int playDialogX; static int playDialogY; static boolean equalizerDialogVisible; static int equalizerDialogX; static int equalizerDialogY; static boolean playlistDialogVisible; static int playlistDialogX; static int playlistDialogY; static int playlistDialogWidth; static int playlistDialogHeight; static { try { Properties p = new Properties(); p.load(new FileInputStream(new File(System.getProperty("user.dir"), "config.ini"))); language = p.get("Language").toString(); if(language == null) language = "English"; proxyHost = p.get("ProxyHost").toString(); if(proxyHost == null) proxyHost = ""; String t = p.get("ProxyPort").toString(); if(t == null) proxyPort = -1; else try { proxyPort = Integer.parseInt(t); if(proxyPort < 0 || proxyPort > 65535) proxyPort = -1; } catch(Exception e) { proxyPort = -1; } t = p.get("Splash").toString(); if(t == null) splash = true; else splash = Boolean.valueOf(t); t = p.get("Multiple").toString(); if(t == null) multiple = true; else multiple = Boolean.valueOf(t); t = p.get("Update").toString(); if(t == null) update = true; else update = Boolean.valueOf(t); t = p.get("ShowInTaskbar").toString(); if(t == null) showInTaskbar = true; else showInTaskbar = Boolean.valueOf(t); t = p.get("ShowInSysTray").toString(); if(t == null) showInSysTray = false; else showInSysTray = Boolean.valueOf(t); t = p.get("ScrollTitle").toString(); if(t == null) scrollTitle = false; else scrollTitle = Boolean.valueOf(t); t = p.get("Docking").toString(); if(t == null) docking = true; else docking = Boolean.valueOf(t); t = p.get("DockingDistance").toString(); if(t == null) dockingd = 10; else try { dockingd = Integer.parseInt(t); if(dockingd < 0) dockingd = 0; else if(dockingd > 50) dockingd = 50; } catch(Exception e) { dockingd = 10; } } catch(Exception e) { language = "English"; proxyHost = ""; 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; playlistDialogWidth = 275; playlistDialogHeight = 115; } } public final static void storeSettings() throws Exception { Properties p = new Properties(); p.put("Lanuage", language); p.put("ProxyHost", proxyHost); p.put("ProxyPort", "" + proxyPort); p.put("Splash", Boolean.toString(splash)); p.put("Multiple", Boolean.toString(multiple)); p.put("Update", Boolean.toString(update)); p.put("ShowInTaskbar", Boolean.toString(showInTaskbar)); p.put("ShowInSysTray", Boolean.toString(showInSysTray)); p.put("ScrollTitle", Boolean.toString(scrollTitle)); p.put("Docking", Boolean.toString(docking)); p.put("DockingDistance", "" + dockingd); p.store(new FileOutputStream(new File(System.getProperty("user.dir"), "config.ini")), null); } } Index: PreferencesDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PreferencesDialog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- PreferencesDialog.java 25 Mar 2006 06:51:45 -0000 1.3 +++ PreferencesDialog.java 25 Mar 2006 10:35:19 -0000 1.4 @@ -22,6 +22,9 @@ DefaultMutableTreeNode mtnVisualization; JPanel panJavaAmp; + JLabel lblLwjgl; + JLabel lblFmod; + JLabel lblOpenGl; JPanel panGenPref; JLabel lblLanguage; JComboBox cmbLanguage; @@ -125,6 +128,45 @@ panJavaAmp.setBorder(BorderFactory.createTitledBorder( "JavaAmp")); panJavaAmp.setBounds(170, 10, 395, 400); + lblLwjgl = new JLabel() { + public void paint(Graphics g) { + g.drawImage(GraphicsLoader.jaa2, 0, 0, lblLwjgl); + } + }; + lblLwjgl.setToolTipText("LWJGL: http://www.lwjgl.org/"); + lblLwjgl.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + Sys.openURL("http://www.lwjgl.org"); + } + }); + lblLwjgl.setBounds(15, 15, 88, 31); + panJavaAmp.add(lblLwjgl); + lblFmod = new JLabel() { + public void paint(Graphics g) { + g.drawImage(GraphicsLoader.jaa3, 0, 0, lblFmod); + } + }; + lblFmod.setToolTipText("FMOD: http://www.fmod.org/"); + lblFmod.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + Sys.openURL("http://www.fmod.org/"); + } + }); + lblFmod.setBounds(15, 50, 88, 31); + panJavaAmp.add(lblFmod); + lblOpenGl = new JLabel() { + public void paint(Graphics g) { + g.drawImage(GraphicsLoader.jaa4, 0, 0, lblOpenGl); + } + }; + lblOpenGl.setToolTipText("OpenGL: http://www.opengl.org/"); + lblOpenGl.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + Sys.openURL("http://www.opengl.org/"); + } + }); + lblOpenGl.setBounds(15, 85, 88, 39); + panJavaAmp.add(lblOpenGl); panGenPref = new JPanel(null); panGenPref.setBorder(BorderFactory.createTitledBorder( Index: JavaAmp.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmp.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- JavaAmp.java 25 Mar 2006 06:51:45 -0000 1.13 +++ JavaAmp.java 25 Mar 2006 10:35:19 -0000 1.14 @@ -15,14 +15,22 @@ VisualizationBridge vb; - boolean docking; - int dockingd; - JFileChooser fchChooser; JOptionPane oppMessages; Random random; public JavaAmp() throws Exception { + Runtime.getRuntime().addShutdownHook(new Thread() { + public void run() { + try { + Settings.storeSettings(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + }); + try { Language.loadLanguage(getClass(), "English"); } @@ -41,9 +49,6 @@ oppMessages = new JOptionPane(); random = new Random(); - docking = true; - dockingd = 10; - setTitle("JavaAmp"); setDefaultCloseOperation(EXIT_ON_CLOSE); setUndecorated(true); Index: PlaylistDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlaylistDialog.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- PlaylistDialog.java 19 Mar 2006 10:17:39 -0000 1.23 +++ PlaylistDialog.java 25 Mar 2006 10:35:19 -0000 1.24 @@ -137,20 +137,20 @@ else if(ct == 2) { ow += e.getX() - mx; oh += e.getY() - my; - if(owner.docking) { + if(Settings.docking) { Point p = new Point(ow, oh); - Docker.dockScreen(owner.dockingd, p, new Rectangle(ow, + Docker.dockScreen(Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), getToolkit().getScreenInsets( getGraphicsConfiguration())); owner.playDialog.dockedPlaylist = Docker.dock( - owner.dockingd, p, new Rectangle(ow, oh, getWidth(), + Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), owner.playDialog.getBounds()); ow = p.x; oh = p.y; if(owner.equalizerDialog.isVisible()) { owner.equalizerDialog.dockedPlaylist = Docker.dock( - owner.dockingd, p, new Rectangle(ow, oh, + Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), owner.equalizerDialog.getBounds()); ow = p.x; @@ -158,7 +158,7 @@ } else owner.equalizerDialog.dockedPlaylist = - Docker.isDocked(owner.dockingd, p, + Docker.isDocked(Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), owner.equalizerDialog.getBounds()); } Index: PlayDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayDialog.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- PlayDialog.java 19 Mar 2006 10:17:39 -0000 1.13 +++ PlayDialog.java 25 Mar 2006 10:35:19 -0000 1.14 @@ -124,17 +124,17 @@ return; ow += e.getX() - mx; oh += e.getY() - my; - if(owner.docking) { + if(Settings.docking) { Point p = new Point(ow, oh); - Docker.dockScreen(owner.dockingd, p, new Rectangle(ow, oh, + Docker.dockScreen(Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), getToolkit().getScreenInsets( getGraphicsConfiguration())); if(!dockedPlaylist2 && owner.playlistDialog.isVisible()) - dockedPlaylist = Docker.dock(owner.dockingd, p, new + dockedPlaylist = Docker.dock(Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), owner.playlistDialog.getBounds()); if(!dockedEqualizer2 && owner.equalizerDialog.isVisible()) - dockedEqualizer = Docker.dock(owner.dockingd, p, new + dockedEqualizer = Docker.dock(Settings.dockingd, p, new Rectangle(ow, oh, getWidth(), getHeight()), owner.equalizerDialog.getBounds()); ow = p.x; @@ -144,7 +144,7 @@ owner.equalizerDialog.dockedPlaylist2)) && owner.playlistDialog.isVisible()) { Point p = new Point(ow + ow2, oh + oh2); - Docker.dockScreen(owner.dockingd, p, new Rectangle(ow + ow2, + Docker.dockScreen(Settings.dockingd, p, new Rectangle(ow + ow2, oh + oh2, owner.playlistDialog.getWidth(), owner.playlistDialog.getHeight()), getToolkit().getScreenInsets( @@ -156,7 +156,7 @@ owner.equalizerDialog.dockedPlaylist2)) && owner.equalizerDialog.isVisible()) { Point p = new Point(ow + ow3, oh + oh3); - Docker.dockScreen(owner.dockingd, p, new Rectangle(ow + ow3, + Docker.dockScreen(Settings.dockingd, p, new Rectangle(ow + ow3, oh + oh3, owner.equalizerDialog.getWidth(), owner.equalizerDialog.getHeight()), getToolkit().getScreenInsets( @@ -171,7 +171,7 @@ owner.playlistDialog.isVisible() && owner.equalizerDialog.isVisible()) { owner.equalizerDialog.dockedPlaylist = - Docker.dock(owner.dockingd, p, new Rectangle(ow + + Docker.dock(Settings.dockingd, p, new Rectangle(ow + ow2, oh + oh2, owner.playlistDialog.getWidth(), owner.playlistDialog.getHeight()), owner.equalizerDialog.getBounds()); @@ -187,7 +187,7 @@ owner.playlistDialog.isVisible() && owner.equalizerDialog.isVisible()) { owner.equalizerDialog.dockedPlaylist = - Docker.dock(owner.dockingd, p, new Rectangle(ow + + Docker.dock(Settings.dockingd, p, new Rectangle(ow + ow3, oh + oh3, owner.equalizerDialog.getWidth(), owner.equalizerDialog.getHeight()), owner.playlistDialog.getBounds()); Index: GraphicsLoader.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/GraphicsLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GraphicsLoader.java 19 Mar 2006 10:17:39 -0000 1.2 +++ GraphicsLoader.java 25 Mar 2006 10:35:19 -0000 1.3 @@ -7,7 +7,7 @@ private static int cid; // JavaAmp - static Image jaa1; + static Image jaa1, jaa2, jaa3, jaa4; // EqualizerDialog static Image eqd1, eqd2; @@ -24,6 +24,9 @@ // JavaAmp jaa1 = tk.getImage(cls.getResource("javaamp32.png")); + jaa2 = tk.getImage(cls.getResource("lwjgl.png")); + jaa3 = tk.getImage(cls.getResource("fmod.png")); + jaa4 = tk.getImage(cls.getResource("opengl.png")); // EqualizerDialog eqd1 = tk.getImage(cls.getResource("presets.png")); @@ -49,6 +52,9 @@ pd17 = tk.getImage(cls.getResource("javaamp3.png")); addImage(jaa1); + addImage(jaa2); + addImage(jaa3); + addImage(jaa4); addImage(eqd1); addImage(eqd2); |
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16107/src Modified Files: JavaAmp.java Language.java PreferencesDialog.java SimpleVisualization.java Visualization.java VisualizationBridge.java Log Message: Timer, other changes Index: Language.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/Language.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Language.java 19 Mar 2006 10:17:40 -0000 1.1 +++ Language.java 25 Mar 2006 06:51:45 -0000 1.2 @@ -3,19 +3,133 @@ public class Language { + static Properties english; static Properties lang; + static { + english = new Properties(); + english.put("ABOVE_SPLINE", "Requested point above spline region"); + english.put("ACTIVATE_EQUALIZER", "Activate equalizer"); + english.put("ADD", "Add"); + english.put("ADD_SHORT", "+"); + english.put("ADD_DIRECTORY", "Add directory to playlist"); + english.put("ADD_FILES", "Add files to playlist"); + english.put("ADD_URL", "Add URL"); + english.put("ALL", "All"); + english.put("ALL_FILES", "All files"); + english.put("ALLOW_MULTIPLE", "Allow multiple instances"); + english.put("APPEARANCE", "Appearance"); + english.put("BELOW_SPLINE", "Requested point below spline region"); + english.put("CANCEL", "Cancel"); + english.put("CHECK_NEW", "Check for new versions at startup"); + english.put("CLOSE", "Close"); + english.put("CENTER", "Center"); + english.put("DELETE", "Delete"); + english.put("DIRECTORY", "Directory"); + english.put("ENABLE_PROXY", "Enable proxy"); + english.put("ENTER_URL", "Enter URL:"); + english.put("EQF_FILES", "EQF files"); + english.put("ERROR_LOADING_GRAPHICS", "Error loading one or more graphics"); + english.put("EXIT", "Exit"); + english.put("FILE", "File"); + english.put("FILE_INFORMATIONS", "File informations"); + english.put("FILE_LENGTH", "File length"); + english.put("FILE_SIZE", "File size"); + english.put("FIND_LANGUAGES", "Find more languages"); + english.put("FMUSIC_ERROR", "FMusic error"); + english.put("FSOUND_ERROR", "FSound error"); + english.put("GENERAL", "General"); + english.put("GENERAL_PREFERENCES", "General preferences"); + english.put("GENERATE_HTML", "Generate HTML list"); + english.put("INTERNET_SETTINGS", "Internet connection settings"); + english.put("INVERT", "Invert"); + english.put("JAVAAMP_ERROR", "JavaAmp: Error"); + english.put("JAVAAMP_WARNING", "JavaAmp: Warning"); + english.put("KEY", "Key"); + english.put("LANGUAGE", "Language:"); + english.put("LAST_MODIFIED", "Last modified"); + english.put("LEFT", "left"); + english.put("LOAD", "Load"); + english.put("LOAD_EQF", "Load EQF"); + english.put("LOAD_FROM_EQF", "From EQF-file"); + english.put("LOAD_INFORMATIONS_EXACTLY", "Load informations (exactly)"); + english.put("LOAD_INFORMATIONS_UNEXACTLY", "Load informations (unexactly)"); + english.put("LOAD_PLAYLIST", "Load playlist"); + english.put("LOADING_INFORMATIONS", "Loading file informations..."); + english.put("MISCELLANEOUS", "Miscellaneous"); + english.put("MISCELLANEOUS_SHORT", "Msc"); + english.put("M3U_FILES", "M3U files"); + english.put("M3U_AND_PLS_FILES", "M3U and PLS files"); + english.put("NEXT", "Next"); + english.put("NOT_DELETED", "File cannot be deleted"); + english.put("NOT_ENOUGH_POINTS_BUILD", "Not enough points to build spline"); + english.put("NOT_ENOUGH_POINTS_COMPUTE", "Not enough points to compute value"); + english.put("NOT_SAME_NUMBER", "Not same number of x and f(x)"); + english.put("NOTHING", "Nothing"); + english.put("OFF", "Off"); + english.put("ON", "On"); + english.put("ONE_FILE", "One file"); + english.put("ONLY_FILES", "Only files can be deleted"); + english.put("OPEN", "Open"); + english.put("OPEN_FILES", "Open file(s)"); + english.put("PAN", "Balance"); + english.put("PAUSE", "Pause"); + english.put("PHYSICALLY", "Physically"); + english.put("PLAY", "Play"); + english.put("PLAYLIST", "Playlist"); + english.put("PLS_FILES", "PLS files"); + english.put("PLUGINS", "Plug-ins"); + english.put("POSITION", "Position"); + english.put("PREAMPLIFIER", "Preamplifier"); + english.put("PREFERENCES", "Preferences"); + english.put("PRESET", "Preset"); + english.put("PRESETS", "Presets"); + english.put("PREVIOUS", "Previous"); + english.put("PROTOCOL", "Protocol"); + english.put("PROXY_HOST", "Proxy Host:"); + english.put("PROXY_PORT", "Proxy Port:"); + english.put("REMOVE", "Remove"); + english.put("REMOVE_SHORT", "-"); + english.put("REPEAT", "Repeat"); + english.put("RIGHT", "right"); + english.put("SAVE", "Save"); + english.put("SAVE_PLAYLIST", "Save playlist"); + english.put("SAVE_EQF", "Save EQF"); + english.put("SAVE_TO_EQF", "To EQF file"); + english.put("SCROLL_TITLE", "Scroll title in the taskbar"); + english.put("SELECT", "Select"); + english.put("SELECT_SHORT", "Sel"); + english.put("SELECTION", "Selection"); + english.put("SHOW_EQUALIZER", "Show equalizer"); + english.put("SHOW_JAVAAMP_IN", "Show JavaAmp in:"); + english.put("SHOW_PLAYLIST", "Show playlist"); + english.put("SHOW_SPLASH", "Show splash screen"); + english.put("SHUFFLE", "Shuffle"); + english.put("START_VISUALIZATION", "Start visualization"); + english.put("STOP", "Stop"); + english.put("SYSTRAY", "System tray"); + english.put("TASKBAR", "Taskbar"); + english.put("TITLES", "Titles"); + english.put("TRACK_ID", "Track ID"); + english.put("UNDEFINED", "Undefined"); + english.put("UNKNOWN", "Unknown"); + english.put("UNKNOWN_ERROR", "Unknown error"); + english.put("UNKNOWN_FILE_EXCEPTION", "Unknown file exception"); + english.put("UNABLE_OPEN_HTML", "Unable to open HTML file"); + english.put("URL", "URL"); + english.put("VALUE", "Value"); + english.put("VISUALIZATION", "Visualization"); + english.put("VOLUME", "Volume"); + } + public final static void loadLanguage(Class cls, String language) throws Exception { Properties p = new Properties(); - try { - p.load(new FileInputStream(new File(System.getProperty("user.dir"), - "/language/languages.ini"))); - } - catch(Exception e) { - p.load(cls.getResourceAsStream("/language/languages.ini")); - } + p.load(new FileInputStream(new File(System.getProperty("user.dir"), + "/language/languages.ini"))); int j = 0, k = -1; + if(language.equals("English")) + j++; for(int i = 0; i < p.keySet().toArray().length; i++) { if(p.keySet().toArray()[i].toString().equals(language)) { j++; @@ -27,35 +141,35 @@ } if(j < 1) throw new Exception("Language not defined"); + if(language.equals("English")) { + lang = english; + return; + } String file = p.get(language).toString(); p = new Properties(); - try { - p.load(new FileInputStream(new File(System.getProperty("user.dir"), - "/language/" + file))); - } - catch(Exception e) { - p.load(cls.getResourceAsStream("/language/" + file)); - } + p.load(new FileInputStream(new File(System.getProperty("user.dir"), + "/language/" + file))); lang = p; } - public final static String[] getAvailableLanguages(Class cls) - throws Exception { + public final static String[] getAvailableLanguages(Class cls) { Properties p = new Properties(); try { p.load(new FileInputStream(new File(System.getProperty("user.dir"), "/language/languages.ini"))); } catch(Exception e) { - p.load(cls.getResourceAsStream("/language/languages.ini")); + return new String[] { "English" }; } - String[] s = new String[p.keySet().toArray().length]; + String[] s = new String[p.keySet().toArray().length + 1]; + s[0] = "English"; for(int i = 0; i < p.keySet().toArray().length; i++) - s[i] = p.keySet().toArray()[i].toString(); + s[i + 1] = p.keySet().toArray()[i].toString(); return s; } public final static String get(String key) { - return lang.get(key).toString(); + String val = lang.get(key).toString(); + return val != null ? val : english.get(key).toString(); } } \ No newline at end of file Index: VisualizationBridge.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/VisualizationBridge.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- VisualizationBridge.java 28 Feb 2006 13:21:20 -0000 1.5 +++ VisualizationBridge.java 25 Mar 2006 06:51:45 -0000 1.6 @@ -29,10 +29,20 @@ return; } Mouse.setGrabbed(true); - vis.init(owner.playDialog.splSpectrum.spec); + vis.init1(owner.playDialog.splSpectrum.spec); + vis.init(); + long time = System.nanoTime(); //if(fullscreen) { // TODO: Support for not fullscreen rendering while(!Display.isCloseRequested() && !Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { + if(System.nanoTime() >= time + vis.delay) { + long tn = System.nanoTime(); + if(tn >= time + vis.delay) { + vis.timer(); + time -= vis.delay; + } + time = tn; + } vis.render(); Display.update(); } Index: PreferencesDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PreferencesDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PreferencesDialog.java 22 Mar 2006 18:26:59 -0000 1.2 +++ PreferencesDialog.java 25 Mar 2006 06:51:45 -0000 1.3 @@ -133,7 +133,6 @@ lblLanguage = new JLabel(Language.get("LANGUAGE")); lblLanguage.setBounds(15, 15, lblLanguage.getFontMetrics( lblLanguage.getFont()).stringWidth(lblLanguage.getText()), 20); - panGenPref.add(lblLanguage); String[] langs = Language.getAvailableLanguages(owner.getClass()); Arrays.sort(langs); @@ -153,7 +152,6 @@ lblFindLanguages.setBounds(250, 15, lblFindLanguages.getFontMetrics( lblFindLanguages.getFont()).stringWidth(Language.get( "FIND_LANGUAGES")), 20); - panGenPref.add(lblFindLanguages); panInternet = new JPanel(null); panInternet.setBorder(BorderFactory.createTitledBorder( @@ -202,19 +200,23 @@ Language.get("GENERAL_PREFERENCES") + " - " + Language.get("PLAYLIST"))); panPlaylist.setBounds(170, 10, 395, 400); + panTitles = new JPanel(null); panTitles.setBorder(BorderFactory.createTitledBorder( Language.get("GENERAL_PREFERENCES") + " - " + Language.get("TITLES"))); panTitles.setBounds(170, 10, 395, 400); + panApperance = new JPanel(null); panApperance.setBorder(BorderFactory.createTitledBorder( Language.get("APPEARANCE"))); panApperance.setBounds(170, 10, 395, 400); + panPlugins = new JPanel(null); panPlugins.setBorder(BorderFactory.createTitledBorder( Language.get("PLUGINS"))); panPlugins.setBounds(170, 10, 395, 400); + panVisualization = new JPanel(null); panVisualization.setBorder(BorderFactory.createTitledBorder( Language.get("PLUGINS") + " - " + Index: JavaAmp.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmp.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- JavaAmp.java 19 Mar 2006 10:17:39 -0000 1.12 +++ JavaAmp.java 25 Mar 2006 06:51:45 -0000 1.13 @@ -24,7 +24,7 @@ public JavaAmp() throws Exception { try { - Language.loadLanguage(getClass(), "German"); + Language.loadLanguage(getClass(), "English"); } catch(Exception e) { String[] langs = Language.getAvailableLanguages(getClass()); @@ -97,7 +97,6 @@ } public final static void main(String[] args) { - Locale.setDefault(Locale.ENGLISH); Toolkit.getDefaultToolkit().setDynamicLayout(false); System.setProperty("sun.awt.noerasebackground", "true"); try { Index: Visualization.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/Visualization.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Visualization.java 26 Feb 2006 12:55:28 -0000 1.2 +++ Visualization.java 25 Mar 2006 06:51:45 -0000 1.3 @@ -1,8 +1,16 @@ import java.nio.*; -public interface Visualization { +public abstract class Visualization { - public void init(FloatBuffer spectrum); - public void render(); - public void stop(); + FloatBuffer spectrum; + long delay; + + protected final void init1(FloatBuffer spec) { + spectrum = spec; + } + + public void init() { } + public abstract void render(); + public void stop() { } + public void timer() { } } \ No newline at end of file Index: SimpleVisualization.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/SimpleVisualization.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SimpleVisualization.java 19 Mar 2006 10:17:39 -0000 1.5 +++ SimpleVisualization.java 25 Mar 2006 06:51:45 -0000 1.6 @@ -7,9 +7,8 @@ import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.opengl.glu.GLU.*; -public class SimpleVisualization implements Visualization { +public class SimpleVisualization extends Visualization { - FloatBuffer spectrum; Random rnd; Spline splinex, spliney, splinez; Vector<float[]> points; @@ -17,9 +16,7 @@ float[] sum; float camx, camy, camz, pi; - public void init(FloatBuffer spec) { - spectrum = spec; - + public void init() { rnd = new Random(); points = new Vector<float[]>(); old = new float[300][30]; @@ -27,6 +24,7 @@ camx = rnd.nextFloat() * 60f; camy = rnd.nextFloat() * 20; camz = rnd.nextFloat() * 30f - 10f; + delay = (long)10E6; glClearColor(0, 0, 0, 1); glColor3f(1, 1, 1); @@ -37,6 +35,48 @@ } public void render() { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glLoadIdentity(); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60, 800f / 600f, 0.1f, 1000f); + gluLookAt(camx, camy, camz, camx, 0, 200, 0, 1, 0); + glMatrixMode(GL_MODELVIEW); + + glPointSize(2); + glBegin(GL_POINTS); + for(int i = 0; i < points.size(); i++) { + float[] t = points.get(i); + glColor3f(t[3] / 100f, t[3] / 100f, t[3] / 100f); + glVertex3f(t[0], t[1], t[2]); + } + glEnd(); + + for(int i = 0; i < 20; i++) { + glColor3f((float)i / 19f, 0, 0); + glBegin(GL11.GL_LINE_LOOP); + for(int j = 0; j < 180; j++) + glVertex3f(30 + (float)Math.cos(Math.toRadians(j * 2)) * 35f, + (float)Math.sin(Math.toRadians(j * 2)) * 35f, 350f - + sum[i] * 40); + glEnd(); + } + + for(int i = 0; i < 300; i++) { + glColor3f(0, 0.5f + (float)i / 598, 0); + glBegin(GL_LINE_STRIP); + glVertex3f(-2, 0, i); + for(int j = 0; j < 30; j++) + glVertex3f(j * 2, old[i][j] * 20, i); + glVertex3f(60, 0, i); + glEnd(); + } + + glFinish(); + } + + public void timer() { for(int i = 1; i < 300; i++) System.arraycopy(old[i], 0, old[i - 1], 0, 30); for(int i = 0; i < 30; i++) @@ -105,45 +145,5 @@ camz = (float)splinez.spline_value(pi); } } - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glLoadIdentity(); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60, 800f / 600f, 0.1f, 1000f); - gluLookAt(camx, camy, camz, camx, 0, 200, 0, 1, 0); - glMatrixMode(GL_MODELVIEW); - - glPointSize(2); - glBegin(GL_POINTS); - for(int i = 0; i < points.size(); i++) { - float[] t = points.get(i); - glColor3f(t[3] / 100f, t[3] / 100f, t[3] / 100f); - glVertex3f(t[0], t[1], t[2]); - } - glEnd(); - - for(int i = 0; i < 20; i++) { - glColor3f((float)i / 19f, 0, 0); - glBegin(GL11.GL_LINE_LOOP); - for(int j = 0; j < 180; j++) - glVertex3f(30 + (float)Math.cos(Math.toRadians(j * 2)) * 35f, - (float)Math.sin(Math.toRadians(j * 2)) * 35f, 350f - - sum[i] * 40); - glEnd(); - } - - for(int i = 0; i < 300; i++) { - glColor3f(0, 0.5f + (float)i / 598, 0); - glBegin(GL_LINE_STRIP); - glVertex3f(-2, 0, i); - for(int j = 0; j < 30; j++) - glVertex3f(j * 2, old[i][j] * 20, i); - glVertex3f(60, 0, i); - glEnd(); - } - - glFinish(); } } \ No newline at end of file |
From: WiESi <wi...@us...> - 2006-03-22 18:27:19
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2835/src Modified Files: PlayQueue.java PreferencesDialog.java SpectrumLabel.java Log Message: Index: PreferencesDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PreferencesDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PreferencesDialog.java 19 Mar 2006 10:17:40 -0000 1.1 +++ PreferencesDialog.java 22 Mar 2006 18:26:59 -0000 1.2 @@ -57,6 +57,7 @@ setLocation((getToolkit().getScreenSize().width - getWidth()) / 2, (getToolkit().getScreenSize().height - getHeight()) / 2); setLayout(null); + setDefaultCloseOperation(HIDE_ON_CLOSE); DefaultMutableTreeNode root = new DefaultMutableTreeNode(); mtnJavaAmp = new DefaultMutableTreeNode("JavaAmp"); @@ -114,6 +115,11 @@ btnClose = new JButton(Language.get("CLOSE")); btnClose.setDefaultCapable(true); btnClose.setBounds(10, 385, 150, 25); + btnClose.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + setVisible(false); + } + }); panJavaAmp = new JPanel(null); panJavaAmp.setBorder(BorderFactory.createTitledBorder( @@ -154,7 +160,7 @@ Language.get("INTERNET_SETTINGS"))); panInternet.setBounds(10, 40, 375, 75); chbProxy = new JCheckBox(Language.get("ENABLE_PROXY")); - chbProxy.setBounds(15, 15, 90, 20); + chbProxy.setBounds(15, 15, 345, 20); panInternet.add(chbProxy); lblProxyHost = new JLabel(Language.get("PROXY_HOST")); lblProxyHost.setBounds(15, 40, 70, 20); @@ -170,27 +176,25 @@ panInternet.add(tfdPort); panGenPref.add(panInternet); chbSplash = new JCheckBox(Language.get("SHOW_SPLASH")); - chbSplash.setBounds(10, 120, 120, 20); + chbSplash.setBounds(10, 120, 370, 20); panGenPref.add(chbSplash); chbMultiple = new JCheckBox(Language.get("ALLOW_MULTIPLE")); - chbMultiple.setBounds(10, 140, chbMultiple.getFontMetrics( - chbMultiple.getFont()).stringWidth(chbMultiple.getText()) + 25, 20); - + chbMultiple.setBounds(10, 140, 370, 20); panGenPref.add(chbMultiple); chbUpdate = new JCheckBox(Language.get("CHECK_NEW")); - chbUpdate.setBounds(10, 160, 190, 20); + chbUpdate.setBounds(10, 160, 370, 20); panGenPref.add(chbUpdate); lblShowIn = new JLabel(Language.get("SHOW_JAVAAMP_IN")); - lblShowIn.setBounds(10, 180, 90, 20); + lblShowIn.setBounds(10, 180, 370, 20); panGenPref.add(lblShowIn); chbTaskbar = new JCheckBox(Language.get("TASKBAR")); - chbTaskbar.setBounds(30, 200, 60, 20); + chbTaskbar.setBounds(30, 200, 350, 20); panGenPref.add(chbTaskbar); chbSysTray = new JCheckBox(Language.get("SYSTRAY")); - chbSysTray.setBounds(30, 220, 80, 20); + chbSysTray.setBounds(30, 220, 350, 20); panGenPref.add(chbSysTray); chbScroll = new JCheckBox(Language.get("SCROLL_TITLE")); - chbScroll.setBounds(10, 240, 140, 20); + chbScroll.setBounds(10, 240, 370, 20); panGenPref.add(chbScroll); panPlaylist = new JPanel(null); Index: SpectrumLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/SpectrumLabel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SpectrumLabel.java 10 Mar 2006 14:29:09 -0000 1.5 +++ SpectrumLabel.java 22 Mar 2006 18:26:59 -0000 1.6 @@ -121,8 +121,7 @@ duration = "##:##"; else duration = JavaAmpToolkit.getDuration00( - FSound.FSOUND_Stream_GetTime(owner.playDialog.pq.stream) / - 1000); + owner.playDialog.pq.position / 1000); int xt = 46; for(int i = 0; i < duration.length(); i++) xt = drawNum(duration.charAt(i), xt, 5); Index: PlayQueue.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayQueue.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- PlayQueue.java 19 Mar 2006 10:17:39 -0000 1.16 +++ PlayQueue.java 22 Mar 2006 18:26:59 -0000 1.17 @@ -10,21 +10,19 @@ JavaAmp owner; int current; boolean running; + int streamlen; int position; int pause; // 0=aus, 1=pause, 2=->aus, 3=->pause boolean change; // false=nichts, true=wechseln boolean hidden; int c; - FSoundStream stream; - int streamlen; public PlayQueue(JavaAmp o) { owner = o; current = o.playlistDialog.lstPlaylist.getSelectedIndex(); running = true; pause = 0; - position = 0; change = false; hidden = false; } @@ -176,10 +174,10 @@ FSound.FSOUND_SetPaused(c, true); pause = 1; } + position = FSound.FSOUND_Stream_GetTime(stream); if(owner.playDialog.prbTrack.getString().equals("0")) owner.playDialog.prbTrack.setValue((int)((double) - FSound.FSOUND_Stream_GetTime(stream) / - (double)streamlen * 255d)); + position / (double)streamlen * 255d)); try { Thread.sleep(50); } |
From: WiESi <wi...@us...> - 2006-03-19 11:34:13
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26359/src Modified Files: EQLabel.java Log Message: Changed equalizer appearance Index: EQLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/EQLabel.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- EQLabel.java 10 Mar 2006 14:29:09 -0000 1.9 +++ EQLabel.java 19 Mar 2006 11:34:07 -0000 1.10 @@ -39,18 +39,27 @@ public void paint(Graphics g) { offg.setColor(Color.WHITE); offg.fillRect(0, 0, 239, 66); + for(int i = 0; i < 10; i++) { int _r = 255 - owner.equalizerDialog.eqvals[i] * 127 / 63; int _g = 128 + owner.equalizerDialog.eqvals[i] * 127 / 63; for(int j = 0; j <= 11; j++) { int _r2 = _r + (int)(Math.pow(j - 11, 2) * (255 - _r) / 121); int _g2 = _g + (int)(Math.pow(j - 11, 2) * (255 - _g) / 121); - offg.setColor(new Color(_r2, _g2, 255 - j * 255 / 11)); - offg.fillRect(i * 24 + j + 1, 0, (11 - j) * 2 - 1, 66); + int _b2 = 255 - j * 255 / 11; + for(int k = 0; k <= 33; k++) { + offg.setColor(new Color(_r2 * (k + 33) / 66, _g2 * + (k + 33) / 66, _b2 * (k + 33) / 66)); + offg.fillRect(i * 24 + j + 1, 32 - k, 1, 1); + offg.fillRect(i * 24 + j + 1, 32 + k, 1, 1); + offg.fillRect(i * 24 - j + 21, 32 - k, 1, 1); + offg.fillRect(i * 24 - j + 21, 32 + k, 1, 1); + } } offg.setColor(Color.LIGHT_GRAY); offg.drawLine(i * 24 - 1, 0, i * 24 - 1, 65); } + offg.setColor(Color.LIGHT_GRAY); offg.fillRect(0, 63 - owner.equalizerDialog.sliPre.getValue(), 239, 3); offg.setColor(Color.BLACK); |
From: WiESi <wi...@us...> - 2006-03-19 10:19:55
|
Update of /cvsroot/javaamp/javaamp/language In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27793/language Added Files: english.ini german.ini languages.ini Log Message: --- NEW FILE: languages.ini --- English=english.ini German=german.ini --- NEW FILE: german.ini --- Language=German Author=Andreas Wiesbauer E-Mail=wi...@us... Target=0.0.4 ABOVE_SPLINE=Gefragter Punkt über Spline-Bereich ACTIVATE_EQUALIZER=Equalizer aktivieren ADD=Hinzufügen ADD_SHORT=+ ADD_DIRECTORY=Verzeichnis hinzufügen ADD_FILES=Dateien hinzufügen ADD_URL=URL hinzufügen ALL=Alle ALL_FILES=Alle Dateien ALLOW_MULTIPLE=Erlaube mehrere Instanzen APPEARANCE=Erscheinung BELOW_SPLINE=Gefragter Punkt unter Spline-Bereich CANCEL=Abbrechen CHECK_NEW=Nach neuen Versionen suchen CLOSE=Schließen CENTER=Mitte DELETE=Löschen DIRECTORY=Verzeichnis ENABLE_PROXY=Proxy aktivieren ENTER_URL=URL eingeben: EQF_FILES=EQF Dateien ERROR_LOADING_GRAPHICS=Fehler beim Laden einer oder mehrerer Grafiken EXIT=Beenden FILE=Datei FILE_INFORMATIONS=Dateieinformationen FILE_LENGTH=Dateilänge FILE_SIZE=Dateigröße FIND_LANGUAGES=Mehr Sprachen suchen FMUSIC_ERROR=FMusic Fehler FSOUND_ERROR=FSound Fehler GENERAL=Allgemein GENERAL_PREFERENCES=Allgemeine Einstellungen GENERATE_HTML=HTML Liste erstellen INTERNET_SETTINGS=Interneteinstellungen INVERT=Invertieren JAVAAMP_ERROR=JavaAmp: Fehler JAVAAMP_WARNING=JavaAmp: Warnung KEY=Schlüssel LANGUAGE=Sprache: LAST_MODIFIED=Zuletzt geändert LEFT=links LOAD=Laden LOAD_EQF=EQF laden LOAD_FROM_EQF=Von EQF Datei LOAD_INFORMATIONS_EXACTLY=Lade Informatioen (genau) LOAD_INFORMATIONS_UNEXACTLY=Lade Informationen (ungenau) LOAD_PLAYLIST=Lade Playlist LOADING_INFORMATIONS=Lade Dateiinformationen... MISCELLANEOUS=Sonstiges MISCELLANEOUS_SHORT=Son M3U_FILES=M3U Dateien M3U_AND_PLS_FILES=M3U und PLS Dateien NEXT=Weiter NOT_DELETED=Datei kann nicht gelöscht werden NOT_ENOUGH_POINTS_BUILD=Nicht genügend Punkte zum Spline erstellen NOT_ENOUGH_POINTS_COMPUTE=Nicht genügend Daten um Wert zu berechnen NOT_SAME_NUMBER=Zahl von x und f(x) unterschiedlich NOTHING=Nichts OFF=Aus ON=An ONE_FILE=Eine Datei ONLY_FILES=Nur Dateien können gelöscht werden OPEN=Öffnen OPEN_FILES=Datei(en) öffnen PAN=Balance PAUSE=Pause PHYSICALLY=Physikalisch PLAY=Abspielen PLAYLIST=Playlist PLS_FILES=PLS Dateien PLUGINS=Plug-ins POSITION=Position PREAMPLIFIER=Vorverstärker PREFERENCES=Einstellungen PRESET=Preset PRESETS=Presets PREVIOUS=Vor PROTOCOL=Protokoll PROXY_HOST=Proxy Host: PROXY_PORT=Proxy Port: REMOVE=Entfernen REMOVE_SHORT=- REPEAT=Wiederholen RIGHT=rechts SAVE=Speichern SAVE_PLAYLIST=Playlist speichern SAVE_EQF=EQF speichern SAVE_TO_EQF=Als EQF Datei SCROLL_TITLE=Titel in der Taskbar scrollen SELECT=Auswählen SELECT_SHORT=Sel SELECTION=Auswahl SHOW_EQUALIZER=Equalizer anzeigen SHOW_JAVAAMP_IN=JavaAmp zeigen in: SHOW_PLAYLIST=Playlist anzeigen SHOW_SPLASH=Splash Screen zeigen SHUFFLE=Shuffle START_VISUALIZATION=Visualisierung starten STOP=Stop SYSTRAY=System Tray TASKBAR=Taskbar TITLES=Titel TRACK_ID=Track ID UNDEFINED=Undefiniert UNKNOWN=Unbekannt UNKNOWN_ERROR=Unbekannter Fehler UNKNOWN_FILE_EXCEPTION=Unbekannter Dateifehler UNABLE_OPEN_HTML=Kann HTML Datei nicht öffnen URL=URL VALUE=Wert VISUALIZATION=Visualisierung VOLUME=Lautstärke --- NEW FILE: english.ini --- Language=English Author=Andreas Wiesbauer E-Mail=wi...@us... Target=0.0.4 ABOVE_SPLINE=Requested point above spline region ACTIVATE_EQUALIZER=Activate equalizer ADD=Add ADD_SHORT=+ ADD_DIRECTORY=Add directory to playlist ADD_FILES=Add files to playlist ADD_URL=Add URL ALL=All ALL_FILES=All files ALLOW_MULTIPLE=Allow multiple instances APPEARANCE=Appearance BELOW_SPLINE=Requested point below spline region CANCEL=Cancel CHECK_NEW=Check for new versions at startup CLOSE=Close CENTER=Center DELETE=Delete DIRECTORY=Directory ENABLE_PROXY=Enable proxy ENTER_URL=Enter URL: EQF_FILES=EQF files ERROR_LOADING_GRAPHICS=Error loading one or more graphics EXIT=Exit FILE=File FILE_INFORMATIONS=File informations FILE_LENGTH=File length FILE_SIZE=File size FIND_LANGUAGES=Find more languages FMUSIC_ERROR=FMusic error FSOUND_ERROR=FSound error GENERAL=General GENERAL_PREFERENCES=General preferences GENERATE_HTML=Generate HTML list INTERNET_SETTINGS=Internet connection settings INVERT=Invert JAVAAMP_ERROR=JavaAmp: Error JAVAAMP_WARNING=JavaAmp: Warning KEY=Key LANGUAGE=Language: LAST_MODIFIED=Last modified LEFT=left LOAD=Load LOAD_EQF=Load EQF LOAD_FROM_EQF=From EQF-file LOAD_INFORMATIONS_EXACTLY=Load informations (exactly) LOAD_INFORMATIONS_UNEXACTLY=Load informations (unexactly) LOAD_PLAYLIST=Load playlist LOADING_INFORMATIONS=Loading file informations... MISCELLANEOUS=Miscellaneous MISCELLANEOUS_SHORT=Msc M3U_FILES=M3U files M3U_AND_PLS_FILES=M3U and PLS files NEXT=Next NOT_DELETED=File cannot be deleted NOT_ENOUGH_POINTS_BUILD=Not enough points to build spline NOT_ENOUGH_POINTS_COMPUTE=Not enough points to compute value NOT_SAME_NUMBER=Not same number of x and f(x) NOTHING=Nothing OFF=Off ON=On ONE_FILE=One file ONLY_FILES=Only files can be deleted OPEN=Open OPEN_FILES=Open file(s) PAN=Balance PAUSE=Pause PHYSICALLY=Physically PLAY=Play PLAYLIST=Playlist PLS_FILES=PLS files PLUGINS=Plug-ins POSITION=Position PREAMPLIFIER=Preamplifier PREFERENCES=Preferences PRESET=Preset PRESETS=Presets PREVIOUS=Previous PROTOCOL=Protocol PROXY_HOST=Proxy Host: PROXY_PORT=Proxy Port: REMOVE=Remove REMOVE_SHORT=- REPEAT=Repeat RIGHT=right SAVE=Save SAVE_PLAYLIST=Save playlist SAVE_EQF=Save EQF SAVE_TO_EQF=To EQF file SCROLL_TITLE=Scroll title in the taskbar SELECT=Select SELECT_SHORT=Sel SELECTION=Selection SHOW_EQUALIZER=Show equalizer SHOW_JAVAAMP_IN=Show JavaAmp in: SHOW_PLAYLIST=Show playlist SHOW_SPLASH=Show splash screen SHUFFLE=Shuffle START_VISUALIZATION=Start visualization STOP=Stop SYSTRAY=System tray TASKBAR=Taskbar TITLES=Titles TRACK_ID=Track ID UNDEFINED=Undefined UNKNOWN=Unknown UNKNOWN_ERROR=Unknown error UNKNOWN_FILE_EXCEPTION=Unknown file exception UNABLE_OPEN_HTML=Unable to open HTML file URL=URL VALUE=Value VISUALIZATION=Visualization VOLUME=Volume |
From: WiESi <wi...@us...> - 2006-03-19 10:19:24
|
Update of /cvsroot/javaamp/javaamp/language In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27709/language Log Message: Directory /cvsroot/javaamp/javaamp/language added to the repository |
From: WiESi <wi...@us...> - 2006-03-19 10:18:49
|
Update of /cvsroot/javaamp/javaamp/unstable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27390/unstable Modified Files: JavaAmp.jar Log Message: Built on 2006-03-19 Index: JavaAmp.jar =================================================================== RCS file: /cvsroot/javaamp/javaamp/unstable/JavaAmp.jar,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 Binary files /tmp/cvsAFsuF7 and /tmp/cvs3GJQmi differ |
From: WiESi <wi...@us...> - 2006-03-19 10:17:44
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26976/src Modified Files: EqualizerDialog.java FileInformationDialog.java GetFileInfoThread.java GraphicsLoader.java JavaAmp.java LoadInfoDialog.java PlayDialog.java PlayQueue.java PlaylistDialog.java SimpleVisualization.java Spline.java Added Files: ID3v2Tags.java Language.java PreferencesDialog.java Log Message: Many changes --- NEW FILE: Language.java --- import java.io.*; import java.util.*; public class Language { static Properties lang; public final static void loadLanguage(Class cls, String language) throws Exception { Properties p = new Properties(); try { p.load(new FileInputStream(new File(System.getProperty("user.dir"), "/language/languages.ini"))); } catch(Exception e) { p.load(cls.getResourceAsStream("/language/languages.ini")); } int j = 0, k = -1; for(int i = 0; i < p.keySet().toArray().length; i++) { if(p.keySet().toArray()[i].toString().equals(language)) { j++; k = i; if(j > 1) throw new Exception( "Language definition twice ore more not allowed"); } } if(j < 1) throw new Exception("Language not defined"); String file = p.get(language).toString(); p = new Properties(); try { p.load(new FileInputStream(new File(System.getProperty("user.dir"), "/language/" + file))); } catch(Exception e) { p.load(cls.getResourceAsStream("/language/" + file)); } lang = p; } public final static String[] getAvailableLanguages(Class cls) throws Exception { Properties p = new Properties(); try { p.load(new FileInputStream(new File(System.getProperty("user.dir"), "/language/languages.ini"))); } catch(Exception e) { p.load(cls.getResourceAsStream("/language/languages.ini")); } String[] s = new String[p.keySet().toArray().length]; for(int i = 0; i < p.keySet().toArray().length; i++) s[i] = p.keySet().toArray()[i].toString(); return s; } public final static String get(String key) { return lang.get(key).toString(); } } Index: EqualizerDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/EqualizerDialog.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- EqualizerDialog.java 10 Mar 2006 14:29:09 -0000 1.14 +++ EqualizerDialog.java 19 Mar 2006 10:17:39 -0000 1.15 @@ -141,7 +141,7 @@ bebBorder = new BevelBorder(BevelBorder.RAISED); tobOn = new JToggleButton(new ImageIcon(GraphicsLoader.eqd2)); - tobOn.setToolTipText("Activate equalizer"); + tobOn.setToolTipText(Language.get("ACTIVATE_EQUALIZER")); tobOn.setFocusable(false); tobOn.setEnabled(false); tobOn.setBounds(5, 5, 20, 15); @@ -151,7 +151,7 @@ eqvals[i] = 31; sliPre = new JSlider(JSlider.VERTICAL, 0, 63, 32); - sliPre.setToolTipText("Preamplifier"); + sliPre.setToolTipText(Language.get("PREAMPLIFIER")); sliPre.setInverted(true); sliPre.setOpaque(false); sliPre.setFocusable(false); @@ -166,18 +166,18 @@ eqlEqualizer.setBounds(30, 28, 239, 66); btnPresets = new JButton(new ImageIcon(GraphicsLoader.eqd1)); - btnPresets.setToolTipText("Presets"); + btnPresets.setToolTipText(Language.get("PRESETS")); btnPresets.setFocusable(false); btnPresets.setBounds(220, 5, 50, 15); pomPresets = new JPopupMenu(); - JMenuItem meiPresets = new JMenuItem("Presets"); + JMenuItem meiPresets = new JMenuItem(Language.get("PRESETS")); meiPresets.setEnabled(false); pomPresets.add(meiPresets); pomPresets.addSeparator(); - menLoad = new JMenu("Load"); - meiLoadPreset = new JMenuItem("Preset"); + menLoad = new JMenu(Language.get("LOAD")); + meiLoadPreset = new JMenuItem(Language.get("PRESET")); menLoad.add(meiLoadPreset); - meiLoadEQF = new JMenuItem("From EQF-file"); + meiLoadEQF = new JMenuItem(Language.get("LOAD_FROM_EQF")); meiLoadEQF.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { @@ -190,10 +190,10 @@ }); menLoad.add(meiLoadEQF); pomPresets.add(menLoad); - menSave = new JMenu("Save"); - meiSavePreset = new JMenuItem("Preset"); + menSave = new JMenu(Language.get("SAVE")); + meiSavePreset = new JMenuItem(Language.get("PRESET")); menSave.add(meiSavePreset); - meiSaveEQF = new JMenuItem("To EQF-file"); + meiSaveEQF = new JMenuItem(Language.get("SAVE_TO_EQF")); meiSaveEQF.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { @@ -206,8 +206,8 @@ }); menSave.add(meiSaveEQF); pomPresets.add(menSave); - menDelete = new JMenu("Delete"); - meiDeletePreset = new JMenuItem("Preset"); + menDelete = new JMenu(Language.get("DELETE")); + meiDeletePreset = new JMenuItem(Language.get("PRESET")); menDelete.add(meiDeletePreset); pomPresets.add(menDelete); btnPresets.addActionListener(new ActionListener() { @@ -248,10 +248,10 @@ return f.toString().toLowerCase().endsWith(".eqf"); } public String getDescription() { - return "EQF files"; + return Language.get("EQF_FILES"); } }); - owner.fchChooser.setDialogTitle("Load EQF"); + owner.fchChooser.setDialogTitle(Language.get("LOAD_EQF")); if(owner.fchChooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) return; FileInputStream fis = new FileInputStream( @@ -259,7 +259,7 @@ byte[] in = new byte[299]; int r = fis.read(in); if(r != 299) - throw new Exception("Unknown file exception!"); + throw new Exception(Language.get("UNKNOWN_FILE_EXCEPTION")); System.arraycopy(in, 288, eqvals, 0, 10); sliPre.setValue(in[298]); eqlEqualizer.repaint(); @@ -280,10 +280,10 @@ return f.toString().toLowerCase().endsWith(".eqf"); } public String getDescription() { - return "EQF files"; + return Language.get("EQF_FILES"); } }); - owner.fchChooser.setDialogTitle("Save as EQF"); + owner.fchChooser.setDialogTitle(Language.get("SAVE_EQF")); if(owner.fchChooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) return; byte[] out = new byte[299]; Index: Spline.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/Spline.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Spline.java 7 Mar 2006 16:13:18 -0000 1.1 +++ Spline.java 19 Mar 2006 10:17:39 -0000 1.2 @@ -36,10 +36,10 @@ last_interval = 0; n = xx.length; if(n <= 3) - throw new RuntimeException("Not enough points to build spline, n=" + - n); + throw new RuntimeException(Language.get("NOT_ENOUGH_POINTS_BUILD") + + ", n=" + n); if(n != ff.length) - throw new RuntimeException("Not same number of x and f(x)"); + throw new RuntimeException(Language.get("NOT_SAME_NUMBER")); x = new double[n]; f = new double[n]; b = new double[n]; @@ -129,13 +129,14 @@ // t < x[interval + 1] if(n <= 1) - throw new RuntimeException("Not enough points to compute value"); + throw new RuntimeException(Language.get( + "NOT_ENOUGH_POINTS_COMPUTE")); // Search for correct interval for t. interval = last_interval; // Heuristic if(t < x[0]) - throw new RuntimeException("Requested point below Spline region"); + throw new RuntimeException(Language.get("BELOW_SPLINE")); if(t > x[n - 1]) - throw new RuntimeException("Requested point above Spline region"); + throw new RuntimeException(Language.get("ABOVE_SPLINE")); if(t > x[n - 2]) interval = n-2; else if (t >= x[last_interval]) @@ -152,33 +153,6 @@ return s; } - public double integrate() { - double suma, sumb, sumc, sumd; - double dx, t; - if(n <= 3) - throw new RuntimeException("Not enough data to integrate"); - if(!uniform) { - t = 0.0; - for(int i = 0; i < n - 1; i++) { - dx = x[i + 1] - x[i]; - t = t + (f[i] + (b[i] / 2.0 + (c[i] / 3.0 + dx * d[i] / 4.0) * - dx) * dx) * dx; - } - return t; - } - // Compute uniform integral of spline fit - suma = sumb = sumc = sumd = 0.0; - for(int i = 0; i < n; i++) { - suma = suma + d[i]; - sumb = sumb + c[i]; - sumc = sumc + b[i]; - sumd = sumd + f[i]; - } - dx = x[1] - x[0]; // Assumes equally spaced points - return (sumd + (sumc / 2.0 + (sumb / 3.0 + dx * suma / 4.0) * dx) * - dx) * dx; - } - private final static void dHeapSort(double key[], double trail[]) { int nkey = key.length; int last_parent_pos = (nkey - 2) / 2; --- NEW FILE: PreferencesDialog.java --- import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.event.*; import javax.swing.tree.*; import org.lwjgl.*; public class PreferencesDialog extends JDialog { JavaAmp owner; JScrollPane scpPreferences; JTree trePreferences; DefaultMutableTreeNode mtnJavaAmp; DefaultMutableTreeNode mtnGenPref; DefaultMutableTreeNode mtnPlaylist; DefaultMutableTreeNode mtnTitles; DefaultMutableTreeNode mtnAppearance; DefaultMutableTreeNode mtnPlugins; DefaultMutableTreeNode mtnVisualization; JPanel panJavaAmp; JPanel panGenPref; JLabel lblLanguage; JComboBox cmbLanguage; JLabel lblFindLanguages; JPanel panInternet; JCheckBox chbProxy; JLabel lblProxyHost; JTextField tfdProxyHost; JLabel lblProxyPort; JTextField tfdPort; JCheckBox chbSplash; JCheckBox chbMultiple; JCheckBox chbUpdate; JLabel lblShowIn; JCheckBox chbTaskbar; JCheckBox chbSysTray; JCheckBox chbScroll; JPanel panPlaylist; JPanel panTitles; JPanel panApperance; JPanel panPlugins; JPanel panVisualization; JButton btnClose; public PreferencesDialog(JavaAmp o) throws Exception { super(o); owner = o; setTitle(Language.get("PREFERENCES")); setSize(585, 450); setResizable(false); setLocation((getToolkit().getScreenSize().width - getWidth()) / 2, (getToolkit().getScreenSize().height - getHeight()) / 2); setLayout(null); DefaultMutableTreeNode root = new DefaultMutableTreeNode(); mtnJavaAmp = new DefaultMutableTreeNode("JavaAmp"); root.add(mtnJavaAmp); mtnGenPref = new DefaultMutableTreeNode(Language.get( "GENERAL_PREFERENCES")); mtnPlaylist = new DefaultMutableTreeNode(Language.get( "PLAYLIST")); mtnGenPref.add(mtnPlaylist); mtnTitles = new DefaultMutableTreeNode(Language.get("TITLES")); mtnGenPref.add(mtnTitles); root.add(mtnGenPref); mtnAppearance = new DefaultMutableTreeNode(Language.get( "APPEARANCE")); root.add(mtnAppearance); mtnPlugins = new DefaultMutableTreeNode(Language.get("PLUGINS")); mtnVisualization = new DefaultMutableTreeNode(Language.get( "VISUALIZATION")); mtnPlugins.add(mtnVisualization); root.add(mtnPlugins); DefaultTreeModel dtm = new DefaultTreeModel(root); trePreferences = new JTree(dtm); trePreferences.setRootVisible(false); trePreferences.setShowsRootHandles(false); for(int i = 0; i < trePreferences.getRowCount(); i++) trePreferences.expandRow(i); DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel(); dtsm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); dtsm.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { if(e.getPath().equals(new TreePath(mtnJavaAmp.getPath()))) makeVisible(panJavaAmp); else if(e.getPath().equals(new TreePath(mtnGenPref.getPath()))) makeVisible(panGenPref); else if(e.getPath().equals(new TreePath(mtnPlaylist.getPath()))) makeVisible(panPlaylist); else if(e.getPath().equals(new TreePath(mtnTitles.getPath()))) makeVisible(panTitles); else if(e.getPath().equals(new TreePath( mtnAppearance.getPath()))) makeVisible(panApperance); else if(e.getPath().equals(new TreePath(mtnPlugins.getPath()))) makeVisible(panPlugins); else if(e.getPath().equals(new TreePath( mtnVisualization.getPath()))) makeVisible(panVisualization); } }); trePreferences.setSelectionModel(dtsm); scpPreferences = new JScrollPane(trePreferences, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scpPreferences.setBounds(10, 10, 150, 365); btnClose = new JButton(Language.get("CLOSE")); btnClose.setDefaultCapable(true); btnClose.setBounds(10, 385, 150, 25); panJavaAmp = new JPanel(null); panJavaAmp.setBorder(BorderFactory.createTitledBorder( "JavaAmp")); panJavaAmp.setBounds(170, 10, 395, 400); panGenPref = new JPanel(null); panGenPref.setBorder(BorderFactory.createTitledBorder( Language.get("GENERAL_PREFERENCES"))); panGenPref.setBounds(170, 10, 395, 400); lblLanguage = new JLabel(Language.get("LANGUAGE")); lblLanguage.setBounds(15, 15, lblLanguage.getFontMetrics( lblLanguage.getFont()).stringWidth(lblLanguage.getText()), 20); panGenPref.add(lblLanguage); String[] langs = Language.getAvailableLanguages(owner.getClass()); Arrays.sort(langs); cmbLanguage = new JComboBox(langs); cmbLanguage.setBounds(80, 15, 160, 20); panGenPref.add(cmbLanguage); lblFindLanguages = new JLabel( "<html><u>" + Language.get("FIND_LANGUAGES") + "</u></html>"); lblFindLanguages.setForeground(Color.BLUE); lblFindLanguages.setCursor(Cursor.getPredefinedCursor( Cursor.HAND_CURSOR)); lblFindLanguages.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { Sys.openURL("http://javaamp.sourceforge.net/"); } }); lblFindLanguages.setBounds(250, 15, lblFindLanguages.getFontMetrics( lblFindLanguages.getFont()).stringWidth(Language.get( "FIND_LANGUAGES")), 20); panGenPref.add(lblFindLanguages); panInternet = new JPanel(null); panInternet.setBorder(BorderFactory.createTitledBorder( Language.get("INTERNET_SETTINGS"))); panInternet.setBounds(10, 40, 375, 75); chbProxy = new JCheckBox(Language.get("ENABLE_PROXY")); chbProxy.setBounds(15, 15, 90, 20); panInternet.add(chbProxy); lblProxyHost = new JLabel(Language.get("PROXY_HOST")); lblProxyHost.setBounds(15, 40, 70, 20); panInternet.add(lblProxyHost); tfdProxyHost = new JTextField(); tfdProxyHost.setBounds(85, 40, 120, 20); panInternet.add(tfdProxyHost); lblProxyPort = new JLabel(Language.get("PROXY_PORT")); lblProxyPort.setBounds(230, 40, 70, 20); panInternet.add(lblProxyPort); tfdPort = new JTextField(); tfdPort.setBounds(300, 40, 60, 20); panInternet.add(tfdPort); panGenPref.add(panInternet); chbSplash = new JCheckBox(Language.get("SHOW_SPLASH")); chbSplash.setBounds(10, 120, 120, 20); panGenPref.add(chbSplash); chbMultiple = new JCheckBox(Language.get("ALLOW_MULTIPLE")); chbMultiple.setBounds(10, 140, chbMultiple.getFontMetrics( chbMultiple.getFont()).stringWidth(chbMultiple.getText()) + 25, 20); panGenPref.add(chbMultiple); chbUpdate = new JCheckBox(Language.get("CHECK_NEW")); chbUpdate.setBounds(10, 160, 190, 20); panGenPref.add(chbUpdate); lblShowIn = new JLabel(Language.get("SHOW_JAVAAMP_IN")); lblShowIn.setBounds(10, 180, 90, 20); panGenPref.add(lblShowIn); chbTaskbar = new JCheckBox(Language.get("TASKBAR")); chbTaskbar.setBounds(30, 200, 60, 20); panGenPref.add(chbTaskbar); chbSysTray = new JCheckBox(Language.get("SYSTRAY")); chbSysTray.setBounds(30, 220, 80, 20); panGenPref.add(chbSysTray); chbScroll = new JCheckBox(Language.get("SCROLL_TITLE")); chbScroll.setBounds(10, 240, 140, 20); panGenPref.add(chbScroll); panPlaylist = new JPanel(null); panPlaylist.setBorder(BorderFactory.createTitledBorder( Language.get("GENERAL_PREFERENCES") + " - " + Language.get("PLAYLIST"))); panPlaylist.setBounds(170, 10, 395, 400); panTitles = new JPanel(null); panTitles.setBorder(BorderFactory.createTitledBorder( Language.get("GENERAL_PREFERENCES") + " - " + Language.get("TITLES"))); panTitles.setBounds(170, 10, 395, 400); panApperance = new JPanel(null); panApperance.setBorder(BorderFactory.createTitledBorder( Language.get("APPEARANCE"))); panApperance.setBounds(170, 10, 395, 400); panPlugins = new JPanel(null); panPlugins.setBorder(BorderFactory.createTitledBorder( Language.get("PLUGINS"))); panPlugins.setBounds(170, 10, 395, 400); panVisualization = new JPanel(null); panVisualization.setBorder(BorderFactory.createTitledBorder( Language.get("PLUGINS") + " - " + Language.get("VISUALIZATION"))); panVisualization.setBounds(170, 10, 395, 400); add(scpPreferences); add(panJavaAmp); add(panGenPref); add(panPlaylist); add(panTitles); add(panApperance); add(panPlugins); add(panVisualization); add(btnClose); makeVisible(panJavaAmp); } public void makeVisible(JPanel pan) { panJavaAmp.setVisible(false); panGenPref.setVisible(false); panPlaylist.setVisible(false); panTitles.setVisible(false); panApperance.setVisible(false); panPlugins.setVisible(false); panVisualization.setVisible(false); pan.setVisible(true); } } --- NEW FILE: ID3v2Tags.java --- import java.util.*; public class ID3v2Tags { public final static Hashtable<String, String> tags; static { tags = new Hashtable<String, String>(); tags.put("AENC", "Audio encryption"); tags.put("APIC", "Attached picture"); tags.put("ASPI", "Audio seek point index"); tags.put("COMM", "Comments"); tags.put("COMR", "Commercial frame"); tags.put("ENCR", "Encryption method registration"); tags.put("EQU2", "Equalisation (2)"); tags.put("ETCO", "Event timing codes"); tags.put("GEOB", "General encapsulated object"); tags.put("GRID", "Group identification registration"); tags.put("LINK", "Linked information"); tags.put("MCDI", "Music CD identifier"); tags.put("MLLT", "MPEG location lookup table"); tags.put("OWNE", "Ownership frame"); tags.put("PRIV", "Private frame"); tags.put("PCNT", "Play counter"); tags.put("POPM", "Popularimeter"); tags.put("POSS", "Position synchronisation frame"); tags.put("RBUF", "Recommended buffer size"); tags.put("RVA2", "Relative volume adjustment (2)"); tags.put("RVRB", "Reverb"); tags.put("SEEK", "Seek frame"); tags.put("SIGN", "Signature frame"); tags.put("SYLT", "Synchronised lyric/text"); tags.put("SYTC", "Synchronised tempo codes"); tags.put("TALB", "Album/Movie/Show title"); tags.put("TBPM", "BPM (beats per minute)"); tags.put("TCOM", "Composer"); tags.put("TCON", "Content type"); tags.put("TCOP", "Copyright message"); tags.put("TDEN", "Encoding time"); tags.put("TDLY", "Playlist delay"); tags.put("TDOR", "Original release time"); tags.put("TDRC", "Recording time"); tags.put("TDRL", "Release time"); tags.put("TDTG", "Tagging time"); tags.put("TENC", "Encoded by"); tags.put("TEXT", "Lyricist/Text writer"); tags.put("TFLT", "File type"); tags.put("TIPL", "Involved people list"); tags.put("TIT1", "Content group description"); tags.put("TIT2", "Title/songname/content description"); tags.put("TIT3", "Subtitle/Description refinement"); tags.put("TKEY", "Initial key"); tags.put("TLAN", "Language(s)"); tags.put("TLEN", "Length"); tags.put("TMCL", "Musician credits list"); tags.put("TMED", "Media type"); tags.put("TMOO", "Mood"); tags.put("TOAL", "Original album/movie/show title"); tags.put("TOFN", "Original filename"); tags.put("TOLY", "Original lyricist(s)/text writer(s)"); tags.put("TOPE", "Original artist(s)/performer(s)"); tags.put("TOWN", "File owner/licensee"); tags.put("TPE1", "Lead performer(s)/Soloist(s)"); tags.put("TPE2", "Band/orchestra/accompaniment"); tags.put("TPE3", "Conductor/performer refinement"); tags.put("TPE4", "Interpreted, remixed, or otherwise modified by"); tags.put("TPOS", "Part of a set"); tags.put("TPRO", "Produced notice"); tags.put("TPUB", "Publisher"); tags.put("TRCK", "Track number/Position in set"); tags.put("TRSN", "Internet radio station name"); tags.put("TRSO", "Internet radio station owner"); tags.put("TSOA", "Album sort order"); tags.put("TSOP", "Performer sort order"); tags.put("TSOT", "Title sort order"); tags.put("TSRC", "ISRC (international standard recording code)"); tags.put("TSSE", "Software/Hardware and settings used for encoding"); tags.put("TSST", "Set subtitle"); tags.put("TXXX", "User defined text information frame"); tags.put("UFID", "Unique file identifier"); tags.put("USER", "Terms of use"); tags.put("USLT", "Unsynchronised lyric/text transcription"); tags.put("WCOM", "Commercial information"); tags.put("WCOP", "Copyright/Legal information"); tags.put("WOAF", "Official audio file webpage"); tags.put("WOAR", "Official artist/performer webpage"); tags.put("WOAS", "Official audio source webpage"); tags.put("WORS", "Official Internet radio station homepage"); tags.put("WPAY", "Payment"); tags.put("WPUB", "Publishers official webpage"); tags.put("WXXX", "User defined URL link frame"); } } Index: JavaAmp.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmp.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- JavaAmp.java 10 Mar 2006 14:29:09 -0000 1.11 +++ JavaAmp.java 19 Mar 2006 10:17:39 -0000 1.12 @@ -11,6 +11,7 @@ PlayDialog playDialog; PlaylistDialog playlistDialog; EqualizerDialog equalizerDialog; + PreferencesDialog preferencesDialog; VisualizationBridge vb; @@ -22,6 +23,14 @@ Random random; public JavaAmp() throws Exception { + try { + Language.loadLanguage(getClass(), "German"); + } + catch(Exception e) { + String[] langs = Language.getAvailableLanguages(getClass()); + Language.loadLanguage(getClass(), langs[0]); + } + GraphicsLoader.startLoading(this); FMOD.create(); @@ -45,6 +54,7 @@ playDialog = new PlayDialog(this); equalizerDialog = new EqualizerDialog(this); playlistDialog = new PlaylistDialog(this); + preferencesDialog = new PreferencesDialog(this); Dimension si = getToolkit().getScreenSize(); Insets in = getToolkit().getScreenInsets(getGraphicsConfiguration()); int x = (si.width + in.left - in.right - 275) / 2; @@ -54,14 +64,14 @@ playlistDialog.setLocation(x, y + 230); if(!GraphicsLoader.finishLoading()) - throw new Exception("Error loading one or more graphics!"); + throw new Exception(Language.get("ERROR_LOADING_GRAPHICS")); playDialog.setVisible(true); equalizerDialog.setVisible(true); playlistDialog.setVisible(true); } - public static void error(Exception e) { + public final static void error(Exception e) { e.printStackTrace(); StringBuilder str = new StringBuilder(e.toString()); str.append('\n'); @@ -70,11 +80,11 @@ str.append(e.getStackTrace()[i]); str.append('\n'); } - Sys.alert("JavaAmp: Error!", str.toString()); + Sys.alert("JavaAmp: Error", str.toString()); System.exit(1); } - public static void warning(Exception e) { + public final static void warning(Exception e) { e.printStackTrace(); StringBuilder str = new StringBuilder(e.toString()); str.append('\n'); @@ -83,12 +93,12 @@ str.append(e.getStackTrace()[i]); str.append('\n'); } - Sys.alert("JavaAmp: Warning!", str.toString()); + Sys.alert("JavaAmp: Warning", str.toString()); } - public static void main(String[] args) { + public final static void main(String[] args) { Locale.setDefault(Locale.ENGLISH); - Toolkit.getDefaultToolkit().setDynamicLayout(true); + Toolkit.getDefaultToolkit().setDynamicLayout(false); System.setProperty("sun.awt.noerasebackground", "true"); try { UIManager.setLookAndFeel( Index: PlayQueue.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayQueue.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- PlayQueue.java 10 Mar 2006 14:29:09 -0000 1.15 +++ PlayQueue.java 19 Mar 2006 10:17:39 -0000 1.16 @@ -96,7 +96,8 @@ rl.unlock(); if(!error && type == 1) { if(!FMusic.FMUSIC_PlaySong(module)) - JavaAmp.warning(new Exception("FMusic error!")); + JavaAmp.warning(new Exception(Language.get( + "FMUSIC_ERROR"))); else { while(pause == 1 || FMusic.FMUSIC_IsPlaying(module)) { if(!running) { @@ -132,7 +133,8 @@ else if(!error && type == 2) { c = FSound.FSOUND_Stream_Play(FSound.FSOUND_FREE, stream); if(c < 0) - JavaAmp.warning(new Exception("FSound error!")); + JavaAmp.warning(new Exception(Language.get( + "FSOUND_ERROR"))); else { FSound.FSOUND_SetVolume(c, owner.playDialog.sliVolume.getValue()); @@ -188,7 +190,7 @@ } } else if(!error) - JavaAmp.warning(new Exception("Unknown error!")); + JavaAmp.warning(new Exception(Language.get("UNKNOWN_ERROR"))); if(owner.playDialog.loopmode != 1) { fieCurrent = null; if(!change) { Index: PlaylistDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlaylistDialog.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- PlaylistDialog.java 3 Mar 2006 18:29:19 -0000 1.22 +++ PlaylistDialog.java 19 Mar 2006 10:17:39 -0000 1.23 @@ -122,6 +122,7 @@ int height = oh - my + e.getY(); if(height < 115) height = 115; + setSize(width, height); scpPlaylist.setBounds(5, 5, width - 10, height - 32); @@ -239,23 +240,23 @@ } }); - btnAdd = new JButton("+"); - btnAdd.setToolTipText("Add"); + btnAdd = new JButton(Language.get("ADD_SHORT")); + btnAdd.setToolTipText(Language.get("ADD")); btnAdd.setFocusable(false); btnAdd.setBounds(5, 90, 60, 20); pomAdd = new JPopupMenu(); - JMenuItem meiAdd = new JMenuItem("Add"); + JMenuItem meiAdd = new JMenuItem(Language.get("ADD")); meiAdd.setEnabled(false); pomAdd.add(meiAdd); pomAdd.addSeparator(); - meiAddFile = new JMenuItem("File"); + meiAddFile = new JMenuItem(Language.get("FILE")); meiAddFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addFiles(); } }); pomAdd.add(meiAddFile); - meiAddDir = new JMenuItem("Directory"); + meiAddDir = new JMenuItem(Language.get("DIRECTORY")); meiAddDir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { owner.fchChooser.setMultiSelectionEnabled(true); @@ -269,7 +270,7 @@ owner.fchChooser.setFileFilter( owner.fchChooser.getAcceptAllFileFilter()); owner.fchChooser.setDialogTitle( - "Add directory to playlist"); + Language.get("ADD_DIRECTORY")); if(owner.fchChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return; @@ -280,7 +281,7 @@ } }); pomAdd.add(meiAddDir); - meiAddURL = new JMenuItem("URL"); + meiAddURL = new JMenuItem(Language.get("URL")); meiAddURL.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addURL(); @@ -293,16 +294,16 @@ } }); - btnRem = new JButton("-"); - btnRem.setToolTipText("Remove"); + btnRem = new JButton(Language.get("REMOVE_SHORT")); + btnRem.setToolTipText(Language.get("REMOVE")); btnRem.setFocusable(false); btnRem.setBounds(67, 90, 60, 20); pomRem = new JPopupMenu(); - JMenuItem meiRem = new JMenuItem("Remove"); + JMenuItem meiRem = new JMenuItem(Language.get("REMOVE")); meiRem.setEnabled(false); pomRem.add(meiRem); pomRem.addSeparator(); - meiRemSel = new JMenuItem("Selection"); + meiRemSel = new JMenuItem(Language.get("SELECTION")); meiRemSel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] sel = lstPlaylist.getSelectedIndices(); @@ -310,7 +311,7 @@ } }); pomRem.add(meiRemSel); - meiRemAll = new JMenuItem("All"); + meiRemAll = new JMenuItem(Language.get("ALL")); meiRemAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { listmodel.clear(); @@ -318,8 +319,8 @@ }); pomRem.add(meiRemAll); - menRemPhy = new JMenu("Physically"); - meiRemSelPhy = new JMenuItem("Selection"); + menRemPhy = new JMenu(Language.get("PHYSICALLY")); + meiRemSelPhy = new JMenuItem(Language.get("SELECTION")); meiRemSelPhy.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] sel = lstPlaylist.getSelectedIndices(); @@ -328,15 +329,15 @@ if(listmodel.get(sel[i] - i + errs).type != FileEntry.TYPE_FILE) { errs++; - JavaAmp.warning(new Exception( - "Only files can be deleted!")); + JavaAmp.warning(new Exception(Language.get( + "ONLY_FILES"))); continue; } if(!listmodel.get(sel[i] - i + errs).file.delete()) { errs++; - JavaAmp.warning(new IOException( - "File cannont be deleted!")); + JavaAmp.warning(new IOException(Language.get( + "NOT_DELETED"))); continue; } listmodel.remove(sel[i] - i + errs); @@ -344,7 +345,7 @@ } }); menRemPhy.add(meiRemSelPhy); - meiRemAllPhy = new JMenuItem("All"); + meiRemAllPhy = new JMenuItem(Language.get("ALL")); meiRemAllPhy.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int num = lstPlaylist.getModel().getSize(); @@ -353,14 +354,14 @@ if(listmodel.get(errs).type != FileEntry.TYPE_FILE) { errs++; - JavaAmp.warning(new Exception( - "Only files can be deleted!")); + JavaAmp.warning(new Exception(Language.get( + "ONLY_FILES"))); continue; } if(!listmodel.get(errs).file.delete()) { errs++; - JavaAmp.warning(new IOException( - "File cannont be deleted!")); + JavaAmp.warning(new IOException(Language.get( + "NOT_DELETED"))); continue; } listmodel.remove(errs); @@ -375,16 +376,16 @@ } }); - btnSel = new JButton("Sel"); - btnSel.setToolTipText("Select"); + btnSel = new JButton(Language.get("SELECT_SHORT")); + btnSel.setToolTipText(Language.get("SELECT")); btnSel.setFocusable(false); btnSel.setBounds(129, 90, 60, 20); pomSel = new JPopupMenu(); - JMenuItem meiSel = new JMenuItem("Select"); + JMenuItem meiSel = new JMenuItem(Language.get("SELECT")); meiSel.setEnabled(false); pomSel.add(meiSel); pomSel.addSeparator(); - meiSelAll = new JMenuItem("All"); + meiSelAll = new JMenuItem(Language.get("ALL")); meiSelAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { lstPlaylist.setSelectionInterval(0, @@ -392,14 +393,14 @@ } }); pomSel.add(meiSelAll); - meiSelZero = new JMenuItem("Nothing"); + meiSelZero = new JMenuItem(Language.get("NOTHING")); meiSelZero.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { lstPlaylist.setSelectedIndices(new int[] { }); } }); pomSel.add(meiSelZero); - meiSelInvert = new JMenuItem("Invert"); + meiSelInvert = new JMenuItem(Language.get("INVERT")); meiSelInvert.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ArrayList<Integer> sels = new ArrayList<Integer>(); @@ -419,31 +420,31 @@ } }); - btnMsc = new JButton("Msc"); - btnMsc.setToolTipText("Miscellaneous"); + btnMsc = new JButton(Language.get("MISCELLANEOUS_SHORT")); + btnMsc.setToolTipText(Language.get("MISCELLANEOUS")); btnMsc.setFocusable(false); btnMsc.setBounds(191, 90, 60, 20); pomMsc = new JPopupMenu(); - JMenuItem meiMsc = new JMenuItem("Miscellaneous"); + JMenuItem meiMsc = new JMenuItem(Language.get("MISCELLANEOUS")); meiMsc.setEnabled(false); pomMsc.add(meiMsc); pomMsc.addSeparator(); - menLst = new JMenu("List"); - meiLoadList = new JMenuItem("Load list"); + menLst = new JMenu(Language.get("PLAYLIST")); + meiLoadList = new JMenuItem(Language.get("LOAD_PLAYLIST")); meiLoadList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { loadList(); } }); menLst.add(meiLoadList); - meiSaveList = new JMenuItem("Save list"); + meiSaveList = new JMenuItem(Language.get("SAVE_PLAYLIST")); meiSaveList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { saveList(); } }); menLst.add(meiSaveList); - meiGenHTMLList = new JMenuItem("Generate HTML-list"); + meiGenHTMLList = new JMenuItem(Language.get("GENERATE_HTML")); meiGenHTMLList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { genHTMLList(); @@ -451,7 +452,8 @@ }); menLst.add(meiGenHTMLList); pomMsc.add(menLst); - meiLoadInfos = new JMenuItem("Load informations (unexactly)"); + meiLoadInfos = new JMenuItem(Language.get( + "LOAD_INFORMATIONS_UNEXACTLY")); meiLoadInfos.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(listmodel.getSize() <= 0) @@ -460,7 +462,8 @@ } }); pomMsc.add(meiLoadInfos); - meiLoadInfosAccurate = new JMenuItem("Load informations (exactly)"); + meiLoadInfosAccurate = new JMenuItem(Language.get( + "LOAD_INFORMATIONS_EXACTLY")); meiLoadInfosAccurate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(listmodel.getSize() <= 0) @@ -476,18 +479,18 @@ }); pomFile = new JPopupMenu(); - JMenuItem meiFile = new JMenuItem("File"); + JMenuItem meiFile = new JMenuItem(Language.get("FILE")); meiFile.setEnabled(false); pomFile.add(meiFile); pomFile.addSeparator(); - meiFilePlay = new JMenuItem("Play"); + meiFilePlay = new JMenuItem(Language.get("PLAY")); meiFilePlay.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { playSelection(); } }); pomFile.add(meiFilePlay); - meiFileDel = new JMenuItem("Remove"); + meiFileDel = new JMenuItem(Language.get("REMOVE")); meiFileDel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { for(ActionListener act : meiRemSel.getActionListeners()) @@ -495,7 +498,7 @@ } }); pomFile.add(meiFileDel); - meiFileInfo = new JMenuItem("File informations"); + meiFileInfo = new JMenuItem(Language.get("FILE_INFORMATIONS")); meiFileInfo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showFileInfoDialog(); @@ -534,8 +537,8 @@ } public void addURL() { - String str = owner.oppMessages.showInputDialog(this, "Enter URL:", - "Add URL", JOptionPane.PLAIN_MESSAGE); + String str = owner.oppMessages.showInputDialog(this, Language.get( + "ENTER_URL"), Language.get("ADD_URL"), JOptionPane.PLAIN_MESSAGE); if(str == null) return; URL url = null; @@ -584,7 +587,7 @@ owner.fchChooser.getAcceptAllFileFilter()); owner.fchChooser.setFileFilter( owner.fchChooser.getAcceptAllFileFilter()); - owner.fchChooser.setDialogTitle("Add file(s) to playlist"); + owner.fchChooser.setDialogTitle(Language.get("ADD_FILES")); if(owner.fchChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return; Vector<FileEntry> vpf = new Vector<FileEntry>(); @@ -652,7 +655,7 @@ return f.toString().toLowerCase().endsWith(".m3u"); } public String getDescription() { - return "M3U files"; + return Language.get("M3U_FILES"); } }); owner.fchChooser.addChoosableFileFilter( @@ -661,7 +664,7 @@ return f.toString().toLowerCase().endsWith(".pls"); } public String getDescription() { - return "PLS files"; + return Language.get("PLS_FILES"); } }); owner.fchChooser.setFileFilter( @@ -671,10 +674,10 @@ f.toString().toLowerCase().endsWith(".pls"); } public String getDescription() { - return "M3U and PLS files"; + return Language.get("M3U_AND_PLS_FILES"); } }); - owner.fchChooser.setDialogTitle("Load playlist"); + owner.fchChooser.setDialogTitle(Language.get("LOAD_PLAYLIST")); if(owner.fchChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return; File file = owner.fchChooser.getSelectedFile(); @@ -789,7 +792,7 @@ return f.toString().toLowerCase().endsWith(".pls"); } public String getDescription() { - return "PLS files"; + return Language.get("PLS_FILES"); } }; owner.fchChooser.addChoosableFileFilter(ffPls); @@ -799,10 +802,10 @@ return f.toString().toLowerCase().endsWith(".m3u"); } public String getDescription() { - return "M3U files"; + return Language.get("M3U_FILES"); } }); - owner.fchChooser.setDialogTitle("Save playlist"); + owner.fchChooser.setDialogTitle(Language.get("SAVE_PLAYLIST")); if(owner.fchChooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION) return; if(owner.fchChooser.getFileFilter().equals(ffPls)) @@ -942,7 +945,7 @@ ps.println("</html>"); ps.close(); if(!Sys.openURL("playlist.html")) - throw new Exception("Unable to open HTML-file!"); + throw new Exception(Language.get("UNABLE_OPEN_HTML")); } catch(Exception e) { owner.warning(e); Index: SimpleVisualization.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/SimpleVisualization.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SimpleVisualization.java 28 Feb 2006 11:51:33 -0000 1.4 +++ SimpleVisualization.java 19 Mar 2006 10:17:39 -0000 1.5 @@ -11,10 +11,11 @@ FloatBuffer spectrum; Random rnd; + Spline splinex, spliney, splinez; Vector<float[]> points; float[][] old; float[] sum; - float ang, camx; + float camx, camy, camz, pi; public void init(FloatBuffer spec) { spectrum = spec; @@ -23,7 +24,9 @@ points = new Vector<float[]>(); old = new float[300][30]; sum = new float[20]; - ang = 0f; + camx = rnd.nextFloat() * 60f; + camy = rnd.nextFloat() * 20; + camz = rnd.nextFloat() * 30f - 10f; glClearColor(0, 0, 0, 1); glColor3f(1, 1, 1); @@ -57,10 +60,51 @@ else points.set(i, t); } - ang += 0.005f; - if(ang > Math.PI * 2) - ang -= Math.PI * 2; - camx = (float)(30d + Math.sin(ang) * 30); + if(splinex == null && rnd.nextInt(10) == 0) { + double[] xx = new double[5]; + double[] ff = new double[5]; + for(int i = 0; i < 5; i++) { + xx[i] = i; + if(i == 0) + ff[i] = camx; + else + ff[i] = rnd.nextDouble() * 60d; + } + splinex = new Spline(xx, ff); + + xx = new double[5]; + ff = new double[5]; + for(int i = 0; i < 5; i++) { + xx[i] = i; + if(i == 0) + ff[i] = camy; + else + ff[i] = rnd.nextDouble() * 20d; + } + spliney = new Spline(xx, ff); + + xx = new double[5]; + ff = new double[5]; + for(int i = 0; i < 5; i++) { + xx[i] = i; + if(i == 0) + ff[i] = camz; + else + ff[i] = rnd.nextDouble() * 50d - 10d; + } + splinez = new Spline(xx, ff); + pi = 0; + } + if(splinex != null) { + pi += 0.001f; + if(pi > 4) + splinex = null; + else { + camx = (float)splinex.spline_value(pi); + camy = (float)spliney.spline_value(pi); + camz = (float)splinez.spline_value(pi); + } + } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); @@ -68,7 +112,7 @@ glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60, 800f / 600f, 0.1f, 1000f); - gluLookAt(camx, 25, -5, camx, 0, 200, 15 - camx / 2f, 30, 0); + gluLookAt(camx, camy, camz, camx, 0, 200, 0, 1, 0); glMatrixMode(GL_MODELVIEW); glPointSize(2); Index: PlayDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayDialog.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- PlayDialog.java 10 Mar 2006 14:29:09 -0000 1.12 +++ PlayDialog.java 19 Mar 2006 10:17:39 -0000 1.13 @@ -25,11 +25,16 @@ JButton btnVis, btnBack, btnPlay, btnPause, btnStop, btnNext, btnOpen, btnRepeat; + JPopupMenu pomPref; + JMenuItem meiJavaAmp; + JMenuItem meiPreferences; + JMenuItem meiExit; + JavaAmp owner; Container cntContainer; BevelBorder bebBorder; int ct, mx, my, ow, oh, ow2, oh2, ow3, oh3; // ct: 0=Fehler, 1=Position, - // 2=Min, 3=Schl + // 2=Min, 3=Schl, 4=Einst int loopmode; // 0=kein, 1=eine datei, 2=alle dateien boolean dockedEqualizer, dockedEqualizer2; boolean dockedPlaylist, dockedPlaylist2; @@ -66,13 +71,16 @@ oh2 = owner.playlistDialog.getLocation().y - oh; ow3 = owner.equalizerDialog.getLocation().x - ow; oh3 = owner.equalizerDialog.getLocation().y - oh; - if(e.getY() >= 12 || e.getX() <= 250) + if(my >= 12) + ct = 1; + else if(mx <= 11) + ct = 4; + else if(mx > 262) + ct = 3; + else if(mx > 250) + ct = 2; + else ct = 1; - else if(my < 12) - if(mx > 262) - ct = 3; - else if(mx > 250) - ct = 2; paint(getGraphics()); } @@ -85,17 +93,20 @@ } if(e.getButton() == MouseEvent.BUTTON1 && my < 12 && e.getY() < 12) - if(ct == 3 && mx > 262 && e.getX() > 262) + if(ct == 3 && e.getX() > 262) System.exit(0); - else if(ct == 2 && mx > 250 && e.getX() > 250) + else if(ct == 2 && e.getX() > 250) owner.setExtendedState(JFrame.ICONIFIED); + else if(ct == 4 && e.getX() <= 11) + pomPref.show(owner, owner.playDialog.getX(), + owner.playDialog.getY()); ct = 0; paint(getGraphics()); } }); addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(MouseEvent e) { - if(ct == 0 || ct == 2 || ct == 3) { + if(ct == 0 || ct == 2 || ct == 3 || ct == 4) { if(e.getY() >= 12) ct = 0; else if((ct == 0 || ct == 3) && mx > 262 && e.getX() > 262) @@ -103,6 +114,8 @@ else if((ct == 0 || ct == 2) && mx > 250 && mx <= 262 && e.getX() > 250 && e.getX() <= 262) ct = 2; + else if((ct == 0 || ct == 4) && mx <= 11 && e.getX() <= 11) + ct = 4; else ct = 0; paint(getGraphics()); @@ -199,6 +212,31 @@ cntContainer.setLayout(null); bebBorder = new BevelBorder(BevelBorder.RAISED); + pomPref = new JPopupMenu(); + meiJavaAmp = new JMenuItem("JavaAmp..."); + meiJavaAmp.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + showAbout(); + } + }); + pomPref.add(meiJavaAmp); + pomPref.addSeparator(); + meiPreferences = new JMenuItem(Language.get("PREFERENCES")); + meiPreferences.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + showPreferences(); + } + }); + pomPref.add(meiPreferences); + pomPref.addSeparator(); + meiExit = new JMenuItem(Language.get("EXIT")); + meiExit.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.exit(0); + } + }); + pomPref.add(meiExit); + splSpectrum = new SpectrumLabel(owner); splSpectrum.setBounds(5, 17, 100, 53); splSpectrum.init(FSound.FSOUND_DSP_GetSpectrum()); @@ -207,14 +245,14 @@ lblSongInfo.setBounds(107, 17, 163, 15); sliVolume = new JSlider(0, 255, 255); - sliVolume.setToolTipText("Volume"); + sliVolume.setToolTipText(Language.get("VOLUME")); sliVolume.setOpaque(false); sliVolume.setFocusable(false); sliVolume.setBounds(110, 51, 65, 23); sliVolume.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { - lblSongInfo.text2 = "Volume: " + (sliVolume.getValue() * 100 / - 255) + " %"; + lblSongInfo.text2 = Language.get("VOLUME") + ": " + + (sliVolume.getValue() * 100 / 255) + " %"; lblSongInfo.showing = false; } @@ -224,15 +262,15 @@ }); sliVolume.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { - lblSongInfo.text2 = "Volume: " + (sliVolume.getValue() * 100 / - 255) + " %"; + lblSongInfo.text2 = Language.get("VOLUME") + ": " + + (sliVolume.getValue() * 100 / 255) + " %"; if(pq != null) FSound.FSOUND_SetVolume(pq.c, sliVolume.getValue()); } }); sliPan = new JSlider(0, 255, 128); - sliPan.setToolTipText("Pan"); + sliPan.setToolTipText(Language.get("PAN")); sliPan.setOpaque(false); sliPan.setFocusable(false); sliPan.setBounds(180, 51, 43, 23); @@ -240,11 +278,14 @@ public void mousePressed(MouseEvent e) { int val = sliPan.getValue() * 200 / 255 - 100; if(val < 0) - lblSongInfo.text2 = "Balance: " + (-val) + " % left"; + lblSongInfo.text2 = Language.get("PAN") + ": " + (-val) + + " % " + Language.get("LEFT"); else if(val > 0) - lblSongInfo.text2 = "Balance: " + val + " % right"; + lblSongInfo.text2 = Language.get("PAN") + ": " + val + + " % " + Language.get("RIGHT"); else - lblSongInfo.text2 = "Balance: Center"; + lblSongInfo.text2 = Language.get("PAN") + ": " + + Language.get("CENTER"); lblSongInfo.showing = false; } @@ -256,18 +297,21 @@ public void stateChanged(ChangeEvent e) { int val = sliPan.getValue() * 200 / 255 - 100; if(val < 0) - lblSongInfo.text2 = "Balance: " + (-val) + " % left"; + lblSongInfo.text2 = Language.get("PAN") + ": " + (-val) + + " % " + Language.get("LEFT"); else if(val > 0) - lblSongInfo.text2 = "Balance: " + val + " % right"; + lblSongInfo.text2 = Language.get("PAN") + ": " + val + + " % " + Language.get("RIGHT"); else - lblSongInfo.text2 = "Balance: Center"; + lblSongInfo.text2 = Language.get("PAN") + ": " + + Language.get("CENTER"); if(pq != null) FSound.FSOUND_SetPan(pq.c, sliPan.getValue()); } }); prbTrack = new JProgressBar(0, 255); - prbTrack.setToolTipText("Position"); + prbTrack.setToolTipText(Language.get("POSITION")); prbTrack.setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR)); prbTrack.setString("0"); prbTrack.setStringPainted(false); @@ -283,10 +327,16 @@ public void mouseReleased(MouseEvent e) { if(!prbTrack.getString().equals("1")) return; - if(pq != null && pq.stream != null) + if(pq != null && pq.stream != null) { + int x = e.getX(); + if(x < 0) + x = 0; + else if(x >= prbTrack.getWidth()) + x = prbTrack.getWidth() - 1; FSound.FSOUND_Stream_SetTime(pq.stream, (int)((double)( - e.getX() * 255 / prbTrack.getWidth()) / 255d * + x * 255 / prbTrack.getWidth()) / 255d * (double)pq.streamlen)); + } prbTrack.setString("0"); } }); @@ -300,7 +350,7 @@ }); btnVis = new JButton(new ImageIcon(GraphicsLoader.pd10)); - btnVis.setToolTipText("Start visualization"); + btnVis.setToolTipText(Language.get("START_VISUALIZATION")); btnVis.setFocusable(false); btnVis.setBounds(228, 38, 20, 15); btnVis.addActionListener(new ActionListener() { @@ -319,7 +369,7 @@ }); tobEQ = new JToggleButton(new ImageIcon(GraphicsLoader.pd1), true); - tobEQ.setToolTipText("Show equalizer"); + tobEQ.setToolTipText(Language.get("SHOW_EQUALIZER")); tobEQ.setFocusable(false); tobEQ.setBounds(228, 55, 20, 15); tobEQ.addActionListener(new ActionListener() { @@ -334,7 +384,7 @@ }); tobPL = new JToggleButton(new ImageIcon(GraphicsLoader.pd2), true); - tobPL.setToolTipText("Show playlist"); + tobPL.setToolTipText(Language.get("SHOW_PLAYLIST")); tobPL.setFocusable(false); tobPL.setBounds(250, 55, 20, 15); tobPL.addActionListener(new ActionListener() { @@ -350,20 +400,23 @@ tobShuffle = new JToggleButton(new ImageIcon(GraphicsLoader.pd9), false); - tobShuffle.setToolTipText("Shuffle: Off"); + tobShuffle.setToolTipText(Language.get("SHUFFLE") + ": " + + Language.get("OFF")); tobShuffle.setFocusable(false); tobShuffle.setBounds(147, 92, 45, 15); tobShuffle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(tobShuffle.isSelected()) - tobShuffle.setToolTipText("Shuffle: On"); + tobShuffle.setToolTipText(Language.get("SHUFFLE") + ": " + + Language.get("ON")); else - tobShuffle.setToolTipText("Shuffle: Off"); + tobShuffle.setToolTipText(Language.get("SHUFFLE") + ": " + + Language.get("OFF")); } }); btnBack = new JButton(new ImageIcon(GraphicsLoader.pd3)); - btnBack.setToolTipText("Previous"); + btnBack.setToolTipText(Language.get("PREVIOUS")); btnBack.setFocusable(false); btnBack.setBounds(5, 90, 20, 20); btnBack.addActionListener(new ActionListener() { @@ -390,7 +443,7 @@ }); btnPlay = new JButton(new ImageIcon(GraphicsLoader.pd4)); - btnPlay.setToolTipText("Play"); + btnPlay.setToolTipText(Language.get("PLAY")); btnPlay.setFocusable(false); btnPlay.setBounds(27, 90, 20, 20); btnPlay.addActionListener(new ActionListener() { @@ -418,7 +471,7 @@ }); btnPause = new JButton(new ImageIcon(GraphicsLoader.pd5)); - btnPause.setToolTipText("Pause"); + btnPause.setToolTipText(Language.get("PAUSE")); btnPause.setFocusable(false); btnPause.setBounds(49, 90, 20, 20); btnPause.addActionListener(new ActionListener() { @@ -433,7 +486,7 @@ }); btnStop = new JButton(new ImageIcon(GraphicsLoader.pd6)); - btnStop.setToolTipText("Stop"); + btnStop.setToolTipText(Language.get("STOP")); btnStop.setFocusable(false); btnStop.setBounds(71, 90, 20, 20); btnStop.addActionListener(new ActionListener() { @@ -446,7 +499,7 @@ }); btnNext = new JButton(new ImageIcon(GraphicsLoader.pd7)); - btnNext.setToolTipText("Next"); + btnNext.setToolTipText(Language.get("NEXT")); btnNext.setFocusable(false); btnNext.setBounds(93, 90, 20, 20); btnNext.addActionListener(new ActionListener() { @@ -472,7 +525,7 @@ }); btnOpen = new JButton(new ImageIcon(GraphicsLoader.pd8)); - btnOpen.setToolTipText("Open"); + btnOpen.setToolTipText(Language.get("OPEN")); btnOpen.setFocusable(false); btnOpen.setBounds(120, 90, 20, 20); btnOpen.addActionListener(new ActionListener() { @@ -487,7 +540,7 @@ owner.fchChooser.getAcceptAllFileFilter()); owner.fchChooser.setFileFilter( owner.fchChooser.getAcceptAllFileFilter()); - owner.fchChooser.setDialogTitle("Open file(s)"); + owner.fchChooser.setDialogTitle(Language.get("OPEN_FILES")); if(owner.fchChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return; @@ -507,7 +560,8 @@ }); btnRepeat = new JButton(new ImageIcon(GraphicsLoader.pd11)); - btnRepeat.setToolTipText("Repeat: Off"); + btnRepeat.setToolTipText(Language.get("REPEAT") + ": " + + Language.get("OFF")); btnRepeat.setFocusable(false); btnRepeat.setBounds(194, 92, 25, 15); btnRepeat.addActionListener(new ActionListener() { @@ -518,15 +572,18 @@ switch(loopmode) { case 0: btnRepeat.setIcon(new ImageIcon(GraphicsLoader.pd11)); - btnRepeat.setToolTipText("Repeat: Off"); + btnRepeat.setToolTipText(Language.get("REPEAT") + ": " + + Language.get("OFF")); break; case 1: btnRepeat.setIcon(new ImageIcon(GraphicsLoader.pd12)); - btnRepeat.setToolTipText("Repeat: One file"); + btnRepeat.setToolTipText(Language.get("REPEAT") + ": " + + Language.get("ONE_FILE")); break; default: btnRepeat.setIcon(new ImageIcon(GraphicsLoader.pd13)); - btnRepeat.setToolTipText("Repeat: All files"); + btnRepeat.setToolTipText(Language.get("REPEAT") + ": " + + Language.get("ALL_FILES")); } } }); @@ -553,6 +610,19 @@ splSpectrum.start(); } + public void showAbout() { + owner.oppMessages.showMessageDialog(null, "<html><font size=3><b>Java" + + "Amp</b></font><br>Copyright © 2006 Andreas Wiesbauer<br>v0." + + "0.4 - Mar 17 2006<br>Visit http://javaamp.sourceforge.net for up" + + "dates.<br>Relesed under the conditions of the BSD-license.</html" + + ">", "About JavaAmp", JOptionPane.INFORMATION_MESSAGE, + new ImageIcon(GraphicsLoader.jaa1)); + } + + public void showPreferences() { + owner.preferencesDialog.setVisible(true); + } + public void paint(Graphics g) { super.paint(graOffscreen); if(ct <= 1) @@ -561,6 +631,8 @@ graOffscreen.drawImage(GraphicsLoader.pd15, 0, 0, this); else if(ct == 3) graOffscreen.drawImage(GraphicsLoader.pd16, 0, 0, this); + else if(ct == 4) + graOffscreen.drawImage(GraphicsLoader.pd17, 0, 0, this); g.drawImage(buiOffscreen, 0, 0, this); } } \ No newline at end of file Index: FileInformationDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/FileInformationDialog.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- FileInformationDialog.java 7 Mar 2006 16:13:18 -0000 1.8 +++ FileInformationDialog.java 19 Mar 2006 10:17:39 -0000 1.9 @@ -33,7 +33,7 @@ DefaultTableModel dtmGen; public FileInformationDialog(JavaAmp o) { - super(o.playlistDialog, "File informations", true); + super(o.playlistDialog, Language.get("FILE_INFORMATIONS"), true); owner = o; setSize(500, 400); @@ -55,7 +55,7 @@ containers[i] = new Container(); containers[i].setLayout(new BorderLayout()); tables[i] = new JTable(new DefaultTableModel(new String[] { - "Key", "Value" }, 0)); + Language.get("KEY"), Language.get("VALUE") }, 0)); scrollPanes[i] = new JScrollPane(tables[i], JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); @@ -65,7 +65,7 @@ cntGen = new Container(); cntGen.setLayout(new BorderLayout()); tabGen = new JTable(new DefaultTableModel(new String[] { - "Key", "Value" }, 0)); + Language.get("KEY"), Language.get("VALUE") }, 0)); dtmGen = (DefaultTableModel)tabGen.getModel(); scpGen = new JScrollPane(tabGen, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, @@ -107,6 +107,12 @@ tag.getType())].getModel()).addRow( new String[] { "GENRE", Genres.getGenre( tag.getValueAsString()) }); + else if(tag.getType() == FSound.FSOUND_TAGFIELD_ID3V2 && + ID3v2Tags.tags.get(tag.getName()) != null) + ((DefaultTableModel)tables[getIDfromType( + tag.getType())].getModel()).addRow( + new String[] { ID3v2Tags.tags.get(tag.getName()), + tag.getValueAsString() }); else ((DefaultTableModel)tables[getIDfromType( tag.getType())].getModel()).addRow( @@ -118,23 +124,23 @@ for(int i = 0; i < containers.length; i++) if(tables[i].getModel().getRowCount() > 0) tapType.add(descriptions[i], containers[i]); - dtmGen.addRow(new String[] { "File length", + dtmGen.addRow(new String[] { Language.get("FILE_LENGTH"), JavaAmpToolkit.getDuration(FSound.FSOUND_Stream_GetLengthMs( stream) / 1000) }); if(entry.type == FileEntry.TYPE_FILE) { File file = entry.file; - dtmGen.addRow(new String[] { "File size", (file.length() / - 1024) + " KB" }); - dtmGen.addRow(new String[] { "Last modified", + dtmGen.addRow(new String[] { Language.get("FILE_SIZE"), + (file.length() / 1024) + " KB" }); + dtmGen.addRow(new String[] { Language.get("LAST_MODIFIED"), DateFormat.getDateInstance().format(new Date( file.lastModified())) }); } else { URL url = entry.url; - dtmGen.addRow(new String[] { "Protocol", + dtmGen.addRow(new String[] { Language.get("PROTOCOL"), url.getProtocol() }); } - tapType.add("General", cntGen); + tapType.add(Language.get("GENERAL"), cntGen); FSound.FSOUND_Stream_Close(stream); return true; } Index: LoadInfoDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/LoadInfoDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- LoadInfoDialog.java 3 Mar 2006 18:29:19 -0000 1.2 +++ LoadInfoDialog.java 19 Mar 2006 10:17:39 -0000 1.3 @@ -14,7 +14,7 @@ Thread thread; public LoadInfoDialog(JavaAmp o, boolean a) { - super(o.playlistDialog, "Loading file informations...", true); + super(o.playlistDialog, Language.get("LOADING_INFORMATIONS"), true); owner = o; accurate = a; running = true; @@ -37,7 +37,7 @@ prbStatus.setString("0/" + max); prbStatus.setStringPainted(true); - btnCancel = new JButton("Cancel"); + btnCancel = new JButton(Language.get("CANCEL")); btnCancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { running = false; Index: GetFileInfoThread.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/GetFileInfoThread.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- GetFileInfoThread.java 28 Feb 2006 16:08:13 -0000 1.6 +++ GetFileInfoThread.java 19 Mar 2006 10:17:39 -0000 1.7 @@ -90,6 +90,14 @@ flag = false; break; } + else { + fld = new FSoundTagField(val, "TPE1"); + if(FSound.FSOUND_Stream_FindTagField(stream, fld)) { + info.append(fld.getValueAsString()); + flag = false; + break; + } + } } if(!flag) { flag = true; @@ -101,6 +109,14 @@ flag = false; break; } + else { + fld = new FSoundTagField(val, "TIT2"); + if(FSound.FSOUND_Stream_FindTagField(stream, fld)) { + info.append(fld.getValueAsString()); + flag = false; + break; + } + } } } if(flag) { Index: GraphicsLoader.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/GraphicsLoader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- GraphicsLoader.java 10 Mar 2006 14:29:09 -0000 1.1 +++ GraphicsLoader.java 19 Mar 2006 10:17:39 -0000 1.2 @@ -1,20 +1,29 @@ import java.awt.*; +import java.io.*; public class GraphicsLoader { private static MediaTracker mt; + private static int cid; + + // JavaAmp + static Image jaa1; // EqualizerDialog static Image eqd1, eqd2; // PlayDialog static Image pd1, pd2, pd3, pd4, pd5, pd6, pd7, pd8, pd9, pd10, pd11, pd12, - pd13, pd14, pd15, pd16; + pd13, pd14, pd15, pd16, pd17; public final static void startLoading(Component comp) { Class cls = comp.getClass(); Toolkit tk = comp.getToolkit(); mt = new MediaTracker(comp); + cid = 0; + + // JavaAmp + jaa1 = tk.getImage(cls.getResource("javaamp32.png")); // EqualizerDialog eqd1 = tk.getImage(cls.getResource("presets.png")); @@ -37,26 +46,35 @@ pd14 = tk.getImage(cls.getResource("javaamp.png")); pd15 = tk.getImage(cls.getResource("javaamp1.png")); pd16 = tk.getImage(cls.getResource("javaamp2.png")); + pd17 = tk.getImage(cls.getResource("javaamp3.png")); - mt.addImage(eqd1, 0); - mt.addImage(eqd2, 1); + addImage(jaa1); - mt.addImage(pd1, 2); - mt.addImage(pd2, 3); - mt.addImage(pd3, 4); - mt.addImage(pd4, 5); - mt.addImage(pd5, 6); - mt.addImage(pd6, 7); - mt.addImage(pd7, 8); - mt.addImage(pd8, 9); - mt.addImage(pd9, 10); - mt.addImage(pd10, 11); - mt.addImage(pd11, 12); - mt.addImage(pd12, 13); - mt.addImage(pd13, 14); - mt.addImage(pd14, 15); - mt.addImage(pd15, 16); - mt.addImage(pd16, 17); + addImage(eqd1); + addImage(eqd2); + + addImage(pd1); + addImage(pd2); + addImage(pd3); + addImage(pd4); + addImage(pd5); + addImage(pd6); + addImage(pd7); + addImage(pd8); + addImage(pd9); + addImage(pd10); + addImage(pd11); + addImage(pd12); + addImage(pd13); + addImage(pd14); + addImage(pd15); + addImage(pd16); + addImage(pd17); + } + + private final static void addImage(Image i) { + mt.addImage(i, cid); + cid++; } public final static boolean finishLoading() { |
From: WiESi <wi...@us...> - 2006-03-19 10:16:18
|
Update of /cvsroot/javaamp/javaamp/res In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26378/res Modified Files: javaamp.png javaamp1.png javaamp2.png Added Files: javaamp3.png javaamp32.png Log Message: Index: javaamp.png =================================================================== RCS file: /cvsroot/javaamp/javaamp/res/javaamp.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvswJZse7 and /tmp/cvsemq4fD differ Index: javaamp2.png =================================================================== RCS file: /cvsroot/javaamp/javaamp/res/javaamp2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvssA5uvb and /tmp/cvsZcOUNH differ Index: javaamp1.png =================================================================== RCS file: /cvsroot/javaamp/javaamp/res/javaamp1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsqSgixf and /tmp/cvsMUwZTL differ --- NEW FILE: javaamp3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: javaamp32.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26048/src Modified Files: EQLabel.java EqualizerDialog.java JavaAmp.java PlayDialog.java PlayQueue.java SpectrumLabel.java Added Files: GraphicsLoader.java Log Message: Index: EqualizerDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/EqualizerDialog.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- EqualizerDialog.java 3 Mar 2006 18:29:19 -0000 1.13 +++ EqualizerDialog.java 10 Mar 2006 14:29:09 -0000 1.14 @@ -41,12 +41,6 @@ super(o); owner = o; - Image i1 = getToolkit().getImage(getClass().getResource("presets.png")); - Image i2 = getToolkit().getImage(getClass().getResource("on.png")); - MediaTracker mt = new MediaTracker(this); - mt.addImage(i1, 0); - mt.addImage(i2, 1); - setUndecorated(true); setSize(275, 115); setLocation(50, 165); @@ -146,7 +140,7 @@ cntContainer.setLayout(null); bebBorder = new BevelBorder(BevelBorder.RAISED); - tobOn = new JToggleButton(new ImageIcon(i2)); + tobOn = new JToggleButton(new ImageIcon(GraphicsLoader.eqd2)); tobOn.setToolTipText("Activate equalizer"); tobOn.setFocusable(false); tobOn.setEnabled(false); @@ -171,7 +165,7 @@ eqlEqualizer = new EQLabel(owner); eqlEqualizer.setBounds(30, 28, 239, 66); - btnPresets = new JButton(new ImageIcon(i1)); + btnPresets = new JButton(new ImageIcon(GraphicsLoader.eqd1)); btnPresets.setToolTipText("Presets"); btnPresets.setFocusable(false); btnPresets.setBounds(220, 5, 50, 15); @@ -238,8 +232,6 @@ cntContainer.add(btnPresets); setContentPane(cntContainer); - - mt.waitForAll(); } public void loadPreset() throws Exception { Index: JavaAmp.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmp.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- JavaAmp.java 3 Mar 2006 18:29:19 -0000 1.10 +++ JavaAmp.java 10 Mar 2006 14:29:09 -0000 1.11 @@ -22,6 +22,8 @@ Random random; public JavaAmp() throws Exception { + GraphicsLoader.startLoading(this); + FMOD.create(); FSound.FSOUND_Init(44100, 16, 0); FSound.FSOUND_DSP_SetActive(FSound.FSOUND_DSP_GetFFTUnit(), true); @@ -50,8 +52,11 @@ playDialog.setLocation(x, y); equalizerDialog.setLocation(x, y + 115); playlistDialog.setLocation(x, y + 230); + + if(!GraphicsLoader.finishLoading()) + throw new Exception("Error loading one or more graphics!"); + playDialog.setVisible(true); - playDialog.splSpectrum.start(); equalizerDialog.setVisible(true); playlistDialog.setVisible(true); } @@ -82,6 +87,7 @@ } public static void main(String[] args) { + Locale.setDefault(Locale.ENGLISH); Toolkit.getDefaultToolkit().setDynamicLayout(true); System.setProperty("sun.awt.noerasebackground", "true"); try { Index: PlayQueue.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayQueue.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- PlayQueue.java 28 Feb 2006 16:08:13 -0000 1.14 +++ PlayQueue.java 10 Mar 2006 14:29:09 -0000 1.15 @@ -1,6 +1,7 @@ import java.io.*; import java.net.*; import java.util.*; +import java.util.concurrent.locks.*; import javax.swing.*; import org.lwjgl.fmod3.*; @@ -32,7 +33,9 @@ hidden = false; owner.playlistDialog.scpPlaylist.repaint(); FileEntry fieCurrent = owner.playlistDialog.listmodel.get(current); + ReentrantLock rl = new ReentrantLock(); while(running && fieCurrent != null) { + rl.lock(); if(owner.playDialog.prbTrack.getString().equals("0")) owner.playDialog.prbTrack.setValue(0); owner.playlistDialog.ensureIsVisible(current); @@ -90,6 +93,7 @@ error = true; type = 2; } + rl.unlock(); if(!error && type == 1) { if(!FMusic.FMUSIC_PlaySong(module)) JavaAmp.warning(new Exception("FMusic error!")); Index: EQLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/EQLabel.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- EQLabel.java 7 Mar 2006 16:13:17 -0000 1.8 +++ EQLabel.java 10 Mar 2006 14:29:09 -0000 1.9 @@ -54,17 +54,12 @@ offg.setColor(Color.LIGHT_GRAY); offg.fillRect(0, 63 - owner.equalizerDialog.sliPre.getValue(), 239, 3); offg.setColor(Color.BLACK); - double[] xx = new double[10]; - double[] ff = new double[10]; for(int i = 0; i < 10; i++) { offg.fillRect(i * 24 + 10, owner.equalizerDialog.eqvals[i], 3, 3); - xx[i] = i * 24 + 11; - ff[i] = owner.equalizerDialog.eqvals[i] + 1; + if(i < 9) + offg.drawLine(i * 24 + 11, owner.equalizerDialog.eqvals[i] + 1, + (i + 1) * 24 + 11, owner.equalizerDialog.eqvals[i + 1] + 1); } - Spline s = new Spline(xx, ff); - for(int i = 11; i < 227; i++) - offg.drawLine(i, (int)s.spline_value(i), i + 1, (int)s.spline_value( - i + 1)); g.drawImage(offscreen, 0, 0, this); } } \ No newline at end of file Index: SpectrumLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/SpectrumLabel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SpectrumLabel.java 3 Mar 2006 18:33:17 -0000 1.4 +++ SpectrumLabel.java 10 Mar 2006 14:29:09 -0000 1.5 @@ -79,6 +79,8 @@ } public void paint(Graphics g) { + if(g == null || ofg == null) + return; ofg.setColor(Color.BLACK); ofg.fillRect(0, 0, getWidth(), h); if(mode == MODE_SPECTRUM) { Index: PlayDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayDialog.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- PlayDialog.java 4 Mar 2006 16:56:00 -0000 1.11 +++ PlayDialog.java 10 Mar 2006 14:29:09 -0000 1.12 @@ -35,8 +35,6 @@ boolean dockedPlaylist, dockedPlaylist2; PlayQueue pq; - Image imgJavaAmp, imgJavaAmp1, imgJavaAmp2; - Image imgRep0, imgRep1, imgRepA; BufferedImage buiOffscreen; Graphics graOffscreen; @@ -46,46 +44,6 @@ loopmode = 0; - Image i1 = getToolkit().getImage(getClass().getResource("eq.png")); - Image i2 = getToolkit().getImage(getClass().getResource("pl.png")); - Image i3 = getToolkit().getImage(getClass().getResource("back.png")); - Image i4 = getToolkit().getImage(getClass().getResource("play.png")); - Image i5 = getToolkit().getImage(getClass().getResource("pause.png")); - Image i6 = getToolkit().getImage(getClass().getResource("stop.png")); - Image i7 = getToolkit().getImage(getClass().getResource("next.png")); - Image i8 = getToolkit().getImage(getClass().getResource("open.png")); - Image i9 = getToolkit().getImage(getClass().getResource("shuffle.png")); - imgJavaAmp = getToolkit().getImage(getClass().getResource( - "javaamp.png")); - imgJavaAmp1 = getToolkit().getImage(getClass().getResource( - "javaamp1.png")); - imgJavaAmp2 = getToolkit().getImage(getClass().getResource( - "javaamp2.png")); - imgRep0 = getToolkit().getImage(getClass().getResource( - "rep0.png")); - imgRep1 = getToolkit().getImage(getClass().getResource( - "rep1.png")); - imgRepA = getToolkit().getImage(getClass().getResource( - "repa.png")); - Image i10 = getToolkit().getImage(getClass().getResource("vis.png")); - MediaTracker mt = new MediaTracker(this); - mt.addImage( i1, 0); - mt.addImage( i2, 1); - mt.addImage( i3, 2); - mt.addImage( i4, 3); - mt.addImage( i5, 4); - mt.addImage( i6, 5); - mt.addImage( i7, 6); - mt.addImage( i8, 7); - mt.addImage( i9, 8); - mt.addImage( imgJavaAmp, 9); - mt.addImage(imgJavaAmp1, 10); - mt.addImage(imgJavaAmp2, 11); - mt.addImage( imgRep0, 12); - mt.addImage( imgRep1, 13); - mt.addImage( imgRepA, 14); - mt.addImage( i10, 15); - buiOffscreen = new BufferedImage(275, 115, BufferedImage.TYPE_INT_RGB); graOffscreen = buiOffscreen.getGraphics(); @@ -280,8 +238,13 @@ sliPan.setBounds(180, 51, 43, 23); sliPan.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { - lblSongInfo.text2 = "Pan: " + (sliPan.getValue() * 200 / - 255 - 100); + int val = sliPan.getValue() * 200 / 255 - 100; + if(val < 0) + lblSongInfo.text2 = "Balance: " + (-val) + " % left"; + else if(val > 0) + lblSongInfo.text2 = "Balance: " + val + " % right"; + else + lblSongInfo.text2 = "Balance: Center"; lblSongInfo.showing = false; } @@ -291,8 +254,13 @@ }); sliPan.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { - lblSongInfo.text2 = "Pan: " + (sliPan.getValue() * 200 / - 255 - 100); + int val = sliPan.getValue() * 200 / 255 - 100; + if(val < 0) + lblSongInfo.text2 = "Balance: " + (-val) + " % left"; + else if(val > 0) + lblSongInfo.text2 = "Balance: " + val + " % right"; + else + lblSongInfo.text2 = "Balance: Center"; if(pq != null) FSound.FSOUND_SetPan(pq.c, sliPan.getValue()); } @@ -306,11 +274,15 @@ prbTrack.setBounds(5, 75, 265, 10); prbTrack.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { + if(e.getButton() != MouseEvent.BUTTON1) + return; if(pq != null && pq.stream != null) prbTrack.setValue(e.getX() * 255 / prbTrack.getWidth()); prbTrack.setString("1"); } public void mouseReleased(MouseEvent e) { + if(!prbTrack.getString().equals("1")) + return; if(pq != null && pq.stream != null) FSound.FSOUND_Stream_SetTime(pq.stream, (int)((double)( e.getX() * 255 / prbTrack.getWidth()) / 255d * @@ -320,12 +292,14 @@ }); prbTrack.addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(MouseEvent e) { + if(!prbTrack.getString().equals("1")) + return; if(pq != null && pq.stream != null) prbTrack.setValue(e.getX() * 255 / prbTrack.getWidth()); } }); - btnVis = new JButton(new ImageIcon(i10)); + btnVis = new JButton(new ImageIcon(GraphicsLoader.pd10)); btnVis.setToolTipText("Start visualization"); btnVis.setFocusable(false); btnVis.setBounds(228, 38, 20, 15); @@ -344,7 +318,7 @@ } }); - tobEQ = new JToggleButton(new ImageIcon(i1), true); + tobEQ = new JToggleButton(new ImageIcon(GraphicsLoader.pd1), true); tobEQ.setToolTipText("Show equalizer"); tobEQ.setFocusable(false); tobEQ.setBounds(228, 55, 20, 15); @@ -359,7 +333,7 @@ } }); - tobPL = new JToggleButton(new ImageIcon(i2), true); + tobPL = new JToggleButton(new ImageIcon(GraphicsLoader.pd2), true); tobPL.setToolTipText("Show playlist"); tobPL.setFocusable(false); tobPL.setBounds(250, 55, 20, 15); @@ -374,7 +348,8 @@ } }); - tobShuffle = new JToggleButton(new ImageIcon(i9), false); + tobShuffle = new JToggleButton(new ImageIcon(GraphicsLoader.pd9), + false); tobShuffle.setToolTipText("Shuffle: Off"); tobShuffle.setFocusable(false); tobShuffle.setBounds(147, 92, 45, 15); @@ -387,7 +362,7 @@ } }); - btnBack = new JButton(new ImageIcon(i3)); + btnBack = new JButton(new ImageIcon(GraphicsLoader.pd3)); btnBack.setToolTipText("Previous"); btnBack.setFocusable(false); btnBack.setBounds(5, 90, 20, 20); @@ -414,7 +389,7 @@ } }); - btnPlay = new JButton(new ImageIcon(i4)); + btnPlay = new JButton(new ImageIcon(GraphicsLoader.pd4)); btnPlay.setToolTipText("Play"); btnPlay.setFocusable(false); btnPlay.setBounds(27, 90, 20, 20); @@ -442,7 +417,7 @@ } }); - btnPause = new JButton(new ImageIcon(i5)); + btnPause = new JButton(new ImageIcon(GraphicsLoader.pd5)); btnPause.setToolTipText("Pause"); btnPause.setFocusable(false); btnPause.setBounds(49, 90, 20, 20); @@ -457,7 +432,7 @@ } }); - btnStop = new JButton(new ImageIcon(i6)); + btnStop = new JButton(new ImageIcon(GraphicsLoader.pd6)); btnStop.setToolTipText("Stop"); btnStop.setFocusable(false); btnStop.setBounds(71, 90, 20, 20); @@ -470,7 +445,7 @@ } }); - btnNext = new JButton(new ImageIcon(i7)); + btnNext = new JButton(new ImageIcon(GraphicsLoader.pd7)); btnNext.setToolTipText("Next"); btnNext.setFocusable(false); btnNext.setBounds(93, 90, 20, 20); @@ -496,7 +471,7 @@ } }); - btnOpen = new JButton(new ImageIcon(i8)); + btnOpen = new JButton(new ImageIcon(GraphicsLoader.pd8)); btnOpen.setToolTipText("Open"); btnOpen.setFocusable(false); btnOpen.setBounds(120, 90, 20, 20); @@ -531,7 +506,7 @@ } }); - btnRepeat = new JButton(new ImageIcon(imgRep0)); + btnRepeat = new JButton(new ImageIcon(GraphicsLoader.pd11)); btnRepeat.setToolTipText("Repeat: Off"); btnRepeat.setFocusable(false); btnRepeat.setBounds(194, 92, 25, 15); @@ -542,15 +517,15 @@ loopmode = 0; switch(loopmode) { case 0: - btnRepeat.setIcon(new ImageIcon(imgRep0)); + btnRepeat.setIcon(new ImageIcon(GraphicsLoader.pd11)); btnRepeat.setToolTipText("Repeat: Off"); break; case 1: - btnRepeat.setIcon(new ImageIcon(imgRep1)); + btnRepeat.setIcon(new ImageIcon(GraphicsLoader.pd12)); btnRepeat.setToolTipText("Repeat: One file"); break; default: - btnRepeat.setIcon(new ImageIcon(imgRepA)); + btnRepeat.setIcon(new ImageIcon(GraphicsLoader.pd13)); btnRepeat.setToolTipText("Repeat: All files"); } } @@ -575,17 +550,17 @@ setContentPane(cntContainer); - mt.waitForAll(); + splSpectrum.start(); } public void paint(Graphics g) { super.paint(graOffscreen); if(ct <= 1) - graOffscreen.drawImage(imgJavaAmp, 0, 0, this); + graOffscreen.drawImage(GraphicsLoader.pd14, 0, 0, this); else if(ct == 2) - graOffscreen.drawImage(imgJavaAmp1, 0, 0, this); + graOffscreen.drawImage(GraphicsLoader.pd15, 0, 0, this); else if(ct == 3) - graOffscreen.drawImage(imgJavaAmp2, 0, 0, this); + graOffscreen.drawImage(GraphicsLoader.pd16, 0, 0, this); g.drawImage(buiOffscreen, 0, 0, this); } } \ No newline at end of file --- NEW FILE: GraphicsLoader.java --- import java.awt.*; public class GraphicsLoader { private static MediaTracker mt; // EqualizerDialog static Image eqd1, eqd2; // PlayDialog static Image pd1, pd2, pd3, pd4, pd5, pd6, pd7, pd8, pd9, pd10, pd11, pd12, pd13, pd14, pd15, pd16; public final static void startLoading(Component comp) { Class cls = comp.getClass(); Toolkit tk = comp.getToolkit(); mt = new MediaTracker(comp); // EqualizerDialog eqd1 = tk.getImage(cls.getResource("presets.png")); eqd2 = tk.getImage(cls.getResource("on.png")); // PlayDialog pd1 = tk.getImage(cls.getResource("eq.png")); pd2 = tk.getImage(cls.getResource("pl.png")); pd3 = tk.getImage(cls.getResource("back.png")); pd4 = tk.getImage(cls.getResource("play.png")); pd5 = tk.getImage(cls.getResource("pause.png")); pd6 = tk.getImage(cls.getResource("stop.png")); pd7 = tk.getImage(cls.getResource("next.png")); pd8 = tk.getImage(cls.getResource("open.png")); pd9 = tk.getImage(cls.getResource("shuffle.png")); pd10 = tk.getImage(cls.getResource("vis.png")); pd11 = tk.getImage(cls.getResource("rep0.png")); pd12 = tk.getImage(cls.getResource("rep1.png")); pd13 = tk.getImage(cls.getResource("repa.png")); pd14 = tk.getImage(cls.getResource("javaamp.png")); pd15 = tk.getImage(cls.getResource("javaamp1.png")); pd16 = tk.getImage(cls.getResource("javaamp2.png")); mt.addImage(eqd1, 0); mt.addImage(eqd2, 1); mt.addImage(pd1, 2); mt.addImage(pd2, 3); mt.addImage(pd3, 4); mt.addImage(pd4, 5); mt.addImage(pd5, 6); mt.addImage(pd6, 7); mt.addImage(pd7, 8); mt.addImage(pd8, 9); mt.addImage(pd9, 10); mt.addImage(pd10, 11); mt.addImage(pd11, 12); mt.addImage(pd12, 13); mt.addImage(pd13, 14); mt.addImage(pd14, 15); mt.addImage(pd15, 16); mt.addImage(pd16, 17); } public final static boolean finishLoading() { try { mt.waitForAll(); } catch(Exception e) { return false; } return !mt.isErrorAny(); } } |
From: WiESi <wi...@us...> - 2006-03-07 16:13:24
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21548/src Modified Files: EQLabel.java FileInformationDialog.java SongInfoLabel.java Added Files: Spline.java Log Message: Splines, ... Index: EQLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/EQLabel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- EQLabel.java 28 Feb 2006 16:08:13 -0000 1.7 +++ EQLabel.java 7 Mar 2006 16:13:17 -0000 1.8 @@ -54,12 +54,17 @@ offg.setColor(Color.LIGHT_GRAY); offg.fillRect(0, 63 - owner.equalizerDialog.sliPre.getValue(), 239, 3); offg.setColor(Color.BLACK); + double[] xx = new double[10]; + double[] ff = new double[10]; for(int i = 0; i < 10; i++) { offg.fillRect(i * 24 + 10, owner.equalizerDialog.eqvals[i], 3, 3); - if(i < 9) - offg.drawLine(i * 24 + 11, 1 + owner.equalizerDialog.eqvals[i], - (i + 1) * 24 + 11, 1 + owner.equalizerDialog.eqvals[i + 1]); + xx[i] = i * 24 + 11; + ff[i] = owner.equalizerDialog.eqvals[i] + 1; } + Spline s = new Spline(xx, ff); + for(int i = 11; i < 227; i++) + offg.drawLine(i, (int)s.spline_value(i), i + 1, (int)s.spline_value( + i + 1)); g.drawImage(offscreen, 0, 0, this); } } \ No newline at end of file Index: FileInformationDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/FileInformationDialog.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- FileInformationDialog.java 4 Mar 2006 10:01:12 -0000 1.7 +++ FileInformationDialog.java 7 Mar 2006 16:13:18 -0000 1.8 @@ -146,7 +146,7 @@ return false; } - public int getIDfromType(int type) { + private int getIDfromType(int type) { for(int i = 0; i < types.length; i++) if(types[i] == type) return i; --- NEW FILE: Spline.java --- /* AUTHORS: Lawrence Shampine, Richard Allen, Steven Pruess for the text Fundamentals of Numerical Computing DATE: February 27, 1996 minimal change convertion to Java August 11, 2003 Modified and standardized by Andreas Wiesbauer, March 2006. */ import java.text.*; public class Spline { int n, last_interval; double x[], f[], b[], c[], d[]; boolean uniform; public Spline(double xx[], double ff[]) { // Calculate coefficients defining a smooth cubic interpolatory spline. // // Input parameters: // xx = vector of values of the independent variable ordered so that // x[i] < x[i + 1] for all i. // ff = vector of values of the dependent variable. // Class values constructed: // n = number of data points. // b = vector of S'(x[i]) values. // c = vector of S''(x[i]) / 2 values. // d = vector of S'''(x[i]) / 6 values (i < n). // x = xx // f = ff double fp1, fpn, h, p; DecimalFormat f1 = new DecimalFormat("00.00000"); boolean sorted = true; uniform = true; last_interval = 0; n = xx.length; if(n <= 3) throw new RuntimeException("Not enough points to build spline, n=" + n); if(n != ff.length) throw new RuntimeException("Not same number of x and f(x)"); x = new double[n]; f = new double[n]; b = new double[n]; c = new double[n]; d = new double[n]; for(int i = 0; i < n; i++) { x[i] = xx[i]; f[i] = ff[i]; if(i >= 1 && x[i] < x[i - 1]) sorted = false; } // Sort if necessary if(!sorted) dHeapSort(x, f); // Calculate coefficients for the tri-diagonal system: store // sub-diagonal in b, diagonal in d, difference quotient in c. b[0] = x[1] - x[0]; c[0] = (f[1] - f[0]) / b[0]; if(n == 2) { b[0] = c[0]; c[0] = 0.0; d[0] = 0.0; b[1] = b[0]; c[1] = 0.0; return; } d[0] = 2.0 * b[0]; for(int i = 1; i < n - 1; i++) { b[i] = x[i + 1] - x[i]; if(Math.abs(b[i] - b[0]) / b[0] > 1.0E-5) uniform = false; c[i] = (f[i + 1] - f[i]) / b[i]; d[i] = 2.0 * (b[i] + b[i - 1]); } d[n - 1] = 2.0 * b[n - 2]; // Calculate estimates for the end slopes. Use polynomials // interpolating data nearest the end. fp1 = c[0] - b[0] * (c[1] - c[0]) / (b[0] + b[1]); if(n > 3) fp1 = fp1 + b[0] * ((b[0] + b[1]) * (c[2] - c[1]) / (b[1] + b[2]) - c[1] + c[0]) / (x[3] - x[0]); fpn = c[n - 2] + b[n - 2] * (c[n - 2] - c[n - 3]) / (b[n - 3] + b [n - 2]); if(n > 3) fpn = fpn + b[n - 2] * (c[n - 2] - c[n - 3] - (b[n - 3] + b[n - 2]) * (c[n - 3] - c[n - 4]) / (b[n - 3] + b[n - 4])) / (x[n - 1] - x[n - 4]); // Calculate the right-hand-side and store it in c. c[n - 1] = 3.0 * (fpn - c[n - 2]); for(int i = n - 2; i > 0; i--) c[i] = 3.0 * (c[i] - c[i - 1]); c[0] = 3.0 * (c[0] - fp1); // Solve the tridiagonal system. for(int k = 1; k < n; k++) { p = b[k - 1] / d[k - 1]; d[k] = d[k] - p * b[k - 1]; c[k] = c[k] - p * c[k - 1]; } c[n - 1] = c[n - 1] / d[n - 1]; for(int k = n - 2; k >= 0; k--) c[k] = (c[k] - b[k] * c[k + 1]) / d[k]; // Calculate the coefficients defining the spline. h = x[1] - x[0]; for(int i = 0; i < n - 1; i++) { h = x[i + 1] - x[i]; d[i] = (c[i + 1] - c[i]) / (3.0 * h); b[i] = (f[i + 1] - f[i]) / h - h * (c[i] + h * d[i]); } b[n - 1] = b[n - 2] + h * (2.0 * c[n - 2] + h * 3.0 * d[n - 2]); } public double spline_value(double t) { // Evaluate the spline s at t using coefficients from Spline constructor // // Input parameters // Class variables // t = point where spline is to be evaluated. // Output: // s = value of spline at t. double dt, s; int interval; // Index such that t >= x[interval] and // t < x[interval + 1] if(n <= 1) throw new RuntimeException("Not enough points to compute value"); // Search for correct interval for t. interval = last_interval; // Heuristic if(t < x[0]) throw new RuntimeException("Requested point below Spline region"); if(t > x[n - 1]) throw new RuntimeException("Requested point above Spline region"); if(t > x[n - 2]) interval = n-2; else if (t >= x[last_interval]) for(int j = last_interval; j < n && t >= x[j]; j++) interval = j; else for(int j = last_interval; t < x[j]; j--) interval = j - 1; last_interval = interval; // Class variable for next call // Evaluate cubic polynomial on [x[interval], x[interval+1]]. dt = t - x[interval]; s = f[interval] + dt * (b[interval] + dt * (c[interval] + dt * d[interval])); return s; } public double integrate() { double suma, sumb, sumc, sumd; double dx, t; if(n <= 3) throw new RuntimeException("Not enough data to integrate"); if(!uniform) { t = 0.0; for(int i = 0; i < n - 1; i++) { dx = x[i + 1] - x[i]; t = t + (f[i] + (b[i] / 2.0 + (c[i] / 3.0 + dx * d[i] / 4.0) * dx) * dx) * dx; } return t; } // Compute uniform integral of spline fit suma = sumb = sumc = sumd = 0.0; for(int i = 0; i < n; i++) { suma = suma + d[i]; sumb = sumb + c[i]; sumc = sumc + b[i]; sumd = sumd + f[i]; } dx = x[1] - x[0]; // Assumes equally spaced points return (sumd + (sumc / 2.0 + (sumb / 3.0 + dx * suma / 4.0) * dx) * dx) * dx; } private final static void dHeapSort(double key[], double trail[]) { int nkey = key.length; int last_parent_pos = (nkey - 2) / 2; int last_parent_index = last_parent_pos; double tkey, ttrail; if(nkey <= 1) return; for(int i = last_parent_index; i >= 0; i--) dremake_heap(key, trail, i, nkey - 1); tkey = key [ 0]; key [ 0] = key [nkey - 1]; key [nkey - 1] = tkey; ttrail = trail[ 0]; trail[ 0] = trail[nkey - 1]; trail[nkey - 1] = ttrail; for(int i = nkey - 2; i > 0; i--) { dremake_heap(key, trail, 0, i); tkey = key[0]; key [0] = key [i]; key [i] = tkey; ttrail = trail[0]; trail [0] = trail[i]; trail [i] = ttrail; } } private final static void dremake_heap(double key[], double trail[], int parent_index, int last_index) { int last_parent_pos = (last_index - 1) / 2; int last_parent_index = last_parent_pos; int l_child, r_child, max_child_index; int parent_temp = parent_index; double tkey, ttrail; while(parent_temp <= last_parent_index) { l_child = parent_temp * 2 + 1; if(l_child == last_index) max_child_index = l_child; else { r_child = l_child + 1; max_child_index = key[l_child] > key[r_child] ? l_child : r_child; } if(key[max_child_index] > key[parent_temp]) { tkey = key[max_child_index]; key[max_child_index] = key[parent_temp]; key[parent_temp] = tkey; ttrail = trail[max_child_index]; trail[max_child_index] = trail[parent_temp]; trail[parent_temp] = ttrail; parent_temp = max_child_index; } else break; } } } Index: SongInfoLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/SongInfoLabel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- SongInfoLabel.java 4 Mar 2006 16:56:00 -0000 1.6 +++ SongInfoLabel.java 7 Mar 2006 16:13:18 -0000 1.7 @@ -24,7 +24,7 @@ xt = 4; text2 = ""; - setText("JavaAmp"); + setText("JavaAmp 0.0.4"); setBorder(new BevelBorder(BevelBorder.LOWERED)); setFont(new Font("Dialog", Font.PLAIN, 10)); setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR)); |
From: WiESi <wi...@us...> - 2006-03-04 16:56:13
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv927/src Modified Files: PlayDialog.java SongInfoLabel.java Log Message: Volume and pan showing on SongInfoLabel Index: PlayDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayDialog.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- PlayDialog.java 3 Mar 2006 18:29:19 -0000 1.10 +++ PlayDialog.java 4 Mar 2006 16:56:00 -0000 1.11 @@ -253,8 +253,21 @@ sliVolume.setOpaque(false); sliVolume.setFocusable(false); sliVolume.setBounds(110, 51, 65, 23); + sliVolume.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent e) { + lblSongInfo.text2 = "Volume: " + (sliVolume.getValue() * 100 / + 255) + " %"; + lblSongInfo.showing = false; + } + + public void mouseReleased(MouseEvent e) { + lblSongInfo.showing = true; + } + }); sliVolume.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { + lblSongInfo.text2 = "Volume: " + (sliVolume.getValue() * 100 / + 255) + " %"; if(pq != null) FSound.FSOUND_SetVolume(pq.c, sliVolume.getValue()); } @@ -265,8 +278,21 @@ sliPan.setOpaque(false); sliPan.setFocusable(false); sliPan.setBounds(180, 51, 43, 23); + sliPan.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent e) { + lblSongInfo.text2 = "Pan: " + (sliPan.getValue() * 200 / + 255 - 100); + lblSongInfo.showing = false; + } + + public void mouseReleased(MouseEvent e) { + lblSongInfo.showing = true; + } + }); sliPan.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { + lblSongInfo.text2 = "Pan: " + (sliPan.getValue() * 200 / + 255 - 100); if(pq != null) FSound.FSOUND_SetPan(pq.c, sliPan.getValue()); } Index: SongInfoLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/SongInfoLabel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SongInfoLabel.java 10 Feb 2006 16:37:59 -0000 1.5 +++ SongInfoLabel.java 4 Mar 2006 16:56:00 -0000 1.6 @@ -10,16 +10,19 @@ BufferedImage imgOffscreen; Graphics ofgOffscreen; Timer tmr; - boolean moving, moveable; + boolean moving, moveable, showing; int mx, xt, wt; + String text2; public SongInfoLabel(JavaAmp o) { owner = o; moving = false; moveable = false; + showing = true; mx = 0; xt = 4; + text2 = ""; setText("JavaAmp"); setBorder(new BevelBorder(BevelBorder.LOWERED)); @@ -110,12 +113,15 @@ ofgOffscreen.setColor(Color.WHITE); ofgOffscreen.fillRect(0, 0, getWidth(), getHeight()); ofgOffscreen.setColor(Color.BLACK); - if(moveable) + if(moveable && showing) ofgOffscreen.drawString(getText() + " *** " + getText(), xt, ofgOffscreen.getFontMetrics().getHeight() - 3); - else + else if(showing) ofgOffscreen.drawString(getText(), xt, ofgOffscreen.getFontMetrics().getHeight() - 3); + else + ofgOffscreen.drawString(text2, 4, + ofgOffscreen.getFontMetrics().getHeight() - 3); getBorder().paintBorder(this, ofgOffscreen, 0, 0, getWidth(), getHeight()); if(g != null) |
From: WiESi <wi...@us...> - 2006-03-04 10:02:13
|
Update of /cvsroot/javaamp/javaamp/unstable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26838/unstable Modified Files: JavaAmp.jar Log Message: Built on 2006-02-04 Index: JavaAmp.jar =================================================================== RCS file: /cvsroot/javaamp/javaamp/unstable/JavaAmp.jar,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 Binary files /tmp/cvs6dYlBn and /tmp/cvsqXdT8Z differ |
From: WiESi <wi...@us...> - 2006-03-04 10:01:17
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26525/src Modified Files: FileInformationDialog.java Log Message: General file information Index: FileInformationDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/FileInformationDialog.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- FileInformationDialog.java 3 Mar 2006 18:29:19 -0000 1.6 +++ FileInformationDialog.java 4 Mar 2006 10:01:12 -0000 1.7 @@ -1,6 +1,10 @@ import java.awt.*; import java.awt.event.*; +import java.io.*; +import java.net.*; import java.nio.*; +import java.text.*; +import java.util.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.table.*; @@ -23,6 +27,10 @@ Container[] containers; JScrollPane[] scrollPanes; JTable[] tables; + Container cntGen; + JScrollPane scpGen; + JTable tabGen; + DefaultTableModel dtmGen; public FileInformationDialog(JavaAmp o) { super(o.playlistDialog, "File informations", true); @@ -54,6 +62,16 @@ containers[i].add(scrollPanes[i]); } + cntGen = new Container(); + cntGen.setLayout(new BorderLayout()); + tabGen = new JTable(new DefaultTableModel(new String[] { + "Key", "Value" }, 0)); + dtmGen = (DefaultTableModel)tabGen.getModel(); + scpGen = new JScrollPane(tabGen, + JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + cntGen.add(scpGen); + tapType = new JTabbedPane(); tapType.setBounds(10, 40, 470, 320); @@ -100,6 +118,24 @@ for(int i = 0; i < containers.length; i++) if(tables[i].getModel().getRowCount() > 0) tapType.add(descriptions[i], containers[i]); + dtmGen.addRow(new String[] { "File length", + JavaAmpToolkit.getDuration(FSound.FSOUND_Stream_GetLengthMs( + stream) / 1000) }); + if(entry.type == FileEntry.TYPE_FILE) { + File file = entry.file; + dtmGen.addRow(new String[] { "File size", (file.length() / + 1024) + " KB" }); + dtmGen.addRow(new String[] { "Last modified", + DateFormat.getDateInstance().format(new Date( + file.lastModified())) }); + } + else { + URL url = entry.url; + dtmGen.addRow(new String[] { "Protocol", + url.getProtocol() }); + } + tapType.add("General", cntGen); + FSound.FSOUND_Stream_Close(stream); return true; } } |
From: WiESi <wi...@us...> - 2006-03-03 18:33:21
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27487/src Modified Files: JavaAmpToolkit.java SpectrumLabel.java Log Message: Index: JavaAmpToolkit.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmpToolkit.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- JavaAmpToolkit.java 28 Feb 2006 16:08:13 -0000 1.1 +++ JavaAmpToolkit.java 3 Mar 2006 18:33:17 -0000 1.2 @@ -10,6 +10,16 @@ return (d / 60) + ":" + sec; } + public final static String getDuration00(int d) { + String min = "" + d / 60; + while(min.length() < 2) + min = '0' + min; + String sec = "" + d % 60; + while(sec.length() < 2) + sec = '0' + sec; + return min + ':' + sec; + } + public final static FSoundStream openCDStream(FileEntry entry) { if(entry.type != FileEntry.TYPE_FILE) return null; Index: SpectrumLabel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/SpectrumLabel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SpectrumLabel.java 29 Jan 2006 15:14:44 -0000 1.3 +++ SpectrumLabel.java 3 Mar 2006 18:33:17 -0000 1.4 @@ -118,8 +118,9 @@ if(owner.playDialog.pq.pause == 1 && pt < 25) duration = "##:##"; else - duration = getDuration(FSound.FSOUND_Stream_GetTime( - owner.playDialog.pq.stream) / 1000); + duration = JavaAmpToolkit.getDuration00( + FSound.FSOUND_Stream_GetTime(owner.playDialog.pq.stream) / + 1000); int xt = 46; for(int i = 0; i < duration.length(); i++) xt = drawNum(duration.charAt(i), xt, 5); @@ -159,14 +160,4 @@ return x + 7; return x; } - - public String getDuration(int d) { - String min = "" + d / 60; - while(min.length() < 2) - min = '0' + min; - String sec = "" + d % 60; - while(sec.length() < 2) - sec = '0' + sec; - return min + ':' + sec; - } } \ No newline at end of file |
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23759/src Modified Files: EqualizerDialog.java FileInformationDialog.java JavaAmp.java LoadInfoDialog.java PlayDialog.java PlaylistDialog.java Log Message: Translated into English Index: EqualizerDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/EqualizerDialog.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- EqualizerDialog.java 25 Feb 2006 16:49:59 -0000 1.12 +++ EqualizerDialog.java 3 Mar 2006 18:29:19 -0000 1.13 @@ -147,7 +147,7 @@ bebBorder = new BevelBorder(BevelBorder.RAISED); tobOn = new JToggleButton(new ImageIcon(i2)); - tobOn.setToolTipText("Equalizer aktivieren"); + tobOn.setToolTipText("Activate equalizer"); tobOn.setFocusable(false); tobOn.setEnabled(false); tobOn.setBounds(5, 5, 20, 15); @@ -157,7 +157,7 @@ eqvals[i] = 31; sliPre = new JSlider(JSlider.VERTICAL, 0, 63, 32); - sliPre.setToolTipText("Vorverstärker"); + sliPre.setToolTipText("Preamplifier"); sliPre.setInverted(true); sliPre.setOpaque(false); sliPre.setFocusable(false); @@ -180,10 +180,10 @@ meiPresets.setEnabled(false); pomPresets.add(meiPresets); pomPresets.addSeparator(); - menLoad = new JMenu("Laden"); + menLoad = new JMenu("Load"); meiLoadPreset = new JMenuItem("Preset"); menLoad.add(meiLoadPreset); - meiLoadEQF = new JMenuItem("Von EQF-Datei"); + meiLoadEQF = new JMenuItem("From EQF-file"); meiLoadEQF.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { @@ -196,10 +196,10 @@ }); menLoad.add(meiLoadEQF); pomPresets.add(menLoad); - menSave = new JMenu("Speichern"); + menSave = new JMenu("Save"); meiSavePreset = new JMenuItem("Preset"); menSave.add(meiSavePreset); - meiSaveEQF = new JMenuItem("Nach EQF-Datei"); + meiSaveEQF = new JMenuItem("To EQF-file"); meiSaveEQF.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { @@ -212,7 +212,7 @@ }); menSave.add(meiSaveEQF); pomPresets.add(menSave); - menDelete = new JMenu("Löschen"); + menDelete = new JMenu("Delete"); meiDeletePreset = new JMenuItem("Preset"); menDelete.add(meiDeletePreset); pomPresets.add(menDelete); @@ -256,10 +256,10 @@ return f.toString().toLowerCase().endsWith(".eqf"); } public String getDescription() { - return "EQF Dateien"; + return "EQF files"; } }); - owner.fchChooser.setDialogTitle("EQF laden"); + owner.fchChooser.setDialogTitle("Load EQF"); if(owner.fchChooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) return; FileInputStream fis = new FileInputStream( @@ -288,10 +288,10 @@ return f.toString().toLowerCase().endsWith(".eqf"); } public String getDescription() { - return "EQF Dateien"; + return "EQF files"; } }); - owner.fchChooser.setDialogTitle("Als EQF speichern"); + owner.fchChooser.setDialogTitle("Save as EQF"); if(owner.fchChooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) return; byte[] out = new byte[299]; Index: JavaAmp.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/JavaAmp.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- JavaAmp.java 28 Feb 2006 16:08:13 -0000 1.9 +++ JavaAmp.java 3 Mar 2006 18:29:19 -0000 1.10 @@ -65,7 +65,7 @@ str.append(e.getStackTrace()[i]); str.append('\n'); } - Sys.alert("JavaAmp: Fehler", str.toString()); + Sys.alert("JavaAmp: Error!", str.toString()); System.exit(1); } @@ -78,7 +78,7 @@ str.append(e.getStackTrace()[i]); str.append('\n'); } - Sys.alert("JavaAmp: Warnung", str.toString()); + Sys.alert("JavaAmp: Warning!", str.toString()); } public static void main(String[] args) { Index: PlaylistDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlaylistDialog.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- PlaylistDialog.java 28 Feb 2006 16:08:13 -0000 1.21 +++ PlaylistDialog.java 3 Mar 2006 18:29:19 -0000 1.22 @@ -240,22 +240,22 @@ }); btnAdd = new JButton("+"); - btnAdd.setToolTipText("Hinzufügen"); + btnAdd.setToolTipText("Add"); btnAdd.setFocusable(false); btnAdd.setBounds(5, 90, 60, 20); pomAdd = new JPopupMenu(); - JMenuItem meiAdd = new JMenuItem("Hinzufügen"); + JMenuItem meiAdd = new JMenuItem("Add"); meiAdd.setEnabled(false); pomAdd.add(meiAdd); pomAdd.addSeparator(); - meiAddFile = new JMenuItem("Datei"); + meiAddFile = new JMenuItem("File"); meiAddFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addFiles(); } }); pomAdd.add(meiAddFile); - meiAddDir = new JMenuItem("Verzeichnis"); + meiAddDir = new JMenuItem("Directory"); meiAddDir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { owner.fchChooser.setMultiSelectionEnabled(true); @@ -269,7 +269,7 @@ owner.fchChooser.setFileFilter( owner.fchChooser.getAcceptAllFileFilter()); owner.fchChooser.setDialogTitle( - "Ordner zur Playlist hinzufügen"); + "Add directory to playlist"); if(owner.fchChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return; @@ -294,15 +294,15 @@ }); btnRem = new JButton("-"); - btnRem.setToolTipText("Entfernen"); + btnRem.setToolTipText("Remove"); btnRem.setFocusable(false); btnRem.setBounds(67, 90, 60, 20); pomRem = new JPopupMenu(); - JMenuItem meiRem = new JMenuItem("Entfernen"); + JMenuItem meiRem = new JMenuItem("Remove"); meiRem.setEnabled(false); pomRem.add(meiRem); pomRem.addSeparator(); - meiRemSel = new JMenuItem("Auswahl"); + meiRemSel = new JMenuItem("Selection"); meiRemSel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] sel = lstPlaylist.getSelectedIndices(); @@ -310,7 +310,7 @@ } }); pomRem.add(meiRemSel); - meiRemAll = new JMenuItem("Alles"); + meiRemAll = new JMenuItem("All"); meiRemAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { listmodel.clear(); @@ -318,8 +318,8 @@ }); pomRem.add(meiRemAll); - menRemPhy = new JMenu("Physikalisch"); - meiRemSelPhy = new JMenuItem("Auswahl"); + menRemPhy = new JMenu("Physically"); + meiRemSelPhy = new JMenuItem("Selection"); meiRemSelPhy.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] sel = lstPlaylist.getSelectedIndices(); @@ -344,7 +344,7 @@ } }); menRemPhy.add(meiRemSelPhy); - meiRemAllPhy = new JMenuItem("Alle"); + meiRemAllPhy = new JMenuItem("All"); meiRemAllPhy.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int num = lstPlaylist.getModel().getSize(); @@ -376,15 +376,15 @@ }); btnSel = new JButton("Sel"); - btnSel.setToolTipText("Auswahl"); + btnSel.setToolTipText("Select"); btnSel.setFocusable(false); btnSel.setBounds(129, 90, 60, 20); pomSel = new JPopupMenu(); - JMenuItem meiSel = new JMenuItem("Auswahl"); + JMenuItem meiSel = new JMenuItem("Select"); meiSel.setEnabled(false); pomSel.add(meiSel); pomSel.addSeparator(); - meiSelAll = new JMenuItem("Alles"); + meiSelAll = new JMenuItem("All"); meiSelAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { lstPlaylist.setSelectionInterval(0, @@ -392,14 +392,14 @@ } }); pomSel.add(meiSelAll); - meiSelZero = new JMenuItem("Nichts"); + meiSelZero = new JMenuItem("Nothing"); meiSelZero.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { lstPlaylist.setSelectedIndices(new int[] { }); } }); pomSel.add(meiSelZero); - meiSelInvert = new JMenuItem("Invertieren"); + meiSelInvert = new JMenuItem("Invert"); meiSelInvert.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ArrayList<Integer> sels = new ArrayList<Integer>(); @@ -419,31 +419,31 @@ } }); - btnMsc = new JButton("Son"); - btnMsc.setToolTipText("Sonstiges"); + btnMsc = new JButton("Msc"); + btnMsc.setToolTipText("Miscellaneous"); btnMsc.setFocusable(false); btnMsc.setBounds(191, 90, 60, 20); pomMsc = new JPopupMenu(); - JMenuItem meiMsc = new JMenuItem("Sonstiges"); + JMenuItem meiMsc = new JMenuItem("Miscellaneous"); meiMsc.setEnabled(false); pomMsc.add(meiMsc); pomMsc.addSeparator(); - menLst = new JMenu("Liste"); - meiLoadList = new JMenuItem("Liste laden"); + menLst = new JMenu("List"); + meiLoadList = new JMenuItem("Load list"); meiLoadList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { loadList(); } }); menLst.add(meiLoadList); - meiSaveList = new JMenuItem("Liste speichern"); + meiSaveList = new JMenuItem("Save list"); meiSaveList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { saveList(); } }); menLst.add(meiSaveList); - meiGenHTMLList = new JMenuItem("HTML-Liste erstellen"); + meiGenHTMLList = new JMenuItem("Generate HTML-list"); meiGenHTMLList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { genHTMLList(); @@ -451,7 +451,7 @@ }); menLst.add(meiGenHTMLList); pomMsc.add(menLst); - meiLoadInfos = new JMenuItem("Informationen laden (ungenau)"); + meiLoadInfos = new JMenuItem("Load informations (unexactly)"); meiLoadInfos.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(listmodel.getSize() <= 0) @@ -460,7 +460,7 @@ } }); pomMsc.add(meiLoadInfos); - meiLoadInfosAccurate = new JMenuItem("Informationen laden (genau)"); + meiLoadInfosAccurate = new JMenuItem("Load informations (exactly)"); meiLoadInfosAccurate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(listmodel.getSize() <= 0) @@ -476,18 +476,18 @@ }); pomFile = new JPopupMenu(); - JMenuItem meiFile = new JMenuItem("Datei"); + JMenuItem meiFile = new JMenuItem("File"); meiFile.setEnabled(false); pomFile.add(meiFile); pomFile.addSeparator(); - meiFilePlay = new JMenuItem("Abspielen"); + meiFilePlay = new JMenuItem("Play"); meiFilePlay.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { playSelection(); } }); pomFile.add(meiFilePlay); - meiFileDel = new JMenuItem("Entfernen"); + meiFileDel = new JMenuItem("Remove"); meiFileDel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { for(ActionListener act : meiRemSel.getActionListeners()) @@ -495,7 +495,7 @@ } }); pomFile.add(meiFileDel); - meiFileInfo = new JMenuItem("Datei Informationen"); + meiFileInfo = new JMenuItem("File informations"); meiFileInfo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showFileInfoDialog(); @@ -534,8 +534,8 @@ } public void addURL() { - String str = owner.oppMessages.showInputDialog(this, "URL eingeben:", - "URL hinzufügen", JOptionPane.PLAIN_MESSAGE); + String str = owner.oppMessages.showInputDialog(this, "Enter URL:", + "Add URL", JOptionPane.PLAIN_MESSAGE); if(str == null) return; URL url = null; @@ -584,7 +584,7 @@ owner.fchChooser.getAcceptAllFileFilter()); owner.fchChooser.setFileFilter( owner.fchChooser.getAcceptAllFileFilter()); - owner.fchChooser.setDialogTitle("Datei(en) zur Playlist hinzufügen"); + owner.fchChooser.setDialogTitle("Add file(s) to playlist"); if(owner.fchChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return; Vector<FileEntry> vpf = new Vector<FileEntry>(); @@ -652,7 +652,7 @@ return f.toString().toLowerCase().endsWith(".m3u"); } public String getDescription() { - return "M3U Dateien"; + return "M3U files"; } }); owner.fchChooser.addChoosableFileFilter( @@ -661,7 +661,7 @@ return f.toString().toLowerCase().endsWith(".pls"); } public String getDescription() { - return "PLS Dateien"; + return "PLS files"; } }); owner.fchChooser.setFileFilter( @@ -671,10 +671,10 @@ f.toString().toLowerCase().endsWith(".pls"); } public String getDescription() { - return "M3U und PLS Dateien"; + return "M3U and PLS files"; } }); - owner.fchChooser.setDialogTitle("Playlist laden"); + owner.fchChooser.setDialogTitle("Load playlist"); if(owner.fchChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return; File file = owner.fchChooser.getSelectedFile(); @@ -789,7 +789,7 @@ return f.toString().toLowerCase().endsWith(".pls"); } public String getDescription() { - return "PLS Dateien"; + return "PLS files"; } }; owner.fchChooser.addChoosableFileFilter(ffPls); @@ -799,10 +799,10 @@ return f.toString().toLowerCase().endsWith(".m3u"); } public String getDescription() { - return "M3U Dateien"; + return "M3U files"; } }); - owner.fchChooser.setDialogTitle("Playlist speichern"); + owner.fchChooser.setDialogTitle("Save playlist"); if(owner.fchChooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION) return; if(owner.fchChooser.getFileFilter().equals(ffPls)) Index: PlayDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/PlayDialog.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- PlayDialog.java 17 Feb 2006 08:21:05 -0000 1.9 +++ PlayDialog.java 3 Mar 2006 18:29:19 -0000 1.10 @@ -249,7 +249,7 @@ lblSongInfo.setBounds(107, 17, 163, 15); sliVolume = new JSlider(0, 255, 255); - sliVolume.setToolTipText("Lautstärke"); + sliVolume.setToolTipText("Volume"); sliVolume.setOpaque(false); sliVolume.setFocusable(false); sliVolume.setBounds(110, 51, 65, 23); @@ -261,7 +261,7 @@ }); sliPan = new JSlider(0, 255, 128); - sliPan.setToolTipText("Balance"); + sliPan.setToolTipText("Pan"); sliPan.setOpaque(false); sliPan.setFocusable(false); sliPan.setBounds(180, 51, 43, 23); @@ -300,7 +300,7 @@ }); btnVis = new JButton(new ImageIcon(i10)); - btnVis.setToolTipText("Visualisierung starten"); + btnVis.setToolTipText("Start visualization"); btnVis.setFocusable(false); btnVis.setBounds(228, 38, 20, 15); btnVis.addActionListener(new ActionListener() { @@ -319,7 +319,7 @@ }); tobEQ = new JToggleButton(new ImageIcon(i1), true); - tobEQ.setToolTipText("Equalizer anzeigen"); + tobEQ.setToolTipText("Show equalizer"); tobEQ.setFocusable(false); tobEQ.setBounds(228, 55, 20, 15); tobEQ.addActionListener(new ActionListener() { @@ -334,7 +334,7 @@ }); tobPL = new JToggleButton(new ImageIcon(i2), true); - tobPL.setToolTipText("Playlist anzeigen"); + tobPL.setToolTipText("Show playlist"); tobPL.setFocusable(false); tobPL.setBounds(250, 55, 20, 15); tobPL.addActionListener(new ActionListener() { @@ -349,20 +349,20 @@ }); tobShuffle = new JToggleButton(new ImageIcon(i9), false); - tobShuffle.setToolTipText("Mischen: Aus"); + tobShuffle.setToolTipText("Shuffle: Off"); tobShuffle.setFocusable(false); tobShuffle.setBounds(147, 92, 45, 15); tobShuffle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(tobShuffle.isSelected()) - tobShuffle.setToolTipText("Mischen: Ein"); + tobShuffle.setToolTipText("Shuffle: On"); else - tobShuffle.setToolTipText("Mischen: Aus"); + tobShuffle.setToolTipText("Shuffle: Off"); } }); btnBack = new JButton(new ImageIcon(i3)); - btnBack.setToolTipText("Vor"); + btnBack.setToolTipText("Previous"); btnBack.setFocusable(false); btnBack.setBounds(5, 90, 20, 20); btnBack.addActionListener(new ActionListener() { @@ -389,7 +389,7 @@ }); btnPlay = new JButton(new ImageIcon(i4)); - btnPlay.setToolTipText("Abspielen"); + btnPlay.setToolTipText("Play"); btnPlay.setFocusable(false); btnPlay.setBounds(27, 90, 20, 20); btnPlay.addActionListener(new ActionListener() { @@ -445,7 +445,7 @@ }); btnNext = new JButton(new ImageIcon(i7)); - btnNext.setToolTipText("Weiter"); + btnNext.setToolTipText("Next"); btnNext.setFocusable(false); btnNext.setBounds(93, 90, 20, 20); btnNext.addActionListener(new ActionListener() { @@ -471,7 +471,7 @@ }); btnOpen = new JButton(new ImageIcon(i8)); - btnOpen.setToolTipText("Öffnen"); + btnOpen.setToolTipText("Open"); btnOpen.setFocusable(false); btnOpen.setBounds(120, 90, 20, 20); btnOpen.addActionListener(new ActionListener() { @@ -486,7 +486,7 @@ owner.fchChooser.getAcceptAllFileFilter()); owner.fchChooser.setFileFilter( owner.fchChooser.getAcceptAllFileFilter()); - owner.fchChooser.setDialogTitle("Datei(en) öffnen"); + owner.fchChooser.setDialogTitle("Open file(s)"); if(owner.fchChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return; @@ -506,7 +506,7 @@ }); btnRepeat = new JButton(new ImageIcon(imgRep0)); - btnRepeat.setToolTipText("Wiederholen: Aus"); + btnRepeat.setToolTipText("Repeat: Off"); btnRepeat.setFocusable(false); btnRepeat.setBounds(194, 92, 25, 15); btnRepeat.addActionListener(new ActionListener() { @@ -517,15 +517,15 @@ switch(loopmode) { case 0: btnRepeat.setIcon(new ImageIcon(imgRep0)); - btnRepeat.setToolTipText("Wiederholen: Aus"); + btnRepeat.setToolTipText("Repeat: Off"); break; case 1: btnRepeat.setIcon(new ImageIcon(imgRep1)); - btnRepeat.setToolTipText("Wiederholen: Eine Datei"); + btnRepeat.setToolTipText("Repeat: One file"); break; default: btnRepeat.setIcon(new ImageIcon(imgRepA)); - btnRepeat.setToolTipText("Wiederholen: Alle Dateien"); + btnRepeat.setToolTipText("Repeat: All files"); } } }); Index: FileInformationDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/FileInformationDialog.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- FileInformationDialog.java 28 Feb 2006 16:08:13 -0000 1.5 +++ FileInformationDialog.java 3 Mar 2006 18:29:19 -0000 1.6 @@ -25,7 +25,7 @@ JTable[] tables; public FileInformationDialog(JavaAmp o) { - super(o.playlistDialog, "Dateiinformationen", true); + super(o.playlistDialog, "File informations", true); owner = o; setSize(500, 400); @@ -47,7 +47,7 @@ containers[i] = new Container(); containers[i].setLayout(new BorderLayout()); tables[i] = new JTable(new DefaultTableModel(new String[] { - "Schlüssel", "Wert" }, 0)); + "Key", "Value" }, 0)); scrollPanes[i] = new JScrollPane(tables[i], JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); Index: LoadInfoDialog.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/LoadInfoDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LoadInfoDialog.java 27 Jan 2006 18:17:12 -0000 1.1 +++ LoadInfoDialog.java 3 Mar 2006 18:29:19 -0000 1.2 @@ -14,7 +14,7 @@ Thread thread; public LoadInfoDialog(JavaAmp o, boolean a) { - super(o.playlistDialog, "Lade Dateiinformationen...", true); + super(o.playlistDialog, "Loading file informations...", true); owner = o; accurate = a; running = true; @@ -37,7 +37,7 @@ prbStatus.setString("0/" + max); prbStatus.setStringPainted(true); - btnCancel = new JButton("Abbrechen"); + btnCancel = new JButton("Cancel"); btnCancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { running = false; |
From: WiESi <wi...@us...> - 2006-03-03 18:13:15
|
Update of /cvsroot/javaamp/javaamp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8115/src Modified Files: FileEntryListModel.java Log Message: Fixed bug when removing items from playlist Index: FileEntryListModel.java =================================================================== RCS file: /cvsroot/javaamp/javaamp/src/FileEntryListModel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- FileEntryListModel.java 25 Feb 2006 14:10:48 -0000 1.5 +++ FileEntryListModel.java 3 Mar 2006 18:13:07 -0000 1.6 @@ -30,6 +30,10 @@ return; int s = entries.size() - 1; entries.clear(); + if(owner.playDialog.pq != null) { + owner.playDialog.pq.hidden = true; + owner.playDialog.pq.current = 0; + } fireIntervalRemoved(this, 0, s); } |