Make dict of wake up sounds a separate file
1
clock.kv
|
@ -117,7 +117,6 @@
|
|||
id: settings_menu_wake_up_sound_select_button
|
||||
on_press: root.settings_menu_wake_up_sound_select_button_cb()
|
||||
font_size: root.height*0.05
|
||||
text: str(app.alarm_settings.sound_selected)
|
||||
color: root.theme.color_font
|
||||
background_normal: ''
|
||||
background_color: root.theme.color_button
|
||||
|
|
17
clock.py
|
@ -9,6 +9,7 @@ import os
|
|||
from kivy.config import Config
|
||||
from kivy.properties import ObjectProperty
|
||||
import time
|
||||
from sounds import WakeUpSounds
|
||||
|
||||
def is_arm():
|
||||
if (os.uname()[4][:3] == 'arm') or (os.uname()[4][:7] == 'aarch64'):
|
||||
|
@ -131,10 +132,6 @@ class AlarmSettings():
|
|||
|
||||
alarm_modified = False
|
||||
|
||||
# sound_selected = "NPO Radio 1"
|
||||
# sound_source = "https://icecast.omroep.nl/radio1-bb-mp3"
|
||||
sound_selected = "Birds"
|
||||
sound_source = "Woodpecker Chirps - QuickSounds.com.mp3"
|
||||
seconds_to_sunrise = 30 * 60 # 30 minutes
|
||||
|
||||
volume = 15
|
||||
|
@ -1175,10 +1172,11 @@ class MyApp(App):
|
|||
cols=2,
|
||||
)
|
||||
|
||||
clock_widget.wake_up_sounds = {
|
||||
"Birds": "Woodpecker Chirps - QuickSounds.com.mp3",
|
||||
"NPO Radio 1": "https://icecast.omroep.nl/radio1-bb-mp3"
|
||||
}
|
||||
clock_widget.wake_up_sounds = WakeUpSounds
|
||||
|
||||
self.alarm_settings.sound_selected = next(iter(clock_widget.wake_up_sounds))
|
||||
self.alarm_settings.sound_source = clock_widget.wake_up_sounds[self.alarm_settings.sound_selected]
|
||||
clock_widget.ids["settings_menu_wake_up_sound_select_button"].text = self.alarm_settings.sound_selected
|
||||
|
||||
clock_widget.wake_up_sound_checkboxes = []
|
||||
clock_widget.wake_up_sound_labels = []
|
||||
|
@ -1187,6 +1185,7 @@ class MyApp(App):
|
|||
for w in clock_widget.wake_up_sounds:
|
||||
c = CheckBox(
|
||||
group = "settings_menu_wake_up_sound",
|
||||
size = [gl.size[0] * 0.1, gl.size[1]],
|
||||
)
|
||||
c.bind(active=clock_widget.settings_menu_wake_up_sound_cb)
|
||||
gl.add_widget(c)
|
||||
|
@ -1201,7 +1200,7 @@ class MyApp(App):
|
|||
text = w,
|
||||
halign = "left",
|
||||
valign = "middle",
|
||||
size = [c.size[0] * 2.88, c.size[1]],
|
||||
size = [gl.size[0] * 2.5, c.size[1]],
|
||||
text_size = Window.size,
|
||||
font_size = Window.height*0.05,
|
||||
color = clock_widget.theme.color_font,
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
WakeUpSounds = {
|
||||
"Birds": "Woodpecker Chirps - QuickSounds.com.mp3",
|
||||
"NPO Radio 1": "https://icecast.omroep.nl/radio1-bb-mp3",
|
||||
"QMusic Non Stop": "https://icecast-qmusicnl-cdp.triple-it.nl/Qmusic_nl_nonstop_high.aac?aw_0_1st.playerId=redirect",
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |