enhancements for the rktplayer

This commit is contained in:
2026-04-28 22:20:36 +02:00
parent f2ae0821d3
commit 042047a355
4 changed files with 20 additions and 13 deletions
+4 -2
View File
@@ -116,7 +116,8 @@
(define current-track-nr #f)
(define (update-track-nr nr)
(unless (eq? playlist #f)
(unless (or (eq? playlist #f)
(= (send playlist length) 0))
(dbg-rktplayer "update-track-nr ~a" nr)
(let ((id (λ () (send playlist track-id current-track-nr))) ;string->symbol (format "track-~a" (+ current-track-nr 1)))))
(ct current-track-nr))
@@ -537,7 +538,8 @@
(update-track-nr #f))
(define/public (play-track idx)
(send player play-track idx))
(unless (= (send playlist length) 0)
(send player play-track idx)))
(define/public (pause)
(send player pause-unpause))
+3 -1
View File
@@ -1,5 +1,7 @@
#lang racket
(require racket-sound)
(provide music-lib-relevant?
is-music-dir?
is-music-file?
@@ -14,7 +16,7 @@
(not (string-prefix? name ".")))
(if (eq? type 'file)
(let* ((fn (string-downcase (format "~a" f)))
(exts (list "flac" "mp3")))
(exts (audio-supported-extensions)))
(let ((l (filter (λ (e) (string-suffix? fn (string-append "." e))) exts)))
(not (null? l))))
#f))))
+2
View File
@@ -266,6 +266,7 @@
)
(define/public (play-track i)
(unless (= (send pl length) 0)
(dbg-rktplayer "play-track ~a" i)
(set! state 'stopped)
(close-player*)
@@ -277,6 +278,7 @@
(track-nr-updater track)
(dbg-rktplayer "track-nr-updater called")
)
)
(define/public (stop)
(stop-and-clear)
+1
View File
@@ -377,6 +377,7 @@
(if (< i N)
(cons (list (send this track-id i) i) (f (+ i 1) N))
'()))))
(dbg-rktplayer "Number of rows in playlist: ~a" (send this length))
(let ((rows (f 0 (send this length))))
(mktable rows 'tracks formatter))))