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" hint_text: "Path to Folder containing the Music files"
pos_hint: {"x":0.2, "y":0.5} pos_hint: {"x":0.2, "y":0.5}
size_hint_x: 0.6 size_hint_x: 0.6
text: "/home/janis/Downloads" text: "/home/janis/Downloads/KB"
Button: Button:
text: "Start" text: "Start"
color: app.theme_cls.primary_color color: app.theme_cls.primary_color
@@ -100,34 +100,55 @@ RootScreen:
<Main>: <Main>:
on_pre_enter: root.initialize() on_pre_enter: root.initialize()
name: "Main" name: "Main"
md_bg_color: app.theme_cls.accent_color
GridLayout: GridLayout:
cols: 1 cols: 1
GridLayout: Label:
cols: 2 text: "MusicPlayer"
Button: font_size: 40
text: "Next" color: app.theme_cls.primary_color
on_release: FloatLayout:
root.nextsong() GridLayout:
Button: size_hint: 0.8, 0.9
text: "Rewind" pos_hint: {"x": 0.1, "y": 0.1}
on_release: cols: 1
root.rewindsong() GridLayout:
Button: cols: 3
text: "Play" Button:
id: pp_button text: "Previous"
on_release: background_color: app.theme_cls.accent_dark
root.playmusic() on_release:
GridLayout: root.previoussong()
cols: 2 Button:
Button: text: "Rewind"
text: "Back" background_color: app.theme_cls.accent_dark
on_release: on_release:
root.go_back() root.rewindsong()
Button: Button:
text: "Showcase" text: "Next"
on_release: background_color: app.theme_cls.accent_dark
app.root.current = "Showcase" on_release:
root.manager.transition.direction = "left" 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>: <ShowcaseS>:
on_pre_enter: root.screen_updater_start() on_pre_enter: root.screen_updater_start()
@@ -171,3 +192,6 @@ RootScreen:
on_release: on_release:
app.root.current = "Main" 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: try:
self.__style = self.__infos.pop(0) self.__style = self.__infos.pop(0)
self.__outp1 += f" | {self.__style}" self.__outp1 += f" | {self.__style}"
except: except IndexError:
pass
try:
self.__tempo = self.__infos.pop(0)
self.__outp1 += f" ({self.__tempo})"
except IndexError:
pass pass
self.__output.append(self.__outp1) self.__output.append(self.__outp1)
cvw.app_str("./data/songtemp.csv", self.__output) cvw.app_str("./data/songtemp.csv", self.__output)

View File

@@ -83,6 +83,22 @@ class Player:
elif other.value == 3: elif other.value == 3:
self.__recent_change = 1000000 self.__recent_change = 1000000
other.value = 0 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: else:
if inst.value == 1: if inst.value == 1:
mx.music.unpause() mx.music.unpause()

View File

