| | |
| | | |
| | | package de.uhilger.calypso; |
| | | |
| | | import de.uhilger.calypso.handler.MPVPlayer; |
| | | import de.uhilger.calypso.handler.MPlayer; |
| | | import de.uhilger.calypso.handler.OMXPlayer; |
| | | import de.uhilger.calypso.handler.Player; |
| | | import de.uhilger.calypso.handler.VLCPlayer; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.logging.Level; |
| | |
| | | public static final String IP_PLAYER = "player"; |
| | | public static final String VLC_PLAYER = "vlc"; |
| | | public static final String OMX_PLAYER = "omx"; |
| | | public static final String M_PLAYER = "mpl"; |
| | | public static final String MPV_PLAYER = "mpv"; |
| | | public static final String OMX_WD = "omx.wd"; |
| | | public static final String CTX = "ctx"; |
| | | public static final String CONF_PATH = "conf"; |
| | | |
| | | public static final String DEFAULT_CTX = "/calypso"; |
| | | |
| | |
| | | * @param args the command line arguments |
| | | */ |
| | | public static void main(String[] args) { |
| | | Logger.getLogger(App.class.getName()).log(Level.INFO, new File(".").getAbsolutePath()); |
| | | initParams = new HashMap(); |
| | | for(String arg: args) { |
| | | String[] argParts = arg.split("="); |
| | |
| | | |
| | | String playerType = getInitParameter(IP_PLAYER); |
| | | switch(playerType) { |
| | | case MPV_PLAYER: |
| | | player = new MPVPlayer(); |
| | | break; |
| | | case M_PLAYER: |
| | | player = new MPlayer(); |
| | | break; |
| | | case VLC_PLAYER: |
| | | player = new VLCPlayer(); |
| | | break; |
| | |
| | | break; |
| | | } |
| | | Server server = new Server(Integer.parseInt(getInitParameter(IP_PORT))); |
| | | server.setPath(getInitParameter(CONF_PATH)); |
| | | String ctx = getInitParameter(CTX); |
| | | if(ctx != null && ctx.length() > 0) { |
| | | server.setContextName(ctx); |