Lines 234-293
Link Here
|
234 |
build.env.Append(CPPPATH="#lib/replaygain") |
234 |
build.env.Append(CPPPATH="#lib/replaygain") |
235 |
|
235 |
|
236 |
class SoundTouch(Dependence): |
236 |
class SoundTouch(Dependence): |
237 |
SOUNDTOUCH_PATH = 'soundtouch-1.4.1' |
|
|
238 |
|
237 |
|
239 |
def sources(self, build): |
238 |
def sources(self, build): |
240 |
sources = ['engine/enginebufferscalest.cpp', |
239 |
sources = ['engine/enginebufferscalest.cpp'] |
241 |
'#lib/%s/SoundTouch.cpp' % self.SOUNDTOUCH_PATH, |
|
|
242 |
'#lib/%s/TDStretch.cpp' % self.SOUNDTOUCH_PATH, |
243 |
'#lib/%s/RateTransposer.cpp' % self.SOUNDTOUCH_PATH, |
244 |
'#lib/%s/AAFilter.cpp' % self.SOUNDTOUCH_PATH, |
245 |
'#lib/%s/FIFOSampleBuffer.cpp' % self.SOUNDTOUCH_PATH, |
246 |
'#lib/%s/FIRFilter.cpp' % self.SOUNDTOUCH_PATH, |
247 |
'#lib/%s/PeakFinder.cpp' % self.SOUNDTOUCH_PATH, |
248 |
'#lib/%s/BPMDetect.cpp' % self.SOUNDTOUCH_PATH] |
249 |
if build.platform_is_windows and build.toolchain_is_msvs: |
250 |
if build.machine_is_64bit: |
251 |
sources.append( |
252 |
'#lib/%s/cpu_detect_x64_win.cpp' % self.SOUNDTOUCH_PATH) |
253 |
elif build.machine == 'x86': |
254 |
sources.append( |
255 |
'#lib/%s/cpu_detect_x86_win.cpp' % self.SOUNDTOUCH_PATH) |
256 |
else: |
257 |
raise Exception("Unhandled CPU configuration for SoundTouch") |
258 |
elif build.toolchain_is_gnu: |
259 |
if build.machine == 'x86_64': |
260 |
sources.append( |
261 |
'#lib/%s/cpu_detect_x64_gcc.cpp' % self.SOUNDTOUCH_PATH) |
262 |
else: |
263 |
sources.append( |
264 |
'#lib/%s/cpu_detect_x86_gcc.cpp' % self.SOUNDTOUCH_PATH) |
265 |
else: |
266 |
raise Exception("Unhandled CPU configuration for SoundTouch") |
267 |
|
268 |
# TODO(XXX) when we figure out a better way to represent features, fix |
269 |
# this. |
270 |
optimize = int(util.get_flags(build.env, 'optimize', 1)) |
271 |
if build.machine_is_64bit or \ |
272 |
(build.toolchain_is_msvs and optimize > 1) or \ |
273 |
(build.toolchain_is_gnu and optimize > 2): |
274 |
sources.extend( |
275 |
['#lib/%s/mmx_optimized.cpp' % self.SOUNDTOUCH_PATH, |
276 |
'#lib/%s/sse_optimized.cpp' % self.SOUNDTOUCH_PATH, |
277 |
]) |
278 |
if build.toolchain_is_msvs and not build.machine_is_64bit: |
279 |
sources.append('#lib/%s/3dnow_win.cpp' % self.SOUNDTOUCH_PATH) |
280 |
else: |
281 |
# TODO(XXX) the docs refer to a 3dnow_gcc, but we don't seem to have |
282 |
# it. |
283 |
pass |
284 |
|
285 |
return sources |
240 |
return sources |
286 |
|
241 |
|
287 |
def configure(self, build, conf): |
242 |
def configure(self, build, conf): |
288 |
if build.platform_is_windows: |
243 |
if not conf.CheckLib(['SoundTouch','libSoundTouch']): |
289 |
build.env.Append(CPPDEFINES = 'WIN%s' % build.bitwidth) |
244 |
raise Exception('Did not find libSoundTouch.a, libSoundTouch.lib, or the libSoundTouch development header files - exiting!') |
290 |
build.env.Append(CPPPATH=['#lib/%s' % self.SOUNDTOUCH_PATH]) |
245 |
build.env.Append(CPPPATH=[SCons.ARGUMENTS.get('prefix', '/usr/local') + '/include/soundtouch']) |
|
|
246 |
build.env.Append(LIBS='SoundTouch') |
291 |
|
247 |
|
292 |
# TODO(XXX) when we figure out a better way to represent features, fix |
248 |
# TODO(XXX) when we figure out a better way to represent features, fix |
293 |
# this. |
249 |
# this. |