Skip to content

Commit

Permalink
introduce function ecasound_apply_kit_volume() in edrumulus_gui
Browse files Browse the repository at this point in the history
  • Loading branch information
corrados committed Nov 13, 2023
1 parent fd74e7d commit fe6b175
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/edrumulus_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,17 +487,20 @@ def ecasound_switch_chains(do_increment):
chain_index = chain_index % len(chain_setups)
selected_kit = chain_setups[chain_index]
ecasound_socket.sendall("engine-halt\r\ncs-select {0}\r\ncs-connect {0}\r\nengine-launch\r\nstart\r\n".format(selected_kit).encode("utf8"))
ecasound_socket.sendall("c-select Master\r\ncop-set 1,1,{0}\r\n".format(kit_volume).encode("utf8")) # update kit volume
kit_vol_str = str(kit_volume) + " dB"
ecasound_apply_kit_volume()

def ecasound_kit_volume(do_increment):
global kit_volume, kit_vol_str
if ecasound_connect_try_cnt == 0:
# now modify and apply new volume value
kit_volume = kit_volume + 1 if do_increment else kit_volume - 1
kit_volume = max(min(kit_volume, 30), -30)
ecasound_socket.sendall("c-select Master\r\ncop-set 1,1,{0}\r\n".format(kit_volume).encode("utf8"))
kit_vol_str = str(kit_volume) + " dB"
ecasound_apply_kit_volume()

def ecasound_apply_kit_volume():
global kit_vol_str
ecasound_socket.sendall("c-select Master\r\ncop-set 1,1,{0}\r\n".format(kit_volume).encode("utf8"))
kit_vol_str = str(kit_volume) + " dB"


################################################################################
Expand Down

0 comments on commit fe6b175

Please sign in to comment.