@@ -1,2 +1,2 @@
0 8
Tennessee Waltz - New 101 Strings Orchestra | Slow Walz,Morning has broken - Cat Stevens | Walzer,Magia - Alvaro Soler | Flashmob,Say So - Doja Cat | Discofox,Save Your Tears (Remix) - The Weeknd & Ariana Grande | Discofox,Shivers - Ed Sheeran | Jive/ Rocknroll,I feel good - Ray Charles | Jive/Rocknroll,Muevelo - Rey Ruiz | Cha ch cha,suelta la cintura - Ruben leon | Cha ch cha,Como Volver a Ser Feliz - Luis Enrique | Salsa,Mas que nada - black eyed peas | Salsa/Discofox,Moon River - Henry Mancini | Slow Walz,Dancing Queen - ABBA | Discofox,Don't Call Me Up - Mabel | Discofox,Magia - Alvaro Soler | Flashmob,Lets have a Party - Wanda Jackson | Jive,Crazy Little Thing Called Love - Queen | Jive / Rocknroll,El Diablo Anda Suelto - Rey Ruiz | Cha ch cha,Lets get loud - jennifer Lopez | Cha ch cha,Enamorame - Somos del Barrio | Salsa,Something Stupid (feat. Reese Witherspoon) - Michael Bublé | Rumba/cha cha cha,When a man loves a woman - Percy Sledge | Slow,Scharlachrot - Patent Ochsner | Walzer,ily (i love you baby) [feat. Emilee] - Surf Mesa | Discofox,Like a sex machine - James Brown | Discofox,Uptown Funk (feat. Bruno Mars) - Discofox | Discofox,Tutti Frutti - Little Richard | Jive/ Rocknroll,Jailhouse Rock - Elvis Presley | Jive/ Rocknroll,Are you lonesome - Elvis Presley | walzer/slow,Ay Mujer - Rey Ruiz | Cha ch cha,Rico Vacilon - Pedro Garcia & His Del Prado Orchestra | Cha ch cha,Jeepers creepers - Benny Goodmann | Foxtrott,An der schönen blauen Donau - New 101 Strings Orchestra | Wiener Walzer,The Last Waltz - Engelbert Humperdinck | Walzer,Stand by me - Sam Brown | Cha ch cha,Staiin' Alive - Begees | Discofox,Easy On Me - Adele | Slow,Magia - Alvaro Soler | Flashmob,Friday (feat. Mufasa & Hypeman) [Dopamine Re-Edit] - Riton & Nightcrawlers | Party,YMCA - Village People | Party,Cotton eyed Joe (Hennustall zermatt mix) - Rednex,Gangnam style - PSY | Party,Take On Me - a-ha | Jive,Rock Around the Clock - Bill Haley & His Comets | Jive/Rocknroll,Satisfaction - Rolling Stones | Party,"Un, dos, tres - Ricky Martin | Party",Party Rock anthem - LFMBQ | Party,I don't care - Icona Pop | Party,Love tonight - Shouse&David Guetta | Party,Insomnia - Faithless | Party,Angels - Robbie Williams | Slow,Nothing compares to you - Sinead O'Connor | Slow Tennessee Waltz - New 101 Strings Orchestra | Slow Walz (lansam),Morning has broken - Cat Stevens | Walzer (Mittel),Magia - Alvaro Soler | Flashmob (Mittel),Say So - Doja Cat | Discofox (Langsam),Save Your Tears (Remix) - The Weeknd & Ariana Grande | Discofox (Langsam),Shivers - Ed Sheeran | Jive/ Rocknroll (Mittel),I feel good - Ray Charles | Jive/Rocknroll (Mittel),Muevelo - Rey Ruiz | Cha cha cha (Mittel),Suelta la cintura - Ruben leon | Cha cha cha (Mittel),Como Volver a Ser Feliz - Luis Enrique | Salsa (Mittel),Mas que nada - black eyed peas | Salsa/Discofox (Mittel),Moon River - Henry Mancini | Slow Walz (Langsam),Dancing Queen - ABBA | Discofox (Langsam),Don't Call Me Up - Mabel | Discofox (Mittel),Magia - Alvaro Soler | Flashmob (Mittel),Lets have a Party - Wanda Jackson | Jive (mittel),Crazy Little Thing Called Love - Queen | Jive / Rocknroll (Schnell),El Diablo Anda Suelto - Rey Ruiz | Cha cha cha (Mittel),Lets get loud - jennifer Lopez | Cha cha cha (Schnell),Enamorame - Somos del Barrio | Salsa (Mittel),Something Stupid (feat. Reese Witherspoon) - Michael Bublé | Rumba/cha cha cha (Langsam),When a man loves a woman - Percy Sledge | Langsam (Langsam),Scharlachrot - Patent Ochsner | Walzer (Langsam),Ily (i love you baby) [feat. Emilee] - Surf Mesa | Discofox (Mittel),Like a sex machine - James Brown | Discofox (Mittel),Uptown Funk (feat. Bruno Mars) - Discofox | Discofox (Schnell),Tutti Frutti - Little Richard | Jive/ Rocknroll (Mittel),Jailhouse Rock - Elvis Presley | Jive/ Rocknroll (Schnell),Are you lonesome - Elvis Presley | walzer/slow (Langsam),Ay Mujer - Rey Ruiz | Cha cha cha (Mittel),Rico Vacilon - Pedro Garcia & His Del Prado Orchestra | Cha cha cha (Mittel),Jeepers creepers - Benny Goodmann | Foxtrott (Mittel),An der schönen blauen Donau - New 101 Strings Orchestra | Wiener Walzer (Schnell),The Last Waltz - Engelbert Humperdinck | Walzer (Mittel),Stand by me - Sam Brown | Cha cha cha (Lansam),Staiin' Alive - Begees | Discofox (Mittel),Easy On Me - Adele | Langsam (Langsam),Magia - Alvaro Soler | Flashmob (Mittel),Friday (feat. Mufasa & Hypeman) [Dopamine Re-Edit] - Riton & Nightcrawlers | Party (Mittel),YMCA - Village People | Party (Mittel),Cotton eyed Joe (Hennustall zermatt mix) - Rednex | Party (Mittel),Gangnam style - PSY | Party (Mittel),Take On Me - a-ha | Jive (Schnell),Rock Around the Clock - Bill Haley & His Comets | Jive/Rocknroll (Schnell),Satisfaction - Rolling Stones | Party (Mittel),"Un, dos, tres - Ricky Martin | Party (Mittel)",Party Rock anthem - LFMBQ | Party (Mittel),I don't care - Icona Pop | Party (Mittel),Love tonight - Shouse&David Guetta | Party (Mittel),Insomnia - Faithless | Party (Mittel),Angels - Robbie Williams | Slow (Langsam),Nothing compares to you - Sinead O'Connor | Slow (Langsam)
1 0 8
2 Tennessee Waltz - New 101 Strings Orchestra | Slow Walz Tennessee Waltz - New 101 Strings Orchestra | Slow Walz (lansam)

View File

@@ -99,8 +99,10 @@ class Main(MDScreen):
self.playmusic() self.playmusic()
elif self.key == "right": elif self.key == "right":
self.nextsong() self.nextsong()
elif self.key == "left": elif self.key == "up":
self.rewindsong() self.rewindsong()
elif self.key == "left":
self.previoussong()
else: else:
pass pass
@@ -130,6 +132,9 @@ class Main(MDScreen):
def rewindsong(self): def rewindsong(self):
self.others.value = 2 self.others.value = 2
def previoussong(self):
self.others.value = 4
def go_back(self): def go_back(self):
try: try:
self.mplayer.kill() self.mplayer.kill()
@@ -138,6 +143,17 @@ class Main(MDScreen):
self.manager.current = "Home" self.manager.current = "Home"
self.manager.transition.direction = "right" self.manager.transition.direction = "right"
def show_current_song(self):
self.__config = cvr.importing("./data/config.csv").pop(0)
self.__info = cvr.importing("./data/songtemp.csv")
self.__currents_imp = self.__info.pop(0)
self.__currents = int(self.__currents_imp.pop(0))
self.__upcoming = self.__info.pop(0)
self.__current = self.__upcoming.pop(self.__currents)
if self.__config == ["1"]:
self.ids.current_song.text = self.__current[:(len(self.__current) - 4)]
else:
self.ids.current_song.text = self.__current
class ShowcaseS(MDScreen): class ShowcaseS(MDScreen):
def screen_updater_start(self): def screen_updater_start(self):