emacs stuff
This commit is contained in:
@@ -130,7 +130,7 @@
|
||||
;;;; font/zoom
|
||||
(setq doom-font (font-spec
|
||||
;:family "Hack Mono"
|
||||
:size 22 :weight 'regular))
|
||||
:size 23 :weight 'regular))
|
||||
|
||||
|
||||
;;; have authinfo file in my $SECRETS_DIR
|
||||
@@ -149,10 +149,90 @@
|
||||
|
||||
;;; supersonic
|
||||
(after! supersonic
|
||||
;;(setq supersonic-host "https://tunes.c2vi.dev")
|
||||
(customize-set-variable 'supersonic-host "https://tunes.c2vi.dev")
|
||||
)
|
||||
|
||||
|
||||
;;; emms
|
||||
(use-package! emms
|
||||
:config
|
||||
(emms-all) ;; Loads stable EMMS features
|
||||
(setq emms-source-file-default-directory "~/work/music/"
|
||||
emms-player-list '(emms-player-vlc))
|
||||
)
|
||||
|
||||
;;; infrasonic
|
||||
(use-package! infrasonic)
|
||||
(defvar my-subsonic-client
|
||||
(infrasonic-make-client :url "tunes.c2vi.dev")
|
||||
)
|
||||
(defun my-play-playlist (playlist-id)
|
||||
"Fetch a Subsonic playlist by PLAYLIST-ID using infrasonic.el and load it into EMMS."
|
||||
(interactive "sEnter Subsonic Playlist ID: ")
|
||||
(message "Fetching Subsonic playlist %s..." playlist-id)
|
||||
|
||||
(let* (
|
||||
(playlist-id "6I9sKLo2NfnyzdtShKwreO")
|
||||
(playlist (infrasonic-get-playlist
|
||||
my-subsonic-client
|
||||
playlist-id
|
||||
))
|
||||
(entries (cdr (assoc 'entry playlist)))
|
||||
(track-count 0)
|
||||
)
|
||||
|
||||
(dolist (track entries)
|
||||
(let* (
|
||||
(track-id (cdr (assoc 'id track)))
|
||||
(stream-url (infrasonic-get-stream-url my-subsonic-client track-id))
|
||||
)
|
||||
;(emms-add-url stream-url)
|
||||
;(emms-add-track
|
||||
;(emms-track 'url stream-url))
|
||||
;(setq track-count (1+ track-count))
|
||||
;(emms-playlist-select-first)
|
||||
;(emms-start)
|
||||
)
|
||||
)
|
||||
entries
|
||||
(infrasonic-get-stream-url my-subsonic-client "7id7XzpofiHmnJPqfORA0O")
|
||||
)
|
||||
|
||||
(lambda (playlist-data)
|
||||
;; This callback executes on a successful API response
|
||||
(let*
|
||||
(
|
||||
|
||||
;; Ensure EMMS is ready and clear old queue if desired
|
||||
(emms-playlist-ensure-playlist-buffer)
|
||||
|
||||
;; 3. Loop through every track returned by the API
|
||||
(dolist (track entries)
|
||||
(let* ((track-id (plist-get track :id))
|
||||
;; Generate the authenticated streaming URL using infrasonic
|
||||
(stream-url (infrasonic-stream-url client track-id)))
|
||||
|
||||
;; 4. Insert the URL track directly into the EMMS track ecosystem
|
||||
(emms-add-track
|
||||
(emms-track 'url stream-url))
|
||||
(setq track-count (1+ track-count))))
|
||||
|
||||
(message "Successfully loaded %d tracks into EMMS from playlist!" track-count)
|
||||
|
||||
;; 5. Start playback immediately if nothing is playing
|
||||
(unless emms-player-playing-p
|
||||
(emms-playlist-select-first)
|
||||
(emms-start))))
|
||||
|
||||
;; Error callback handling
|
||||
(lambda (error-data)
|
||||
(error "Infrasonic playlist fetch failed: %S" error-data)))
|
||||
)
|
||||
(defun my-play-work () (interactive)(my-play-playlist "6I9sKLo2NfnyzdtShKwreO"))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;;; scratch
|
||||
(defun my/scratch ()
|
||||
@@ -160,6 +240,17 @@
|
||||
(lookup-key corfu-map (kbd "C-i"))
|
||||
(define-key corfu-map (kbd "C-i") 'my/corfu-insert-first)
|
||||
|
||||
(plz 'get "https://tunes.c2vi.dev")
|
||||
(infrasonic-get-playlist
|
||||
my-subsonic-client
|
||||
"6I9sKLo2NfnyzdtShKwreO"
|
||||
)
|
||||
(infrasonic-ping my-subsonic-client)
|
||||
(infrasonic-api-call my-subsonic-client "ping" nil (lambda () (message "hi")) (lambda (e) (message e)))
|
||||
(shell-command-to-string "curl https://tunes.c2vi.dev")
|
||||
|
||||
(emms-play-url "https://tunes.c2vi.dev/rest/stream.view?u=c2vi&t=618e0d04594b0e72c865d7989b6dad38&s=5b08708ee057af16caab55db98c3dd03&v=1.16.1&c=infrasonic&f=json&id=7id7XzpofiHmnJPqfORA0O")
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
(package! obsidian)
|
||||
(package! empv)
|
||||
(package! f)
|
||||
(package! emms)
|
||||
(package! infrasonic
|
||||
:recipe (:host github :repo "kaibagley/infrasonic")
|
||||
:pin "134dff93c19d6862768c68d5981c59e084d48760"
|
||||
)
|
||||
|
||||
(package! supersonic
|
||||
:recipe (:host github :repo "systemfreund/supersonic.el" )
|
||||
|
||||
@@ -5,6 +5,5 @@ hostname = "mac"
|
||||
ips = ["192.168.4.3"]
|
||||
port = 4410
|
||||
position = "right"
|
||||
activate_on_startup = true
|
||||
|
||||
[authorized_fingerprints]
|
||||
|
||||
@@ -1 +1 @@
|
||||
224184
|
||||
591144
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user