dtas 0.17.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/Documentation/.gitignore +1 -1
  4. data/Documentation/GNUmakefile +1 -1
  5. data/Documentation/dtas-archive.pod +1 -1
  6. data/Documentation/dtas-console.pod +1 -1
  7. data/Documentation/dtas-ctl.pod +1 -1
  8. data/Documentation/dtas-cueedit.pod +1 -1
  9. data/Documentation/dtas-enq.pod +1 -1
  10. data/Documentation/dtas-env.pod +1 -1
  11. data/Documentation/dtas-msinkctl.pod +1 -1
  12. data/Documentation/dtas-player.pod +1 -1
  13. data/Documentation/dtas-player_effects.pod +1 -1
  14. data/Documentation/dtas-player_protocol.pod +1 -1
  15. data/Documentation/dtas-player_sink_examples.pod +1 -1
  16. data/Documentation/dtas-sinkedit.pod +2 -2
  17. data/Documentation/dtas-sourceedit.pod +2 -2
  18. data/Documentation/dtas-splitfx.pod +42 -9
  19. data/Documentation/dtas-tl.pod +3 -1
  20. data/Documentation/dtas-xdelay.pod +1 -1
  21. data/Documentation/update-footer.rb +1 -1
  22. data/GIT-VERSION-FILE +1 -1
  23. data/GIT-VERSION-GEN +2 -2
  24. data/GNUmakefile +13 -1
  25. data/HACKING +1 -1
  26. data/INSTALL +17 -25
  27. data/NEWS +121 -0
  28. data/README +13 -7
  29. data/Rakefile +1 -1
  30. data/TODO +1 -1
  31. data/bin/dtas-archive +7 -3
  32. data/bin/dtas-console +49 -16
  33. data/bin/dtas-ctl +1 -1
  34. data/bin/dtas-cueedit +1 -1
  35. data/bin/dtas-enq +1 -1
  36. data/bin/dtas-mlib +1 -1
  37. data/bin/dtas-msinkctl +2 -3
  38. data/bin/dtas-partstats +3 -9
  39. data/bin/dtas-player +1 -2
  40. data/bin/dtas-readahead +11 -25
  41. data/bin/dtas-sinkedit +3 -4
  42. data/bin/dtas-sourceedit +3 -4
  43. data/bin/dtas-splitfx +17 -5
  44. data/bin/dtas-tl +32 -27
  45. data/bin/dtas-xdelay +1 -1
  46. data/dtas-linux.gemspec +1 -1
  47. data/dtas-mpris.gemspec +1 -1
  48. data/dtas.gemspec +3 -3
  49. data/dtas.sh +8 -0
  50. data/examples/splitfx.sample.yml +1 -1
  51. data/examples/tfx.sample.yml +1 -1
  52. data/lib/dtas/buffer/fiddle_splice.rb +217 -0
  53. data/lib/dtas/buffer/read_write.rb +3 -4
  54. data/lib/dtas/buffer/splice.rb +5 -2
  55. data/lib/dtas/buffer.rb +11 -8
  56. data/lib/dtas/command.rb +1 -1
  57. data/lib/dtas/cue_index.rb +1 -1
  58. data/lib/dtas/disclaimer.rb +1 -1
  59. data/lib/dtas/edit_client.rb +2 -3
  60. data/lib/dtas/encoding.rb +8 -9
  61. data/lib/dtas/fadefx.rb +2 -2
  62. data/lib/dtas/format.rb +1 -1
  63. data/lib/dtas/mcache.rb +14 -3
  64. data/lib/dtas/mlib/migrations/0001_initial.rb +1 -1
  65. data/lib/dtas/mlib.rb +23 -13
  66. data/lib/dtas/parse_freq.rb +1 -1
  67. data/lib/dtas/parse_time.rb +1 -1
  68. data/lib/dtas/partstats.rb +3 -5
  69. data/lib/dtas/pipe.rb +14 -11
  70. data/lib/dtas/pipeline.rb +1 -4
  71. data/lib/dtas/player/client_handler.rb +25 -17
  72. data/lib/dtas/player.rb +6 -12
  73. data/lib/dtas/process.rb +3 -5
  74. data/lib/dtas/replaygain.rb +1 -1
  75. data/lib/dtas/rg_state.rb +2 -2
  76. data/lib/dtas/serialize.rb +1 -1
  77. data/lib/dtas/sigevent/efd.rb +3 -1
  78. data/lib/dtas/sigevent/fiddle_efd.rb +37 -0
  79. data/lib/dtas/sigevent/pipe.rb +3 -4
  80. data/lib/dtas/sigevent.rb +6 -3
  81. data/lib/dtas/sink.rb +1 -2
  82. data/lib/dtas/source/av.rb +1 -1
  83. data/lib/dtas/source/av_ff_common.rb +4 -4
  84. data/lib/dtas/source/cmd.rb +1 -1
  85. data/lib/dtas/source/common.rb +1 -1
  86. data/lib/dtas/source/ff.rb +1 -1
  87. data/lib/dtas/source/file.rb +1 -1
  88. data/lib/dtas/source/mp3gain.rb +1 -1
  89. data/lib/dtas/source/sox.rb +4 -4
  90. data/lib/dtas/source/splitfx.rb +2 -3
  91. data/lib/dtas/source.rb +1 -1
  92. data/lib/dtas/splitfx.rb +22 -10
  93. data/lib/dtas/state_file.rb +2 -2
  94. data/lib/dtas/tfx.rb +1 -1
  95. data/lib/dtas/track.rb +2 -2
  96. data/lib/dtas/tracklist.rb +1 -1
  97. data/lib/dtas/unix_accepted.rb +12 -37
  98. data/lib/dtas/unix_client.rb +2 -2
  99. data/lib/dtas/unix_server.rb +2 -14
  100. data/lib/dtas/util.rb +1 -1
  101. data/lib/dtas/version.rb +1 -1
  102. data/lib/dtas/watchable/fiddle_ino.rb +78 -0
  103. data/lib/dtas/watchable/inotify.rb +13 -0
  104. data/lib/dtas/watchable.rb +58 -58
  105. data/lib/dtas/writable_iter.rb +1 -1
  106. data/lib/dtas/xs.rb +1 -1
  107. data/lib/dtas.rb +13 -21
  108. data/man/dtas-archive.1 +2 -2
  109. data/man/dtas-console.1 +2 -2
  110. data/man/dtas-ctl.1 +2 -2
  111. data/man/dtas-cueedit.1 +2 -2
  112. data/man/dtas-enq.1 +2 -2
  113. data/man/dtas-env.7 +2 -2
  114. data/man/dtas-msinkctl.1 +2 -2
  115. data/man/dtas-player.1 +2 -2
  116. data/man/dtas-player_effects.7 +2 -2
  117. data/man/dtas-player_protocol.7 +2 -2
  118. data/man/dtas-player_sink_examples.7 +2 -2
  119. data/man/dtas-sinkedit.1 +3 -3
  120. data/man/dtas-sourceedit.1 +3 -3
  121. data/man/dtas-splitfx.1 +43 -13
  122. data/man/dtas-tl.1 +4 -2
  123. data/man/dtas-xdelay.1 +2 -2
  124. data/{perl → script}/dtas-graph +1 -1
  125. data/setup.rb +1 -2
  126. data/test/covshow.rb +1 -1
  127. data/test/helper.rb +1 -1
  128. data/test/player_integration.rb +1 -2
  129. data/test/test_buffer.rb +8 -8
  130. data/test/test_encoding.rb +2 -3
  131. data/test/test_env.rb +1 -1
  132. data/test/test_fadefx.rb +1 -1
  133. data/test/test_format.rb +1 -1
  134. data/test/test_format_change.rb +2 -2
  135. data/test/test_mcache.rb +15 -5
  136. data/test/test_mlib.rb +1 -1
  137. data/test/test_parse_freq.rb +1 -1
  138. data/test/test_pipeline.rb +1 -1
  139. data/test/test_player.rb +1 -1
  140. data/test/test_player_client_handler.rb +2 -2
  141. data/test/test_player_integration.rb +7 -8
  142. data/test/test_process.rb +1 -1
  143. data/test/test_rg_integration.rb +9 -9
  144. data/test/test_rg_state.rb +1 -1
  145. data/test/test_sigevent.rb +20 -0
  146. data/test/test_sink.rb +2 -2
  147. data/test/test_sink_pipe_size.rb +13 -16
  148. data/test/test_sink_tee_integration.rb +1 -1
  149. data/test/test_source_av.rb +1 -1
  150. data/test/test_source_sox.rb +1 -1
  151. data/test/test_splitfx.rb +2 -5
  152. data/test/test_tfx.rb +2 -3
  153. data/test/test_tracklist.rb +1 -1
  154. data/test/test_unixserver.rb +2 -2
  155. data/test/test_util.rb +1 -1
  156. metadata +11 -8
  157. data/lib/dtas/compat_onenine.rb +0 -17
  158. data/lib/dtas/nonblock.rb +0 -24
  159. data/lib/dtas/spawn_fix.rb +0 -10
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
1
+ # Copyright (C) all contributors <dtas-all@nongnu.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require 'socket'
@@ -10,23 +10,22 @@ class DTAS::UNIXAccepted # :nodoc:
10
10
 
