LH пре 6 година
родитељ
комит
b365a0ded4

+ 27 - 5
iZpl/build.gradle

@@ -23,10 +23,11 @@ jar{
 }
 
 startScripts << { 
-
+  defaultJvmOpts = ["-Dlog4j.skipJansi=false"] // fahr zur hölle Log5J
   def startScriptDir = outputDir.getAbsolutePath()
   def winStartScript = startScriptDir + "/" + applicationName + ".bat"
   def winStartScriptCopy = startScriptDir + "/" + applicationName + "c.bat"
+  def linuxStartScript = startScriptDir + "/" + applicationName
   def overwriteExistingFile = true
   copyFile(winStartScript, winStartScriptCopy, overwriteExistingFile)
 
@@ -41,6 +42,10 @@ startScripts << {
     else if(it.startsWith("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%")){
       return "start \"\" /b " + it
     }
+    else if (it.startsWith("set DEFAULT_JVM_OPTS="))
+    {
+        return it+" -Dlog4j.skipJansi=false"
+    }
     else if(it.startsWith(":init"))
     {
         //HACK
@@ -51,12 +56,28 @@ startScripts << {
       return it
     }
   }
+  
+    modifyFile(linuxStartScript) {
+    if (it.startsWith("DEFAULT_JVM_OPTS=\"\""))
+    {
+        return "DEFAULT_JVM_OPTS=\"-Dlog4j.skipJansi=false\""
+    }
+    // Leave the line unchanged
+    else{
+      return it
+    }
+  }
+  
   modifyFile(winStartScriptCopy) {
     if(it.startsWith(":init"))
     {
     //HACK
         return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins" 
     }
+    else if (it.startsWith("set DEFAULT_JVM_OPTS="))
+    {
+        return it+" -Dlog4j.skipJansi=false"
+    }
     // Leave the line unchanged
     else{
       return it
@@ -108,10 +129,11 @@ dependencies{
     compile 'de.schlichtherle.truezip:truezip-driver-tzp:7.7.7'
     compile 'de.schlichtherle.truezip:truezip-driver-http:7.7.7'
     compile 'commons-cli:commons-cli:1.3'
-	compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.1'
-	compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.1'
-	compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.1'
-    compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.1'
+	compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.1'
+	compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.1'
+	compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.11.1'
+    compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.1'
+    compile group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '2.11.1'
     compile 'org.fusesource.jansi:jansi:1.11'
     compile 'org.jgrapht:jgrapht-core:0.9.0'
     compile(project(':ToolKit')) {

+ 37 - 22
iZpl/src/main/java/de/nplusc/izc/iZpl/GUI/PlayListManagingDefault.java

@@ -221,7 +221,11 @@ public class PlayListManagingDefault extends javax.swing.JFrame implements PlayL
        int viewRow = tblPLE.getSelectedRow();
         viewRow = tblPLE.convertRowIndexToModel(viewRow);
         
-        PlayListEditAPI.forceElement((Integer)((DefaultTableModel)tblPLE.getModel()).getValueAt(viewRow,0));
+        int index = (Integer)((DefaultTableModel)tblPLE.getModel()).getValueAt(viewRow,0);
+        if(index>=0)
+        {
+            PlayListEditAPI.forceElement(index);
+        }
     }//GEN-LAST:event_btnForceActionPerformed
 
     /**
@@ -276,28 +280,39 @@ public class PlayListManagingDefault extends javax.swing.JFrame implements PlayL
     private boolean rebuilding=false;
     /*packageprivate*/ void rebuildTable(boolean recovery)
     {
-        try{
-        rebuilding = true;
-        
-        //mdl.setAllColumnsVisible();
-        PlayListEditAPI.refreshKeyList();
-        String[] titles = PlayListEditAPI.getTrackTitles();
-        for(int i=tblPLE.getRowCount()-1;i>0;i--)
-	{
-	    ((DefaultTableModel)tblPLE.getModel()).removeRow(i-1);
-	}
-            tblPLE.getModel().setValueAt(0,0,0);
-            tblPLE.getModel().setValueAt(titles[0],0,1);
-            tblPLE.getModel().setValueAt(PlayListEditAPI.getTargetPlayCount(0),0,2);
-            tblPLE.getModel().setValueAt(PlayListEditAPI.getPlayCount(0),0,3);
-        for (int i = 0; i < titles.length; i++)
+        try
         {
-            ((DefaultTableModel)tblPLE.getModel()).addRow(new Object[]{null,null,null,null});
-            tblPLE.getModel().setValueAt(i,i,0);
-            tblPLE.getModel().setValueAt(titles[i],i,1);
-            tblPLE.getModel().setValueAt(PlayListEditAPI.getTargetPlayCount(i),i,2);
-            tblPLE.getModel().setValueAt(PlayListEditAPI.getPlayCount(i),i,3);
-        }
+            rebuilding = true;
+
+            //mdl.setAllColumnsVisible();
+            PlayListEditAPI.refreshKeyList();
+            String[] titles = PlayListEditAPI.getTrackTitles();
+            for(int i=tblPLE.getRowCount()-1;i>0;i--)
+            {
+                ((DefaultTableModel)tblPLE.getModel()).removeRow(i-1);
+            }
+            if(titles.length>0)
+            {
+                tblPLE.getModel().setValueAt(0,0,0);
+                tblPLE.getModel().setValueAt(titles[0],0,1);
+                tblPLE.getModel().setValueAt(PlayListEditAPI.getTargetPlayCount(0),0,2);
+                tblPLE.getModel().setValueAt(PlayListEditAPI.getPlayCount(0),0,3);
+            }
+            else
+            {
+                tblPLE.getModel().setValueAt(-1,0,0);
+                tblPLE.getModel().setValueAt("-- NO TRACKS --",0,1);
+                tblPLE.getModel().setValueAt(0,0,2);
+                tblPLE.getModel().setValueAt(0,0,3);
+            }
+            for (int i = 0; i < titles.length; i++)
+            {
+                ((DefaultTableModel)tblPLE.getModel()).addRow(new Object[]{null,null,null,null});
+                tblPLE.getModel().setValueAt(i,i,0);
+                tblPLE.getModel().setValueAt(titles[i],i,1);
+                tblPLE.getModel().setValueAt(PlayListEditAPI.getTargetPlayCount(i),i,2);
+                tblPLE.getModel().setValueAt(PlayListEditAPI.getPlayCount(i),i,3);
+            }
         rebuilding=false;
         }
         catch(InvalidPlayListFileException e)

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

@@ -162,14 +162,14 @@ public class Main extends javax.swing.JFrame
     
     static void setupLogging(boolean verbose,int verbosityLevel)
     {
-        
+        System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager"); //HACK to catch java.util.logging loggers
         l=LogManager.getLogger(Main.class.getName());
         LoggerContext cx = (LoggerContext) LogManager.getContext(false);
         org.apache.logging.log4j.core.config.Configuration config = cx.getConfiguration();
         LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME); 
         LoggerConfig vlcj = config.getLoggerConfig("uk.co.caprica.vlcj"); 
         LoggerConfig externalloggerConfig = config.getLoggerConfig("External"); 
-
+        
         if (verbose)
         {
             loggerConfig.setLevel(Level.TRACE);

+ 31 - 13
iZpl/src/main/java/de/nplusc/izc/iZpl/PlProcessorV2.java

@@ -387,7 +387,8 @@ public class PlProcessorV2 implements HttpHandler
                             StandardWatchEventKinds.ENTRY_DELETE,
                             StandardWatchEventKinds.ENTRY_MODIFY);
                     registeredFolders.put(path, k);
-                } catch (IOException ex)
+                } 
+                catch (IOException ex)
                 {
                     l.info("Failed to register the observer");
                 }
@@ -407,12 +408,16 @@ public class PlProcessorV2 implements HttpHandler
         while(true)
         {
             WatchKey key;
-            try {
+            try 
+            {
                 key = observer.take();
-            } catch (InterruptedException x) {
+            } 
+            catch (InterruptedException x) 
+            {
                 l.warn("Unexpected Interrupt on the FSMonitor");
                 return;
             }
+            l.trace("Incoming Changeset");
             synchronized(registeredFolders)
             {
                 if(registeredFolders.containsValue(key))
@@ -440,29 +445,42 @@ public class PlProcessorV2 implements HttpHandler
                     l.trace("Unexpected Notification");
                 }
             }
+            key.pollEvents();
+            key.reset(); //fickdich...
+            l.trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Notification parsed");
         }
     }
     @SuppressWarnings("SleepWhileInLoop")
     private void FSWatchFilter()
     {
-        while(true)
+        try
         {
-            try
+            while(true)
             {
-                Thread.sleep(1000);
-                if(requiresRefresh)
+                try
                 {
-                    synchronized(refreshLock)
+                    Thread.sleep(1000);
+                    if(requiresRefresh)
                     {
-                        requiresRefresh=false;
+                        synchronized(refreshLock)
+                        {
+                            requiresRefresh=false;
+                        }
+                        reloadLists(true);
+                        IZPLApi.getUIPlugin().reloadPlayList();
+                        l.trace("Refreshed the UI lists");
                     }
-                    reloadLists(true);
-                    IZPLApi.getUIPlugin().reloadPlayList();
+                } 
+                catch (InterruptedException ex)
+                {
                 }
-            } catch (InterruptedException ex)
-            {
             }
         }
+        catch(Exception e)
+        {
+            l.warn("Zoinks!, This method shouldnt exit");
+            e.printStackTrace();
+        }
     }
     
     

+ 12 - 3
iZpl/src/main/java/de/nplusc/izc/iZpl/Utils/VlcInterface.java

@@ -100,8 +100,6 @@ public class VlcInterface implements PlaybackPlugin , MediaPlayerEventListener
                     try
                     {
                         zippo.cp_rp(target);
-                        TFile jarschcrap = new TFile(jarschiv + "\\vlc\\");
-                        jarschcrap.rm_r();//removal of the embedded VLC data after connecting to the System
                     }
                     catch (IOException ex)
                     {
@@ -116,7 +114,18 @@ public class VlcInterface implements PlaybackPlugin , MediaPlayerEventListener
             {
                 throw new UnsupportedOperationException("ERROR! Host VLC is not supported yet on Windows");
             }
-            
+            try
+            {
+                TFile jarschcrap = new TFile(jarschiv + "\\vlc\\");
+                if(jarschcrap.exists())
+                {
+                    jarschcrap.rm_r();//removal of the embedded VLC data after connecting to the System
+                }
+            }
+            catch (IOException ex)
+            {
+                ex.printStackTrace();
+            }
 
         }
         else

+ 34 - 26
iZplPlugins/JukeBox/src/main/java/de/nplusc/izc/izpl/plugins/jukebox/JukeBox.form

@@ -3,6 +3,9 @@
 <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
   <Properties>
     <Property name="defaultCloseOperation" type="int" value="3"/>
+    <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+      <Dimension value="[480, 800]"/>
+    </Property>
   </Properties>
   <SyntheticProperties>
     <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
@@ -23,25 +26,28 @@
   <Layout>
     <DimensionLayout dim="0">
       <Group type="103" groupAlignment="0" attributes="0">
-          <Group type="102" alignment="1" attributes="0">
-              <EmptySpace max="32767" attributes="0"/>
-              <Group type="103" groupAlignment="0" max="-2" attributes="0">
+          <Component id="seekBar" alignment="0" max="32767" attributes="0"/>
+          <Group type="102" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="jScrollPane2" alignment="1" max="32767" attributes="0"/>
                   <Group type="102" alignment="1" attributes="0">
-                      <Component id="btnPlayPause" max="32767" attributes="0"/>
+                      <Component id="btnEnqueue" max="32767" attributes="0"/>
                       <EmptySpace max="-2" attributes="0"/>
-                      <Component id="btnSkip" min="-2" max="-2" attributes="0"/>
-                      <EmptySpace max="-2" attributes="0"/>
-                      <Component id="lblStatus" min="-2" pref="355" max="-2" attributes="0"/>
+                      <Component id="btnReload" max="32767" attributes="0"/>
+                  </Group>
+                  <Component id="jScrollPane1" alignment="0" pref="468" max="32767" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Component id="btnPlayPause" min="-2" pref="221" max="-2" attributes="0"/>
+                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                      <Component id="btnSkip" max="32767" attributes="0"/>
                   </Group>
-                  <Component id="lblTrackName" alignment="1" max="32767" attributes="0"/>
                   <Group type="102" attributes="0">
-                      <Component id="btnEnqueue" min="-2" pref="201" max="-2" attributes="0"/>
+                      <Component id="lblTrackName" min="-2" pref="303" max="-2" attributes="0"/>
                       <EmptySpace max="-2" attributes="0"/>
-                      <Component id="jButton2" max="32767" attributes="0"/>
+                      <Component id="lblStatus" min="-2" pref="158" max="-2" attributes="0"/>
+                      <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
                   </Group>
-                  <Component id="jScrollPane2" max="32767" attributes="0"/>
-                  <Component id="jScrollPane1" max="32767" attributes="0"/>
-                  <Component id="seekBar" alignment="0" max="32767" attributes="0"/>
               </Group>
               <EmptySpace max="-2" attributes="0"/>
           </Group>
@@ -51,25 +57,27 @@
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="0" attributes="0">
               <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="jScrollPane1" pref="284" max="32767" attributes="0"/>
+              <Component id="jScrollPane1" pref="497" max="32767" attributes="0"/>
               <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" max="-2" attributes="0">
                   <Component id="btnEnqueue" max="32767" attributes="0"/>
-                  <Component id="jButton2" pref="35" max="32767" attributes="0"/>
+                  <Component id="btnReload" max="32767" attributes="0"/>
+              </Group>
+              <EmptySpace type="separate" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="btnSkip" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="btnPlayPause" alignment="3" min="-2" max="-2" attributes="0"/>
               </Group>
               <EmptySpace max="-2" attributes="0"/>
-              <Component id="jScrollPane2" min="-2" pref="119" max="-2" attributes="0"/>
-              <EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
               <Component id="seekBar" min="-2" max="-2" attributes="0"/>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="lblTrackName" min="-2" max="-2" attributes="0"/>
-              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
-                  <Component id="btnPlayPause" alignment="3" min="-2" max="-2" attributes="0"/>
-                  <Component id="btnSkip" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="lblTrackName" alignment="3" min="-2" max="-2" attributes="0"/>
                   <Component id="lblStatus" alignment="3" min="-2" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jScrollPane2" min="-2" pref="126" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
           </Group>
       </Group>
     </DimensionLayout>
@@ -151,7 +159,7 @@
         <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnEnqueueActionPerformed"/>
       </Events>
     </Component>
-    <Component class="javax.swing.JButton" name="jButton2">
+    <Component class="javax.swing.JButton" name="btnReload">
       <Properties>
         <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
           <Font name="Tahoma" size="20" style="0"/>
@@ -159,7 +167,7 @@
         <Property name="text" type="java.lang.String" value="Neu laden"/>
       </Properties>
       <Events>
-        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnReloadActionPerformed"/>
       </Events>
     </Component>
     <Component class="javax.swing.JButton" name="btnPlayPause">
@@ -178,7 +186,7 @@
         <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
           <Font name="Tahoma" size="20" style="0"/>
         </Property>
-        <Property name="text" type="java.lang.String" value="Skip"/>
+        <Property name="text" type="java.lang.String" value="&#xdc;berspringen"/>
       </Properties>
       <Events>
         <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSkipActionPerformed"/>

+ 103 - 57
iZplPlugins/JukeBox/src/main/java/de/nplusc/izc/izpl/plugins/jukebox/JukeBox.java

@@ -11,6 +11,7 @@ import de.nplusc.izc.iZpl.API.PlaybackPlugin;
 import de.nplusc.izc.iZpl.API.UIPlugin;
 import de.nplusc.izc.iZpl.API.shared.InvalidPlayListFileException;
 import de.nplusc.izc.iZpl.API.shared.PlayListItem;
+import de.nplusc.izc.tools.baseTools.Detectors;
 import de.nplusc.izc.tools.baseTools.HidableTableColumnModel;
 import java.awt.EventQueue;
 import java.awt.Image;
@@ -61,7 +62,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
         jScrollPane2 = new javax.swing.JScrollPane();
         lstScheduled = new javax.swing.JList();
         btnEnqueue = new javax.swing.JButton();
-        jButton2 = new javax.swing.JButton();
+        btnReload = new javax.swing.JButton();
         btnPlayPause = new javax.swing.JButton();
         btnSkip = new javax.swing.JButton();
         seekBar = new javax.swing.JSlider();
@@ -69,6 +70,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
         lblTrackName = new javax.swing.JLabel();
 
         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+        setPreferredSize(new java.awt.Dimension(480, 800));
 
         tblPLE.setAutoCreateRowSorter(true);
         tblPLE.setModel(new javax.swing.table.DefaultTableModel(
@@ -112,13 +114,13 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
             }
         });
 
-        jButton2.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
-        jButton2.setText("Neu laden");
-        jButton2.addActionListener(new java.awt.event.ActionListener()
+        btnReload.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
+        btnReload.setText("Neu laden");
+        btnReload.addActionListener(new java.awt.event.ActionListener()
         {
             public void actionPerformed(java.awt.event.ActionEvent evt)
             {
-                jButton2ActionPerformed(evt);
+                btnReloadActionPerformed(evt);
             }
         });
 
@@ -133,7 +135,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
         });
 
         btnSkip.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
-        btnSkip.setText("Skip");
+        btnSkip.setText("Überspringen");
         btnSkip.addActionListener(new java.awt.event.ActionListener()
         {
             public void actionPerformed(java.awt.event.ActionEvent evt)
@@ -152,45 +154,48 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
         getContentPane().setLayout(layout);
         layout.setHorizontalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
-                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+            .addComponent(seekBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING)
                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
-                        .addComponent(btnPlayPause, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                        .addComponent(btnEnqueue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(btnSkip)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(lblStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE))
-                    .addComponent(lblTrackName, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                        .addComponent(btnReload, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(btnPlayPause, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                        .addComponent(btnSkip, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                     .addGroup(layout.createSequentialGroup()
-                        .addComponent(btnEnqueue, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addComponent(lblTrackName, javax.swing.GroupLayout.PREFERRED_SIZE, 303, javax.swing.GroupLayout.PREFERRED_SIZE)
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-                    .addComponent(jScrollPane2)
-                    .addComponent(jScrollPane1)
-                    .addComponent(seekBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                        .addComponent(lblStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addGap(0, 0, Short.MAX_VALUE)))
                 .addContainerGap())
         );
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(layout.createSequentialGroup()
                 .addContainerGap()
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                     .addComponent(btnEnqueue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                    .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(btnReload, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                 .addGap(18, 18, 18)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(btnSkip)
+                    .addComponent(btnPlayPause))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(seekBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(lblTrackName)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                    .addComponent(btnPlayPause)
-                    .addComponent(btnSkip)
+                    .addComponent(lblTrackName)
                     .addComponent(lblStatus))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addContainerGap())
         );
 
@@ -199,6 +204,16 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
 
     private void btnSkipActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSkipActionPerformed
     {//GEN-HEADEREND:event_btnSkipActionPerformed
+        //hidden exit from fullscreen jukebox mode
+        int modified = evt.getModifiers();
+        if(modified>0)
+        {
+            l.trace("Modifiers = {}",modified);
+        }
+        if((modified&evt.ALT_MASK)!=0)
+        {
+            IZPLApi.shutdownWithSave();
+        }
         selectedPlaybackPlugin.skipTitle();
     }//GEN-LAST:event_btnSkipActionPerformed
 
@@ -211,14 +226,18 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
     {//GEN-HEADEREND:event_btnEnqueueActionPerformed
         int viewRow = tblPLE.getSelectedRow();
         viewRow = tblPLE.convertRowIndexToModel(viewRow);
-        
-        PlayListEditAPI.forceElement((Integer)((DefaultTableModel)tblPLE.getModel()).getValueAt(viewRow,0));
+        int index = (Integer)((DefaultTableModel)tblPLE.getModel()).getValueAt(viewRow,0);
+        if(index>=0)
+        {
+            PlayListEditAPI.forceElement(index);
+        }
     }//GEN-LAST:event_btnEnqueueActionPerformed
 
-    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed
-    {//GEN-HEADEREND:event_jButton2ActionPerformed
+    private void btnReloadActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnReloadActionPerformed
+    {//GEN-HEADEREND:event_btnReloadActionPerformed
         PlayListEditAPI.reloadList();
-    }//GEN-LAST:event_jButton2ActionPerformed
+        rebuildTable(false);
+    }//GEN-LAST:event_btnReloadActionPerformed
     
     @Override
     public String getPluginName()
@@ -243,29 +262,40 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
     private boolean rebuilding=false;
     private void rebuildTable(boolean recovery)
     {
-        try{
-        rebuilding = true;
-        
-        //mdl.setAllColumnsVisible();
-        PlayListEditAPI.refreshKeyList();
-        String[] titles = PlayListEditAPI.getTrackTitles();
-        for(int i=tblPLE.getRowCount()-1;i>0;i--)
-	{
-	    ((DefaultTableModel)tblPLE.getModel()).removeRow(i-1);
-	}
-            tblPLE.getModel().setValueAt(0,0,0);
-            tblPLE.getModel().setValueAt(titles[0],0,1);
-            tblPLE.getModel().setValueAt(PlayListEditAPI.getTargetPlayCount(0),0,2);
-            tblPLE.getModel().setValueAt(PlayListEditAPI.getPlayCount(0),0,3);
-        for (int i = 0; i < titles.length; i++)
+        try
         {
-            ((DefaultTableModel)tblPLE.getModel()).addRow(new Object[]{null,null,null,null});
-            tblPLE.getModel().setValueAt(i,i,0);
-            tblPLE.getModel().setValueAt(titles[i],i,1);
-            tblPLE.getModel().setValueAt(PlayListEditAPI.getTargetPlayCount(i),i,2);
-            tblPLE.getModel().setValueAt(PlayListEditAPI.getPlayCount(i),i,3);
-        }
-        rebuilding=false;
+            rebuilding = true;
+
+            //mdl.setAllColumnsVisible();
+            PlayListEditAPI.refreshKeyList();
+            String[] titles = PlayListEditAPI.getTrackTitles();
+            for(int i=tblPLE.getRowCount()-1;i>0;i--)
+            {
+                ((DefaultTableModel)tblPLE.getModel()).removeRow(i-1);
+            }
+            if(titles.length>0)
+            {
+                tblPLE.getModel().setValueAt(0,0,0);
+                tblPLE.getModel().setValueAt(titles[0],0,1);
+                tblPLE.getModel().setValueAt(PlayListEditAPI.getTargetPlayCount(0),0,2);
+                tblPLE.getModel().setValueAt(PlayListEditAPI.getPlayCount(0),0,3);
+            }
+            else
+            {
+                tblPLE.getModel().setValueAt(-1,0,0);
+                tblPLE.getModel().setValueAt("-- NO TRACKS --",0,1);
+                tblPLE.getModel().setValueAt(0,0,2);
+                tblPLE.getModel().setValueAt(0,0,3);
+            }
+            for (int i = 0; i < titles.length; i++)
+            {
+                ((DefaultTableModel)tblPLE.getModel()).addRow(new Object[]{null,null,null,null});
+                tblPLE.getModel().setValueAt(i,i,0);
+                tblPLE.getModel().setValueAt(titles[i],i,1);
+                tblPLE.getModel().setValueAt(PlayListEditAPI.getTargetPlayCount(i),i,2);
+                tblPLE.getModel().setValueAt(PlayListEditAPI.getPlayCount(i),i,3);
+            }
+            rebuilding=false;
         }
         catch(InvalidPlayListFileException e)
         {
@@ -285,8 +315,8 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JButton btnEnqueue;
     private javax.swing.JButton btnPlayPause;
+    private javax.swing.JButton btnReload;
     private javax.swing.JButton btnSkip;
-    private javax.swing.JButton jButton2;
     private javax.swing.JScrollPane jScrollPane1;
     private javax.swing.JScrollPane jScrollPane2;
     private javax.swing.JLabel lblStatus;
@@ -359,6 +389,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
     public void setTrackName(String trackName)
     {
         EventQueue.invokeLater(()->lblTrackName.setText(trackName));
+        EventQueue.invokeLater(()->rebuildTable(false));
     }
     
 
@@ -375,10 +406,24 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
     @Override
     public void initializeUI()
     {
+        boolean onARM = Detectors.getSystemClassification()[1].equals("arm");
+        if(onARM)
+        {
+            setUndecorated(true);
+            setLocation(0, 0);
+        }
         setIconImage(IZPLApi.getProgramIcon());
         initComponents();
+        
         mdl=(HidableTableColumnModel) tblPLE.getColumnModel();
         mdl.setColumnVisible(mdl.getColumn(0), false);
+        //most probably "embedded" device.
+        if(onARM)
+        {
+            //target and current playcount hidden, decluttering
+            mdl.setColumnVisible(mdl.getColumn(1), false);
+            mdl.setColumnVisible(mdl.getColumn(1), false);
+        }
         addWindowListener(new WindowAdapter()
         {
             @Override
@@ -389,7 +434,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
         });
         seekBar.addMouseListener(this);
         
-        
+
         
         //play();
         int condition = JComponent.WHEN_IN_FOCUSED_WINDOW;
@@ -409,6 +454,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
         }); 
         // selectedPlaybackPlugin.registerVideoSurface(videoPanel);
         //TODO: HAX für RPi mit ProjectM-SDL/PulseAudio fullscreen. 
+        // HW-Incompat, Requires different HW
         rebuildTable(false);
     }
     
@@ -462,7 +508,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
     @Override
     public void reloadPlayList()
     {
-        
+        EventQueue.invokeLater(()->this.rebuildTable(false));
     }
     
     

+ 26 - 0
izpl-shared/src/main/java/de/nplusc/izc/iZpl/API/shared/FolderHandler.java

@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2018 iZc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package de.nplusc.izc.iZpl.API.shared;
+
+/**
+ * QUick Replacement for the COnsumer class of Java8 for Java7 compat of the code
+ * @author iZc (nplusc.de)
+ */
+public interface FolderHandler<T> {
+    void accept(T t);
+}
+

+ 21 - 17
izpl-shared/src/main/java/de/nplusc/izc/iZpl/Utils/shared/PLFileIO.java

@@ -17,6 +17,7 @@
 
 package de.nplusc.izc.iZpl.Utils.shared;
 
+import de.nplusc.izc.iZpl.API.shared.FolderHandler;
 import de.nplusc.izc.iZpl.API.shared.InvalidPlayListFileException;
 import de.nplusc.izc.iZpl.API.shared.MultiPlayListItem;
 import de.nplusc.izc.iZpl.API.shared.PlayListFile;
@@ -37,7 +38,6 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.function.Consumer;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.jaudiotagger.audio.AudioFile;
@@ -119,7 +119,7 @@ public class PLFileIO
         return readSingleList(path,null);
     }
     
-    public static RawPlayListFile readSingleList(String path,Consumer<String> folderHandler) throws InvalidPlayListFileException
+    public static RawPlayListFile readSingleList(String path,FolderHandler<String> folderHandler) throws InvalidPlayListFileException
     {
         if(new File(path).isDirectory())
         {
@@ -201,6 +201,7 @@ public class PLFileIO
                         String[] meta = ln.split(":")[1].split("\\|");
                         if(meta[0].equalsIgnoreCase("include"))
                         {
+                            l.trace("Include element detected");
                             if(meta.length==3)
                             {
                                 if(meta[2].equalsIgnoreCase("expand"))
@@ -303,11 +304,12 @@ public class PLFileIO
                                     try
                                     {
                                         itm.setTitle(getExtM3uLine(ln));
-                                    } catch (CannotReadException | IOException | TagException | ReadOnlyFileException | InvalidAudioFrameException ex)
+                                    }
+                                    catch (CannotReadException | IOException | TagException | ReadOnlyFileException | InvalidAudioFrameException ex)
                                     {
-                                        l.warn("Skipped invalid File ({})",ln);
+                                        l.info("No ID3-Data for file, falling back to nabe based implementation. ({})",ln);
+                                        itm.setTitle("#EXTINF:0,"+new File(ln).getName());
                                     }
-                                    itm.setTitle("#EXTINF:0,"+new File(ln).getName()); //TODO ID3parse
                                 }
                                 if(!(ln.substring(1).startsWith(":")||ln.startsWith(File.separator)))
                                 {
@@ -323,12 +325,14 @@ public class PLFileIO
                                 itm.setPath(ln);
                                 itm.setPrefix(itmprefix.toArray(new String[]{}));
                                 itm.setInlineCOmmentLines(itmprefix.toArray(new String[]{}));
+                                l.trace("Itemstats:incl,path|{},{}:",itm.isIncludeElement(),itm.getPath());
                                 returndata.add(itm);
                                 itm=new SinglePlayListItem();
                                 extinf=false;
                                 itmprefix.clear();
                                 itmsuffix.clear();
                                 tail.clear();
+                                
                             }
                             else
                             {
@@ -368,23 +372,18 @@ public class PLFileIO
         
     }
     
-        public static List<PlayListItem> parseFullList(String path,Consumer<String> folderHandler) throws InvalidPlayListFileException
+    public static List<PlayListItem> parseFullList(String path,FolderHandler<String> folderHandler) throws InvalidPlayListFileException
     {
         return parseFullList(path, 40,false,folderHandler);
         
     }
     
-    public static List<PlayListItem> parseFullList(String path,int rd) throws InvalidPlayListFileException
-    {
-        return parseFullList(path, rd,false);
-    }
-    
-        public static List<PlayListItem> parseFullList(String path,int rd,boolean singelifyMultiItems) throws InvalidPlayListFileException
+    public static List<PlayListItem> parseFullList(String path,int rd,boolean singelifyMultiItems) throws InvalidPlayListFileException
     {
         return parseFullList(path, rd,false,null);
     }
     
-    public static List<PlayListItem> parseFullList(String path,int rd,boolean singelifyMultiItems,Consumer<String> folderHandler) throws InvalidPlayListFileException
+    public static List<PlayListItem> parseFullList(String path,int rd,boolean singelifyMultiItems,FolderHandler<String> folderHandler) throws InvalidPlayListFileException
     {
         
         HashMap<Integer,MultiPlayListItem> groups = new HashMap<>();
@@ -392,9 +391,14 @@ public class PLFileIO
 
         List<SinglePlayListItem> rootList = readSingleList(path,folderHandler).getData();
         try{
-            Class yaml = Class.forName("org.yaml.snakeyaml.Yaml");
-            Object y = yaml.getConstructor().newInstance();
-            l.trace(yaml.getMethod("dump", Object.class).invoke(y, rootList));
+            Class izplapi = Class.forName("de.nplusc.izc.iZpl.API.IZPLApi");
+            Method m = izplapi.getMethod("isVerboseMode", null);
+            if((Boolean)m.invoke(null, null))
+            {
+                Class yaml = Class.forName("org.yaml.snakeyaml.Yaml");
+                Object y = yaml.getConstructor().newInstance();
+                l.trace(yaml.getMethod("dump", Object.class).invoke(y, rootList));
+            }
         }
         catch(Exception e)
         {
@@ -422,7 +426,7 @@ public class PLFileIO
                 }
                 else
                 {
-                    List<PlayListItem> temp = parseFullList(re.getPath(),rd-1);
+                    List<PlayListItem> temp = parseFullList(re.getPath(),rd-1,singelifyMultiItems,folderHandler);
                     for (PlayListItem ple : temp)
                     {
                         ple.setTargetPlaycount(ple.getTargetPlaycount()*re.getTargetPlaycount());