everything related to duct tape audio suite (dtas)
 help / color / mirror / code / Atom feed
 Warning: Initial query:
 %22player: extra %22%22cue%22%22 seeking functionality%22
 returned no results, used:
 "player: extra ""cue"" seeking functionality"
 instead

Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] dtas 0.15.0 - duct tape audio suite for *nix
@ 2017-04-07  7:58  6% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2017-04-07  7:58 UTC (permalink / raw)
  To: ruby-talk, dtas-all

Free Software command-line tools for audio playback, mastering, and
whatever else related to audio.  dtas follows the worse-is-better
philosophy and acts as duct tape to combine existing command-line tools
for flexibility and ease-of-development.  dtas is currently implemented
in Ruby (and some embedded shell), but may use other languages in the
future.

Changes:

    dtas 0.15.0
    
    There's a couple of minor bugfixes and features that's been
    sitting around for a while in git.  Internally there's some
    garbage reductions so player processes might be a bit smaller.
    
    21 changes since dtas 0.14.2 (2016-03-18):
    
          player: "cue prev" reliably hits previous cue breakpoint
          README: add link to gmane NNTP server
          player: extra "cue" seeking functionality
          archive: fix suffix replacement for stats
          dtas-readahead: cleanup open files on pause
          readahead: handle queued commands properly
          mlib: use transaction for removing stale entries
          splitfx: more consistently generate fade_in effects
          format.from_file: reduce soxi invocations
          introduce mcache class for caching audio metadata
          source/sox: integrate mcache support to reduce soxi calls
          test/test_rb_state: quiet deprecation warning
          http -> https, and relocate homepage to https://80x24.org/dtas/
          player: freeze sink name to avoid needless dup
          source/sox: simplify conditional, slightly
          buffer/splice: remove MAX_SIZE constant
          rg_state: fix no-op gain detection
          source/sox: relax comment NAME restriction
          readahead: handle queued commands properly (again)
          readahead: fix running commands with non-files
          deduplicate strings using String#-@ (uminus) in Ruby 2.5+

* homepage: https://80x24.org/dtas/README
* https://80x24.org/dtas/INSTALL
* https://80x24.org/dtas/dtas-player.txt
* https://80x24.org/dtas/NEWS.atom
* git clone git://80x24.org/dtas
* dtas-all@nongnu.org (plain-text only, no HTML mail, please)
* mailing list archives: https://80x24.org/dtas-all/
  nntp://news.public-inbox.org/inbox.comp.audio.dtas
  https://80x24.org/dtas-all/new.atom


^ permalink raw reply	[relevance 6%]

* year-end dtas project updates
@ 2016-12-27  7:46  7% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2016-12-27  7:46 UTC (permalink / raw)
  To: dtas-all

Sorry about the lack of activity, but really, I'm quite
satisfied with plain-old dtas-player for music playback and I
have been working on more general Free Software stuff and less
on audio production, lately.

Adding mpd/mpris compatibility layers is still a goal,
and some internal cleanups should help with that.

Anyways, happy holidays!  Ruby 2.4.0 was also just released,
and I've been running trunk without problems for several years,
including the server which powers https://80x24.org/dtas/
(yes, the homepage is on HTTPS, and I'll be dropping the
 first part of the hostname to speed up HTTPS subjectAltName
 negotiation and cert renewals).

There's a couple of changes sitting in dtas.git

13 changes since v0.14.2:

      player: "cue prev" reliably hits previous cue breakpoint
      README: add link to gmane NNTP server
      player: extra "cue" seeking functionality
      archive: fix suffix replacement for stats
      dtas-readahead: cleanup open files on pause
      readahead: handle queued commands properly
      mlib: use transaction for removing stale entries
      splitfx: more consistently generate fade_in effects
      format.from_file: reduce soxi invocations
      introduce mcache class for caching audio metadata
      source/sox: integrate mcache support to reduce soxi calls
      test/test_rb_state: quiet deprecation warning
      http -> https, and relocate homepage to https://80x24.org/dtas/

  git clone git://80x24.org/dtas


^ permalink raw reply	[relevance 7%]

* [PATCH] player: extra "cue" seeking functionality
  @ 2016-04-24  2:45  6% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2016-04-24  2:45 UTC (permalink / raw)
  To: dtas-all

These commands allow easier jumping within a track marked by
embedded CUE sheets.  I've found them helpful for tracking out
large recordings of multiple tracks (e.g. vinyl transfers or
live concert recordings).
---
 This is a followup-to commit 285155328f72
 https://80x24.org/dtas-all/20160411022743.GA22090@dcvr.yhbt.net/

 Documentation/dtas-player_protocol.pod | 19 ++++++++--
 lib/dtas/player/client_handler.rb      | 66 ++++++++++++++++++++++++++++++----
 2 files changed, 77 insertions(+), 8 deletions(-)