11
11
  def initialize(sock)
12
12
  @to_io = sock
13
- @send_buf = []
13
+ @sbuf = []
14
14
  end
15
15
 
16
16
  # public API (for DTAS::Player)
17
17
  # returns :wait_readable on success
18
18
  def emit(msg)
19
- buffered = @send_buf.size
20
- if buffered == 0
21
- case rv = sendmsg_nonblock(msg)
19
+ if @sbuf.empty?
20
+ case rv = @to_io.sendmsg_nonblock(msg, Socket::MSG_EOR, exception: false)
22
21
  when :wait_writable
23
- @send_buf << msg
22
+ @sbuf << msg
24
23
  rv
25
24
  else
26
25
  :wait_readable
27
26
  end
28
- else # buffered > 0
29
- @send_buf << msg
27
+ else
28
+ @sbuf << msg
30
29
  :wait_writable
31
30
  end
32
31
  rescue => e
@@ -35,11 +34,11 @@ class DTAS::UNIXAccepted # :nodoc:
35
34
 
36
35
  # flushes pending data if it got buffered
37
36
  def writable_iter
38
- case sendmsg_nonblock(@send_buf[0])
37
+ case @to_io.sendmsg_nonblock(@sbuf[0], Socket::MSG_EOR, exception: false)
39
38
  when :wait_writable then return :wait_writable
