From 59ca3ba986e1f872d851b9b6ce588e20d8020243 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 9 Sep 2013 04:12:29 +0000 Subject: player: implement basic tracklist functionality This should allow us to repeat through a list of tracks with relative ease. There is a rudimentary dtas-tl client implemented. This may be removed in the future. --- bin/dtas-tl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 bin/dtas-tl (limited to 'bin/dtas-tl') diff --git a/bin/dtas-tl b/bin/dtas-tl new file mode 100755 index 0000000..cbe1b83 --- /dev/null +++ b/bin/dtas-tl @@ -0,0 +1,25 @@ +#!/usr/bin/env ruby +# Copyright (C) 2013, Eric Wong and all contributors +# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) +require 'dtas/unix_client' +require 'yaml' +require 'shellwords' + +c = DTAS::UNIXClient.new +case cmd = ARGV[0] +when "cat" + track_ids = c.req("tl tracks") + # we could get more, but SEQPACKET limits size... + track_ids.split(/ /).each do |track_id| + puts c.req("tl get #{track_id}") + end +when "add-all" + ARGV.shift + ARGV.reverse.each do |path| + res = c.req_ok("tl add #{path}") + puts "#{path} #{res}" + end +else + # act like dtas-ctl for now... + puts c.req([ "tl", *ARGV ]) +end -- cgit v1.2.3-24-ge0c7