server almost running - Second display working

This commit is contained in:
janis
2022-10-30 16:19:09 +01:00
parent f5b682598b
commit 14d9620ab8
14 changed files with 337 additions and 75 deletions

Binary file not shown.

View File

@@ -6,8 +6,29 @@ RootScreen:
###########
# POPUPS
###########
<ConnectPU>:
title: "Connect to Server"
auto_dismiss: False
size_hint: 0.8, 0.8
GridLayout:
cols: 1
Label:
text: "Please enter the Server's IP address below!"
Label:
text: ""
id: output
TextInput:
text: ""
id: url
hint_text: "Enter Server-IP"
Button:
text: "Connect"
on_release:
root.tryconnect()
<QuitPU>:
title: "BiogasControllerApp"
title: "MusicPlayer"
font_size: 50
size_hint: 0.5, 0.4
auto_dismiss: False
@@ -218,12 +239,17 @@ RootScreen:
on_release:
root.playmusic()
GridLayout:
cols: 2
cols: 3
Button:
text: "Back"
background_color: app.theme_cls.accent_dark
on_release:
root.go_back()
Button:
text: "Connect to Server"
background_color: app.theme_cls.accent_dark
on_release:
root.connectToServer()
Button:
text: "Showcase"
background_color: app.theme_cls.accent_dark

View File

@@ -5,6 +5,7 @@ import bin.filepathanalysis
import pygame
import bin.info_handler
import configparser
import time
pa = bin.filepathanalysis.PathAnalysis()
cvr = bin.csv_parsers.CsvRead()
@@ -134,3 +135,4 @@ class Player:
self.infoupdater()
else:
pass
time.sleep(0.25)

48
bin/servercoms.py Normal file
View File

@@ -0,0 +1,48 @@
import requests
class ServerComs:
def __init__(self):
pass
def connect(self, url):
try:
self.x = requests.get(f"{url}/tryconnect")
return True
except Exception:
return False
def postcurrentsong(self, url, data):
try:
self.x = requests.post(f"{url}/postcurrentsong", {"songname":data})
return True
except Exception:
return False
def postupcomingsongs(self, url, data):
try:
self.x = requests.post(f"{url}/postupcomingsongs", {"songs":data})
return True
except Exception:
return False
def postplaybackpos(self, url, data):
try:
self.x = requests.post(f"{url}/postplayback", {"pos":data})
return True
except Exception:
return False
def postsonglength(self, url, data):
try:
self.x = requests.post(f"{url}/postsonglength", {"length":data})
return True
except Exception:
return False
def postfullscreen(self, url, data):
try:
self.x = requests.post(f"{url}/postfullscreen", {"fullscreen":data})
return True
except Exception:
return False