the end-point for setting the knob values has been created

This commit is contained in:
SallarShayegan
2025-03-13 21:48:01 +01:00
parent 24a60d7745
commit 6269e6f9f6
3 changed files with 16 additions and 10 deletions

View File

@ -27,10 +27,6 @@ class Knobs:
'Gain'
]
self.values = []
for i in range(len(knob_names)):
self.values.append(random.random())
# Create and position the knobs
self.knobs_radius = self.gui.screenW / 25
knobs_spacing = self.knobs_radius * 2
@ -39,8 +35,8 @@ class Knobs:
knobs_y = (self.gui.screenH - (self.knobs_radius + knobs_spacing) * 3) / 2
y = knobs_y
self.knobs = []
for i in range(8):
self.knobs.append(Knob(self, knob_names[i], self.knobs_radius, (x, y), self.values[i]))
for i in range(len(knob_names)):
self.knobs.append(Knob(self, knob_names[i], self.knobs_radius, (x, y), 0))
y += self.knobs_radius + knobs_spacing
if i == 3 or i == 6:
x += self.knobs_radius + knobs_spacing
@ -141,6 +137,10 @@ class Knobs:
if knob is None:
k.vanish_label_path = False
def set_value(self, index, value):
self.set_focused(self.knobs[index])
self.knobs[index].set_value(value)
def display(self):
if self.fade_in and self.opacity < 255: self.opacity += self.fade_speed
if self.fade_out and self.opacity > 0: self.opacity -= self.fade_speed