From 8f9e5257f64b14da01e05f44137b722705461619 Mon Sep 17 00:00:00 2001 From: SallarShayegan Date: Tue, 8 Apr 2025 16:03:58 +0200 Subject: [PATCH] athmos display been bugfixed and can now be switched by the knobs display --- athmos.py | 8 +++++--- knobs.py | 17 +++++++++-------- main.py | 5 +++++ 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/athmos.py b/athmos.py index 6c719c0..8e99c9c 100755 --- a/athmos.py +++ b/athmos.py @@ -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, diff --git a/knobs.py b/knobs.py index 5059ce6..2775688 100755 --- a/knobs.py +++ b/knobs.py @@ -142,11 +142,12 @@ class Knobs: 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 - self.knobs_surface = pygame.Surface((self.gui.screenW, self.gui.screenH), pygame.SRCALPHA) - for knob in self.knobs: - if knob.focused or knob.vanish_label_path: self.display_label(knob) - knob.display(self.knobs_surface) - - self.gui.screen.blit(self.knobs_surface, (0,0)) + 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) + for knob in self.knobs: + if knob.focused or knob.vanish_label_path: self.display_label(knob) + knob.display(self.knobs_surface) + + self.gui.screen.blit(self.knobs_surface, (0,0)) diff --git a/main.py b/main.py index ee7fc16..dace6f5 100755 --- a/main.py +++ b/main.py @@ -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