Skip to content

Commit

Permalink
main.py: simplify the configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasMamo committed Apr 5, 2023
1 parent add7701 commit 7f04a20
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,16 @@
This is only done to place the configuration at the top of the file.
"""

DURATION = None
DUCK = None
STEPS = None
FADE = None

def config():
"""
Configure the auto-ducker.
The function is defined here so that by the time it is called, the functions have all been defined.
"""

# the number of milliseconds to spend fading
global DURATION
DURATION = 2000

# the minimum volume to which to duck music applications
global DUCK
DUCK = 0.4

# how detailed the auto-ducking; the higher the steps, the lower the performance but the more seamless the ducking
global STEPS
STEPS = 30

# the fade function
global FADE
FADE = bezier
DURATION = 2000 # the number of milliseconds to spend fading
DUCK = 0.4 # the minimum volume to which to duck music applications
STEPS = 30 # how smooth the auto-ducking
FADE = lambda x: bezier(x) # the fade function

"""
MAIN LOOP
"""

async def main():
config() # configure the auto-ducker
ducking = [ ] # the apps that have been or are being ducked

# connect to the PulseAudio sound server
Expand Down

0 comments on commit 7f04a20

Please sign in to comment.