|
@@ -6,12 +6,21 @@
|
|
|
|
|
|
package de.nplusc.izc.izstreamer;
|
|
package de.nplusc.izc.izstreamer;
|
|
|
|
|
|
|
|
+import de.nplusc.izc.tools.baseTools.Messagers;
|
|
import java.awt.Canvas;
|
|
import java.awt.Canvas;
|
|
|
|
+import java.awt.Desktop;
|
|
import java.awt.Graphics;
|
|
import java.awt.Graphics;
|
|
import java.awt.Graphics2D;
|
|
import java.awt.Graphics2D;
|
|
|
|
+import java.awt.event.ActionEvent;
|
|
import java.awt.image.BufferedImage;
|
|
import java.awt.image.BufferedImage;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.net.URI;
|
|
|
|
+import java.net.URISyntaxException;
|
|
|
|
+import javax.swing.JButton;
|
|
import javax.swing.JFrame;
|
|
import javax.swing.JFrame;
|
|
|
|
+import javax.swing.JLabel;
|
|
import javax.swing.JPanel;
|
|
import javax.swing.JPanel;
|
|
|
|
+import javax.swing.JSlider;
|
|
import javax.swing.WindowConstants;
|
|
import javax.swing.WindowConstants;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -41,9 +50,9 @@ public class VisualizedGUI extends JFrame implements PlayerStructure
|
|
}*/
|
|
}*/
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void setPlaying(String tit)
|
|
|
|
|
|
+ public void setPlaying(String titp)
|
|
{
|
|
{
|
|
- //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
|
|
|
|
+ tit.setText("Now playing: "+ titp);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -51,7 +60,10 @@ public class VisualizedGUI extends JFrame implements PlayerStructure
|
|
{
|
|
{
|
|
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ JLabel tit;
|
|
|
|
+ JButton play,info,last20trax;
|
|
|
|
+ JSlider vol;
|
|
|
|
+ private boolean playing;
|
|
public VisualizedGUI()
|
|
public VisualizedGUI()
|
|
{
|
|
{
|
|
/*
|
|
/*
|
|
@@ -64,13 +76,65 @@ public class VisualizedGUI extends JFrame implements PlayerStructure
|
|
setLayout(new GridLayout(1, 1));
|
|
setLayout(new GridLayout(1, 1));
|
|
*/
|
|
*/
|
|
// this.add(c);
|
|
// this.add(c);
|
|
|
|
+ setLayout(null);
|
|
surface = new Canvas();
|
|
surface = new Canvas();
|
|
- surface.setSize(x, y);
|
|
|
|
- setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
|
|
|
|
|
+ surface.setBounds(0,0,x, y);
|
|
add(surface);
|
|
add(surface);
|
|
|
|
+ setSize(x,y+90);
|
|
|
|
+ tit=new JLabel("Now playing:");
|
|
|
|
+ tit.setBounds(0, y,x, 15);
|
|
|
|
+ play = new JButton("Play");
|
|
|
|
+ play.setBounds(0,y+15,150,40);
|
|
|
|
+ info = new JButton("Play");
|
|
|
|
+ info.setBounds(160,y+15,50,30);
|
|
|
|
+ last20trax = new JButton("PLAY");
|
|
|
|
+ last20trax.setBounds(220,y+15,40,25);
|
|
|
|
+ add(play);
|
|
|
|
+ add(tit);
|
|
|
|
+ add(info);
|
|
|
|
+ add(last20trax);
|
|
|
|
+ play.addActionListener((ActionEvent e) ->
|
|
|
|
+ {
|
|
|
|
+ if (playing)
|
|
|
|
+ {
|
|
|
|
+ play.setText("PLAY");
|
|
|
|
+ StreamGUI.player.stopPlay=true;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ play.setText("STOP");
|
|
|
|
+ StreamGUI.player.play();
|
|
|
|
+ }
|
|
|
|
+ playing = !playing;
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ info.addActionListener((ActionEvent e) ->
|
|
|
|
+ {
|
|
|
|
+ Messagers.SingleLineMsg("Not implemented", "Klappe halten.....");
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ last20trax.addActionListener((ActionEvent e) ->
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ Desktop.getDesktop().browse(new URI("http://31.7.177.108:2294/played.html"));
|
|
|
|
+ }
|
|
|
|
+ catch (URISyntaxException ex)
|
|
|
|
+ {
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ catch (IOException ex)
|
|
|
|
+ {
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
|
|
|
+ validate();
|
|
StreamGUI.player.setPlayerStructure(this);
|
|
StreamGUI.player.setPlayerStructure(this);
|
|
|
|
+ setResizable(false);
|
|
|
|
|
|
- // setSize(x, y);
|
|
|
|
|
|
+ // setSize(x, y);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|