-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtui.py
51 lines (39 loc) · 1.12 KB
/
tui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from textual.app import App
from screens.edit import EditScreen
from screens.settings import SettingsScreen
from screens.sync import SyncScreen
from player import MusicPlayer
from parser import Lyrics
class TTMLApp(App):
"""A Textual app to create ttml files."""
CSS_PATH = [
"styles/base.tcss",
"styles/filenamepicker.tcss",
"styles/sidebar.tcss",
"styles/carousel.tcss",
"styles/playerbox.tcss",
"styles/elementedit.tcss",
]
CURR_LYRICS: Lyrics = None
PLAYER = MusicPlayer()
BINDINGS = [
("q", "quit", "Quit the app"),
("x", "switch_mode('settings')", "Go to Settings"),
("e", "switch_mode('edit')", "Switch to Edit mode"),
("r", "switch_mode('sync')", "Switch to Sync Mode")
]
SCREENS = {
"edit": EditScreen,
"sync": SyncScreen,
"settings": SettingsScreen
}
MODES = {
"edit": "edit",
"sync": "sync",
"settings": "settings"
}
def on_mount(self) -> None:
self.switch_mode("edit")
if __name__ == "__main__":
app = TTMLApp()
app.run()