def load_library(libname, cdll=False): if paths.is_frozen(): libfile = os.path.join(paths.embedded_data_path(), 'accessible_output2', 'lib', libname) else: libfile = os.path.join(paths.module_path(), 'lib', libname) if cdll: return ctypes.cdll[libfile] else: return ctypes.windll[libfile]
def load_library(libname, cdll=False): if paths.is_frozen(): libfile = os.path.join(paths.embedded_data_path(), "accessible_output2", "lib", libname) else: libfile = os.path.join(paths.module_path(), "lib", libname) if not os.path.exists(libfile): _cxfreeze_libfile = os.path.join(paths.embedded_data_path(), "lib", "accessible_output2", "lib", libname) if os.path.exists(_cxfreeze_libfile): libfile = _cxfreeze_libfile if cdll: return ctypes.cdll[libfile] return ctypes.windll[libfile]
def test_module_path(self): print paths.module_path() self.assertTrue(paths.module_path().endswith('tests'))
features. It also provides the ability to go the other way and split a BASS channel into multiple channels. ''' import os, sys, ctypes, platform, pybass QWORD = pybass.QWORD HSYNC = pybass.HSYNC HSTREAM = pybass.HSTREAM DOWNLOADPROC = pybass.DOWNLOADPROC SYNCPROC = pybass.SYNCPROC BASS_FILEPROCS = pybass.BASS_FILEPROCS from platform_utils import libloader, paths x86_path = os.path.join(paths.module_path(), '..', 'lib', 'x86') x64_path = os.path.join(paths.module_path(), '..', 'lib', 'x64') bassmix_module = libloader.load_library('bassmix', x86_path=x86_path, x64_path=x64_path) func_type = libloader.get_functype() # additional BASS_SetConfig option BASS_CONFIG_MIXER_FILTER = 0x10600 BASS_CONFIG_MIXER_BUFFER = 0x10601 BASS_CONFIG_SPLIT_BUFFER = 0x10610 # BASS_Mixer_StreamCreate flags BASS_MIXER_END = 0x10000# end the stream when there are no sources BASS_MIXER_NONSTOP = 0x20000# don't stall when there are no sources BASS_MIXER_RESUME = 0x1000# resume stalled immediately upon new/unpaused source
import os from platform_utils.paths import module_path, is_frozen, embedded_data_path if is_frozen(): x86_path = os.path.join(embedded_data_path(), 'sound_lib', 'lib', 'x86') x64_path = os.path.join(embedded_data_path(), 'sound_lib', 'lib', 'x64') else: x86_path = os.path.join(module_path(), '..', 'lib', 'x86') x64_path = os.path.join(module_path(), '..', 'lib', 'x64')