Skip to content

Commit

Permalink
Move Phazor classes to root
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rn3j committed Mar 2, 2025
1 parent f5b44ec commit 77000b5
Show file tree
Hide file tree
Showing 2 changed files with 447 additions and 451 deletions.
23 changes: 11 additions & 12 deletions src/tauon/t_modules/t_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from __future__ import annotations



import base64
import builtins
import certifi
Expand Down Expand Up @@ -165,7 +164,7 @@
from tauon.t_modules.t_jellyfin import Jellyfin
from tauon.t_modules.t_launch import Launch
from tauon.t_modules.t_lyrics import genius, lyric_sources, uses_scraping
from tauon.t_modules.t_phazor import phazor_exists, player4
from tauon.t_modules.t_phazor import phazor_exists, player4, Cachement, LibreSpot
from tauon.t_modules.t_prefs import Prefs
from tauon.t_modules.t_search import bandcamp_search
from tauon.t_modules.t_spot import SpotCtl
Expand All @@ -186,6 +185,7 @@
from websocket import WebSocketApp
from lynxtray import SysTrayIcon
from mutagen.id3 import ID3
from subprocess import Popen

class LoadImageAsset:
assets: list[LoadImageAsset] = []
Expand Down Expand Up @@ -1574,8 +1574,8 @@ def __init__(self, tauon: Tauon) -> None:
self.volume_store: float = 50 # Used to save the previous volume when muted
self.new_time = 0
self.time_to_get = []
self.a_time = 0
self.b_time = 0
self.a_time: float = 0
self.b_time: float = 0
# self.playlist_backup = []
self.active_replaygain = 0
self.auto_stop = False
Expand Down Expand Up @@ -4345,7 +4345,7 @@ def process_queue(self) -> None:

self.running = False

def update(self, add_time):
def update(self, add_time: float) -> None:
if self.pctl.queue_step > len(self.pctl.track_queue) - 1:
logging.info("Queue step error 1")
return
Expand Down Expand Up @@ -5432,8 +5432,6 @@ def __init__(self, holder: Holder, bag: Bag, gui: GuiVar) -> None:
self.move_in_progress: bool = False
self.msys = bag.msys
self.worker2_lock = threading.Lock()
#TODO(Martin) : Fix this by moving the class to root of the module
self.cachement: player4.Cachement | None = None
self.dummy_event: sdl3.SDL_Event = sdl3.SDL_Event()
self.temp_dest = sdl3.SDL_FRect(0, 0)
self.text_box_canvas_rect = sdl3.SDL_FRect(0, 0, round(2000 * gui.scale), round(40 * gui.scale))
Expand Down Expand Up @@ -5665,7 +5663,12 @@ def __init__(self, holder: Holder, bag: Bag, gui: GuiVar) -> None:
self.quick_close = False

self.copied_track = None
self.aud: CDLL | None = None
self.aud: CDLL | None = None
self.player4_state: int = 0
self.librespot_p: Popen[bytes] | None = None
self.spot_ctl = SpotCtl(self)
self.cachement = Cachement(self)
self.spotc = LibreSpot(self)

self.recorded_songs = []

Expand All @@ -5675,9 +5678,6 @@ def __init__(self, holder: Holder, bag: Bag, gui: GuiVar) -> None:
self.remote_limited = True
self.enable_librespot = shutil.which("librespot")

#TODO(Martin) : Fix this by moving the class to root of the module
self.spotc: player4.LibreSpot | None = None
self.librespot_p = None
self.MenuItem = MenuItem

self.gme_formats = bag.formats.GME
Expand All @@ -5695,7 +5695,6 @@ def __init__(self, holder: Holder, bag: Bag, gui: GuiVar) -> None:
finally:
logging.debug("Found Chrome(pychromecast) for chromecast support")

self.spot_ctl = SpotCtl(self)
self.tidal = Tidal(self)
self.plex = PlexService(self)
self.jellyfin = Jellyfin(self)
Expand Down
Loading

0 comments on commit 77000b5

Please sign in to comment.