Skip to content

Commit

Permalink
Move phazor init to Tauon to avoid None case
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rn3j committed Mar 3, 2025
1 parent 4eb719c commit f796666
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/tauon/t_modules/t_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,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, Cachement, LibreSpot
from tauon.t_modules.t_phazor import get_phazor_path, 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 Down Expand Up @@ -5662,7 +5662,8 @@ 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 = ctypes.cdll.LoadLibrary(str(get_phazor_path(self.pctl)))
logging.debug(f"Loaded Phazor path at: {get_phazor_path(self.pctl)}")
self.player4_state: int = 0
self.librespot_p: Popen[bytes] | None = None
self.spot_ctl = SpotCtl(self)
Expand Down
4 changes: 1 addition & 3 deletions src/tauon/t_modules/t_phazor.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ def start_librespot() -> None:
loaded_track = None
fade_time = 400

aud = ctypes.cdll.LoadLibrary(str(get_phazor_path(pctl)))
logging.debug("Loaded Phazor path at: " + str(get_phazor_path(pctl)))
aud = tauon.aud

aud.config_set_dev_name(prefs.phazor_device_selected.encode())

Expand All @@ -725,7 +724,6 @@ def start_librespot() -> None:

aud.feed_raw.argtypes = (ctypes.c_int,ctypes.c_char_p)
aud.feed_raw.restype = None
tauon.aud = aud
aud.set_volume(int(pctl.player_volume))

bins1 = (ctypes.c_float * 24)()
Expand Down

0 comments on commit f796666

Please sign in to comment.