Wobuzz/wobuzz/gui_communication/gui_communication.py

32 lines
823 B
Python
Raw Permalink Normal View History

2024-12-21 19:00:06 +01:00
#!/usr/bin/python3
from .menu_bar import MenuBar
2024-12-22 19:42:48 +01:00
from .track_control import TrackControl
from .settings import Settings
2024-12-21 19:00:06 +01:00
class GUICommunication:
"""
Class handling events that are a bit more complex.
"""
2024-12-21 19:00:06 +01:00
def __init__(self, app):
self.app = app
2024-12-21 20:20:06 +01:00
self.menu_bar = MenuBar(self.app)
2024-12-22 19:42:48 +01:00
self.track_control = TrackControl(self.app)
self.settings = Settings(self.app)
2024-12-21 20:20:06 +01:00
self.settings.update_all()
2024-12-21 20:20:06 +01:00
def on_track_change(self, previous_track=None, track=None):
self.track_control.on_track_change(previous_track, track)
self.app.library.on_track_change(previous_track, track)
2024-12-21 19:00:06 +01:00
def on_playstate_update(self):
self.track_control.on_playstate_update()
def on_settings_change(self, key, value):
self.settings.update_settings(key, value)