From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Kost Newsgroups: gmane.emacs.help Subject: Re: Is it possible to display song durations in EMMS playlist? Date: Fri, 11 Jan 2019 22:32:49 +0300 Message-ID: <87va2vng66.fsf@gmail.com> References: <87ef9ltuj8.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1547235083 19062 195.159.176.226 (11 Jan 2019 19:31:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2019 19:31:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 11 20:31:19 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gi2WT-0004oV-H6 for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jan 2019 20:31:17 +0100 Original-Received: from localhost ([127.0.0.1]:60234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gi2Ya-0002Pt-6Z for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jan 2019 14:33:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gi2Xm-0002OJ-Kw for help-gnu-emacs@gnu.org; Fri, 11 Jan 2019 14:32:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gi2Xl-0003WT-Ub for help-gnu-emacs@gnu.org; Fri, 11 Jan 2019 14:32:38 -0500 Original-Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:44523) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gi2Xl-0003U4-IT for help-gnu-emacs@gnu.org; Fri, 11 Jan 2019 14:32:37 -0500 Original-Received: by mail-lj1-x22d.google.com with SMTP id k19-v6so13905512lji.11 for ; Fri, 11 Jan 2019 11:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=q+zMMNHqmN+UcYObEK85l3UIZo9n2bjtLA8KUuRWaxg=; b=B+Eyiezz/bGGk3GyfAt8JMOmawA2APkXWH4i3vc4//2i+Se7orphTSVcT9Ecd1mcW+ nDukFCutGMmFGvlZ4+8kdF7Uu2s5iz/7noHSosbCZ+pBQR23/Tm2uQXSOpe0aGElIRYN CaNUd7ee2/a5tBcfNvldjnnr87yXVSV4u0lqMHeBZPr0dZFG3kaQ0TUnfiAmcknUq62h 4CJg313Aa63ej9bNpp+hqwNzyyjgjNOBROpo4uVJe3j3zFl5jF/O2bPGhq3pw2veUNcv EiNKgMAg5k+4oIv/EPbIq3yfklyzHZYH0nPoB6Gr4WOV+xVQADV9p+qGrjyxLL/B2uNy dlxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=q+zMMNHqmN+UcYObEK85l3UIZo9n2bjtLA8KUuRWaxg=; b=NYJRphdZYT04rDTWsJbw95oAXy8FNK9ORXcb7l+1vA66g5LVz/Jiy8GajQZCb3ishW bkkVbNHOrog4CGUOJXPW8+Cyun/JQFTYeVDCfcBfuIUFQKdA+/l1wiEGSIRD84R+lTVq 5jmo4RgcuD6HuGY7dN6IPc/1n4U0JRBTKqeH7wB21ipZtwbf1AZ467T+m7CYpHPDbxFA 2dXPSfgtk9EixbbXVEnSB9TegOJeHZ25/i2fWSe+Rk8VYoNZML34cZ3lMKFxA61hrrdo k5wq9IWlDxuyclrXg/dfbBV455WEjzEbxVjBLLqcL28Nexzryrj/lt0msLby2y/RxiGU DD6Q== X-Gm-Message-State: AJcUukdXIWC7hSEaXtJZqdUPxGiKyqxV5BwP0P2WcvcKeGet8ipvwDSO 14m9+j2cUOWBzafDEGbZnzQ04PG4 X-Google-Smtp-Source: ALg8bN4xzaZV5/5HORdh3OGIeTOJBaEDctuHD2a063sJxXgVyGZRKt53gx6JfYyH1f7jnEvrz1Yqzw== X-Received: by 2002:a2e:2a06:: with SMTP id q6-v6mr7126847ljq.37.1547235154943; Fri, 11 Jan 2019 11:32:34 -0800 (PST) Original-Received: from leviafan ([217.107.194.9]) by smtp.gmail.com with ESMTPSA id q67sm14956867lfe.19.2019.01.11.11.32.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 11:32:34 -0800 (PST) In-Reply-To: <87ef9ltuj8.fsf@mbork.pl> (Marcin Borkowski's message of "Wed, 09 Jan 2019 22:01:31 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119107 Archived-At: --=-=-= Content-Type: text/plain Marcin Borkowski (2019-01-09 22:01 +0100) wrote: > Hi all, Hello, > I couldn't find anything in the manual, nor could I find any variable > suggesting this is possible. Is there something I missed? There is `emms-track-description-function' variable for this purpose. For example, you can add the playing time using the following code: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=emms-track-description.el Content-Transfer-Encoding: quoted-printable (defun my-emms-format-time (seconds) "Convert SECONDS into a human readable string." (let ((min (/ seconds 60)) (sec (% seconds 60))) (format "%d:%02d" min sec))) (defun my-emms-track-description (track) ;; Note that (require 'emms-info) is needed for this function, but ;; this feature is required automatically if you setup your EMMS with ;; (emms-all). (let ((time (emms-track-get track 'info-playing-time))) (concat (emms-info-track-description track) (when time (format " (%s)" (my-emms-format-time time)))))) (setq emms-track-description-function 'my-emms-track-description) --=-=-= Content-Type: text/plain -- Alex --=-=-=--