Stable-V.1.0.1

- added a progressbar for the song
This commit is contained in:
janis
2022-03-12 11:56:19 +01:00
parent 1773eb882e
commit 1aae4a74cf
6 changed files with 55 additions and 18 deletions

View File

@@ -50,7 +50,7 @@ class CsvWrite:
def chg_str(self, path, row, pos, new_value):
"""Opens the csv-file in write mode to change a value, e.g. if a recipes is changed."""
"""Opens the csv-file in write mode to change a value, e.g. if a recipe is changed."""
self.__imp = open(path)
self.__raw = csv.reader(self.__imp, delimiter=',')
self.__impl = list(self.__raw)

View File

@@ -67,7 +67,7 @@ RootScreen:
<Home>:
name: "Home"
md_bg_color: app.theme_cls.accent_color
md_bg_color: app.theme_cls.accent_dark
GridLayout:
cols: 1
Label:
@@ -100,7 +100,7 @@ RootScreen:
<Main>:
on_pre_enter: root.initialize()
name: "Main"
md_bg_color: app.theme_cls.accent_color
md_bg_color: app.theme_cls.accent_dark
GridLayout:
cols: 1
GridLayout:
@@ -163,33 +163,45 @@ RootScreen:
FloatLayout:
Label:
text: "Currently Playing"
bold: True
italic: True
pos_hint: {"y": 0.35}
font_size: 45
font_size: 60
color: app.theme_cls.primary_color
MDProgressBar:
orientation: "horizontal"
value: 100
pos_hint: {"y": 0.3}
color: (1, 1, 1, 0.5)
MDProgressBar:
id: progressbars
orientation: "horizontal"
value: 0
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.22}
font_size: 30
font_size: 45
color: app.theme_cls.primary_color
shorten: False
halign: "center"
Label:
text: "upcoming"
font_size: 25
bold: True
italic: True
font_size: 35
pos_hint: {"y": -0.05}
color: app.theme_cls.primary_color
Label:
id: upcoming_songs
text: "Upcoming Songs will appear here"
pos_hint: {"y": -0.25}
font_size: 20
font_size: 30
color: app.theme_cls.primary_color
shorten: False
halign: "center"
Button:
text: "back"
font_size: 10

View File

@@ -18,6 +18,7 @@ class Player:
self.__imports = []
self.information = []
self.current_playing_pos = 0
self.__songlength = 0
def start_playing(self):
# initialize playing
@@ -40,6 +41,7 @@ class Player:
mx.music.pause()
def infoupdater(self):
self.__songlength = mx.Sound(self.current_playing).get_length()
self.transmission = []
cvw.write_str("./data/songtemp.csv", [self.current_playing_pos])
self.__config = cvr.importing("./data/config.csv").pop(0)
@@ -50,12 +52,15 @@ class Player:
try:
bin.info_handler.InfoHandler().infohandler(self.listinfo, self.pathtr)
except FileNotFoundError:
cvw.chg_str("./data/config.csv", 0, 0, "1")
cvw.app_str("./data/songtemp.csv", self.information)
cvw.app_str("./data/songtemp.csv", [self.__songlength])
def musicmanager(self, inst, other):
def musicmanager(self, inst, other, backfeed):
self.start_playing()
self.infoupdater()
while self.__running == 1:
backfeed.value = mx.music.get_pos() / 1000
if self.__recent_change < 1:
pass
else:
@@ -77,7 +82,9 @@ class Player:
self.infoupdater()
elif other.value == 2:
mx.music.rewind()
mx.music.unload()
mx.music.load(self.current_playing)
mx.music.play()
other.value = 0
elif other.value == 3: