Beta-1.0.1:

- added a function to go back to previous song
This commit is contained in:
janis
2022-03-11 19:19:20 +01:00
parent 92350fc5aa
commit f1f3d5461c
5 changed files with 93 additions and 32 deletions

View File

@@ -87,7 +87,7 @@ RootScreen:
hint_text: "Path to Folder containing the Music files"
pos_hint: {"x":0.2, "y":0.5}
size_hint_x: 0.6
text: "/home/janis/Downloads"
text: "/home/janis/Downloads/KB"
Button:
text: "Start"
color: app.theme_cls.primary_color
@@ -100,34 +100,55 @@ RootScreen:
<Main>:
on_pre_enter: root.initialize()
name: "Main"
md_bg_color: app.theme_cls.accent_color
GridLayout:
cols: 1
GridLayout:
cols: 2
Button:
text: "Next"
on_release:
root.nextsong()
Button:
text: "Rewind"
on_release:
root.rewindsong()
Button:
text: "Play"
id: pp_button
on_release:
root.playmusic()
GridLayout:
cols: 2
Button:
text: "Back"
on_release:
root.go_back()
Button:
text: "Showcase"
on_release:
app.root.current = "Showcase"
root.manager.transition.direction = "left"
Label:
text: "MusicPlayer"
font_size: 40
color: app.theme_cls.primary_color
FloatLayout:
GridLayout:
size_hint: 0.8, 0.9
pos_hint: {"x": 0.1, "y": 0.1}
cols: 1
GridLayout:
cols: 3
Button:
text: "Previous"
background_color: app.theme_cls.accent_dark
on_release:
root.previoussong()
Button:
text: "Rewind"
background_color: app.theme_cls.accent_dark
on_release:
root.rewindsong()
Button:
text: "Next"
background_color: app.theme_cls.accent_dark
on_release:
root.nextsong()
Button:
text: "Play"
id: pp_button
background_color: app.theme_cls.accent_dark
on_release:
root.playmusic()
GridLayout:
cols: 2
Button:
text: "Back"
background_color: app.theme_cls.accent_dark
on_release:
root.go_back()
Button:
text: "Showcase"
background_color: app.theme_cls.accent_dark
on_release:
app.root.current = "Showcase"
root.manager.transition.direction = "left"
<ShowcaseS>:
on_pre_enter: root.screen_updater_start()
@@ -170,4 +191,7 @@ RootScreen:
background_color: app.theme_cls.accent_light
on_release:
app.root.current = "Main"
root.manager.transition.direction = "right"
root.manager.transition.direction = "right"
<SettingsS>:
name: "Settings"

View File

@@ -26,7 +26,12 @@ class InfoHandler:
try:
self.__style = self.__infos.pop(0)
self.__outp1 += f" | {self.__style}"
except:
except IndexError:
pass
try:
self.__tempo = self.__infos.pop(0)
self.__outp1 += f" ({self.__tempo})"
except IndexError:
pass
self.__output.append(self.__outp1)
cvw.app_str("./data/songtemp.csv", self.__output)

View File

@@ -83,6 +83,22 @@ class Player:
elif other.value == 3:
self.__recent_change = 1000000
other.value = 0
elif other.value == 4:
other.value = 0
mx.music.unload()
self.playlist = copy.deepcopy(self.playlist_backup)
if self.current_playing_pos > 0:
self.current_playing_pos -= 1
else:
self.current_playing_pos = len(self.playlist_backup) - 1
for i in range(self.current_playing_pos):
self.playlist.pop(0)
self.current_playing = self.playlist.pop(0)
mx.music.load(self.current_playing)
mx.music.play()
self.__recent_change = 10000000
self.infoupdater()
else:
if inst.value == 1:
mx.music.unpause()