commit | author | age
|
8e2038
|
1 |
package de.uhilger.avdirektor; |
U |
2 |
|
|
3 |
import java.io.IOException; |
|
4 |
import java.util.HashMap; |
|
5 |
import java.util.logging.Level; |
|
6 |
import java.util.logging.Logger; |
|
7 |
|
|
8 |
/** |
|
9 |
* |
|
10 |
* @author ulrich |
|
11 |
*/ |
|
12 |
public class App { |
|
13 |
|
|
14 |
private static final Logger logger = Logger.getLogger(App.class.getName()); |
|
15 |
|
|
16 |
|
|
17 |
public static final String PI_PLAYER = "pi_player"; |
|
18 |
//public static final String FBI_PROC = "fbi_proc"; |
|
19 |
|
|
20 |
public static final String CMD_STOP = "q"; |
|
21 |
public static final String CMD_DEC_SPEED = "1"; |
|
22 |
public static final String CMD_INC_SPEED = "2"; |
|
23 |
public static final String CMD_PREV_AUDIO = "j"; |
|
24 |
public static final String CMD_NEXT_AUDIO = "k"; |
|
25 |
public static final String CMD_PREV_CHAPTER = "i"; |
|
26 |
public static final String CMD_NEXT_CHAPTER = "o"; |
|
27 |
public static final String CMD_PREV_SUB = "n"; |
|
28 |
public static final String CMD_NEXT_SUB = "m"; |
|
29 |
public static final String CMD_TOGGLE_SUB = "s"; |
|
30 |
public static final String CMD_PAUSE_RESUME = "p"; |
|
31 |
public static final String CMD_DEC_VOL = "-"; |
|
32 |
public static final String CMD_INC_VOL = "+"; |
|
33 |
|
|
34 |
public static final String PFEIL_LINKS = "5b44"; |
|
35 |
public static final String PFEIL_RECHTS = "5b43"; |
|
36 |
public static final String PFEIL_HERAUF = "5b41"; |
|
37 |
public static final String PFEIL_HERUNTER = "5b42"; |
|
38 |
|
|
39 |
public static final String SP_RUECK_30 = "rueck30"; |
|
40 |
public static final String SP_VOR_30 = "rueck30"; |
|
41 |
public static final String SP_VOR_600 = "vor600"; |
|
42 |
public static final String SP_RUECK_600 = "rueck600"; |
|
43 |
|
|
44 |
public static final String OPT_LOCAL_AUDIO = "-o%20local"; |
|
45 |
public static final String OPT_HDMI_AUDIO = "-o hdmi"; |
|
46 |
|
|
47 |
public static final String BLANK = " "; |
|
48 |
|
|
49 |
private static HashMap initParams; |
|
50 |
|
|
51 |
/** |
|
52 |
* @param args the command line arguments |
|
53 |
*/ |
|
54 |
public static void main(String[] args) { |
|
55 |
initParams = new HashMap(); |
|
56 |
for(String arg: args) { |
|
57 |
//logger.info("arg: " + arg); |
|
58 |
String[] argParts = arg.split("="); |
|
59 |
//logger.info(argParts[0]); |
|
60 |
//logger.info(argParts[1]); |
|
61 |
initParams.put(argParts[0], argParts[1]); |
|
62 |
} |
|
63 |
|
|
64 |
|
|
65 |
Server server = new Server(Integer.parseInt(getInitParameter("port"))); |
|
66 |
try { |
|
67 |
server.start(); |
|
68 |
} catch (IOException ex) { |
|
69 |
Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex); |
|
70 |
} |
|
71 |
} |
|
72 |
|
|
73 |
public static void stop() { |
|
74 |
System.exit(0); |
|
75 |
} |
|
76 |
|
|
77 |
public static String getInitParameter(String pname) { |
|
78 |
String param = null; |
|
79 |
Object o = initParams.get(pname); |
|
80 |
if(o != null) { |
|
81 |
param = o.toString(); |
|
82 |
} |
|
83 |
return param; |
|
84 |
} |
|
85 |
|
|
86 |
|
|
87 |
} |