mirror of https://github.com/McSinyx/palace
parent
9de664a750
commit
b2329a1428
|
@ -76,7 +76,7 @@ __all__ = [
|
|||
'thread_local', 'current_context', 'use_context',
|
||||
'cache', 'free', 'decode', 'sample_size', 'sample_length',
|
||||
'Device', 'Context', 'Listener', 'Buffer', 'Source', 'SourceGroup',
|
||||
'Effect', 'ReverbEffect', 'ChorusEffect',
|
||||
'BaseEffect', 'ReverbEffect', 'ChorusEffect',
|
||||
'Decoder', 'BaseDecoder', 'FileIO', 'MessageHandler']
|
||||
|
||||
from abc import abstractmethod, ABCMeta
|
||||
|
@ -2010,7 +2010,7 @@ cdef class BaseEffect:
|
|||
return <boolean> self.slot and <boolean> self.impl
|
||||
|
||||
@setter
|
||||
def gain(self, value: float) -> None:
|
||||
def slot_gain(self, value: float) -> None:
|
||||
"""Gain of the effect slot."""
|
||||
self.slot.set_gain(value)
|
||||
|
||||
|
|
|
@ -23,14 +23,14 @@ from palace import BaseEffect, ReverbEffect, Source
|
|||
from pytest import raises
|
||||
|
||||
|
||||
def test_gain(context):
|
||||
"""Test write-only property gain."""
|
||||
def test_slot_gain(context):
|
||||
"""Test write-only property slot_gain."""
|
||||
with BaseEffect() as fx:
|
||||
fx.gain = 0
|
||||
fx.gain = 1
|
||||
fx.gain = 5/7
|
||||
with raises(ValueError): fx.gain = 7/5
|
||||
with raises(ValueError): fx.gain = -1
|
||||
fx.slot_gain = 0
|
||||
fx.slot_gain = 1
|
||||
fx.slot_gain = 5/7
|
||||
with raises(ValueError): fx.slot_gain = 7/5
|
||||
with raises(ValueError): fx.slot_gain = -1
|
||||
|
||||
|
||||
def test_source_sends(context):
|
||||
|
|
Loading…
Reference in New Issue