diff options
Diffstat (limited to 'songdbj/org/tritonus/share/TSettings.java')
-rw-r--r-- | songdbj/org/tritonus/share/TSettings.java | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/songdbj/org/tritonus/share/TSettings.java b/songdbj/org/tritonus/share/TSettings.java new file mode 100644 index 0000000000..ae1a315e0e --- /dev/null +++ b/songdbj/org/tritonus/share/TSettings.java | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * TSettings.java | ||
3 | * | ||
4 | * This file is part of Tritonus: http://www.tritonus.org/ | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * Copyright (c) 1999 - 2001 by Matthias Pfisterer | ||
9 | * | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU Library General Public License as published | ||
13 | * by the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU Library General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU Library General Public | ||
22 | * License along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | /* | ||
28 | |<--- this code is formatted to fit into 80 columns --->| | ||
29 | */ | ||
30 | |||
31 | package org.tritonus.share; | ||
32 | |||
33 | import java.io.PrintStream; | ||
34 | import java.util.StringTokenizer; | ||
35 | import java.security.AccessControlException; | ||
36 | |||
37 | import org.tritonus.share.TDebug; | ||
38 | |||
39 | |||
40 | public class TSettings | ||
41 | { | ||
42 | public static boolean SHOW_ACCESS_CONTROL_EXCEPTIONS = false; | ||
43 | private static final String PROPERTY_PREFIX = "tritonus."; | ||
44 | |||
45 | |||
46 | public static boolean AlsaUsePlughw = getBooleanProperty("AlsaUsePlughw"); | ||
47 | |||
48 | |||
49 | |||
50 | private static boolean getBooleanProperty(String strName) | ||
51 | { | ||
52 | String strPropertyName = PROPERTY_PREFIX + strName; | ||
53 | String strValue = "false"; | ||
54 | try | ||
55 | { | ||
56 | strValue = System.getProperty(strPropertyName, "false"); | ||
57 | } | ||
58 | catch (AccessControlException e) | ||
59 | { | ||
60 | if (SHOW_ACCESS_CONTROL_EXCEPTIONS) | ||
61 | { | ||
62 | TDebug.out(e); | ||
63 | } | ||
64 | } | ||
65 | // TDebug.out("property: " + strPropertyName + "=" + strValue); | ||
66 | boolean bValue = strValue.toLowerCase().equals("true"); | ||
67 | // TDebug.out("bValue: " + bValue); | ||
68 | return bValue; | ||
69 | } | ||
70 | } | ||
71 | |||
72 | |||
73 | |||
74 | /*** TSettings.java ***/ | ||
75 | |||