from kivy.properties import ListProperty, StringProperty
from kivy.clock import Clock
from kivy.core.window import Window
-
+from kivy.lang import Builder
from helpers.key import Key
from helpers.mapping import Mapping
+import sys
+
+if getattr(sys, 'frozen', False):
+ Builder.load_file(sys._MEIPASS + '/musicsampler.kv')
+
class PlayList(RelativeLayout):
playlist = ListProperty([])
#:import math math
+#:import h helpers
<Key>:
pad_col_sep: 0 if not self.pad_cols else self.parent.pad_x
width: self.line_width
Label:
id: key_label
- font_name: "fonts/Ubuntu-B.ttf"
+ font_name: h.path() + "fonts/Ubuntu-B.ttf"
font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size))
color: 0, 0, 0, 1
text: self.parent.key_sym
center_y: self.parent.y + self.parent.height - self.texture_size[1] /2 - 5
Label:
id: key_description_title
- font_name: "fonts/Ubuntu-Regular.ttf"
+ font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2))
color: 0, 0, 0, 1
text: self.parent.description_title
center_y: self.parent.y + self.parent.height - self.texture_size[1] /2 - 5
Label:
id: key_description
- font_name: "fonts/Ubuntu-Regular.ttf"
+ font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2))
color: 0, 0, 0, 1
text: "\n".join(self.parent.description)
size: self.width, self.height
Label:
id: action_list_title
- font_name: "fonts/Ubuntu-B.ttf"
+ font_name: h.path() + "fonts/Ubuntu-B.ttf"
font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
color: 0, 0, 0, 1
text: self.parent.action_title
size: self.texture_size[0], self.parent.height
Label:
id: action_list_icons
- font_name: "fonts/Symbola.ttf"
+ font_name: h.path() + "fonts/Symbola.ttf"
font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
line_height: 1.2 # FIXME: Donner la bonne taille de label
color: 0, 0, 0, 1
size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size
Label:
id: action_list_names
- font_name: "fonts/Ubuntu-Regular.ttf"
+ font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
color: 0, 0, 0, 1
text: "\n".join(map(lambda x: x[1], self.parent.action_list))
size: self.width, self.height
Label:
id: playlist_icons
- font_name: "fonts/Symbola.ttf"
+ font_name: h.path() + "fonts/Symbola.ttf"
font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
line_height: 1.2 # FIXME: Donner la bonne taille de label
color: 0, 0, 0, 1
size: self.texture_size[0], self.parent.height
Label:
id: playlist_names
- font_name: "fonts/Ubuntu-Regular.ttf" # FIXME: Mettre en gras quand c'est en cours
+ font_name: h.path() + "fonts/Ubuntu-Regular.ttf" # FIXME: Mettre en gras quand c'est en cours
font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
color: 0, 0, 0, 1
text: "\n".join(map(lambda x: x[1], self.parent.playlist))