Sfoglia il codice sorgente

added some outline for VLC remote control

git-svn-id: http://repo.nplusc.de/svn/iZink@315 8b19561d-0d00-6744-8ac1-9afc8f58a8aa
masterX244 10 anni fa
parent
commit
6e749f0d0e

+ 73 - 2
iZpl/src/de/nplusc/izc/iZpl/GUI/iZplGUIDefault.form

@@ -23,13 +23,84 @@
   <Layout>
     <DimensionLayout dim="0">
       <Group type="103" groupAlignment="0" attributes="0">
-          <EmptySpace min="0" pref="400" max="32767" attributes="0"/>
+          <Group type="102" alignment="1" attributes="0">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" attributes="0">
+                      <EmptySpace pref="127" max="32767" attributes="0"/>
+                      <Component id="jButton3" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jButton2" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jButton1" min="-2" pref="109" max="-2" attributes="0"/>
+                  </Group>
+                  <Component id="jSlider1" max="32767" attributes="0"/>
+              </Group>
+              <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
+          </Group>
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="32767" attributes="0"/>
+          </Group>
       </Group>
     </DimensionLayout>
     <DimensionLayout dim="1">
       <Group type="103" groupAlignment="0" attributes="0">
-          <EmptySpace min="0" pref="300" max="32767" attributes="0"/>
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="32767" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="103" alignment="1" groupAlignment="3" attributes="0">
+                      <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <Group type="102" alignment="1" attributes="0">
+                      <Component id="jButton1" min="-2" pref="58" max="-2" attributes="0"/>
+                      <EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+              <Component id="jSlider1" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+          </Group>
       </Group>
     </DimensionLayout>
   </Layout>
+  <SubComponents>
+    <Component class="javax.swing.JSlider" name="jSlider1">
+    </Component>
+    <Component class="javax.swing.JButton" name="jButton1">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Play"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="jButton2">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Skip"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JButton" name="jButton3">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Show List"/>
+      </Properties>
+    </Component>
+    <Container class="javax.swing.JPanel" name="jPanel1">
+
+      <Layout>
+        <DimensionLayout dim="0">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <EmptySpace min="0" pref="186" max="32767" attributes="0"/>
+          </Group>
+        </DimensionLayout>
+        <DimensionLayout dim="1">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <EmptySpace min="0" pref="171" max="32767" attributes="0"/>
+          </Group>
+        </DimensionLayout>
+      </Layout>
+    </Container>
+  </SubComponents>
 </Form>

+ 68 - 2
iZpl/src/de/nplusc/izc/iZpl/GUI/iZplGUIDefault.java

@@ -30,22 +30,83 @@ public class iZplGUIDefault extends javax.swing.JFrame
     private void initComponents()
     {
 
+        jSlider1 = new javax.swing.JSlider();
+        jButton1 = new javax.swing.JButton();
+        jButton2 = new javax.swing.JButton();
+        jButton3 = new javax.swing.JButton();
+        jPanel1 = new javax.swing.JPanel();
+
         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 
+        jButton1.setText("Play");
+        jButton1.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                jButton1ActionPerformed(evt);
+            }
+        });
+
+        jButton2.setText("Skip");
+
+        jButton3.setText("Show List");
+
+        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+        jPanel1.setLayout(jPanel1Layout);
+        jPanel1Layout.setHorizontalGroup(
+            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 186, Short.MAX_VALUE)
+        );
+        jPanel1Layout.setVerticalGroup(
+            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 171, Short.MAX_VALUE)
+        );
+
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
         getContentPane().setLayout(layout);
         layout.setHorizontalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 400, Short.MAX_VALUE)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addContainerGap(127, Short.MAX_VALUE)
+                        .addComponent(jButton3)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addComponent(jButton2)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
+                    .addComponent(jSlider1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                .addGap(24, 24, 24))
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 300, Short.MAX_VALUE)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                        .addComponent(jButton2)
+                        .addComponent(jButton3))
+                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addGap(2, 2, 2)))
+                .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap())
         );
 
         pack();
     }// </editor-fold>//GEN-END:initComponents
 
+    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
+    {//GEN-HEADEREND:event_jButton1ActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_jButton1ActionPerformed
+
     /**
      * @param args the command line arguments
      */
@@ -95,5 +156,10 @@ public class iZplGUIDefault extends javax.swing.JFrame
         });
     }
     // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton jButton1;
+    private javax.swing.JButton jButton2;
+    private javax.swing.JButton jButton3;
+    private javax.swing.JPanel jPanel1;
+    private javax.swing.JSlider jSlider1;
     // End of variables declaration//GEN-END:variables
 }

+ 10 - 1
iZpl/src/de/nplusc/izc/iZpl/TestClass.java

