Wobuzz/wobuzz/main.py

41 lines
1,016 B
Python

#!/usr/bin/python3
import os
import sys
from PyQt6.QtWidgets import QApplication
from wobbl_tools.data_file import load_dataclass_json
from .settings import Settings
from .utils import Utils
from .player import Player
from .library.library import Library
from .gui import GUI
class Wobuzz:
def __init__(self):
self.qt_app = QApplication([])
self.utils = Utils(self)
self.settings = load_dataclass_json(Settings, self.utils.settings_location, self, True, True)
self.settings.set_attribute_change_event(self.on_settings_change)
self.player = Player(self)
self.library = Library(self)
self.gui = GUI(self)
self.post_init()
def post_init(self):
self.gui.track_control.track_progress_slider.post_init()
self.library.load()
def on_settings_change(self, key, value):
self.gui.on_settings_change(key, value)
return True
if __name__ == "__main__":
wobuzz = Wobuzz()
sys.exit(wobuzz.qt_app.exec())