mirror of
https://github.com/memen45/SubMusic.git
synced 2026-12-05 04:57:28 +01:00
added playables to store state in between sessions added shuffle to stored state added shuffle option to playlist options added podcast mode to play with persistent playback position
39 lines
840 B
MonkeyC
39 lines
840 B
MonkeyC
using Toybox.WatchUi;
|
|
using SubMusic.Menu;
|
|
|
|
module SubMusic {
|
|
module Menu {
|
|
class NowPlaying extends SongsLocal {
|
|
|
|
function initialize() {
|
|
SongsLocal.initialize(
|
|
Rez.Strings.confPlayback_NowPlaying_title,
|
|
SubMusic.NowPlaying.getPlayable().getSongIds()
|
|
);
|
|
}
|
|
}
|
|
|
|
class NowPlayingView extends MenuView {
|
|
function initialize() {
|
|
MenuView.initialize(new NowPlaying());
|
|
}
|
|
}
|
|
|
|
class NowPlayingDelegate extends SongsLocalDelegate {
|
|
function initialize() {
|
|
SongsLocalDelegate.initialize();
|
|
}
|
|
|
|
// @Override
|
|
function onSongSelect(item) {
|
|
var songid = item.getId();
|
|
|
|
// start playback with new songid
|
|
var playable = SubMusic.NowPlaying.getPlayable();
|
|
playable.setSongId(songid);
|
|
SubMusic.NowPlaying.setPlayable(playable);
|
|
Media.startPlayback(null);
|
|
}
|
|
}
|
|
}
|
|
} |