Просмотр исходного кода

Streaming support preview, also toolkit tests

LH 9 лет назад
Родитель
Сommit
080267c24f

+ 1 - 1
ToolKit/build.gradle

@@ -32,4 +32,4 @@ dependencies{
 	compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.1'
 	compile 'mysql:mysql-connector-java:5.1.6'
 
-}
+}

+ 0 - 1
ToolKit/src/main/java/de/nplusc/izc/tools/baseTools/Lock.java

@@ -17,7 +17,6 @@
 
 package de.nplusc.izc.tools.baseTools;
 
-
 /**
  *
  * @author LH

+ 1 - 1
iZpl/build.gradle

@@ -8,7 +8,7 @@ apply plugin: 'java'
 apply plugin: 'application'
 apply from: "$rootDir/utils/IO.gradle"
 
-version = '0.7.1.0'
+version = '0.8.0.0-SNAPSHOT'
 mainClassName = 'de.nplusc.izc.iZpl.Main'
 //'de.nplusc.izc.iZpl.Main'
 

+ 17 - 3
iZpl/src/main/java/de/nplusc/izc/iZpl/CommandLineParsing.java

@@ -60,13 +60,15 @@ public class CommandLineParsing
         String selectedSkinPath="";
         boolean allowPluginLoad=false;
         int uimodestate=UIMODE_NONE;
+        int streamport=-1;
         CommandLineParser parser = new DefaultParser();
         Options options = new Options();
         OptionGroup modes = new OptionGroup();
         OptionGroup uimodes = new OptionGroup();
         
-        //gopvsferbicuxm
-        //bcefgimoprsuvx
+        
+        //gopvsferbicuxmh
+        //bcefghimoprsuvx
         uimodes.addOption(OptionBuilder.withLongOpt("newgui")
                 .withDescription("enables the Standalone GUI mode. Starts program straight if --file or --resume is set")
                 .create("g"));
@@ -95,6 +97,11 @@ public class CommandLineParsing
                 .hasOptionalArg()
                 .withArgName("FILE")
                 .create("s"));
+        options.addOption(OptionBuilder.withLongOpt("htpstream")
+                .withDescription("Streams the audio on the given PORT instead of playing it locally, only works with new UI mode")
+                .hasArg()
+                .withArgName("PORT")
+                .create("h"));
         modes.addOption(OptionBuilder.withLongOpt("file")
                 .withDescription("load FILE as iZpl-File")
                 .hasArg()
@@ -161,6 +168,12 @@ public class CommandLineParsing
             filemode = true;
             file_path = cl.getOptionValue("file");
         }
+        
+        if (cl.hasOption("httpstream"))
+        {
+            streamport = Integer.valueOf(cl.getOptionValue("file"));
+        }
+        
         if (cl.hasOption("registerfileextensions"))
         {
             Utilities.registerFileExtensions();
@@ -267,6 +280,7 @@ public class CommandLineParsing
             allowPluginLoad=true;
         }
         return new CommandLineStatus(filemode, statefile, verboseMode, burnDisc, file_path, burnDisc, forcePregen, featurePluginMode,
-                featurePluginID, pluginParameter, loadConfigMode, menumode, firstrunmode, updateInit, allowPluginLoad,skinParameterSet,selectedSkinPath,uimodestate);
+                featurePluginID, pluginParameter, loadConfigMode, menumode, firstrunmode, updateInit, 
+                allowPluginLoad,skinParameterSet,selectedSkinPath,uimodestate,streamport>0,streamport);
     }
 }

+ 8 - 2
iZpl/src/main/java/de/nplusc/izc/iZpl/CommandLineStatus.java

@@ -47,12 +47,16 @@ public class CommandLineStatus
     public final boolean skinParameterSet;
     public final String selectedSkinPath;
     public  final int uimodestate;
+    public final boolean streaming;
+    public final int streamport;
+    
+    
     
     public CommandLineStatus(boolean filemode, boolean statefile, boolean verboseMode, boolean useGUI, 
             String file_path, boolean burnDisc, boolean forcePregen, boolean featurePluginMode, 
             String featurePluginID, 
             String pluginParameter, boolean loadConfigMode, boolean menumode, boolean firstrunmode, boolean updateInit, boolean allowPluginLoad,boolean skinParameterSet,
-            String selectedSkinPath,int uimodestate)
+            String selectedSkinPath,int uimodestate,boolean streaming,int streamport)
     {
         this.filemode = filemode;
         this.statefile = statefile;
@@ -72,6 +76,8 @@ public class CommandLineStatus
         this.skinParameterSet=skinParameterSet;
         this.selectedSkinPath=selectedSkinPath;
         this.uimodestate=uimodestate;
+        this.streaming=streaming;
+        this.streamport=streamport;
     }
     
     
@@ -79,7 +85,7 @@ public class CommandLineStatus
     public CommandLineStatus changeUseGUI(boolean pGUI)
     {
         return new CommandLineStatus(filemode, statefile, verboseMode, pGUI, file_path, burnDisc, forcePregen, featurePluginMode,
-                featurePluginID, pluginParameter, loadConfigMode, menumode, firstrunmode, updateInit, allowPluginLoad,skinParameterSet,selectedSkinPath,uimodestate);
+                featurePluginID, pluginParameter, loadConfigMode, menumode, firstrunmode, updateInit, allowPluginLoad,skinParameterSet,selectedSkinPath,uimodestate,streaming,streamport);
     }
     
     

+ 1 - 1
iZpl/src/main/java/de/nplusc/izc/iZpl/Main.java

@@ -169,7 +169,7 @@ public class Main extends javax.swing.JFrame
             allowPluginLoad=true;
         }
         stts=new CommandLineStatus(filemode, statefile, false, true, file_path, burnDisc, forcePregen, 
-                featurePluginMode, featurePluginID, null, loadConfigMode, menumode, false,false, allowPluginLoad,false,null,UIMODE_NONE);
+                featurePluginMode, featurePluginID, null, loadConfigMode, menumode, false,false, allowPluginLoad,false,null,UIMODE_NONE,false,0);
         mainProcessing();
     }
     

+ 9 - 1
iZpl/src/main/java/de/nplusc/izc/iZpl/Utils/VlcInterface.java

@@ -467,7 +467,15 @@ public class VlcInterface implements PlaybackPlugin , MediaPlayerEventListener
         public VlcJIterface(String vlcpath,VlcInterface parent)
         {
             this.parent=parent;
-            f= new MediaPlayerFactory("--no-video-title-show");
+            if(new File(IZPLApi.APPDIR+File.separator+"stream").exists())
+            {
+                f= new MediaPlayerFactory("--no-video-title-show","--sout=#transcode{vcodec=none,acodec=mp3,ab=256,channels=2,samplerate=44100}:http{mux=ts,dst=:8080/}","--sout-keep");
+            }
+            else
+            {
+                f= new MediaPlayerFactory("--no-video-title-show");
+            }
+            
             mpaccess = f.newHeadlessMediaPlayer();
             mpaccess.addMediaPlayerEventListener(parent);
         }