playlist timer pause/resume without affecting active feeds

This commit is contained in:
Dmitry Sergeev
2026-09-01 22:32:19 +03:00
parent b0e7bc4cc3
commit ca25bf88a7
11 changed files with 371 additions and 28 deletions
+26
View File
@@ -753,6 +753,21 @@ func main() {
if cimgui.Button("Next##playlist") && !playlistRuntime.Next() {
log.Print("playlist command queue is full")
}
if hasPlaylistSnapshot &&
playlistSnapshot.State.HasSelection &&
playlistSnapshot.Entry.Duration > 0 &&
!playlistSnapshot.Timing.Expired {
cimgui.SameLine()
if playlistSnapshot.Timing.Paused {
if cimgui.Button("Resume timer##playlist") &&
!playlistRuntime.Resume() {
log.Print("playlist command queue is full")
}
} else if cimgui.Button("Pause timer##playlist") &&
!playlistRuntime.Pause() {
log.Print("playlist command queue is full")
}
}
if hasPlaylistSnapshot && playlistSnapshot.State.HasSelection {
entry := playlistSnapshot.Entry
@@ -786,6 +801,17 @@ func main() {
switch {
case entry.Duration == 0:
cimgui.Text("Timing: manual advance")
case playlistSnapshot.Timing.Paused:
fraction, remaining := playlistTimingProgress(
playlistSnapshot.Timing,
time.Now(),
)
cimgui.Text("Timing: paused")
cimgui.ProgressBarV(
fraction,
cimgui.Vec2{X: -1, Y: 0},
remaining.Round(time.Second).String(),
)
case playlistSnapshot.Timing.Started:
fraction, remaining := playlistTimingProgress(
playlistSnapshot.Timing,