change the actual controller fx_mode when tapping the lozenge_buttons
This commit is contained in:
@ -23,6 +23,7 @@ class LozengeButton:
|
|||||||
if math.sqrt(math.pow(pos[0] - self.x, 2) + math.pow(pos[1] - self.y, 2)) < self.radius_y:
|
if math.sqrt(math.pow(pos[0] - self.x, 2) + math.pow(pos[1] - self.y, 2)) < self.radius_y:
|
||||||
self.focused = True
|
self.focused = True
|
||||||
self.gui.set_fx_mode_by_name(self.side, self.name)
|
self.gui.set_fx_mode_by_name(self.side, self.name)
|
||||||
|
self.gui.set_controller_fx_mode(self.side, self.name)
|
||||||
|
|
||||||
if self.focused:
|
if self.focused:
|
||||||
w = 0
|
w = 0
|
||||||
|
|||||||
7
main.py
7
main.py
@ -10,7 +10,8 @@ from .beatplayer import BeatPlayer
|
|||||||
|
|
||||||
class GuiMain:
|
class GuiMain:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, controller):
|
||||||
|
self.controller = controller
|
||||||
# pygame setup
|
# pygame setup
|
||||||
pygame.init()
|
pygame.init()
|
||||||
pygame.display.set_caption("SantoscopeUI")
|
pygame.display.set_caption("SantoscopeUI")
|
||||||
@ -154,6 +155,10 @@ class GuiMain:
|
|||||||
for b in self.fx_mode_buttons[side]:
|
for b in self.fx_mode_buttons[side]:
|
||||||
b.focused = (b.name == mode)
|
b.focused = (b.name == mode)
|
||||||
|
|
||||||
|
def set_controller_fx_mode(self, side, mode):
|
||||||
|
i = self.fx_mode_labels[side].index(mode)
|
||||||
|
self.controller.set_fx_mode(side, i)
|
||||||
|
|
||||||
def show_athmos(self, show=True):
|
def show_athmos(self, show=True):
|
||||||
self.athmos.show_list = show
|
self.athmos.show_list = show
|
||||||
self.show_knobs = not show
|
self.show_knobs = not show
|
||||||
|
|||||||
Reference in New Issue
Block a user