2024-12-21 19:00:06 +01:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
2024-12-24 12:13:24 +01:00
|
|
|
from .menu_bar import MenuBar
|
2024-12-22 19:42:48 +01:00
|
|
|
from .track_control import TrackControl
|
2024-12-24 12:13:24 +01:00
|
|
|
from .settings import Settings
|
2024-12-21 19:00:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
class GUICommunication:
|
2024-12-21 20:50:09 +01:00
|
|
|
"""
|
|
|
|
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
|
|
|
|
2024-12-24 12:13:24 +01:00
|
|
|
self.menu_bar = MenuBar(self.app)
|
2024-12-22 19:42:48 +01:00
|
|
|
self.track_control = TrackControl(self.app)
|
2024-12-24 12:13:24 +01:00
|
|
|
self.settings = Settings(self.app)
|
2024-12-21 20:20:06 +01:00
|
|
|
|
2024-12-24 12:13:24 +01:00
|
|
|
self.settings.update_all()
|
2024-12-21 20:20:06 +01:00
|
|
|
|
2024-12-29 18:55:55 +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
|
|
|
|
2024-12-29 15:18:38 +01:00
|
|
|
def on_playstate_update(self):
|
|
|
|
self.track_control.on_playstate_update()
|
|
|
|
|
2024-12-24 12:13:24 +01:00
|
|
|
def on_settings_change(self, key, value):
|
|
|
|
self.settings.update_settings(key, value)
|
|
|
|
|