diff options
Diffstat (limited to 'bongo.el')
-rw-r--r-- | bongo.el | 40 |
1 files changed, 24 insertions, 16 deletions
@@ -3,6 +3,7 @@ (use-package "bongo" 'bongo (require 'json) + (setq bongo-track-mark-icon-file-name nil) (setq volume-electric-mode nil) (setq bongo-default-directory (expand-file-name "~/Desktop/Centre/Musique")) (setq bongo-prefer-library-buffers nil) @@ -15,8 +16,8 @@ (setq bongo-display-playback-mode-indicator t) (setq bongo-display-inline-playback-progress nil) (setq bongo-mark-played-tracks nil) - (setq bongo-header-line-mode nil) - (setq bongo-header-line-function nil) + (setq bongo-header-line-mode t) + (setq bongo-header-line-function #'bongo-default-header-line-function) (setq bongo-mode-line-indicator-mode nil) (setq bongo-enabled-backends '(mpv)) (setq bongo-seek-electric-mode nil) @@ -67,20 +68,6 @@ This is used since my music directories used to contain symbolic links.") (add-hook 'dired-mode-hook #'durand-bongo-dired-library) - ;; (map! :map durand-view-map - ;; [?m] 'bongo - ;; :map bongo-dired-library-mode-map - ;; [?\C-j] 'durand-bongo-dired-ivy-find-to-add - ;; [?\C-c ?n] 'durand-bongo-play-next-or-first - ;; [?\C-c ?p] 'durand-bongo-play-previous-or-last - ;; :map bongo-playlist-mode-map - ;; [?n] 'bongo-next-object-line - ;; [?p] 'bongo-previous-object-line - ;; [?j] 'durand-bongo-save-playlist - ;; "TAB" #'bongo-show - ;; [?\C-c ?n] 'durand-bongo-play-next-or-first - ;; [?\C-c ?p] 'durand-bongo-play-previous-or-last) - ;; seek mode map additions (define-key bongo-seek-mode-map [?t] 'bongo-seek-to) @@ -256,6 +243,27 @@ convention is changed." (advice-add #'bongo-compose-remote-option :override 'durand-bongo-compose-remote-option) ;;;###autoload + (defun durand-bongo-mpv-player-tick (player) + "Only fetch metadata and length of track if not fetched already. + +Afterwards just stop the annoying timer." + (let ((timer (bongo-player-get player 'timer))) + (cond + ;; ((or (not (bongo-player-running-p player)) + ;; (and (bongo-player-get player 'socket) + ;; (not (equal (process-status (bongo-player-get player 'socket)) + ;; 'open)))) + ;; (bongo-mpv-player-stop-timer player)) + ((null (bongo-player-total-time player)) + (bongo--run-mpv-command player "duration" "get_property" "duration")) + ;; ((null (bongo-player-get player 'metadata-fetched)) + ;; (bongo--run-mpv-command player "metadata" "get_property" "metadata")) + (t (bongo-mpv-player-stop-timer player))))) + +;;;###autoload + ;; (advice-add #'bongo-mpv-player-tick :override #'durand-bongo-mpv-player-tick) + +;;;###autoload (defvar durand-bongo-save-playlist-hist nil "A variable that holds the history values for saving playlist names.") |