forked from flutydeer/audio-slicer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
slicer-gui.py
47 lines (39 loc) · 1.16 KB
/
slicer-gui.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
import os
import sys
import datetime
import qdarktheme
from PySide6.QtWidgets import QApplication, QStyleFactory
from PySide6.QtGui import QFont
import gui.mainwindow
if __name__ == '__main__':
# Write console outputs to log file.
__stderr__ = sys.stderr
date_time = datetime.datetime.now().strftime('%Y_%m_%d_%H_%M_%S')
folder = os.path.exists('log')
if not folder:
os.makedirs('log')
sys.stderr = open(f'log/log {date_time}.txt', 'w')
app = QApplication(sys.argv)
app.setApplicationName("Audio Slicer")
app.setApplicationDisplayName("Audio Slicer")
# Apply auto dark theme
qdarktheme.setup_theme(
theme="auto",
# custom_colors={
# "[dark]": {
# "primary": "#8dc8d1",
# },
# "[light]": {
# "primary": "#3b7d92",
# }
# }
)
# Auto dark title bar on Windows 10/11
style = QStyleFactory.create("fusion")
app.setStyle(style)
font = QFont('Microsoft YaHei UI')
font.setPixelSize(12)
app.setFont(font)
window = gui.mainwindow.MainWindow()
window.show()
sys.exit(app.exec())