40
39
  else
41
- @send_buf.shift
42
- @send_buf.empty? ? :wait_readable : :wait_writable
40
+ @sbuf.shift
41
+ @sbuf.empty? ? :wait_readable : :wait_writable
43
42
  end
44
43
  rescue => e
45
44
  e
@@ -51,13 +50,13 @@ class DTAS::UNIXAccepted # :nodoc:
51
50
  # EOF, assume no spurious wakeups for SOCK_SEQPACKET
52
51
  return nil if nread == 0
53
52
 
54
- case msg = recv_nonblock(nread)
53
+ case msg = @to_io.recv_nonblock(nread, exception: false)
55
54
  when :wait_readable then return msg
56
55
  when '', nil then return nil # EOF
57
56
  else
58
57
  yield(self, msg) # DTAS::Player deals with this
59
58
  end
60
- @send_buf.empty? ? :wait_readable : :wait_writable
59
+ @sbuf.empty? ? :wait_readable : :wait_writable
61
60
  rescue SystemCallError
62
61
  nil
63
62
  end
@@ -69,28 +68,4 @@ class DTAS::UNIXAccepted # :nodoc:
69
68
  def closed?
70
69
  @to_io.closed?
71
70
  end
72
-
73
- if RUBY_VERSION.to_f >= 2.3
74
- def sendmsg_nonblock(msg)
75
- @to_io.sendmsg_nonblock(msg, Socket::MSG_EOR, exception: false)
76
- end
77
-
78
- def recv_nonblock(len)
79
- @to_io.recv_nonblock(len, exception: false)
80
- end
81
- else
82
- def sendmsg_nonblock(msg)
83
- @to_io.sendmsg_nonblock(msg, Socket::MSG_EOR)
84
- rescue IO::WaitWritable
85
- :wait_writable
86
- end
87
-
88
- def recv_nonblock(len)
89
- @to_io.recv_nonblock(len)
90
- rescue IO::WaitReadable
91
- :wait_readable
92
- rescue EOFError
93
- nil
94
- end
95
- end
96
71
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
1
+ # Copyright (C) all contributors <dtas-all@nongnu.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require_relative '../dtas'
@@ -39,7 +39,7 @@ class DTAS::UNIXClient # :nodoc:
39
39
  end
