def get_parameters(self): """Retrieves the parameters of an effect.""" res = {} params = self.struct() bass_call(pybass.BASS_FXGetParameters, self.handle, ctypes.pointer(params)) for f in params._fields_: res[f[0]] = getattr(params, f[0]) return res
def get_3d_position(self): res = { 'position': BASS_3DVECTOR(), 'velocity': BASS_3DVECTOR(), 'front': BASS_3DVECTOR(), 'top': BASS_3DVECTOR() } bass_call(BASS_Get3DPosition, pointer(res['position']), pointer(res['velocity']), pointer(res['front']), pointer(res['top'])) return res
def set_parameters(self, parameters): """ Args: parameters: Returns: """ params = self.struct() for p, v in parameters.items(): setattr(params, p, v) bass_call(pybass.BASS_FXSetParameters, self.handle, ctypes.pointer(params))
def __init__(self, channel, flags=0, loop=False, software=False, three_d=False, sample_fx=False, autofree=False, decode=False, free_source=False): flags = flags | self.flags_for(loop=False, software=False, three_d=False, sample_fx=False, autofree=False, decode=False, free_source=False) self.channel = channel if isinstance(channel, Channel): channel = channel.handle handle = bass_call(pybass_fx.BASS_FX_TempoCreate, channel, flags) super(Tempo, self).__init__(handle) self.add_attributes_to_mapping( tempo=pybass_fx.BASS_ATTRIB_TEMPO, tempo_pitch=pybass_fx.BASS_ATTRIB_TEMPO_PITCH, tempo_freq=pybass_fx.BASS_ATTRIB_TEMPO_FREQ, )
def __init__(self, channel, type=None, priority=0): self.original_channel = channel if hasattr(channel, "handle"): channel = channel.handle if type is None: type = self.effect_type self.effect_type = type self.priority = priority self.handle = bass_call(pybass.BASS_ChannelSetFX, channel, type, priority)
def __init__(self, channel, type=None, priority=0): self.original_channel = channel if hasattr(channel, 'handle'): channel = channel.handle if type is None: type = self.effect_type self.effect_type = type self.priority = priority self.handle = bass_call(pybass.BASS_ChannelSetFX, channel, type, priority)
def set_3d_position(self, position=None, velocity=None, front=None, top=None): """Sets the position, velocity, and orientation of the listener (ie. the player).""" old = self.get_3d_position() if position is None: position = old['position'] if velocity is None: velocity = old['velocity'] if front is None: front = old['front'] if top is None: top = old['top'] position = pointer(position) velocity = pointer(velocity) front = pointer(front) top = pointer(top) bass_call(BASS_Set3DPosition, position, velocity, front, top)
def __setitem__(self, key, val): key = self.config_map.get(key, key) if key in self.ptr_config: return bass_call(pybass.BASS_SetConfigPtr, key, ctypes.create_string_buffer(val)) return bass_call(pybass.BASS_SetConfig, key, val)
def __getitem__(self, key): key = self.config_map.get(key, key) if key in self.ptr_config: return ctypes.string_at(bass_call(pybass.BASS_GetConfigPtr, key)) return bass_call_0(pybass.BASS_GetConfig, key)
def get_rate_ratio(self): return bass_call(pybass_fx.BASS_FX_TempoGetRateRatio, self.handle)
def set_parameters(self, parameters): params = self.struct() for p, v in parameters.iteritems(): setattr(params, p, v) bass_call(pybass.BASS_FXSetParameters, self.handle, ctypes.pointer(params))