almost-stable-V2.0

This commit is contained in:
janis
2022-10-30 19:05:49 +01:00
parent 14d9620ab8
commit 52a15342e5
16 changed files with 185 additions and 34 deletions

View File

@@ -6,6 +6,19 @@ RootScreen:
###########
# POPUPS
###########
<AppQuitting>:
title: "App is quitting"
auto_dismiss: False
GridLayout:
cols: 1
Label:
text: "App is closing remaining processes..."
font_size: 30
Label:
text: "Please wait..."
font_size: 20
<ConnectPU>:
title: "Connect to Server"
auto_dismiss: False
@@ -21,10 +34,16 @@ RootScreen:
text: ""
id: url
hint_text: "Enter Server-IP"
Button:
text: "Connect"
on_release:
root.tryconnect()
GridLayout:
cols: 2
Button:
text: "Connect"
on_release:
root.tryconnect()
Button:
text: "Cancel"
on_release:
root.dismiss()
<QuitPU>:
@@ -43,6 +62,7 @@ RootScreen:
text: "Yes"
font_size: 15
on_release:
root.quitapp()
app.stop()
Button:
text: "No"
@@ -107,6 +127,24 @@ RootScreen:
on_release:
root.dismiss()
<NotConnected>:
title: "NOTICE!"
font_size: 50
size_hint: 0.5, 0.4
auto_dismiss: False
GridLayout:
cols:1
Label:
text: "You are not connected to a server!"
font_size: 18
Label:
text: "Therefore this function is not available!"
font_size: 15
Button:
text:"Ok"
on_release:
root.dismiss()
<LeavePU>:
title: "DISABLE FULLSCREEN AND LEAVE"
font_size: 50
@@ -161,7 +199,7 @@ RootScreen:
pos_hint: {"x":0.2, "y":0.5}
size_hint_x: 0.6
focus: True
text: ""
text: "/mnt/storage/SORTED/Music"
on_text:
root.autocomplete()
on_text_validate:
@@ -173,7 +211,7 @@ RootScreen:
text_size: self.size
id: cmd_output
GridLayout:
cols: 2
cols: 3
Button:
text: "Start"
color: app.theme_cls.primary_color
@@ -182,6 +220,14 @@ RootScreen:
background_color: app.theme_cls.accent_dark
on_release:
root.change_screen()
Button:
text: "Connect to Server"
color: app.theme_cls.primary_color
font_size: 30
bold: True
background_color: app.theme_cls.accent_dark
on_release:
root.connectServer()
Button:
text: "Quit"
color: app.theme_cls.primary_color
@@ -246,16 +292,21 @@ RootScreen:
on_release:
root.go_back()
Button:
text: "Connect to Server"
text: "Fullscreen on client\n(Only available if connected)"
id: fullscreenc
background_color: app.theme_cls.accent_dark
on_release:
root.connectToServer()
root.changeServerSettings()
Button:
text: "Showcase"
background_color: app.theme_cls.accent_dark
on_release:
app.root.current = "Showcase"
root.manager.transition.direction = "left"
Label:
text: "Test"
id: connectstatus
pos_hint: {"y": -0.45}
<ShowcaseS>:
on_pre_enter: root.reset()

View File

@@ -27,10 +27,10 @@ class Player:
def start_playing(self):
# initialize playing
print("starting player")
if pygame.get_init() == True:
pass
else:
pygame.init()
self.path = cvr.importing("./data/temp.csv").pop(0)
self.pathtr = self.path.pop(0)
self.__imports = pa.validsonglistcreator(self.pathtr)
@@ -135,4 +135,4 @@ class Player:
self.infoupdater()
else:
pass
time.sleep(0.25)
time.sleep(0.2)

View File

@@ -39,10 +39,24 @@ class ServerComs:
except Exception:
return False
def postfullscreen(self, url, data):
def changefullscreen(self, url):
try:
self.x = requests.post(f"{url}/postfullscreen", {"fullscreen":data})
self.x = requests.get(f"{url}/changefullscreen")
return True
except Exception:
return False
def getfullscreeninfo(self, url):
try:
self.x = requests.get(f"{url}/changefullscreen")
except Exception:
pass
return self.x.text
def poststatus(self, url, isalive):
print("updating status")
try:
self.x = requests.post(f"{url}/poststatus", {"status":f"{isalive}"})
return True
except Exception:
return False