40
40
 
41
41
  def res_wait(timeout = nil)
42
- IO.select([@to_io], nil, nil, timeout)
42
+ @to_io.wait_readable(timeout)
43
43
  nr = @to_io.nread
44
44
  nr > 0 or raise EOFError, "unexpected EOF from server"
45
45
  @to_io.recv(nr)
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
1
+ # Copyright (C) all contributors <dtas-all@nongnu.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require 'socket'
@@ -59,7 +59,7 @@ class DTAS::UNIXServer # :nodoc:
59
59
 
60
60
  def readable_iter
61
61
  # we do not do anything with the block passed to us
62
- case rv = accept_nonblock
62
+ case rv = @to_io.accept_nonblock(exception: false)
63
63
  when :wait_readable then return rv
64
64
  else
65
65
  @readers[DTAS::UNIXAccepted.new(rv[0])] = true
@@ -114,16 +114,4 @@ class DTAS::UNIXServer # :nodoc:
114
114
  wait_ctl(io, io.readable_iter { |_io, msg| yield(_io, msg) })
115
115
  end
116
116
  end
117
-
118
- if RUBY_VERSION.to_f >= 2.3
119
- def accept_nonblock
120
- @to_io.accept_nonblock(exception: false)
121
- end
122
- else
123
- def accept_nonblock
124
- @to_io.accept_nonblock
125
- rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO
126
- :wait_readable
127
- end
128
- end
129
117
  end
