Beta-1.0:

- added new option to show song titles
This commit is contained in:
janis
2022-03-11 17:59:14 +01:00
parent 014640466c
commit 92350fc5aa
6 changed files with 61 additions and 19 deletions

View File

@@ -136,23 +136,25 @@ RootScreen:
FloatLayout:
Label:
text: "Currently Playing"
pos_hint: {"y": 0.4}
font_size: 35
pos_hint: {"y": 0.35}
font_size: 45
color: app.theme_cls.primary_color
MDProgressBar:
orientation: "horizontal"
value: 100
pos_hint: {"y": 0.35}
pos_hint: {"y": 0.3}
color: app.theme_cls.primary_dark
Label:
id: current_song
text: "Currently playing Song will appear here"
pos_hint: {"y": 0.25}
pos_hint: {"y": 0.22}
font_size: 30
color: app.theme_cls.primary_color
shorten: False
Label:
text: "upcoming"
font_size: 25
pos_hint: {"y": -0.05}
color: app.theme_cls.primary_color
Label:
id: upcoming_songs
@@ -160,6 +162,7 @@ RootScreen:
pos_hint: {"y": -0.25}
font_size: 20
color: app.theme_cls.primary_color
shorten: False
Button:
text: "back"
font_size: 10

View File

@@ -7,11 +7,26 @@ cvw = bin.csv_parsers.CsvWrite()
class InfoHandler:
def __init__(self):
pass
self.path = ""
self.__infos = ""
self.__style = ""
self.__outp1 = ""
self.__output = []
def infohandler(self, infos, path):
print(path, "path")
self.path = f"{path}/songlist.csv"
def infohandler(self, listname, path):
self.path = f"{path}/{listname}"
self.__info_doc = cvr.importing(self.path)
print(self.__info_doc)
print(infos)
self.__outp1 = ""
self.__output = []
for self.item in self.__info_doc:
self.__outp1 = []
self.__infos = ""
self.__infos = self.item
self.__outp1 = f"{self.__infos.pop(0)} - {self.__infos.pop(0)}"
try:
self.__style = self.__infos.pop(0)
self.__outp1 += f" | {self.__style}"
except:
pass
self.__output.append(self.__outp1)
cvw.app_str("./data/songtemp.csv", self.__output)

View File

@@ -43,11 +43,14 @@ class Player:
self.transmission = []
cvw.write_str("./data/songtemp.csv", [self.current_playing_pos])
self.__config = cvr.importing("./data/config.csv").pop(0)
self.listinfo = self.__config.pop(1)
if self.__config == ["1"]:
cvw.app_str("./data/songtemp.csv", self.information)
else:
print(self.path, "path")
bin.info_handler.InfoHandler().infohandler(self.information, self.pathtr)
try:
bin.info_handler.InfoHandler().infohandler(self.listinfo, self.pathtr)
except FileNotFoundError:
cvw.app_str("./data/songtemp.csv", self.information)
def musicmanager(self, inst, other):
self.start_playing()
@@ -101,4 +104,3 @@ class Player:
self.infoupdater()
else:
pass