diff --git a/Documentation/dtas-player_protocol.pod b/Documentation/dtas-player_protocol.pod
index d0dd25e..be9f4ef 100644
--- a/Documentation/dtas-player_protocol.pod
+++ b/Documentation/dtas-player_protocol.pod
@@ -96,7 +96,7 @@ Commands here should be alphabetized according to `LC_ALL=C sort'
 
 PENDING: this may be renamed to "queue clear" or "queue-clear"
 
-=item cue - display the index/offsets of the embedded cue sheet
+=item cue - display the index/offsets of the embedded CUE sheet
 
 =item cue next - skip to the next cue sheet offset
 
@@ -109,11 +109,26 @@ This may just seek to the beginning
 if there is no embedded cue sheet or if we are playing the first
 (embedded) track.
 
-=item cue goto INTEGER - go to the cue index denoted by INTEGER
+=item cue goto INTEGER [TIMESTAMP] - go to the cue index denoted by INTEGER
 
 0 is first track as returned by "cue".
 Negative values of INTEGER allows selecting track relative to the last
 track (-1 is the last track, -2 is the penultimate, and so on).
+The optional TIMESTAMP allows starting the index track at a given
+point, negative values allow going to a set point before the given
+index.   In other words: "cue goto 1 -5" seeks to the last five seconds
+of the first track while "cue goto 1 5" seeks to the fifth second of
+the second track
+
+=item cue seek TIMESTAMP - seek within the current cue index
+
+Like the normal "seek" command, but this confines the seeking
+within the currently playing index.  As with "seek",
+"+" and "-" prefixes allow seeking relative to the currently
+playing position
+
+Using a "=-" prefix allows seeking to the previous track within
+the CUE sheet, relative to the currently playing track.
 
 =item current - output information about the current track/command in YAML
 
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb
index 8a15974..838abf7 100644
--- a/lib/dtas/player/client_handler.rb
+++ b/lib/dtas/player/client_handler.rb
@@ -186,6 +186,21 @@ def bytes_decoded(src = @current)
     bytes = bytes < 0 ? 0 : bytes # maybe negative in case of sink errors
   end
 
+  def __goto_offset_samples(offset)
+    if offset.sub!(/\A\+/, '')
+      __offset_to_samples(offset)
+    elsif offset.sub!(/\A-/, '')
+      __offset_to_samples(offset) * -1
+    else # ignore leading '=' for sox compat with 2nd "trim" arg
+      __offset_to_samples(offset)
+    end
+  end
+
+  def __offset_to_samples(offset)
+    offset.sub!(/s\z/, '') and return offset.to_i
+    @current.format.hhmmss_to_samples(offset)
+  end
+
   # returns seek offset as an Integer in sample count
   def __seek_offset_adj(dir, offset)
     if offset.sub!(/s\z/, '')
@@ -377,7 +392,7 @@ def seek_internal(cur, offset)
   end
 
   def dpc_seek(io, msg)
-    offset = msg[0]
+    offset = msg[0] or return io.emit('ERR usage: seek OFFSET')
     if @current
       if @current.respond_to?(:infile)
         begin
@@ -730,6 +745,7 @@ def _dpc_tl_swap(io, msg)
   end
 
   def __bp_prev_next(io, msg, cur, bp)
+    # msg = [ (prev|next) [, (track|pregap|subindex|<digit>|any) ]
     case type = msg[1]
     when nil, "track"
       bp.keep_if(&:track?)
@@ -772,6 +788,47 @@ def __bp_prev_next(io, msg, cur, bp)
     io.emit("OK")
   end
 
+  def __bp_seek(io, msg, cur, bp)
+    offset = msg[1] or return io.emit('ERR usage: cue seek OFFSET')
+
+    # relative + offset work just like normal, non-CUE "seek"
+    offset =~ /\A[\+-]/ and return dpc_seek(io, [ offset ])
+
+    # "=-" is special, it means go before the current index start:
+    dir = offset.sub!(/\A=-/, '') ? -1 : 1
+
+    begin
+      offset = __offset_to_samples(offset)
+    rescue ArgumentError
+      return io.emit('ERR bad time format')
+    end
+
+    ds = __current_decoded_samples
+    fmt = cur.format
+    prev = 0
+    bp.each do |ci|
+      ci_offset = ci.offset_samples(fmt)
+      break if ci_offset >= ds
+      prev = ci_offset
+    end
+    offset = offset * dir + prev
+    seek_internal(cur, "#{offset < 0 ? 0 : offset}s")
+    io.emit('OK')
+  end
+
+  def __bp_goto(io, msg, cur, bp)
+    index = msg[1] or return io.emit('NOINDEX')
+    ci = bp[index.to_i] or return io.emit('BADINDEX')
+    if offset = msg[2]
+      fmt = cur.format
+      offset = "#{ci.offset_samples(fmt) + __goto_offset_samples(offset)}s"
+    else
+      offset = ci.offset
+    end
+    seek_internal(cur, offset)
+    io.emit('OK')
+  end
+
   def dpc_cue(io, msg)
     cur = @current
     if cur.respond_to?(:cuebreakpoints)
@@ -782,11 +839,8 @@ def dpc_cue(io, msg)
         io.emit(tmp.to_yaml)
       when "next", "prev"
         return __bp_prev_next(io, msg, cur, bp)
-      when "goto"
-        index = msg[1] or return io.emit("NOINDEX")
-        ci = bp[index.to_i] or return io.emit("BADINDEX")
-        seek_internal(cur, ci.offset)
-        return io.emit("OK")
+      when 'seek' then return __bp_seek(io, msg, cur, bp)
+      when 'goto' then return __bp_goto(io, msg, cur, bp)
       end
     else
       io.emit("NOCUE")
-- 
EW


^ permalink raw reply related	[relevance 6%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-04-11  2:27     [RFC] player: "cue prev" reliably hits previous cue breakpoint Eric Wong
2016-04-24  2:45  6% ` [PATCH] player: extra "cue" seeking functionality Eric Wong
2016-12-27  7:46  7% year-end dtas project updates Eric Wong
2017-04-07  7:58  6% [ANN] dtas 0.15.0 - duct tape audio suite for *nix Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/dtas.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).