data/lib/dtas/util.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
1
+ # Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require_relative '../dtas'
data/lib/dtas/version.rb CHANGED
@@ -1 +1 @@
1
- DTAS::VERSION = '0.17.0'.freeze # :nodoc:
1
+ DTAS::VERSION = '0.20.0'.freeze # :nodoc:
@@ -0,0 +1,78 @@
1
+ # Copyright (C) all contributors <dtas-all@nongnu.org>
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
+ # frozen_string_literal: true
4
+ require 'fiddle'
5
+
6
+ # used to restart DTAS::Source::SplitFX processing in dtas-player
7
+ # if the YAML file is edited
8
+ class DTAS::Watchable::InotifyReadableIter # :nodoc:
9
+ include DTAS::Watchable::InotifyCommon
10
+
11
+ Inotify_init = Fiddle::Function.new(DTAS.libc['inotify_init1'],
12
+ [ Fiddle::TYPE_INT ],
13
+ Fiddle::TYPE_INT)
14
+
15
+ Inotify_add_watch = Fiddle::Function.new(DTAS.libc['inotify_add_watch'],
16
+ [ Fiddle::TYPE_INT, Fiddle::TYPE_VOIDP, Fiddle::TYPE_INT ],
17
+ Fiddle::TYPE_INT)
18
+
19
+ # IO.select compatibility
20
+ attr_reader :to_io #:nodoc:
21
+
22
+ def initialize # :nodoc:
23
+ fd = Inotify_init.call(02000000 | 04000) # CLOEXEC | NONBLOCK
24
+ raise "inotify_init failed: #{Fiddle.last_error}" if fd < 0
25
+ @to_io = IO.for_fd(fd)
26
+ @buf = ''.b
27
+ @q = []
28
+ end
29
+
30
+ # struct inotify_event {
31
+ # int wd; /* Watch descriptor */
32
+ # uint32_t mask; /* Mask describing event */
33
+ # uint32_t cookie; /* Unique cookie associating related
34
+ # events (for rename(2)) */
35
+ # uint32_t len; /* Size of name field */
36
+ # char name[]; /* Optional null-terminated name */
37
+ InotifyEvent = Struct.new(:wd, :mask, :cookie, :len, :name) # :nodoc:
38
+
39
+ def take(nonblock) # :nodoc:
40
+ event = @q.pop and return event
41
+ case rv = @to_io.read_nonblock(16384, @buf, exception: false)
42
+ when :wait_readable, nil
43
+ return
44
+ else
45
+ until rv.empty?
46
+ hdr = rv.slice!(0,16)
47
+ name = nil
48
+ wd, mask, cookie, len = res = hdr.unpack('iIII')
49
+ wd && mask && cookie && len or
50
+ raise "bogus inotify_event #{res.inspect} hdr=#{hdr.inspect}"
51
+ if len > 0
52
+ name = rv.slice!(0, len)
53
+ name.size == len or raise "short name #{name.inspect} != #{len}"
54
+ name.sub!(/\0+\z/, '') or
55
+ raise "missing: `\\0', inotify_event.name=#{name.inspect}"
56
+ name = -name
57
+ end
58
+ ie = InotifyEvent.new(wd, mask, cookie, len, name)
59
+ if event
60
+ @q << ie
61
+ else
62
+ event = ie
63
+ end
64
+ end # /until rv.empty?
65
+ return event
66
+ end while true
67
+ end
68
+
69
+ def add_watch(watchdir, flags)
70
+ wd = Inotify_add_watch.call(@to_io.fileno, watchdir, flags)
71
+ raise "inotify_add_watch failed: #{Fiddle.last_error}" if wd < 0
72
+ wd
73
+ end
74
+
75
+ def close
76
+ @to_io = @to_io.close if @to_io
77
+ end
78
+ end
@@ -0,0 +1,13 @@
1
+ # Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
+ # frozen_string_literal: true
4
+ require 'sleepy_penguin'
5
+
6
+ # used to restart DTAS::Source::SplitFX processing in dtas-player
7
+ # if the YAML file is edited
8
+ class DTAS::Watchable::InotifyReadableIter < SleepyPenguin::Inotify # :nodoc:
9
+ include DTAS::Watchable::InotifyCommon
10
+ def self.new
11
+ super(:CLOEXEC)
12
+ end
13
+ end
@@ -1,71 +1,71 @@
1
- # Copyright (C) 2013-2019 all contributors <dtas-all@nongnu.org>
1
+ # Copyright (C) all contributors <dtas-all@nongnu.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
+ require_relative '../dtas'
4
5
  begin
5
- require 'sleepy_penguin'
6
+ module DTAS::Watchable # :nodoc:
7
+ module InotifyCommon # :nodoc:
8
+ FLAGS = 8 | 128 # IN_CLOSE_WRITE | IN_MOVED_TO
6
9
 
