123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- /*
- * 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.API;
- import de.nplusc.izc.iZpl.Main;
- import java.io.File;
- import java.util.List;
- /**
- *
- * @author iZc <nplusc.de>
- */
- public class IZPLApi
- {
- /**
- * defines the path to load the standard skin file inside the iZpl jar
- */
- public static final String DEFAULT_SKIN_PATH = IZPLApi.class.getProtectionDomain().getCodeSource().getLocation().getPath()+File.separator+"rsrc";
-
- /**
- * defines the application directory of iZpl where it got installed
- */
- public static final String APPDIR = new File(IZPLApi.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile().getParent();
-
- public static final String PLUGINPATH = APPDIR + File.separator + "plugins";
- public static final String SKINPATH = APPDIR + File.separator + "skins";
- /**
- * Checks whether the Program runs in fully new UI mode or in the old Mode where only the managing UI is loaded
- * @return true when the program is in the new UI mode
- */
- public static boolean isNEwGUIMode()
- {
- return Main.isStandaloneGUI();
- }
-
- /**
- * Obtains the path of the last selected Skin. Points to the file in skins folder or to the default path defined in DEFAULT_SKIN_PATH
- * @return Path of the currently selected skin from the Skins folder
- */
- public static String getSkinPath()
- {
- return Main.getSelectedSkinPath();
- }
- /**
- * Exits the program without saving the statefile for the current session. Recommended in case of a error
- */
- public static void quickQuitWithoutSaving()
- {
- Main.quickQuit();
- }
-
- /**
- * Obtains a reference to the currently loaded PlaybackPlugin
- * @return PlaybackPlugin that is currently in use
- */
- public static PlaybackPlugin getCurrentPlaybackPlugin()
- {
- return Main.getSelectedPlaybackPlugin();
- }
- public static UIPlugin getUIPlugin()
- {
- return Main.getSelectedUIPlugin();
- }
- /**
- * Saves the state of the session and then exits the program
- */
- public static void shutdownWithSave()
- {
- Main.checkpointedExit(false);
- }
- /**
- * Obtains the next Item to play
- * @return PlayListItem that should be played next
- */
- public static PlayListItem getNextItem()
- {
- return Main.getPLServer().ppp.getBlockRaw();
- }
- private IZPLApi()
- {
- }
-
- public static List<UIPlugin> getDetectedUIPlugins()
- {
- return Main.getRegisteredUIs();
- }
-
- public static List<PlaybackPlugin> getDetectedPlaybackPlugins()
- {
- return Main.getRegisteredPlayBackAdapters();
- }
- public static List<String> getAvailableSkins()
- {
- return Main.getDetectedSkins();
- }
- }
|