1
0
Эх сурвалжийг харах

testBuld and some memory fixes

git-svn-id: http://repo.nplusc.de/svn/iZink@303 8b19561d-0d00-6744-8ac1-9afc8f58a8aa
masterX244 10 жил өмнө
parent
commit
249480cedf

+ 4 - 3
iZStreamer/src/de/nplusc/izc/izstreamer/StreamGUI.java

@@ -23,14 +23,14 @@ public class StreamGUI
     boolean stopPlay = false;
     public MediaPlayer m;
     private boolean fs=true;
-    private String url = "D:\\mp3\\assorted Earworms\\22 - StarDisc - Fernando Pepe.flac";//"http://31.7.177.108:2294";
+    private String url = "http://31.7.177.108:2294";//"D:\\mp3\\assorted Earworms\\22 - StarDisc - Fernando Pepe.flac";//
     public static StreamGUI player = new StreamGUI();
     private PlayerStructure thix;
     public void setPlayerStructure(PlayerStructure x)
     {
         thix=x;
     }
-            
+    Canvas lc = null;
     public void play()
     {
         //if(m==null)
@@ -43,12 +43,13 @@ public class StreamGUI
             m = mpf.newEmbeddedMediaPlayer();
             
            Canvas s = thix.getBackGround();
-            if(s!=null)
+            if(s!=null&&s!=lc)
             {
                  ((EmbeddedMediaPlayer)m).setVideoSurface(mpf.newVideoSurface(s));
             }
             m.startMedia(url);
             fs=true;
+            lc=s;
         }
         else
         {

+ 5 - 2
iZStreamer/src/de/nplusc/izc/izstreamer/VisualizedGUI.java

@@ -12,6 +12,7 @@ import java.awt.Graphics2D;
 import java.awt.image.BufferedImage;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
+import javax.swing.WindowConstants;
 
 /**
  *
@@ -54,7 +55,7 @@ public class VisualizedGUI extends JFrame implements PlayerStructure
     public VisualizedGUI()
     {
         /*
-        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+        
         surface= new EJP();
         image = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().
                 getDefaultConfiguration().createCompatibleImage(x,y);
@@ -65,6 +66,7 @@ public class VisualizedGUI extends JFrame implements PlayerStructure
        // this.add(c);
         surface = new Canvas();
         surface.setSize(x, y);
+        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
         add(surface);
         StreamGUI.player.setPlayerStructure(this);
         
@@ -78,7 +80,7 @@ public class VisualizedGUI extends JFrame implements PlayerStructure
     }
     
     
-    
+    /*
     private class EJP extends JPanel
 {
         private BufferedImage image;
@@ -100,4 +102,5 @@ public class VisualizedGUI extends JFrame implements PlayerStructure
             // You could draw on top of the image here...
             }
         };
+    */
 }

+ 1 - 1
iZStreamer/src/de/nplusc/izc/izstreamer/iZstreamer.java

@@ -50,7 +50,7 @@ public class iZstreamer
             FileTK.writeFile("@echo off\n"
                     + "set bindir=%~dp0\n"
                     + "cd %bindir%\n"
-                    + "start javaw -jar %bindir%\\iZStreamer.jar --appsource #sfxjar#\n"
+                    + "start javaw -jar -Xmx128M %bindir%\\iZStreamer.jar --appsource #sfxjar#\n"
                     + "REM DUMMYDUMMYDUMMYDUMMY", jpath + File.separator + "params.sfx");//<<<<HACK!
             new File(jpath + "release.jar").delete();//alte jar ausm weg räumen falls nicht schon geschehen
             String apath = jpath + File.separator + "iZstreamerStandalone.jar";