7
- # used to restart DTAS::Source::SplitFX processing in dtas-player
8
- # if the YAML file is edited
9
- module DTAS::Watchable # :nodoc:
10
- class InotifyReadableIter < SleepyPenguin::Inotify # :nodoc:
11
- def self.new
12
- super(:CLOEXEC)
13
- end
14
-
15
- FLAGS = CLOSE_WRITE | MOVED_TO
16
-
17
- def readable_iter
18
- or_call = false
19
- while event = take(true) # drain the buffer
20
- w = @watches[event.wd] or next
21
- if (event.mask & FLAGS) != 0 && w[event.name]
22
- or_call = true
10
+ def readable_iter
11
+ or_call = false
12
+ while event = take(true) # drain the buffer
13
+ w = @watches[event.wd] or next
14
+ if (event.mask & FLAGS) != 0 && w[event.name]
15
+ or_call = true
16
+ end
17
+ end
18
+ if or_call
19
+ @on_readable.call
20
+ :delete
21
+ else
22
+ :wait_readable
23
23
  end
24
24
  end
25
- if or_call
26
- @on_readable.call
27
- :delete
28
- else
29
- :wait_readable
30
- end
31
- end
32
25
 
33
- # we must watch the directory, since
34
- def watch_files(paths, blk)
35
- @watches = {} # wd -> { basename -> true }
36
- @on_readable = blk
37
- @dir2wd = {}
38
- Array(paths).each do |path|
39
- watchdir, watchbase = File.split(File.expand_path(path))
40
- begin
41
- wd = @dir2wd[watchdir] ||= add_watch(watchdir, FLAGS)
42
- m = @watches[wd] ||= {}
43
- m[watchbase] = true
44
- rescue SystemCallError => e
45
- warn "#{watchdir.dump}: #{e.message} (#{e.class})"
26
+ # we must watch the directory, since
27
+ def watch_files(paths, blk)
28
+ @watches = {} # wd -> { basename -> true }
29
+ @on_readable = blk
30
+ @dir2wd = {}
31
+ Array(paths).each do |path|
32
+ watchdir, watchbase = File.split(File.expand_path(path))
33
+ begin
34
+ wd = @dir2wd[watchdir] ||= add_watch(watchdir, FLAGS)
35
+ m = @watches[wd] ||= {}
36
+ m[watchbase] = true
37
+ rescue SystemCallError => e
38
+ warn "#{watchdir.dump}: #{e.message} (#{e.class})"
39
+ end
46
40
  end
47
41
  end
48
- end
49
- end
42
+ end # module InotifyCommon
50
43
 
51
- def watch_begin(blk)
52
- @ino = InotifyReadableIter.new
53
- @ino.watch_files(@watch_extra << @infile, blk)
54
- @ino
55
- end
44
+ begin
45
+ require_relative 'watchable/inotify'
46
+ rescue LoadError
47
+ # TODO: support kevent
48
+ require_relative 'watchable/fiddle_ino'
49
+ end
56
50
 
57
- def watch_extra(paths)
58
- @ino.watch_extra(paths)
59
- end
51
+ def watch_begin(blk)
52
+ @ino = DTAS::Watchable::InotifyReadableIter.new
53
+ @ino.watch_files(@watch_extra << @infile, blk)
54
+ @ino
55
+ end
60
56
 
61
- # Closing the inotify descriptor (instead of using inotify_rm_watch)
62
- # is cleaner because it avoids EINVAL on race conditions in case
63
- # a directory is deleted: https://lkml.org/lkml/2007/7/9/3
64
- def watch_end(srv)
65
- srv.wait_ctl(@ino, :delete)
66
- @ino = @ino.close
67
- end
68
- end
57
+ def watch_extra(paths)
58
+ @ino.watch_extra(paths)
59
+ end
69
60
 
70
- rescue LoadError
71
- end
61
+ # Closing the inotify descriptor (instead of using inotify_rm_watch)
62
+ # is cleaner because it avoids EINVAL on race conditions in case
63
+ # a directory is deleted: https://lkml.org/lkml/2007/7/9/3
64
+ def watch_end(srv)
65
+ srv.wait_ctl(@ino, :delete)
66
+ @ino = @ino.close
67
+ end
68
+ end # module DTAS::Watchable
69
+ rescue LoadError, StandardError => e
70
+ warn "#{e.message} (#{e.class})"
71
+ end # begin
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
1
+ # Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require_relative '../dtas'
data/lib/dtas/xs.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
1
+ # Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require_relative '../dtas'
data/lib/dtas.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2019 all contributors <dtas-all@nongnu.org>
1
+ # Copyright (C) all contributors <dtas-all@nongnu.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
 
