(unless (fboundp 'buffer-local-value)
(defun buffer-local-value (var buf)
(with-current-buffer buf (symbol-value var))))
-
+
;;; Main code starts here.
(not (member (setq val (cdr elem)) res)))
(push val res)))
(nreverse res)))
-
+
(defun mpc-union (&rest lists)
(let ((res (nreverse (pop lists))))
(dolist (list lists)
(sort song-poss '>))))
(if (stringp playlist)
(puthash (cons 'Playlist playlist) nil mpc--find-memoize)))
-
+
(defun mpc-cmd-move (song-poss dest-pos &optional playlist)
(let ((i 0))
(setq col (+ col size))))))
(put-text-property start (point) 'mpc-pred
`(lambda (info) (and ,@(nreverse pred))))))
-
+
;;; The actual UI code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar mpc-mode-map
(overlay-put ol 'face 'region)
(overlay-put ol 'evaporate t)
(set (make-local-variable 'mpc-tagbrowser-all-ol) ol))))))
-
+
;; (defvar mpc-constraints nil)
(defun mpc-separator (active)
;; Place a separator mark.
(cond
((member name active) (concat "1" name))
(t (concat "2" "name"))))))))))
-
+
(defvar mpc--changed-selection)
(defun mpc-reorder (&optional nodeactivate)
(cdr cst)))))
(setq active
(if (listp active) (mpc-intersection active vals) vals))))
-
+
(when (and (listp active))
;; Remove the selections if they are all in conflict with
;; other constraints.
nil x))
new)))))
(mpc-tagbrowser-refresh)))
-
+
;;; Playlist management ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when (buffer-local-value 'mpc-tag buf)
(with-current-buffer buf (mpc-reorder))))
(mpc-songs-refresh))))
-
+
(defun mpc-songs-kill-search ()
"Turn off the current search restriction."
(interactive)
follow-link t
mouse-face mode-line-highlight
keymap (keymap (mode-line keymap (mouse-2 . mpc-songs-search)))))))
-
+
;; (set (make-local-variable 'mode-line-process)
;; '("" ;; mpc-volume " "
;; mpc-songs-totaltime
(mapc 'kill-buffer bufs)
(mpc-status-stop)
(if proc (delete-process proc))))
-
+
(defun mpc-stop ()
"Stop playing the current queue of songs."
(interactive)
(lambda ()
(let ((newsongid (cdr (assq 'songid mpc-status)))
(newsongnb (cdr (assq 'song mpc-status))))
-
+
(if (and (equal prevsongid newsongid)
(not (equal prevsongid songid)))
;; We left prevsongid and came back to it. Pretend it
;; didn't happen.
(setq newsongid songid))
-
+
(cond
((null newsongid) (mpc--faster-stop))
((not (equal songid newsongid))
(interactive (list last-nonmenu-event))
;; (mpc--faster event 4.0 1)
(mpc--faster-toggle mpc-faster-speedup 1))
-
+
(defun mpc-rewind (event)
"Fast rewind."
(interactive (list last-nonmenu-event))
;; (mpc--faster event 4.0 -1)
(mpc--faster-toggle mpc-faster-speedup -1))
-
-
+
+
(defun mpc-play-at-point (&optional event)
(interactive (list last-nonmenu-event))
(mpc-select event)