From 8bb93c3957421cd04f19acfe159ae28c05c8b641 Mon Sep 17 00:00:00 2001 From: simplePCBuilding <98422316+simplePCBuilding@users.noreply.github.com> Date: Wed, 9 Mar 2022 15:15:39 +0100 Subject: [PATCH] dev-0.1 --- bin/gui/gui.kv | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ musicplayer.py | 55 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 bin/gui/gui.kv create mode 100644 musicplayer.py diff --git a/bin/gui/gui.kv b/bin/gui/gui.kv new file mode 100644 index 0000000..f37ef3b --- /dev/null +++ b/bin/gui/gui.kv @@ -0,0 +1,62 @@ +RootScreen: + Home: + Main: + +: + title: "NOTICE!" + font_size: 50 + size_hint: 0.5, 0.4 + auto_dismiss: False + GridLayout: + cols:1 + Label: + text: "No path specified, unable to proceed" + font_size: 18 + Label: + text: "Please enter a path and try again" + font_size: 15 + Button: + text:"Ok" + on_release: + root.dismiss() + +: + name: "Home" + md_bg_color: app.theme_cls.accent_color + GridLayout: + cols: 1 + Label: + text: "MusicPlayer V1.0" + color: app.theme_cls.primary_color + font_size: 50 + bold: True + italic: True + FloatLayout: + GridLayout: + cols: 1 + pos_hint: {"x":0.05, "y":0.05} + size_hint: 0.9, 0.9 + FloatLayout: + MDTextField: + id: filepath + hint_text: "Path to Folder containing the Music files" + pos_hint: {"x":0.2, "y":0.5} + size_hint_x: 0.6 + Button: + text: "Start" + color: app.theme_cls.primary_color + font_size: 30 + bold: True + background_color: (0.5, 0.5, 0.5, 1) + on_release: + root.change_screen() + +
: + name: "Main" + GridLayout: + cols: 1 + Button: + text: "Back" + on_release: + app.root.current = "Home" + diff --git a/musicplayer.py b/musicplayer.py new file mode 100644 index 0000000..187dbfb --- /dev/null +++ b/musicplayer.py @@ -0,0 +1,55 @@ +import playsound as ps +import os +from kivy.uix.screenmanager import ScreenManager +from kivymd.uix.screen import MDScreen +from kivymd.app import MDApp +from kivy.base import Builder +from kivy.uix.popup import Popup + + +########### +# Popups +########### + + +class PathMissingPU(Popup): + pass + + +########### +# SCREENS +########### + + +class Home(MDScreen): + def change_screen(self): + if self.ids.filepath.text != "": + self.manager.current = "Main" + self.manager.transition.directio = "right" + else: + self.openpathmpu() + + def openpathmpu(self): + self.pmpu = PathMissingPU() + self.pmpu.open() + +class Main(MDScreen): + pass + + +class RootScreen(ScreenManager): + pass + + +class MusicPlayer(MDApp): + def build(self): + self.title = "MusicPlayer" + self.theme_cls.primary_palette = "Yellow" + self.theme_cls.accent_palette = "BlueGray" + # self.icon = "./BiogasControllerAppLogo.png" + return Builder.load_file("./bin/gui/gui.kv") + +if __name__ == "__main__": + MusicPlayer().run() + +# ps.playsound("/mnt/sda3/Music/Videos/Songs/Ancient.mp3")