@@ -9,15 +9,8 @@ module DTAS
9
9
  # try to use the monotonic clock in Ruby >= 2.1, it is immune to clock
10
10
  # offset adjustments and generates less garbage (Float vs Time object)
11
11
  # :stopdoc:
12
- begin
12
+ def self.now # :nodoc:
13
13
  ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
14
- def self.now # :nodoc:
15
- ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
16
- end
17
- rescue NameError, NoMethodError
18
- def self.now # :nodoc:
19
- Time.now.to_f # Ruby <= 2.0
20
- end
21
14
  end
22
15
 
23
16
  @null = nil
@@ -25,22 +18,21 @@ module DTAS
25
18
  @null ||= File.open('/dev/null', 'r+')
26
19
  end
27
20
 
28
- # String#-@ will deduplicate strings when Ruby 2.5 is released (Dec 2017)
29
- # https://bugs.ruby-lang.org/issues/13077
30
- if RUBY_VERSION.to_f >= 2.5
31
- def self.dedupe_str(str)
32
- -str
33
- end
34
- else
35
- # Ruby 2.1 - 2.4, noop for older Rubies
36
- def self.dedupe_str(str)
37
- eval "#{str.inspect}.freeze"
21
+ @libc = nil
22
+ def self.libc
23
+ @libc ||= begin
24
+ require 'fiddle'
25
+ Fiddle.dlopen(nil)
38
26
  end
39
27
  end
28
+
29
+ # prevent breakage in Psych 4.x; we're a shell and designed to execute code
30
+ def self.yaml_load(buf)
31
+ require 'yaml'
32
+ YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(buf) : YAML.load(buf)
33
+ end
40
34
  # :startdoc:
41
35
  end
42
36
 
43
- require_relative 'dtas/compat_onenine'
44
- require_relative 'dtas/spawn_fix'
45
37
  require_relative 'dtas/encoding'
46
38
  DTAS.extend(DTAS::Encoding)
data/man/dtas-archive.1 CHANGED
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-ARCHIVE 1"
136
- .TH DTAS-ARCHIVE 1 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-ARCHIVE 1 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -180,7 +180,7 @@ Continue after error
180
180
  Number of times to repeat the \fBsndfile\-cmp\fR\|(1) check. Default: 1
181
181
  .SH "COPYRIGHT"
182
182
  .IX Header "COPYRIGHT"
183
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
183
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
184
184
  .PP
185
185
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
186
186
  .SH "CONTACT"
data/man/dtas-console.1 CHANGED
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-CONSOLE 1"
136
- .TH DTAS-CONSOLE 1 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-CONSOLE 1 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -212,7 +212,7 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
212
212
  No subscription is necessary to post to the mailing list.
213
213
  .SH "COPYRIGHT"
214
214
  .IX Header "COPYRIGHT"
215
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
215
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
216
216
  .PP
217
217
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
218
218
  .SH "SEE ALSO"
data/man/dtas-ctl.1 CHANGED
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-CTL 1"
136
- .TH DTAS-CTL 1 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-CTL 1 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -215,7 +215,7 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
215
215
  No subscription is necessary to post to the mailing list.
216
216
  .SH "COPYRIGHT"
217
217
  .IX Header "COPYRIGHT"
218
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
218
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
219
219
  .PP
220
220
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
221
221
  .SH "SEE ALSO"
data/man/dtas-cueedit.1 CHANGED
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-CUEEDIT 1"
136
- .TH DTAS-CUEEDIT 1 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-CUEEDIT 1 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -161,7 +161,7 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
161
161
  No subscription is necessary to post to the mailing list.
162
162
  .SH "COPYRIGHT"
