athmos display been bugfixed and can now be switched by the knobs display

This commit is contained in:
SallarShayegan
2025-04-08 16:03:58 +02:00
parent bfd5b41e93
commit 8f9e5257f6
3 changed files with 19 additions and 11 deletions

View File

@ -27,15 +27,17 @@ class Athmos:
if self.show_list:
self.surface.fill("black")
for i in range(self.get_display_count()):
text = self.filenames[(i-self.index-math.floor(self.get_display_count()/2))%len(self.filenames)]
if i == math.floor(self.get_display_count()/2):
# text = self.filenames[(i-self.index-math.floor(self.get_display_count()/2))%len(self.filenames)]
text = self.filenames[i]
# if i == math.floor(self.get_display_count()/2):
if i == self.index:
text_surface = font_helvetica16.render(text, False, "black", color_primary_light)
else:
text_surface = font_helvetica16.render(text, False, color_primary_light)
opacity = math.floor((i+1) * 2 * 255 / MAX_COUNT
if i < MAX_COUNT/2
else (MAX_COUNT-i) * 2 * 255 / MAX_COUNT)
text_surface.set_alpha(opacity)
# text_surface.set_alpha(opacity)
self.surface.blit(text_surface, ((0, self.surface.get_height()/self.get_display_count()*i)))
self.screen.blit(self.surface, (self.screen.get_width()/3,

View File

@ -142,6 +142,7 @@ class Knobs:
self.knobs[index].set_value(value)
def display(self):
if self.gui.show_knobs:
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
self.knobs_surface = pygame.Surface((self.gui.screenW, self.gui.screenH), pygame.SRCALPHA)

View File

@ -48,6 +48,7 @@ class GuiMain:
self.knobs.append(Knobs(self))
self.set_fx_mode(self.fx_mode)
self.show_knobs = True
self.mute_button = BinaryButton(
self.screen,
@ -86,6 +87,10 @@ class GuiMain:
for b in self.fx_mode_buttons:
b.focused = (b.name == mode)
def show_athmos(self, show=True):
self.athmos.show_list = show
self.show_knobs = not show
def set_athmo_index(self, index):
self.athmos.index = index