|
@@ -0,0 +1,153 @@
|
|
|
+/*
|
|
|
+ * 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.plugins.jukebox;
|
|
|
+
|
|
|
+import de.nplusc.izc.iZpl.API.FeaturePlugin;
|
|
|
+import de.nplusc.izc.iZpl.API.UIPlugin;
|
|
|
+import java.awt.Image;
|
|
|
+import org.apache.logging.log4j.LogManager;
|
|
|
+import org.apache.logging.log4j.Logger;
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @author iZc <nplusc.de>
|
|
|
+ */
|
|
|
+public class JukeBoxPlugin implements UIPlugin,FeaturePlugin
|
|
|
+{
|
|
|
+
|
|
|
+ private Backend jukeboxBackend;
|
|
|
+ private static final Logger l = LogManager.getLogger();
|
|
|
+ private JukeBox jukebox;
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setAlbumArt(Image image)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setTrackLength(int i)
|
|
|
+ {
|
|
|
+ //jukeboxBackend.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setPlaybackPositionInSeconds(int i)
|
|
|
+ {
|
|
|
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setVisible(boolean bln)
|
|
|
+ {
|
|
|
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setTrackName(String string)
|
|
|
+ {
|
|
|
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void loadPlayListEditScreen()
|
|
|
+ {
|
|
|
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void initializeUI()
|
|
|
+ {
|
|
|
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void refreshScheduledItemList()
|
|
|
+ {
|
|
|
+ UIPlugin.super.refreshScheduledItemList(); //To change body of generated methods, choose Tools | Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void reloadPlayList()
|
|
|
+ {
|
|
|
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getPluginName()
|
|
|
+ {
|
|
|
+ return "JukeBox";
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void initializePlugin()
|
|
|
+ {
|
|
|
+ if(APIWrapper.getUiPlugin()==this)
|
|
|
+ {
|
|
|
+ l.info("Init UI(JukeBox)");
|
|
|
+ jukebox = new JukeBox(this);
|
|
|
+ jukeboxBackend= new LocalBackend(jukebox);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ l.info("Loaded as featurePlugin or standalone, delaying the init");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void prepareUpgrade()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void parseParameter(String param)
|
|
|
+ {
|
|
|
+ if(param!=null&&!param.equals(""))
|
|
|
+ {
|
|
|
+ jukebox = new JukeBox(this);
|
|
|
+ jukeboxBackend = new RemoteBackend(param, jukebox);
|
|
|
+ jukeboxBackend.initBackend();
|
|
|
+ openUserInterface();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ l.error("Invalid parameter");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean hasUserInterface()
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void openUserInterface()
|
|
|
+ {
|
|
|
+ //TODO Dialog für IP-abfrage bei GUI-launch
|
|
|
+ jukebox.openUserInterface();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean requiresLoadedPlayList()
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|