-import sys
-import pygame
-import helpers
-import threading
-
-pygame.mixer.pre_init(frequency = 44100)
-pygame.init()
-
-size = width, height = 1024, 600
-screen = pygame.display.set_mode(size)
-screen.fill((250, 250, 250))
-
-draw_lock = helpers.Lock("draw")
-
-mapping = helpers.Mapping(screen, draw_lock)
-helpers.parse_config(mapping)
+from kivy.app import App
+from kivy.uix.floatlayout import FloatLayout
+from kivy.uix.relativelayout import RelativeLayout
+from kivy.properties import ListProperty, StringProperty
+from kivy.clock import Clock
+from kivy.core.window import Window
+
+from helpers.key import Key
+from helpers.mapping import Mapping
+
+class PlayList(RelativeLayout):
+ playlist = ListProperty([])
+
+ def __init__(self, **kwargs):
+ super(PlayList, self).__init__(**kwargs)
+ Clock.schedule_interval(self.update_playlist, 0.5)
+
+ def update_playlist(self, dt):
+ if self.parent is None or 'Mapping' not in self.parent.ids:
+ return True
+
+ open_files = self.parent.ids['Mapping'].open_files
+ self.playlist = []
+ for music_file in open_files.values():
+ if not music_file.is_playing():
+ continue
+ if music_file.is_paused():
+ self.playlist.append(["⏸", music_file.name, False])
+ else:
+ self.playlist.append(["⏵", music_file.name, True])