;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\301%\210\310\311\312\313\314DD\315\316\317\307\304&\210\310\320\312\313\321DD\322\316\317\307\304&\210\310\323\312\313\324DD\325\316\317\307\304&\210\310\326\312\313\327DD\330\316\317\307\304&\210\310\331\312\313\332DD\333\316\317\307\304&\210\310\334\312\313\335DD\336\316\317\307\304&\207" [require libmpdel mpdel-core custom-declare-group mpdel-song nil "Control MPD's current song." :group custom-declare-variable mpdel-song-small-increment funcall function #[0 "\300\207" [#1="+2"] 1 #1#] "Time to seek to slowly move forward." :type string mpdel-song-small-decrement #[0 "\300\207" [#2="-2"] 1 #2#] "Time to seek to slowly move backward." mpdel-song-normal-increment #[0 "\300\207" [#3="+10"] 1 #3#] "Time to seek to move forward." mpdel-song-normal-decrement #[0 "\300\207" [#4="-10"] 1 #4#] "Time to seek to move backward." mpdel-song-large-increment #[0 "\300\207" [#5="+30"] 1 #5#] "Time to seek to quickly move forward." mpdel-song-large-decrement #[0 "\300\207" [#6="-30"] 1 #6#] "Time to seek to quickly move backward."] 8) #@35 Song displayed by current buffer. (defvar mpdel-song-song nil (#$ . 1189)) (make-variable-buffer-local 'mpdel-song-song) #@132 Non-nil if buffer displays the current song. When non-nil, the buffer keeps showing the current song, even when the song changes. (defvar mpdel-song-current-song-p nil (#$ . 1317)) (byte-code "\300\301!\210\302\303\304\305\304\306%\210\302\307\304\310\304\311%\207" [make-variable-buffer-local mpdel-song-current-song-p cl-generic-define-method navigel-open nil ((song libmpdel-song) _target &context (navigel-app mpdel)) #[514 "\300!\207" [mpdel-song-open] 4 "\n\n(fn SONG TARGET)"] navigel-entity-at-point (&context (navigel-app mpdel) (major-mode mpdel-song-mode)) #[0 "\207" [mpdel-song-song] 1]] 6) #@41 Store timer to refresh the seek buffer. (defvar mpdel-song--timer nil (#$ . 1930)) #@22 Start refresh timer. (defalias 'mpdel-song--start-timer #[0 "?\205 \301\302\303\304p$\211\207" [mpdel-song--timer run-at-time t 1 mpdel-song-refresh] 5 (#$ . 2019)]) #@21 Stop refresh timer. (defalias 'mpdel-song--stop-timer #[0 "\205 \301!\210\302\211\207" [mpdel-song--timer cancel-timer nil] 2 (#$ . 2194)]) #@70 Seek TIME within current song and refresh current buffer. (fn TIME) (defalias 'mpdel-song--seek #[257 "\300!\207" [libmpdel-playback-seek] 3 (#$ . 2344)]) #@62 Give information about current play state and control timer. (defalias 'mpdel-song--display-play-state #[0 "\300 \211\301\267\202\302c\210\303 \207\304c\210\305 \207\306c\210\305 \207\307\207" [libmpdel-play-state #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (play 8 pause 14 stop 20)) "Currently playing\n" mpdel-song--start-timer "Currently paused\n" mpdel-song--stop-timer "Currently stopped\n" nil] 3 (#$ . 2507)]) #@62 Give information about current play time in DATA. (fn DATA) (defalias 'mpdel-song--display-play-time #[257 "\300\301\302\303\236A!\302\304\236A!#c\207" [format "%s / %s" libmpdel-time-to-string elapsed duration] 7 (#$ . 2974)]) #@47 Give information about current song metadata. (defalias 'mpdel-song--display-metadata #[0 "\301!\206\302\303!\206\302\304!\206\302\305\306$c\207" [mpdel-song-song libmpdel-entity-name "" libmpdel-album-name libmpdel-artist-name format "Title: %s\nArtist: %s\nAlbum: %s\n"] 9 (#$ . 3211)]) #@223 Write information about currently-played song in DATA to BUFFER. DATA is an alist returned by MPD server as answer to 'status'. In particular, it must contain key symbol `elapsed' and symbol `duration'. (fn DATA BUFFER) (defalias 'mpdel-song--refresh-current-song #[514 "r\211q\210\302\303 \210\304 \305 \210\306 \210\307!*\207" [inhibit-read-only mpdel-song-song t erase-buffer libmpdel-current-song mpdel-song--display-play-state mpdel-song--display-metadata mpdel-song--display-play-time] 4 (#$ . 3520)]) #@71 Write information about the song associated with BUFFER. (fn BUFFER) (defalias 'mpdel-song--refresh-non-current-song #[257 "r\211q\210\301\302 \210\303 *\207" [inhibit-read-only t erase-buffer mpdel-song--display-metadata] 2 (#$ . 4039)]) #@74 Refresh MPDEL seek BUFFER, current buffer if nil. (fn &optional BUFFER) (defalias 'mpdel-song-refresh #[256 "r\211\206pq\210\203\301\302\303\304\"\"\202\305p!)\207" [mpdel-song-current-song-p libmpdel-send-command "status" make-closure #[257 "\301\300\"\207" [V0 mpdel-song--refresh-current-song] 4 "\n\n(fn DATA)"] mpdel-song--refresh-non-current-song] 6 (#$ . 4286) nil]) #@245 Open a buffer to display information about SONG. If SONG is nil, use current song instead. When SONG is nil, the buffer updates itself to keep showing latest song. Additionally, the buffer lets the user control playback. (fn &optional SONG) (defalias 'mpdel-song-open #[256 "\211?\302\203 \303\202\304\305\306!\"!\307\310\"\206\311 rq\210\312 \210\211\313!\210\203E\314\315\"\210\314\316\317\320\321$\210\314\316\307\322\"\320\321$\210\323p!)\207" [mpdel-song-song mpdel-song-current-song-p get-buffer-create "*MPDEL Current Song*" format "*MPDEL Song: %s*" libmpdel-entity-name make-closure #[0 "\301\300!\207" [V0 mpdel-song-refresh] 2] libmpdel-current-song mpdel-song-mode mpdel-song-refresh add-hook libmpdel-player-changed-hook kill-buffer-hook mpdel-song--stop-timer nil t #[0 "\301\302\300\"\207" [V0 remove-hook libmpdel-player-changed-hook] 3] pop-to-buffer] 10 (#$ . 4677) nil]) (define-key mpdel-core-map "v" 'mpdel-song-open) #@47 Start playing the song of the current buffer. (defalias 'mpdel-song-play #[0 "\301!\207" [mpdel-song-song libmpdel-play-song] 2 (#$ . 5643) nil]) #@206 Quit window and kill its buffer. Killing the buffer instead of just burrying it is important when displaying current song: this is because the buffer keeps refreshing itself to display playback position. (defalias 'mpdel-song-quit-window #[0 "\300\301!\207" [quit-window t] 2 (#$ . 5797) nil]) #@65 Move forward by value of variable `mpdel-song-small-increment'. (defalias 'mpdel-song-small-increment #[0 "\301!\207" [mpdel-song-small-increment mpdel-song--seek] 2 (#$ . 6098) nil]) (define-key mpdel-core-map "F" 'mpdel-song-small-increment) #@66 Move forward by value of variable `mpdel-song-normal-increment'. (defalias 'mpdel-song-normal-increment #[0 "\301!\207" [mpdel-song-normal-increment mpdel-song--seek] 2 (#$ . 6349) nil]) (define-key mpdel-core-map "f" 'mpdel-song-normal-increment) #@65 Move forward by value of variable `mpdel-song-large-increment'. (defalias 'mpdel-song-large-increment #[0 "\301!\207" [mpdel-song-large-increment mpdel-song--seek] 2 (#$ . 6604) nil]) (define-key mpdel-core-map [134217830] 'mpdel-song-large-increment) #@66 Move backward by value of variable `mpdel-song-small-decrement'. (defalias 'mpdel-song-small-decrement #[0 "\301!\207" [mpdel-song-small-decrement mpdel-song--seek] 2 (#$ . 6863) nil]) (define-key mpdel-core-map "B" 'mpdel-song-small-decrement) #@67 Move backward by value of variable `mpdel-song-normal-decrement'. (defalias 'mpdel-song-normal-decrement #[0 "\301!\207" [mpdel-song-normal-decrement mpdel-song--seek] 2 (#$ . 7115) nil]) (define-key mpdel-core-map "b" 'mpdel-song-normal-decrement) #@66 Move backward by value of variable `mpdel-song-large-decrement'. (defalias 'mpdel-song-large-decrement #[0 "\301!\207" [mpdel-song-large-decrement mpdel-song--seek] 2 (#$ . 7371) nil]) (define-key mpdel-core-map [134217826] 'mpdel-song-large-decrement) #@34 Keybindgs for `mpdel-song-mode'. (defvar mpdel-song-mode-map (byte-code "\302 \303\304 \"\"\210\305\306\307#\210\305\310\311#\210\305\312\313#\210\207" [mpdel-core-map special-mode-map make-sparse-keymap set-keymap-parent make-composed-keymap define-key "g" mpdel-song-refresh "p" mpdel-song-play "q" mpdel-song-quit-window] 6) (#$ . 7631)) (defvar mpdel-song-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [mpdel-song-mode-hook variable-documentation put "Hook run after entering MPDEL song mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp mpdel-song-mode-map definition-name mpdel-song-mode] 4) (defvar mpdel-song-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [mpdel-song-mode-abbrev-table mpdel-song-mode-map variable-documentation put purecopy "Keymap for `mpdel-song-mode'." boundp mpdel-song-mode-syntax-table definition-name mpdel-song-mode (lambda (#1=#:def-tmp-var) (defvar mpdel-song-mode-syntax-table #1#)) make-syntax-table "Syntax table for `mpdel-song-mode'." (lambda (#1#) (defvar mpdel-song-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `mpdel-song-mode'." derived-mode-parent special-mode] 5) #@246 Guide the user to seek inside current song. In addition to any hooks its parent mode `special-mode' might have run, this mode runs the hook `mpdel-song-mode-hook', as the final or penultimate step during initialization. \{mpdel-song-mode-map} (defalias 'mpdel-song-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2035\211\321 =\203;\322\f\323 \"\210\210\324 \325\"\204R =\204R\326 \325C#\210\327 !\210\330\f!\210 \306\331!\210\332)\333\334!\207" [delay-mode-hooks major-mode mode-name mpdel-song-mode-map mpdel-song-mode-syntax-table mpdel-song-mode-abbrev-table make-local-variable t special-mode mpdel-song-mode "MPDEL song" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table navigel-app mpdel run-mode-hooks mpdel-song-mode-hook local-abbrev-table] 5 (#$ . 9185) nil]) (provide 'mpdel-song)