From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 208.118.235.0/24 X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: dtas-all@80x24.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 5B99220443 for ; Fri, 27 Nov 2015 11:34:45 +0000 (UTC) Received: from localhost ([::1]:55974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2HIa-0003RT-KZ for dtas-all@80x24.org; Fri, 27 Nov 2015 06:34:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2HI6-0002oQ-Kg for dtas-all@nongnu.org; Fri, 27 Nov 2015 06:34:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2HI2-0005A7-Lo for dtas-all@nongnu.org; Fri, 27 Nov 2015 06:34:14 -0500 Received: from dcvr.yhbt.net ([64.71.152.64]:47327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2HI2-00057j-H7 for dtas-all@nongnu.org; Fri, 27 Nov 2015 06:34:10 -0500 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CE0D5203F8; Fri, 27 Nov 2015 11:34:08 +0000 (UTC) Date: Fri, 27 Nov 2015 11:34:08 +0000 From: Eric Wong To: Rene Maurer Subject: Re: Output the filename of the current playing song Message-ID: <20151127113408.GA11770@dcvr.yhbt.net> References: <20151127113317.21e820ad@loco5> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151127113317.21e820ad@loco5> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.71.152.64 Cc: dtas-all@nongnu.org X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+dtas-all=80x24.org@nongnu.org Sender: dtas-all-bounces+dtas-all=80x24.org@nongnu.org Rene Maurer wrote: > Hello > > I am really very happy using dtas. There are some minor things I miss. > One thing is a shortcut to get the filename of the current playing song. > For example something like this: > > # COMMANDS > > * current song [FILENAME] - output the filename of the current playing > song or the song at the top if the queue in case the player is > paused. If FILENAME is specified, the output is written to that file. Great to know you're still using it! You can use "dtas-ctl current" and parse the YAML output. Perhaps something along the lines of: #!/usr/bin/env ruby require 'yaml' x = YAML.load `dtas-ctl current` if cur = x['current'] puts cur['infile'] elsif x['paused'] x = YAML.load `dtas-ctl queue cat` puts Array(x[0])[0] end Fwiw, I never intended the current player protocol to be used much; but was planning on writing an MPRIS proxy to talk to dtas-player and encourage users to use existing MPRIS clients instead... However, MPRIS seems to be a dead-end for text-only clients; while mpd has a strong following. So I'll probably start work on an mpd protocol proxy over holidays, so we'll have a lot more clients able to use the playback features dtas-player. Of course, the editing/effects features of dtas will only be available via the dtas-player protocol, but the MPD-compatible library will be able to play YAML files intended for dtas-splitfx (or anything dtas-player understands).