1 /***************************************************************************
\r
4 begin : Wed May 15 2002
\r
5 copyright : (C) 2002 by Pete Bernert
\r
6 email : BlackDove@addcom.de
\r
7 ***************************************************************************/
\r
8 /***************************************************************************
\r
10 * This program is free software; you can redistribute it and/or modify *
\r
11 * it under the terms of the GNU General Public License as published by *
\r
12 * the Free Software Foundation; either version 2 of the License, or *
\r
13 * (at your option) any later version. See also the license.txt file for *
\r
14 * additional informations. *
\r
16 ***************************************************************************/
\r
22 #include "externals.h"
\r
24 ////////////////////////////////////////////////////////////////////////
\r
25 // LINUX CONFIG/ABOUT HANDLING
\r
26 ////////////////////////////////////////////////////////////////////////
\r
30 ////////////////////////////////////////////////////////////////////////
\r
31 // START EXTERNAL CFG TOOL
\r
32 ////////////////////////////////////////////////////////////////////////
\r
34 void StartCfgTool(char * pCmdLine)
\r
39 strcpy(filename,"cfgDFSound");
\r
40 cf=fopen(filename,"rb");
\r
46 execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL);
\r
52 strcpy(filename,"cfg/cfgDFSound");
\r
53 cf=fopen(filename,"rb");
\r
60 execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL);
\r
66 sprintf(filename,"%s/cfgDFSound",getenv("HOME"));
\r
67 cf=fopen(filename,"rb");
\r
73 chdir(getenv("HOME"));
\r
74 execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL);
\r
78 else printf("Sound error: cfgDFSound not found!\n");
\r
83 /////////////////////////////////////////////////////////
\r
84 // READ LINUX CONFIG FILE
\r
85 /////////////////////////////////////////////////////////
\r
87 static void ReadConfigFile(void)
\r
89 FILE *in;char t[256];int len;
\r
92 strcpy(t,"dfsound.cfg");
\r
93 in = fopen(t,"rb");
\r
96 strcpy(t,"cfg/dfsound.cfg");
\r
97 in = fopen(t,"rb");
\r
100 sprintf(t,"%s/dfsound.cfg",getenv("HOME"));
\r
101 in = fopen(t,"rb");
\r
106 pB = (char *)malloc(32767);
\r
107 memset(pB,0,32767);
\r
109 len = fread(pB, 1, 32767, in);
\r
112 strcpy(t,"\nVolume");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
\r
113 if(p) iVolume=4-atoi(p+len);
\r
114 if(iVolume<1) iVolume=1;
\r
115 if(iVolume>4) iVolume=4;
\r
117 strcpy(t,"\nXAPitch");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
\r
118 if(p) iXAPitch=atoi(p+len);
\r
119 if(iXAPitch<0) iXAPitch=0;
\r
120 if(iXAPitch>1) iXAPitch=1;
\r
122 strcpy(t,"\nHighCompMode");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
\r
123 if(p) iUseTimer=atoi(p+len);
\r
124 if(iUseTimer<0) iUseTimer=0;
\r
125 // note: timer mode 1 (win time events) is not supported
\r
126 // in linux. But timer mode 2 (spuupdate) is safe to use.
\r
127 if(iUseTimer) iUseTimer=2;
\r
129 strcpy(t,"\nSPUIRQWait");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
\r
130 if(p) iSPUIRQWait=atoi(p+len);
\r
131 if(iSPUIRQWait<0) iSPUIRQWait=0;
\r
132 if(iSPUIRQWait>1) iSPUIRQWait=1;
\r
134 strcpy(t,"\nUseReverb");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
\r
135 if(p) iUseReverb=atoi(p+len);
\r
136 if(iUseReverb<0) iUseReverb=0;
\r
137 if(iUseReverb>2) iUseReverb=2;
\r
139 strcpy(t,"\nUseInterpolation");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
\r
140 if(p) iUseInterpolation=atoi(p+len);
\r
141 if(iUseInterpolation<0) iUseInterpolation=0;
\r
142 if(iUseInterpolation>3) iUseInterpolation=3;
\r
147 /////////////////////////////////////////////////////////
\r
148 // READ CONFIG called by spu funcs
\r
149 /////////////////////////////////////////////////////////
\r
151 void ReadConfigSPU(void)
\r
158 iUseInterpolation=2;
\r