@@ -8,6 +8,7 @@ import de.nplusc.izc.iZpl.GUI.PlayListManagingBackend;
 import de.nplusc.izc.iZpl.GUI.PlayListManagingDefault;
 import de.nplusc.izc.iZpl.GUI.PlayListManagingSkinnable;
 import de.nplusc.izc.tools.UiToolz.IZSkinFile;
+import de.nplusc.izc.tools.baseTools.Tools;
 import java.io.FileReader;
 import org.yaml.snakeyaml.Yaml;
 
@@ -21,6 +22,9 @@ public class TestClass
     {
         try
         {
+            
+            System.out.println(Tools.runSingleCmd(true, true, true, "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe", "--version"));
+            
             /*  
               PlProcessorV2 ppp = new PlProcessorV2();
               ppp.InitializeOnPath("D:\\mp3\\iZpl\\rxe.izpl");
@@ -29,13 +33,18 @@ public class TestClass
               //HashMap<String,PlayListItem> xxx = (HashMap<String,PlayListItem>) new Yaml().load(plif);
               */
               
+            
+            /*
               IZSkinFile f = new Yaml().loadAs(new FileReader("T:\\icns\\iZpl\\skdev\\skindef.izmeta"), IZSkinFile.class);
               PlProcessorV2 ppp = new Yaml().loadAs(new FileReader("D:\\mp3\\iZpl\\rxe.iZcont"), PlProcessorV2.class);
               PlayListManagingBackend.initPPP(ppp);
               //new PlayListManagingDefault().setVisible(true);
               PlayListManagingSkinnable t =  new PlayListManagingSkinnable(f, "T:\\icns\\izpl\\skdev");
               t.setVisible(true);
-             
+             */
+            
+            
+            
              /* IZSkinFile f = new IZSkinFile("iZplaylist");
               HashMap<String,int[]> ep = f.getElementPositions();
               

+ 1 - 1
iZpl/src/de/nplusc/izc/iZpl/Utils/PLReader.java

@@ -331,7 +331,7 @@ public class PLReader
         ArrayList<String> cleanup=new ArrayList<>();
         for (String line : playListRaw)
         {
-            if(line!=null&&!line.equals(""))
+            if(line!=null&&!line.equals("")&&line.length()>4)
             {
                 cleanup.add(line);
             }

+ 127 - 0
iZpl/src/de/nplusc/izc/iZpl/Utils/VlcInterface.java

@@ -0,0 +1,127 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package de.nplusc.izc.iZpl.Utils;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.util.Arrays;
+import org.boris.pecoff4j.PE;
+import org.boris.pecoff4j.io.PEParser;
+import org.boris.pecoff4j.util.IO;
+
+/**
+ *
+ * @author inge
+ */
+public class VlcInterface
+{
+    private VlcInterface instance;
+    
+    private VlcInterface (String vlcpath)
+    {
+        
+    }
+    
+    
+    public int getLengthInSeconds()
+    {
+        return 0;
+    }
+    public int getPosition()
+    {
+        return 0;
+    }
+    public void seek(int sekunde)
+    {
+        
+    }
+    
+    public void skipTitle()
+    {
+        
+    }
+    
+    private class VlcJIterface
+    {
+        public int getLengthInSeconds()
+        {
+            return 0;
+        }
+        public int getPosition()
+        {
+            return 0;
+        }
+        public void seek(int sekunde)
+        {
+
+        }
+
+        public void skipTitle()
+        {
+
+        }
+    }
+    
+    private class VlcTelnetIterface
+    {
+        public int getLengthInSeconds()
+        {
+            return 0;
+        }
+        public int getPosition()
+        {
+            return 0;
+        }
+        public void seek(int sekunde)
+        {
+
+        }
+
+        public void skipTitle()
+        {
+
+        }
+    }
+    
+    
+    
+    
+    public static void main(String[] args)
+    {
+        System.out.println(Arrays.toString(getVlcVersionFromExe("C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe")));
+    }
+    
+    
+    //#####################################################
+    public static int[] getVlcVersionFromExe(String vlcpath)
+    {
+        
+        
+
+        
+        try
+        {
+            PE vlcexe = PEParser.parse(vlcpath);
+            return new int[]
+            {
+                vlcexe.getImageData().getResourceTable().getTable().getMajorVersion(),
+                vlcexe.getImageData().getResourceTable().getTable().getMajorVersion()
+            };
+        }
+        catch (IOException ex)
+        {
+            ex.printStackTrace();
+        }
+        return new int[]{0,0};
+    }
+            //RandomAccessFile vex = new RandomAccessFile(new File(vlcpath), "r");
+}
+           
+    
+    
+