Files
SubMusic/source/View/SubMusicMenuPlayback.mc
Memen 1f3fba2289 fixed settings storage having 0 Bytes
fixed some rare crashes on receiving invalid response
added setting to enable debug logging
removed default debug output (speed improvement)
2023-02-20 15:42:22 +01:00

47 lines
1.2 KiB
MonkeyC

using Toybox.WatchUi;
using SubMusic.Menu;
module SubMusic {
module Menu {
class Playback extends MenuBase {
function initialize() {
MenuBase.initialize(WatchUi.loadResource(Rez.Strings.confPlayback_Title), false);
}
function load() {
if ($.debug) {
System.println("Menu.Playback::load()");
}
return MenuBase.load([
new Menu.NowPlaying(),
{
LABEL => WatchUi.loadResource(Rez.Strings.confPlayback_PlayAll_label),
SUBLABEL => null,
METHOD => method(:onPlayAll),
},
new Menu.PlaylistsLocal(WatchUi.loadResource(Rez.Strings.playbackMenuTitle)),
new Menu.PodcastsLocal(WatchUi.loadResource(Rez.Strings.Podcasts_label)),
new Menu.More(),
new Menu.Settings(),
{
LABEL => WatchUi.loadResource(Rez.Strings.Donate_label),
SUBLABEL => null,
METHOD => method(:onDonate),
},
]);
}
// plays all songs
static function onPlayAll() {
var iplayable = new SubMusic.IPlayable();
iplayable.loadSongIds(SongStore.getIds());
Media.startPlayback(null);
}
static function onDonate() {
WatchUi.pushView(new DonateView(), new DonateDelegate(), WatchUi.SLIDE_IMMEDIATE);
}
}
}
}