|
@@ -16,25 +16,17 @@
|
|
|
*/
|
|
|
package de.nplusc.izc.iZpl;
|
|
|
|
|
|
-import de.nplusc.izc.iZpl.API.FeaturePlugin;
|
|
|
import de.nplusc.izc.iZpl.API.IZPLApi;
|
|
|
-import de.nplusc.izc.iZpl.API.PlaybackPlugin;
|
|
|
-import de.nplusc.izc.iZpl.API.Plugin;
|
|
|
-import de.nplusc.izc.iZpl.API.UIPlugin;
|
|
|
+import de.nplusc.izc.iZpl.API.PluginManager;
|
|
|
import de.nplusc.izc.iZpl.GUI.ConfigureScreen;
|
|
|
import de.nplusc.izc.iZpl.GUI.FirstRunScreen;
|
|
|
-import de.nplusc.izc.iZpl.GUI.IZplGUIDefault;
|
|
|
-import de.nplusc.izc.iZpl.GUI.IZplGUISkinnable;
|
|
|
import de.nplusc.izc.iZpl.GUI.MainMenu;
|
|
|
import de.nplusc.izc.iZpl.Utils.BurnMe;
|
|
|
-import de.nplusc.izc.iZpl.Utils.VlcInterface;
|
|
|
import de.nplusc.izc.tools.IOtools.FileTK;
|
|
|
import de.nplusc.izc.tools.baseTools.Detectors;
|
|
|
import de.nplusc.izc.tools.baseTools.Messagers;
|
|
|
import de.nplusc.izc.tools.baseTools.Tools;
|
|
|
import de.schlichtherle.truezip.file.TFile;
|
|
|
-import de.schlichtherle.truezip.file.TFileReader;
|
|
|
-import java.awt.Desktop;
|
|
|
import java.awt.EventQueue;
|
|
|
import java.awt.Image;
|
|
|
import java.io.BufferedReader;
|
|
@@ -43,23 +35,9 @@ import java.io.FileNotFoundException;
|
|
|
import java.io.FileReader;
|
|
|
import java.io.FileWriter;
|
|
|
import java.io.IOException;
|
|
|
-import java.net.MalformedURLException;
|
|
|
-import java.net.URL;
|
|
|
-import java.net.URLClassLoader;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
import javax.imageio.ImageIO;
|
|
|
import javax.swing.JTextArea;
|
|
|
-import org.apache.commons.cli.CommandLine;
|
|
|
-import org.apache.commons.cli.CommandLineParser;
|
|
|
-import org.apache.commons.cli.DefaultParser;
|
|
|
-import org.apache.commons.cli.HelpFormatter;
|
|
|
-import org.apache.commons.cli.OptionBuilder;
|
|
|
-import org.apache.commons.cli.OptionGroup;
|
|
|
-import org.apache.commons.cli.Options;
|
|
|
import org.apache.commons.cli.ParseException;
|
|
|
import org.apache.logging.log4j.Level;
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
@@ -76,74 +54,29 @@ import org.yaml.snakeyaml.Yaml;
|
|
|
@SuppressWarnings("CallToPrintStackTrace")
|
|
|
public class Main extends javax.swing.JFrame
|
|
|
{
|
|
|
+ private static PluginManager p = new PluginManager();
|
|
|
+
|
|
|
+
|
|
|
private static Logger l;
|
|
|
|
|
|
- private static boolean verboseMode=false;
|
|
|
-
|
|
|
private static final String jarschiv = Main.class.getProtectionDomain().getCodeSource().getLocation().getPath();
|
|
|
public static final String CONFIGPATH = IZPLApi.APPDIR + File.separator + "config" + File.separator + "config.yml";
|
|
|
public static final Yaml y = new Yaml();
|
|
|
|
|
|
- private static final int UIMODE_NONE=0,UIMODE_OLD=1,UIMODE_NEW=2;
|
|
|
- private static int uimodestate=UIMODE_NONE;
|
|
|
-
|
|
|
- // public static LogStream stdout;
|
|
|
- private static final List<PlaybackPlugin> registeredPlayBackAdapters = new ArrayList<>();
|
|
|
- private static final List<FeaturePlugin> registeredFeatures = new ArrayList<>();
|
|
|
- private static final List<UIPlugin> registeredUIs = new ArrayList<>();
|
|
|
- private static final List<String> detectedSkins = new ArrayList<>();
|
|
|
+ public static final int UIMODE_NONE=0,UIMODE_OLD=1,UIMODE_NEW=2;
|
|
|
+ //private static int uimodestate=UIMODE_NONE;
|
|
|
private static boolean loadedVLC = false;
|
|
|
private static PLServer ps = null;
|
|
|
|
|
|
private static boolean issueDetected = false;
|
|
|
- private static boolean useGUI = false;
|
|
|
- //--newGUI
|
|
|
-
|
|
|
- private static boolean filemode = false;//X
|
|
|
- private static boolean statefile = false;//X
|
|
|
- private static String file_path = ""; //X
|
|
|
- //--file path
|
|
|
- //--state path
|
|
|
-
|
|
|
- private static boolean burnDisc = false; //X
|
|
|
- //--burn path
|
|
|
-
|
|
|
- private static Boolean forcePregen = false;//X
|
|
|
- //--pregen
|
|
|
-
|
|
|
- private static boolean featurePluginMode; //X
|
|
|
- private static String featurePluginID; //X
|
|
|
- private static String pluginParameter; //X
|
|
|
-
|
|
|
- private static boolean loadConfigMode=false; //X
|
|
|
-
|
|
|
- private static boolean menumode = false;
|
|
|
-
|
|
|
- private static boolean firstrunmode = false;
|
|
|
-
|
|
|
- private static boolean updateInit=false;
|
|
|
-
|
|
|
- private static boolean allowPluginLoad=false;
|
|
|
-
|
|
|
public static Configuration CONFIG;
|
|
|
// ../config/config.yml
|
|
|
|
|
|
- private static String selectedSkinPath;
|
|
|
- private static boolean skinParameterSet = false;
|
|
|
-
|
|
|
- private static PlaybackPlugin selectedPlaybackPlugin;
|
|
|
-
|
|
|
- private static UIPlugin selectedUIPlugin;
|
|
|
+ private static CommandLineStatus stts;
|
|
|
private static FirstRunScreen frs;
|
|
|
|
|
|
private static Image playListIcon;
|
|
|
-
|
|
|
- private static FeaturePlugin selectedFeaturePlugin;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- private static boolean pluginsAlreadyLoaded=false;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="Gefruzel::Main">
|
|
|
/**
|
|
@@ -174,7 +107,7 @@ public class Main extends javax.swing.JFrame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- processCommandLine(args);
|
|
|
+ CommandLineStatus stts = CommandLineParsing.processCommandLine(args);
|
|
|
logStart();
|
|
|
|
|
|
mainProcessing();
|
|
@@ -196,113 +129,11 @@ public class Main extends javax.swing.JFrame
|
|
|
LoggerContext cx = (LoggerContext) LogManager.getContext(false);
|
|
|
Runtime.getRuntime().addShutdownHook(new Shitdown());
|
|
|
}
|
|
|
- // </editor-fold>
|
|
|
- public static void UIMain(boolean pFfilemode,boolean pStatemode,String pFile,boolean pForcePregen,
|
|
|
- boolean pBurnDisc,boolean pLoadConfigMode,boolean pFeatureMode,String pFeaturePluginID)
|
|
|
- {
|
|
|
- menumode=false;//hardwired da man vom menü wieder raus will
|
|
|
- filemode=pFfilemode;
|
|
|
- statefile = pStatemode;
|
|
|
- file_path = pFile;
|
|
|
- forcePregen = pForcePregen;
|
|
|
- burnDisc=pBurnDisc;
|
|
|
- loadConfigMode=pLoadConfigMode;
|
|
|
- featurePluginMode = pFeatureMode;
|
|
|
- featurePluginID = pFeaturePluginID;
|
|
|
-
|
|
|
- if(burnDisc||filemode||statefile||loadConfigMode||featurePluginMode)
|
|
|
- {
|
|
|
- allowPluginLoad=true;
|
|
|
- }
|
|
|
- mainProcessing();
|
|
|
- }
|
|
|
|
|
|
- public static void spawnUI()
|
|
|
- {
|
|
|
- pluginInitCore(); //sorgt dafür dass plugins bereits registriert sind
|
|
|
- EventQueue.invokeLater(()->{
|
|
|
- MainMenu m = new MainMenu();
|
|
|
- m.setIconImage(IZPLApi.getProgramIcon());
|
|
|
- m.setVisible(true);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- private static void processCommandLine(String[] args) throws ParseException
|
|
|
+ public static void setupLogging(boolean verbose)
|
|
|
{
|
|
|
- CommandLineParser parser = new DefaultParser();
|
|
|
- Options options = new Options();
|
|
|
- OptionGroup modes = new OptionGroup();
|
|
|
- OptionGroup uimodes = new OptionGroup();
|
|
|
-
|
|
|
- //gopvsferbicuxm
|
|
|
- //bcefgimoprsuvx
|
|
|
- uimodes.addOption(OptionBuilder.withLongOpt("newgui")
|
|
|
- .withDescription("enables the Standalone GUI mode. Starts program straight if --file or --resume is set")
|
|
|
- .create("g"));
|
|
|
- uimodes.addOption(OptionBuilder.withLongOpt("oldgui")
|
|
|
- .withDescription("enables External VLC Player UIMode. Starts program straight if --file or --resume is set")
|
|
|
- .create("o"));
|
|
|
- options.addOption("p", "pregen", false, "Pregens a standalone playlist with the randomisation included. Use togehter only with --file");
|
|
|
- options.addOption("v", "verbose", false, "Enables verbose VLCJ logging");
|
|
|
|
|
|
|
|
|
- options.addOption(OptionBuilder.withLongOpt("pluginparameter")
|
|
|
- .withDescription("uses the given pluginParameter to initialize the selected FeaturePlugin")
|
|
|
- .hasOptionalArg()
|
|
|
- .withArgName("PluginParameter")
|
|
|
- .create("x"));
|
|
|
-
|
|
|
- options.addOption(OptionBuilder.withLongOpt("featureplugin")
|
|
|
- .withDescription("loads the specified FeaturePlugin. Lists them if no plugin name given")
|
|
|
- .hasOptionalArg()
|
|
|
- .withArgName("plugin")
|
|
|
- .create("e"));
|
|
|
-
|
|
|
-
|
|
|
- options.addOption(OptionBuilder.withLongOpt("skin")
|
|
|
- .withDescription("load FILE as skin. No file specified means default skin")
|
|
|
- .hasOptionalArg()
|
|
|
- .withArgName("FILE")
|
|
|
- .create("s"));
|
|
|
- modes.addOption(OptionBuilder.withLongOpt("file")
|
|
|
- .withDescription("load FILE as iZpl-File")
|
|
|
- .hasArg()
|
|
|
- .withArgName("FILE")
|
|
|
- .create("f"));
|
|
|
- modes.addOption(OptionBuilder.withLongOpt("menu")
|
|
|
- .withDescription("starts the MainMenu")
|
|
|
- .create("m"));
|
|
|
- modes.addOption(OptionBuilder.withLongOpt("resume")
|
|
|
- .withDescription("load FILE as iZpl-Statefile to resume the playback session")
|
|
|
- .hasArg()
|
|
|
- .withArgName("FILE")
|
|
|
- .create("r"));
|
|
|
- modes.addOption(OptionBuilder.withLongOpt("burn")
|
|
|
- .withDescription("load FILE as iZpl-File and then sends it to the Burn Disc-compilation GUI")
|
|
|
- .hasArg()
|
|
|
- .withArgName("FILE")
|
|
|
- .create("b"));
|
|
|
- modes.addOption(OptionBuilder.withLongOpt("initialize")
|
|
|
- .withDescription("Loads the Setup-finalize-GUI to get the last steps configured")
|
|
|
- .create("i"));
|
|
|
- modes.addOption(OptionBuilder.withLongOpt("configure")
|
|
|
- .withDescription("Loads the Configuration UI")
|
|
|
- .create("c"));
|
|
|
- modes.addOption(OptionBuilder.withLongOpt("upgrade")
|
|
|
- .withDescription("Reextracts the natives and does the init without affecting custom Data")
|
|
|
- .create("u"));
|
|
|
- options.addOptionGroup(modes);
|
|
|
- options.addOptionGroup(uimodes);
|
|
|
-
|
|
|
- if(Detectors.getSystemClassification()[0].equals("windows"))
|
|
|
- {
|
|
|
- options.addOption(OptionBuilder.withLongOpt("registerfileextensions")
|
|
|
- .withDescription("Registers the FileExtensions. ")
|
|
|
- .create());
|
|
|
- }
|
|
|
-
|
|
|
- CommandLine cl = parser.parse(options, args);
|
|
|
-
|
|
|
//if(!cl.hasOption("verbose")&&!(System.getProperty("log4j.configurationFile")==null))
|
|
|
//{
|
|
|
// System.setProperty("log4j.configurationFile", "file:///"+jarschiv+"!log4j2NonVerbose.xml");
|
|
@@ -313,9 +144,9 @@ public class Main extends javax.swing.JFrame
|
|
|
LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
|
|
|
LoggerConfig externalloggerConfig = config.getLoggerConfig("External");
|
|
|
|
|
|
- if (cl.hasOption("verbose"))
|
|
|
+ if (verbose)
|
|
|
{
|
|
|
- verboseMode=true;
|
|
|
+
|
|
|
loggerConfig.setLevel(Level.TRACE);
|
|
|
externalloggerConfig.setLevel(Level.TRACE);
|
|
|
}
|
|
@@ -325,143 +156,44 @@ public class Main extends javax.swing.JFrame
|
|
|
externalloggerConfig.setLevel(Level.INFO);
|
|
|
}
|
|
|
cx.updateLoggers();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // </editor-fold>
|
|
|
+ public static void UIMain(boolean pFfilemode,boolean pStatemode,String pFile,boolean pForcePregen,
|
|
|
+ boolean pBurnDisc,boolean pLoadConfigMode,boolean pFeatureMode,String pFeaturePluginID)
|
|
|
+ {
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (cl.hasOption("i"))
|
|
|
- {
|
|
|
- firstrunmode=true;
|
|
|
- }
|
|
|
-
|
|
|
- if (cl.hasOption("u"))
|
|
|
- {
|
|
|
- updateInit=true;
|
|
|
- }
|
|
|
-
|
|
|
- if (cl.hasOption("m"))
|
|
|
- {
|
|
|
- menumode=true;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (cl.hasOption("c"))
|
|
|
- {
|
|
|
- loadConfigMode=true;
|
|
|
- }
|
|
|
- if (cl.hasOption("file"))
|
|
|
- {
|
|
|
- filemode = true;
|
|
|
- file_path = cl.getOptionValue("file");
|
|
|
- }
|
|
|
- if (cl.hasOption("registerfileextensions"))
|
|
|
- {
|
|
|
- registerFileExtensions();
|
|
|
- quickQuit();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (cl.hasOption("resume"))
|
|
|
- {
|
|
|
- if (filemode)
|
|
|
- {
|
|
|
- l.error("Error: --file & --resume & --burn can't be specified at the same time");
|
|
|
- System.exit(9263);
|
|
|
- }
|
|
|
- statefile = true;
|
|
|
- file_path = cl.getOptionValue("resume");
|
|
|
- }
|
|
|
-
|
|
|
- if(cl.hasOption("e"))
|
|
|
- {
|
|
|
- boolean listmode=true;
|
|
|
-
|
|
|
- if(cl.getOptionValue("e")!=null)
|
|
|
- {
|
|
|
- listmode=false;
|
|
|
- featurePluginID=cl.getOptionValue("e");
|
|
|
- l.trace("Listmode disabled due to e param=\""+featurePluginID+"\"");
|
|
|
- }
|
|
|
- //handling für den ListPluginMode
|
|
|
- pluginParameter="";
|
|
|
- featurePluginMode=true;
|
|
|
- if(listmode)
|
|
|
- {
|
|
|
- featurePluginID="";
|
|
|
- l.trace("\"\"");
|
|
|
- }
|
|
|
- l.trace("Parameter of e is now:\""+pluginParameter+"\"");
|
|
|
- }
|
|
|
-
|
|
|
- if(cl.hasOption("x"))
|
|
|
- {
|
|
|
- pluginParameter="";
|
|
|
- if(cl.getOptionValue("e")!=null)
|
|
|
- {
|
|
|
- pluginParameter = cl.getOptionValue("x");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (cl.hasOption("burn"))
|
|
|
- {
|
|
|
- if (filemode || statefile)
|
|
|
- {
|
|
|
- l.error("Error: --file & --resume & --burn can't be specified at the same time");
|
|
|
- System.exit(9263);
|
|
|
- }
|
|
|
- burnDisc = true;
|
|
|
- file_path = cl.getOptionValue("burn");
|
|
|
- }
|
|
|
- if (cl.hasOption("newgui"))
|
|
|
- {
|
|
|
- uimodestate=UIMODE_NEW;
|
|
|
- }
|
|
|
- if (cl.hasOption("oldgui"))
|
|
|
- {
|
|
|
- uimodestate=UIMODE_OLD;
|
|
|
- }
|
|
|
- if (cl.hasOption("pregen"))
|
|
|
- {
|
|
|
- if (!(filemode))
|
|
|
- {
|
|
|
- l.error("Error: pregen only works on --file parameters");
|
|
|
- System.exit(9263);
|
|
|
- }
|
|
|
- forcePregen = true;
|
|
|
- }
|
|
|
-
|
|
|
- //skinPath=DEFAULT_SKIN_PATH;
|
|
|
- if (cl.hasOption("skin"))
|
|
|
- {
|
|
|
- skinParameterSet = true;
|
|
|
- String sfp_i = cl.getOptionValue("skin");
|
|
|
-
|
|
|
- if (sfp_i != null)
|
|
|
- {
|
|
|
- selectedSkinPath = sfp_i;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selectedSkinPath = "default";
|
|
|
- }
|
|
|
- }
|
|
|
- if (!(burnDisc || filemode || statefile || firstrunmode||
|
|
|
- loadConfigMode||updateInit||featurePluginMode||menumode)
|
|
|
- &&uimodestate==UIMODE_NONE)
|
|
|
- {
|
|
|
- HelpFormatter formatter = new HelpFormatter();
|
|
|
- formatter.printHelp("izpl", options);
|
|
|
- System.exit(0);
|
|
|
- }
|
|
|
- if(burnDisc||filemode||statefile||firstrunmode||loadConfigMode||updateInit||featurePluginMode)
|
|
|
+ boolean menumode=false;//hardwired da man vom menü wieder raus will
|
|
|
+ boolean filemode=pFfilemode;
|
|
|
+ boolean statefile = pStatemode;
|
|
|
+ String file_path = pFile;
|
|
|
+ boolean forcePregen = pForcePregen;
|
|
|
+ boolean burnDisc=pBurnDisc;
|
|
|
+ boolean loadConfigMode=pLoadConfigMode;
|
|
|
+ boolean featurePluginMode = pFeatureMode;
|
|
|
+ String featurePluginID = pFeaturePluginID;
|
|
|
+ boolean allowPluginLoad=false;
|
|
|
+ if(burnDisc||filemode||statefile||loadConfigMode||featurePluginMode)
|
|
|
{
|
|
|
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);
|
|
|
+ mainProcessing();
|
|
|
}
|
|
|
+
|
|
|
+ public static void spawnUI()
|
|
|
+ {
|
|
|
+ p.pluginInitCore(); //sorgt dafür dass plugins bereits registriert sind
|
|
|
+ EventQueue.invokeLater(()->{
|
|
|
+ MainMenu m = new MainMenu();
|
|
|
+ m.setIconImage(IZPLApi.getProgramIcon());
|
|
|
+ m.setVisible(true);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private static void mainProcessing()
|
|
|
{
|
|
@@ -487,14 +219,14 @@ public class Main extends javax.swing.JFrame
|
|
|
|
|
|
}
|
|
|
//</editor-fold>
|
|
|
- if(menumode)
|
|
|
+ if(stts.menumode)
|
|
|
{
|
|
|
spawnUI();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (firstrunmode)
|
|
|
+ if (stts.firstrunmode)
|
|
|
{
|
|
|
java.awt.EventQueue.invokeLater(() ->
|
|
|
{
|
|
@@ -510,69 +242,15 @@ public class Main extends javax.swing.JFrame
|
|
|
loadConfigs();
|
|
|
if (CONFIG.isStandaloneMode())
|
|
|
{
|
|
|
- useGUI = true;
|
|
|
+ stts= stts.changeUseGUI(true);
|
|
|
}
|
|
|
- detectSkins();
|
|
|
+ p.detectSkins();
|
|
|
l.info("Initializing the plugins now. This may take a while");
|
|
|
- initializePlugins();
|
|
|
+ p.initializePlugins();
|
|
|
l.info("Plugins initialized");
|
|
|
//TODO: GUI-Editor zum Erzeugen von iZpl-S
|
|
|
|
|
|
- /* go to Stage 2 of the loading */
|
|
|
- java.awt.EventQueue.invokeLater(() ->
|
|
|
- {
|
|
|
- if ((filemode || statefile||featurePluginMode) && !(firstrunmode || loadConfigMode))
|
|
|
- {
|
|
|
- final Main b = new Main();
|
|
|
- pload.setIndeterminate(true);
|
|
|
- b.setIconImage(playListIcon);
|
|
|
- b.setVisible(true);
|
|
|
-
|
|
|
- Thread t1 = new Thread(() ->
|
|
|
- {
|
|
|
- startup();
|
|
|
- });
|
|
|
- t1.setName("IZPL-Backend");
|
|
|
- t1.start();
|
|
|
- Thread t2 = new Thread(() ->
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- while (!loadedVLC)
|
|
|
- {
|
|
|
- Thread.sleep(150);
|
|
|
- }
|
|
|
- if (!useGUI) //ladebalken hinter UI macht keinen sinn
|
|
|
- {
|
|
|
- Thread.sleep(1500);
|
|
|
- }
|
|
|
- }
|
|
|
- catch (InterruptedException ex)
|
|
|
- {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- b.setVisible(false);
|
|
|
- });
|
|
|
- t2.setName("LoadCloser");
|
|
|
- t2.start();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (burnDisc)
|
|
|
- {
|
|
|
- BurnMe.InitializeBurnDisc(file_path);
|
|
|
- //quickQuit();
|
|
|
- }
|
|
|
- if (firstrunmode || loadConfigMode)
|
|
|
- {
|
|
|
- if (!loadConfigMode)
|
|
|
- {
|
|
|
- frs.setVisible(false);
|
|
|
- }
|
|
|
- new ConfigureScreen(firstrunmode).setVisible(true);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ mainProcessingStage2();
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings(
|
|
@@ -611,14 +289,14 @@ public class Main extends javax.swing.JFrame
|
|
|
ex.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- if (skinParameterSet)
|
|
|
+ if (stts.skinParameterSet)
|
|
|
{
|
|
|
- CONFIG.setSkinSelected(selectedSkinPath);
|
|
|
+ CONFIG.setSkinSelected(stts.selectedSkinPath);
|
|
|
}
|
|
|
- selectedSkinPath = CONFIG.getSkinSelected();
|
|
|
- if(uimodestate!=UIMODE_NONE)
|
|
|
+ p.setSelectedSkinPath(CONFIG.getSkinSelected());
|
|
|
+ if(stts.uimodestate!=UIMODE_NONE)
|
|
|
{
|
|
|
- if(uimodestate==UIMODE_NEW)
|
|
|
+ if(stts.uimodestate==UIMODE_NEW)
|
|
|
{
|
|
|
CONFIG.setStandaloneMode(true);
|
|
|
}
|
|
@@ -637,241 +315,70 @@ public class Main extends javax.swing.JFrame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void detectSkins()
|
|
|
- {
|
|
|
- new File(IZPLApi.SKINPATH).mkdirs();
|
|
|
- //new File().mkdirs();
|
|
|
- detectedSkins.clear();
|
|
|
- detectedSkins.add("default"); //hardwired da immer enthalten
|
|
|
- String[] skinsAvailable = FileTK.getDirectoryContent(IZPLApi.SKINPATH,true);
|
|
|
- detectedSkins.addAll(Arrays.asList(skinsAvailable));
|
|
|
- }
|
|
|
-
|
|
|
- @SuppressWarnings("element-type-mismatch")
|
|
|
- private static void initializePlugins()
|
|
|
+ private static void mainProcessingStage2()
|
|
|
{
|
|
|
-
|
|
|
- new File(IZPLApi.PLUGINPATH).mkdirs();
|
|
|
- if(!detectedSkins.contains(selectedSkinPath))
|
|
|
- {
|
|
|
- CONFIG.setSkinSelected("default");
|
|
|
- skinParameterSet=true;
|
|
|
- }
|
|
|
- if(skinParameterSet||uimodestate!=UIMODE_NONE)
|
|
|
+ /* go to Stage 2 of the loading */
|
|
|
+ java.awt.EventQueue.invokeLater(() ->
|
|
|
{
|
|
|
- try
|
|
|
+ if ((stts.filemode || stts.statefile||stts.featurePluginMode) && !(stts.firstrunmode || stts.loadConfigMode))
|
|
|
{
|
|
|
- y.dump(CONFIG, new FileWriter(CONFIGPATH));
|
|
|
- }
|
|
|
- catch (IOException ex)
|
|
|
- {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- if(!allowPluginLoad)
|
|
|
- quickQuit();
|
|
|
+ final Main b = new Main();
|
|
|
+ pload.setIndeterminate(true);
|
|
|
+ b.setIconImage(playListIcon);
|
|
|
+ b.setVisible(true);
|
|
|
|
|
|
- if (selectedSkinPath.equals("default"))
|
|
|
- {
|
|
|
- selectedSkinPath = IZPLApi.DEFAULT_SKIN_PATH;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selectedSkinPath = IZPLApi.APPDIR + File.separator + "skins" + File.separator + selectedSkinPath;
|
|
|
- }
|
|
|
- pluginInitCore();
|
|
|
-
|
|
|
- //pluginhandling interception: abort load if only enumerating of Features is wanted
|
|
|
- if(featurePluginMode && featurePluginID.equals(""))
|
|
|
- {
|
|
|
- //NOLOG
|
|
|
- System.out.println("Features available:");
|
|
|
- for (FeaturePlugin featurePlugin : registeredFeatures)
|
|
|
- {
|
|
|
- //NOLOG
|
|
|
- System.out.println(featurePlugin.getPluginName());
|
|
|
- }
|
|
|
- quickQuit();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //PluginHandling stage 2: call the prepareUpgrade handler
|
|
|
- if(firstrunmode||updateInit)
|
|
|
- {
|
|
|
- for (PlaybackPlugin playbackPlugin : registeredPlayBackAdapters)
|
|
|
- {
|
|
|
- if (playbackPlugin.getPluginName().equals(CONFIG.getMediaPlayerForStandalone()))
|
|
|
+ Thread t1 = new Thread(() ->
|
|
|
{
|
|
|
-
|
|
|
- playbackPlugin.prepareUpgrade();
|
|
|
- selectedPlaybackPlugin = playbackPlugin;
|
|
|
- }
|
|
|
- }
|
|
|
- for (UIPlugin uIPlugin : registeredUIs)
|
|
|
- {
|
|
|
- if (uIPlugin.getPluginName().equals(CONFIG.getUsedPluginUI()))
|
|
|
- { //incase of a dualPlugin
|
|
|
- if(!(uIPlugin instanceof PlaybackPlugin )&&!registeredPlayBackAdapters.contains(uIPlugin))
|
|
|
- uIPlugin.prepareUpgrade();
|
|
|
- selectedUIPlugin = uIPlugin;
|
|
|
- }
|
|
|
- }
|
|
|
- for (FeaturePlugin featurePlugin : registeredFeatures)
|
|
|
- {
|
|
|
- if(!(featurePlugin instanceof PlaybackPlugin )&&!registeredPlayBackAdapters.contains(featurePlugin)&&
|
|
|
- !(featurePlugin instanceof UIPlugin )&&!registeredUIs.contains(featurePlugin))
|
|
|
- featurePlugin.prepareUpgrade();
|
|
|
- }
|
|
|
- }
|
|
|
- //PluginHandling stage 3: initialize the plugins
|
|
|
- for (PlaybackPlugin playbackPlugin : registeredPlayBackAdapters)
|
|
|
- {
|
|
|
- if (playbackPlugin.getPluginName().equals(CONFIG.getMediaPlayerForStandalone()))
|
|
|
- {
|
|
|
- if(firstrunmode||updateInit)
|
|
|
- playbackPlugin.initializePlugin();
|
|
|
- selectedPlaybackPlugin = playbackPlugin;
|
|
|
- }
|
|
|
- }
|
|
|
- for (UIPlugin uIPlugin : registeredUIs)
|
|
|
- {
|
|
|
- if (uIPlugin.getPluginName().equals(CONFIG.getUsedPluginUI()))
|
|
|
- { //incase of a dualPlugin
|
|
|
- if((firstrunmode||updateInit)&&!(uIPlugin instanceof PlaybackPlugin )&&!registeredPlayBackAdapters.contains(uIPlugin))
|
|
|
- uIPlugin.initializePlugin();
|
|
|
- selectedUIPlugin = uIPlugin;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for (FeaturePlugin featurePlugin : registeredFeatures)
|
|
|
- {
|
|
|
- if(featurePlugin.getPluginName().equals(featurePluginID)||(firstrunmode||updateInit))
|
|
|
- {
|
|
|
- selectedFeaturePlugin=featurePlugin;
|
|
|
- featurePlugin.initializePlugin();
|
|
|
- }
|
|
|
- }
|
|
|
- if(featurePluginMode&&selectedFeaturePlugin==null)
|
|
|
- {
|
|
|
- l.error("NO valid FeaturePlugin given");
|
|
|
- quickQuit();
|
|
|
- }
|
|
|
- if(featurePluginMode)
|
|
|
- {
|
|
|
- if(selectedFeaturePlugin.requiresLoadedPlayList()&&!(filemode||statefile))
|
|
|
- {
|
|
|
- l.error("The selected FeaturePlugin requires a Playlist to be loaded");
|
|
|
- System.out.println("The selected FeaturePlugin requires a Playlist to be loaded");
|
|
|
- quickQuit();
|
|
|
- }
|
|
|
- }
|
|
|
- if(!firstrunmode&&!updateInit&&!featurePluginMode)
|
|
|
- {
|
|
|
- if (selectedPlaybackPlugin != null)
|
|
|
- {
|
|
|
- selectedPlaybackPlugin.initializePlugin();
|
|
|
- }
|
|
|
- if (selectedUIPlugin != null && selectedUIPlugin != selectedPlaybackPlugin)
|
|
|
- {
|
|
|
- selectedUIPlugin.initializePlugin();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public static void pluginInitCore()
|
|
|
- {
|
|
|
- if(pluginsAlreadyLoaded)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- pluginsAlreadyLoaded=true;
|
|
|
- //registeredPlayBackAdapters.add()
|
|
|
- String[] osdata = Detectors.getSystemClassification();
|
|
|
- //TODO Plugins abfragen
|
|
|
- if(osdata[0].equals("windows"))
|
|
|
- registeredPlayBackAdapters.add(new VlcInterface()); //nur unter windoof bis auf weiteres
|
|
|
- registeredUIs.add(new IZplGUIDefault());
|
|
|
- registeredUIs.add(new IZplGUISkinnable());
|
|
|
- //pluginhandling stage 1
|
|
|
- String[] jarsInPluginFolder = FileTK.getDirectoryContent(IZPLApi.PLUGINPATH);
|
|
|
- for (String plugin : jarsInPluginFolder)
|
|
|
- {
|
|
|
- TFile pluginattributes = new TFile(plugin + File.separator + "plugin.yml");
|
|
|
- if (pluginattributes.exists())
|
|
|
- {
|
|
|
- try
|
|
|
+ startup();
|
|
|
+ });
|
|
|
+ t1.setName("IZPL-Backend");
|
|
|
+ t1.start();
|
|
|
+ Thread t2 = new Thread(() ->
|
|
|
{
|
|
|
- TFileReader r =new TFileReader(pluginattributes);
|
|
|
- HashMap<String, Object> plugindata = (HashMap<String, Object>) y.load(r);
|
|
|
- r.close();
|
|
|
-
|
|
|
- List<String> supportedOSes = (List<String>) plugindata.get("supportedoses");
|
|
|
- List<String> supportedArchs = (List<String>) plugindata.get("supportedarchitectures");
|
|
|
- if (supportedOSes.contains(osdata[0]) && supportedArchs.contains(osdata[1]))
|
|
|
+ try
|
|
|
{
|
|
|
- Class clazz = new URLClassLoader(new URL[]
|
|
|
- {
|
|
|
- new File(plugin).toURI().toURL()
|
|
|
- }).loadClass((String) plugindata.get("pluginbaseclass"));
|
|
|
- // holen der Interfaces die die Klasse impementiert
|
|
|
- Class[] interfaces = clazz.getInterfaces();
|
|
|
- // Durchlaufen durch die Interfaces der Klasse und nachsehn ob es das passende Plugin implementiert
|
|
|
- boolean isplugin = false;
|
|
|
- boolean isPlaybackPlugin = false;
|
|
|
- boolean isUIPlugin = false;
|
|
|
- boolean isFeaturePlugin=false;
|
|
|
- for (int i = 0; i < interfaces.length && !isplugin; i++)
|
|
|
+ while (!loadedVLC)
|
|
|
{
|
|
|
- if (interfaces[i].getName().equals("de.nplusc.izc.iZpl.API.PlaybackPlugin"))
|
|
|
- {
|
|
|
- isplugin = true;
|
|
|
- isPlaybackPlugin = true;
|
|
|
-
|
|
|
- }
|
|
|
- if (interfaces[i].getName().equals("de.nplusc.izc.iZpl.API.UIPlugin"))
|
|
|
- {
|
|
|
- isplugin = true;
|
|
|
- isUIPlugin = true;
|
|
|
-
|
|
|
- }
|
|
|
- if(interfaces[i].getName().equals("de.nplusc.izc.iZpl.API.FeaturePlugin"))
|
|
|
- {
|
|
|
- isplugin=isFeaturePlugin=true;
|
|
|
- }
|
|
|
+ Thread.sleep(150);
|
|
|
}
|
|
|
- if (isplugin)
|
|
|
+ if (!stts.useGUI) //ladebalken hinter UI macht keinen sinn
|
|
|
{
|
|
|
- Plugin pluginInstance = (Plugin) clazz.newInstance();
|
|
|
- if (isUIPlugin)
|
|
|
- {
|
|
|
- registeredUIs.add((UIPlugin) pluginInstance);
|
|
|
- }
|
|
|
- if (isPlaybackPlugin)
|
|
|
- {
|
|
|
- registeredPlayBackAdapters.add((PlaybackPlugin) pluginInstance);
|
|
|
- }
|
|
|
- if(isFeaturePlugin)
|
|
|
- {
|
|
|
- registeredFeatures.add((FeaturePlugin)pluginInstance);
|
|
|
- }
|
|
|
+ Thread.sleep(1500);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- catch (FileNotFoundException | ClassNotFoundException | MalformedURLException | InstantiationException | IllegalAccessException ex)
|
|
|
+ catch (InterruptedException ex)
|
|
|
+ {
|
|
|
+ ex.printStackTrace();
|
|
|
+ }
|
|
|
+ b.setVisible(false);
|
|
|
+ });
|
|
|
+ t2.setName("LoadCloser");
|
|
|
+ t2.start();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (stts.burnDisc)
|
|
|
{
|
|
|
- ex.printStackTrace();
|
|
|
+ BurnMe.InitializeBurnDisc(stts.file_path);
|
|
|
+ //quickQuit();
|
|
|
}
|
|
|
- catch (IOException ex)
|
|
|
+ if (stts.firstrunmode || stts.loadConfigMode)
|
|
|
{
|
|
|
- ex.printStackTrace();
|
|
|
+ if (!stts.loadConfigMode)
|
|
|
+ {
|
|
|
+ frs.setVisible(false);
|
|
|
+ }
|
|
|
+ new ConfigureScreen(stts.firstrunmode).setVisible(true);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private static void startup()
|
|
|
{
|
|
|
String time = "";
|
|
@@ -880,7 +387,7 @@ public class Main extends javax.swing.JFrame
|
|
|
l.info("IZPL-Core:initialized at:" + time);
|
|
|
String vlcpath = CONFIG.getMPExecutablePath();
|
|
|
l.info("vlcpath=" + vlcpath);
|
|
|
- if(!(useGUI||featurePluginMode)&&vlcpath.equals("")&&!new File(vlcpath).exists())
|
|
|
+ if(!(stts.useGUI||stts.featurePluginMode)&&vlcpath.equals("")&&!new File(vlcpath).exists())
|
|
|
{
|
|
|
l.error("ungültige MediaPlayer executable");
|
|
|
quickQuit();
|
|
@@ -898,15 +405,15 @@ public class Main extends javax.swing.JFrame
|
|
|
try
|
|
|
{
|
|
|
|
|
|
- l.trace("fpl|" + forcePregen + "|shitmp|" + isShittyPlayer + "|a1|" + file_path + "|vp|" + vlcpath);
|
|
|
+ l.trace("fpl|" + stts.forcePregen + "|shitmp|" + isShittyPlayer + "|a1|" + stts.file_path + "|vp|" + vlcpath);
|
|
|
if (
|
|
|
- (filemode && !(forcePregen || isShittyPlayer)) ||
|
|
|
- (featurePluginMode&&selectedFeaturePlugin.requiresLoadedPlayList()))
|
|
|
+ (stts.filemode && !(stts.forcePregen || isShittyPlayer)) ||
|
|
|
+ (stts.featurePluginMode&&p.getSelectedFeaturePlugin().requiresLoadedPlayList()))
|
|
|
{
|
|
|
- l.trace("usegui=" + useGUI);
|
|
|
- l.trace("featurePlugin=" + featurePluginMode);
|
|
|
+ l.trace("usegui=" + stts.useGUI);
|
|
|
+ l.trace("featurePlugin=" + stts.featurePluginMode);
|
|
|
|
|
|
- ps = new PLServer(/*"D:\\mp3\\iZpl\\rxe.izpl"/*/file_path/**/, !(useGUI||featurePluginMode));//DBG_CD3
|
|
|
+ ps = new PLServer(/*"D:\\mp3\\iZpl\\rxe.izpl"/*/stts.file_path/**/, !(stts.useGUI||stts.featurePluginMode));//DBG_CD3
|
|
|
if (issueDetected)
|
|
|
{
|
|
|
quickQuit();
|
|
@@ -914,8 +421,8 @@ public class Main extends javax.swing.JFrame
|
|
|
}
|
|
|
else//RELOADER
|
|
|
{
|
|
|
- if (!(forcePregen || isShittyPlayer||
|
|
|
- (featurePluginMode&&!selectedFeaturePlugin.requiresLoadedPlayList())))
|
|
|
+ if (!(stts.forcePregen || isShittyPlayer||
|
|
|
+ (stts.featurePluginMode&&!p.getSelectedFeaturePlugin().requiresLoadedPlayList())))
|
|
|
{
|
|
|
reload();
|
|
|
}
|
|
@@ -925,10 +432,10 @@ public class Main extends javax.swing.JFrame
|
|
|
}
|
|
|
}
|
|
|
//http://localhost:9263/lst.m3u
|
|
|
- if (isShittyPlayer || forcePregen)
|
|
|
+ if (isShittyPlayer || stts.forcePregen)
|
|
|
{
|
|
|
PlProcessorV2 ppp = new PlProcessorV2();
|
|
|
- ppp.InitializeOnPath(file_path);
|
|
|
+ ppp.InitializeOnPath(stts.file_path);
|
|
|
if (issueDetected)
|
|
|
{
|
|
|
quickQuit();
|
|
@@ -960,20 +467,20 @@ public class Main extends javax.swing.JFrame
|
|
|
|
|
|
if (!isWMShit && !isOtherShit)
|
|
|
{
|
|
|
- if (useGUI&&!featurePluginMode)
|
|
|
+ if (stts.useGUI&&!stts.featurePluginMode)
|
|
|
{
|
|
|
EventQueue.invokeLater(() ->
|
|
|
{
|
|
|
- selectedUIPlugin.initializeUI();
|
|
|
- selectedUIPlugin.setVisible(true);
|
|
|
+ p.getSelectedUIPlugin().initializeUI();
|
|
|
+ p.getSelectedUIPlugin().setVisible(true);
|
|
|
});
|
|
|
loadedVLC = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(featurePluginMode)
|
|
|
+ if(stts.featurePluginMode)
|
|
|
{
|
|
|
- selectedFeaturePlugin.parseParameter(pluginParameter);
|
|
|
+ p.getSelectedFeaturePlugin().parseParameter(stts.pluginParameter);
|
|
|
loadedVLC = true;
|
|
|
}
|
|
|
else
|
|
@@ -997,13 +504,13 @@ public class Main extends javax.swing.JFrame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (!forcePregen)
|
|
|
+ if (!stts.forcePregen)
|
|
|
{
|
|
|
Tools.runSingleCmd(false, true, false, true, new JTextArea(), vlcpath, new File("wmpload.m3u").getAbsolutePath());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (!(useGUI||featurePluginMode))
|
|
|
+ if (!(stts.useGUI||stts.featurePluginMode))
|
|
|
{
|
|
|
checkpointedExit(isShittyPlayer);
|
|
|
}
|
|
@@ -1018,47 +525,11 @@ public class Main extends javax.swing.JFrame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static void registerFileExtensions()
|
|
|
- {
|
|
|
- String extensionPath = (IZPLApi.APPDIR+File.separator+"bin"+File.separator+"iZpl.bat").replace("\\", "\\\\");
|
|
|
- String iconMain=(IZPLApi.APPDIR+File.separator+"res"+File.separator+"izpl.ico,0").replace("\\", "\\\\");
|
|
|
- String iconResume=(IZPLApi.APPDIR+File.separator+"res"+File.separator+"izplresume.ico,0").replace("\\", "\\\\");
|
|
|
- String regPatternPlayList="Windows Registry Editor Version 5.00\n" +
|
|
|
- "\n" +
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.playlist\\shell\\open\\command]\n" +
|
|
|
- "@=\"cmd.exe /D /C "+extensionPath+" --file \\\"%1\\\"\"\n" +
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\.izpl]\n" +
|
|
|
- "@=\"izplaylist.playlist\"\n"+
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.playlist\\DefaultIcon]\n" +
|
|
|
- "@=\""+iconMain+"\"\n" +
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.resumefile\\shell\\open\\command]\n" +
|
|
|
- "@=\"cmd.exe /D /C "+extensionPath+" --resume \\\"%1\\\"\"\n" +
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\.izcont]\n" +
|
|
|
- "@=\"izplaylist.resumefile\"\n"+
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\.izcontinue]\n" +
|
|
|
- "@=\"izplaylist.resumefile\"\n"+
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.resumefile\\DefaultIcon]\n" + // nicht die Software\\Classes\\ kkomponente im pfad vergesse.!!!
|
|
|
- "@=\""+iconResume+"\"";
|
|
|
- //regedit /fickDich
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
- new File(IZPLApi.APPDIR+File.separator+"res").mkdirs();
|
|
|
- FileWriter fw = new FileWriter(new File(IZPLApi.APPDIR+File.separator+"res"+File.separator+"fileexts.reg"));
|
|
|
- fw.write(regPatternPlayList);
|
|
|
- fw.flush();
|
|
|
- fw.close();
|
|
|
- Desktop.getDesktop().open(new File(IZPLApi.APPDIR+File.separator+"res"+File.separator+"fileexts.reg"));
|
|
|
- }
|
|
|
- catch (IOException ex)
|
|
|
- {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
private static void reload() throws FileNotFoundException, IOException
|
|
|
{
|
|
|
- String tpath = file_path;
|
|
|
+ String tpath = stts.file_path;
|
|
|
boolean sym = true;
|
|
|
boolean newPPP = false;
|
|
|
int redirs = 0;
|
|
@@ -1103,8 +574,8 @@ public class Main extends javax.swing.JFrame
|
|
|
pp.InitializeOnPath(((PlProcessor) u).getPath());
|
|
|
}
|
|
|
plf.close();
|
|
|
- l.trace("usegui=" + useGUI);
|
|
|
- ps = new PLServer(pp, !useGUI);
|
|
|
+ l.trace("usegui=" + stts.useGUI);
|
|
|
+ ps = new PLServer(pp, !stts.useGUI);
|
|
|
}
|
|
|
|
|
|
public static void checkpointedExit(boolean isShittyPlayer)
|
|
@@ -1114,7 +585,7 @@ public class Main extends javax.swing.JFrame
|
|
|
l.info("IZPL-Core:Checkpoint erstellen:" + time);
|
|
|
//muss nen StateSaver hier reintoasten....; done...
|
|
|
//statefile immer gleich genannt wie originaldatei; ermöglicht mehrere states...
|
|
|
- if (!(forcePregen || isShittyPlayer))
|
|
|
+ if (!(stts.forcePregen || isShittyPlayer))
|
|
|
{
|
|
|
String pp = y.dump(ps.ppp);
|
|
|
String fp = ps.ppp.getPath();
|
|
@@ -1183,10 +654,6 @@ public class Main extends javax.swing.JFrame
|
|
|
return ps;
|
|
|
}
|
|
|
|
|
|
- public static boolean isStandaloneGUI()
|
|
|
- {
|
|
|
- return useGUI;
|
|
|
- }
|
|
|
|
|
|
public static void gotAIssue()
|
|
|
{
|
|
@@ -1199,61 +666,29 @@ public class Main extends javax.swing.JFrame
|
|
|
issueDetected = issue;
|
|
|
}
|
|
|
|
|
|
- public static String getSelectedSkinPath()
|
|
|
- {
|
|
|
- return selectedSkinPath;
|
|
|
- }
|
|
|
-
|
|
|
- public static PlaybackPlugin getSelectedPlaybackPlugin()
|
|
|
- {
|
|
|
- return selectedPlaybackPlugin;
|
|
|
- }
|
|
|
|
|
|
- public static UIPlugin getSelectedUIPlugin()
|
|
|
+ public static Image getPlayListIcon()
|
|
|
{
|
|
|
- return selectedUIPlugin;
|
|
|
+ return playListIcon;
|
|
|
}
|
|
|
-
|
|
|
- public static List<PlaybackPlugin> getRegisteredPlayBackAdapters()
|
|
|
+ public static boolean isFilemode()
|
|
|
{
|
|
|
- return registeredPlayBackAdapters;
|
|
|
+ return stts.filemode;
|
|
|
}
|
|
|
|
|
|
- public static List<UIPlugin> getRegisteredUIs()
|
|
|
+ public static boolean isStatefile()
|
|
|
{
|
|
|
- return registeredUIs;
|
|
|
+ return stts.statefile;
|
|
|
}
|
|
|
|
|
|
- public static List<String> getDetectedSkins()
|
|
|
+ public static CommandLineStatus getStts()
|
|
|
{
|
|
|
- return detectedSkins;
|
|
|
+ return stts;
|
|
|
}
|
|
|
|
|
|
- public static Image getPlayListIcon()
|
|
|
+ public static PluginManager getPluginManager()
|
|
|
{
|
|
|
- return playListIcon;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<String> getAvailableFeaturePlugins(boolean requireUI)
|
|
|
- {
|
|
|
- List<String> pluginsAvailable = new ArrayList<>();
|
|
|
- for (FeaturePlugin featurePlugin : registeredFeatures)
|
|
|
- {
|
|
|
- if(requireUI&&!featurePlugin.hasUserInterface())
|
|
|
- continue;
|
|
|
- pluginsAvailable.add(featurePlugin.getPluginName());
|
|
|
- }
|
|
|
- return pluginsAvailable;
|
|
|
- }
|
|
|
-
|
|
|
- public static boolean isVerboseMode()
|
|
|
- {
|
|
|
- return verboseMode;
|
|
|
- }
|
|
|
-
|
|
|
- public static FeaturePlugin getSelectedFeaturePlugin()
|
|
|
- {
|
|
|
- return selectedFeaturePlugin;
|
|
|
+ return p;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1297,6 +732,6 @@ public class Main extends javax.swing.JFrame
|
|
|
* V0.4.1.1 Bugfixes
|
|
|
* V0.5.0.0 MainMenu added
|
|
|
* V0.6.0.0 Editor basics, Bugfixxes & rewrite of the Reader code whic resides now in PLFileIO.java
|
|
|
+ * V0.7.0.0 Refactor of the main class to shrink it
|
|
|
*/
|
|
|
-
|
|
|
}
|