163
163
  .IX Header "COPYRIGHT"
164
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
164
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
165
165
  .PP
166
166
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
167
167
  .SH "SEE ALSO"
data/man/dtas-enq.1 CHANGED
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-ENQ 1"
136
- .TH DTAS-ENQ 1 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-ENQ 1 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -167,7 +167,7 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
167
167
  No subscription is necessary to post to the mailing list.
168
168
  .SH "COPYRIGHT"
169
169
  .IX Header "COPYRIGHT"
170
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
170
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
171
171
  .PP
172
172
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
173
173
  .SH "SEE ALSO"
data/man/dtas-env.7 CHANGED
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-ENV 7"
136
- .TH DTAS-ENV 7 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-ENV 7 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -194,6 +194,6 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
194
194
  No subscription is necessary to post to the mailing list.
195
195
  .SH "COPYRIGHT"
196
196
  .IX Header "COPYRIGHT"
197
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
197
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
198
198
  .PP
199
199
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
data/man/dtas-msinkctl.1 CHANGED
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-MSINKCTL 1"
136
- .TH DTAS-MSINKCTL 1 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-MSINKCTL 1 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -192,7 +192,7 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
192
192
  No subscription is necessary to post to the mailing list.
193
193
  .SH "COPYRIGHT"
194
194
  .IX Header "COPYRIGHT"
195
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
195
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
196
196
  .PP
197
197
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
198
198
  .SH "SEE ALSO"
data/man/dtas-player.1 CHANGED
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-PLAYER 1"
136
- .TH DTAS-PLAYER 1 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-PLAYER 1 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -254,7 +254,7 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
254
254
  No subscription is necessary to post to the mailing list.
255
255
  .SH "COPYRIGHT"
256
256
  .IX Header "COPYRIGHT"
257
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
257
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
258
258
  .PP
259
259
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
260
260
  .SH "SEE ALSO"
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-PLAYER_EFFECTS 7"
136
- .TH DTAS-PLAYER_EFFECTS 7 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-PLAYER_EFFECTS 7 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -228,6 +228,6 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
228
228
  No subscription is necessary to post to the mailing list.
229
229
  .SH "COPYRIGHT"
230
230
  .IX Header "COPYRIGHT"
231
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
231
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
232
232
  .PP
233
233
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-PLAYER_PROTOCOL 7"
136
- .TH DTAS-PLAYER_PROTOCOL 7 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-PLAYER_PROTOCOL 7 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -559,6 +559,6 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
559
559
  No subscription is necessary to post to the mailing list.
560
560
  .SH "COPYRIGHT"
561
561
  .IX Header "COPYRIGHT"
562
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
562
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
563
563
  .PP
564
564
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
@@ -133,7 +133,7 @@
133
133
  .\" ========================================================================
134
134
  .\"
135
135
  .IX Title "DTAS-PLAYER_SINK_EXAMPLES 7"
136
- .TH DTAS-PLAYER_SINK_EXAMPLES 7 "1994-10-02" "dtas 0.17.0" "dtas user manual"
136
+ .TH DTAS-PLAYER_SINK_EXAMPLES 7 "1994-10-02" "dtas 0.20.0" "dtas user manual"
137
137
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
138
  .\" way too many mistakes in technical documents.
139
139
  .if n .ad l
@@ -217,7 +217,7 @@ and <https://lists.gnu.org/archive/html/dtas\-all/>
217
217
  No subscription is necessary to post to the mailing list.
218
218
  .SH "COPYRIGHT"
219
219
  .IX Header "COPYRIGHT"
220
- Copyright 2013\-2016 all contributors <mailto:dtas\-all@nongnu.org>
220
+ Copyright 2013\-2020 all contributors <mailto:dtas\-all@nongnu.org>
221
221
  .PP
222
222
  License: \s-1GPL\-3.0+\s0 <https://www.gnu.org/licenses/gpl\-3.0.txt>
223
223
  .SH "SEE ALSO"