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) |