From 4d28d444af32ddf4af5900786473fadacc43e4b1 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 19 Jan 2021 15:07:57 +0800 Subject: QoL changes. * bongo.el: Use header-line now. Try to improve the tick. * dired-conf.el: Require dired-x. * elisp.el: Hide Eldoc on the mode line. * text-conf.el (assq): Hide auto-fill-mode on the mode line. * modeline.el (modeline-format-left): Display minor modes information. (modeline-minor-modes-name-len-max): Max length of displayed minor modes. (modeline-format-minor-modes): Display minor modes information. (durand-mouse-minor-mode-menu): Make the default minor mode menu work with my custom mode line. * rime-conf.el ("emacs-rime"): Bind a key to set the input method to rime in the minibuffer, so that I can use this input method to search the buffer, for example. --- bongo.el | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'bongo.el') diff --git a/bongo.el b/bongo.el index f5ccd8c..623317a 100644 --- a/bongo.el +++ b/bongo.el @@ -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) @@ -255,6 +242,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.") -- cgit v1.2.3-18-g5258