dev-0.1
This commit is contained in:
62
bin/gui/gui.kv
Normal file
62
bin/gui/gui.kv
Normal file
@@ -0,0 +1,62 @@
|
||||
RootScreen:
|
||||
Home:
|
||||
Main:
|
||||
|
||||
<PathMissingPU>:
|
||||
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()
|
||||
|
||||
<Home>:
|
||||
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()
|
||||
|
||||
<Main>:
|
||||
name: "Main"
|
||||
GridLayout:
|
||||
cols: 1
|
||||
Button:
|
||||
text: "Back"
|
||||
on_release:
|
||||
app.root.current = "Home"
|
||||
|
||||
55
musicplayer.py
Normal file
55
musicplayer.py
Normal file
@@ -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")
|
||||
Reference in New Issue
Block a user