Skip to content

Commit

Permalink
Just a little thing updated
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatDamon committed Feb 8, 2024
1 parent 917e60d commit ad6d3d8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
4 changes: 3 additions & 1 deletion i18n/en_US.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"beenUntop": "Canceled always on top",
"resetMenuBar": "Press Ctrl-H to reset the menu bar!",
"enableLoop": "Looped playback enabled",
"disableLoop": "Looped playback disabled"
"disableLoop": "Looped playback disabled",
"unsupportWithYourOS": "Unsupport with your OS! \n Exiting...",
"notSupportMacOS": "Not supported on macOS"
}

tooltips = {
Expand Down
4 changes: 3 additions & 1 deletion i18n/zh_CN.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"beenUntop": "已取消置顶",
"resetMenuBar": "按下 Ctrl+H 复原顶栏!",
"enableLoop": "已启用循环播放",
"disableLoop": "已禁用循环播放"
"disableLoop": "已禁用循环播放",
"unsupportWithYourOS": "不支持您的操作系统! \n 正在退出·...",
"notSupportMacOS": "不支持 macOS"
}

tooltips = {
Expand Down
49 changes: 34 additions & 15 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,16 @@ def autoKeepAudioProgress(e):
page.update()

"""
def enableOrDisableLoop(e):
def enableOrDisableLoop(e):
global loopOpen
if loopOpen == False:
loopOpen = True
page.snack_bar = ft.SnackBar(ft.Text(value = lang.mainMenu["enableLoop"]))
page.snack_bar.open = True
elif loopOpen == True:
loopOpen = False
page.snack_bar = ft.SnackBar(ft.Text(value = lang.mainMenu["disableLoop"]))
page.snack_bar.open = True
print(playAudio.release_mode)
# playAudio.release_mode = ReleaseMode.LOOP
page.update()
logging.info("Page updated")
"""
Expand Down Expand Up @@ -400,23 +400,38 @@ def openAboutDlg(e):
page.update()
logging.info("Page updated")

def stereoBalanceNotSupport():
logging.warning("Not support with macOS")
page.snack_bar = ft.SnackBar(ft.Text(value = lang.mainMenu["notSupportMacOS"]))
page.snack_bar.open = True
logging.info("Snack Bar loaded - notSupportMacOS")

def balanceLeft(e):
playAudio.balance -= 0.1
logging.info("Channel left shift to " + str(playAudio.balance))
playAudio.update()
logging.info("playAudio updated")
if currentOS == "darwin":
stereoBalanceNotSupport()
else:
playAudio.balance -= 0.1
logging.info("Channel left shift to " + str(playAudio.balance))
playAudio.update()
logging.info("playAudio updated")

def balanceRight(e):
playAudio.balance += 0.1
logging.info("Channel right shift to " + str(playAudio.balance))
playAudio.update()
logging.info("playAudio updated")
if currentOS == "darwin":
stereoBalanceNotSupport()
else:
playAudio.balance += 0.1
logging.info("Channel right shift to " + str(playAudio.balance))
playAudio.update()
logging.info("playAudio updated")

def balanceMiddle(e):
playAudio.balance = 0
logging.info("Channel set banlace to 0")
playAudio.update()
logging.info("playAudio updated")
if currentOS == "darwin":
stereoBalanceNotSupport()
else:
playAudio.balance = 0
logging.info("Channel set banlace to 0")
playAudio.update()
logging.info("playAudio updated")

playAudio = ft.Audio(
autoplay = False,
Expand Down Expand Up @@ -673,6 +688,10 @@ def balanceMiddle(e):
else:
print(lang.infomation["nonTestWarning"])
logging.warning("Non-test OS")
if currentOS == "bsd" or currentOS == "unknown":
print(lang.mainMenu("unsupportWithYourOS"))
logging.error("Unsupport with the current os: " + currentOS)
exit()
audioArtistText = lang.mainMenu["unknownArtist"]
audioTitleText = lang.mainMenu["unknownMusic"]
audioInfo = lang.mainMenu["none"]
Expand Down

0 comments on commit ad6d3d8

Please sign in to comment.