dtas 0.14.2 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) 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 +2 -2
  6. data/Documentation/dtas-console.pod +2 -2
  7. data/Documentation/dtas-ctl.pod +2 -2
  8. data/Documentation/dtas-cueedit.pod +2 -2
  9. data/Documentation/dtas-enq.pod +2 -2
  10. data/Documentation/dtas-env.pod +2 -2
  11. data/Documentation/dtas-msinkctl.pod +2 -2
  12. data/Documentation/dtas-player.pod +2 -2
  13. data/Documentation/dtas-player_effects.pod +2 -2
  14. data/Documentation/dtas-player_protocol.pod +19 -4
  15. data/Documentation/dtas-player_sink_examples.pod +2 -2
  16. data/Documentation/dtas-sinkedit.pod +2 -2
  17. data/Documentation/dtas-sourceedit.pod +2 -2
  18. data/Documentation/dtas-splitfx.pod +1 -1
  19. data/Documentation/dtas-tl.pod +2 -2
  20. data/Documentation/dtas-xdelay.pod +2 -2
  21. data/Documentation/update-footer.rb +3 -3
  22. data/GIT-VERSION-GEN +2 -2
  23. data/GNUmakefile +1 -1
  24. data/HACKING +2 -2
  25. data/INSTALL +10 -10
  26. data/README +6 -5
  27. data/Rakefile +5 -5
  28. data/TODO +1 -1
  29. data/bin/dtas-archive +2 -2
  30. data/bin/dtas-console +1 -1
  31. data/bin/dtas-ctl +1 -1
  32. data/bin/dtas-cueedit +1 -1
  33. data/bin/dtas-enq +1 -1
  34. data/bin/dtas-mlib +1 -1
  35. data/bin/dtas-msinkctl +1 -1
  36. data/bin/dtas-partstats +1 -1
  37. data/bin/dtas-player +1 -1
  38. data/bin/dtas-readahead +19 -8
  39. data/bin/dtas-sinkedit +1 -1
  40. data/bin/dtas-sourceedit +1 -1
  41. data/bin/dtas-splitfx +1 -1
  42. data/bin/dtas-tl +1 -1
  43. data/bin/dtas-xdelay +1 -1
  44. data/dtas-linux.gemspec +2 -2
  45. data/dtas-mpris.gemspec +2 -2
  46. data/dtas.gemspec +2 -2
  47. data/lib/dtas.rb +15 -2
  48. data/lib/dtas/buffer.rb +1 -1
  49. data/lib/dtas/buffer/read_write.rb +1 -1
  50. data/lib/dtas/buffer/splice.rb +1 -2
  51. data/lib/dtas/command.rb +1 -1
  52. data/lib/dtas/compat_onenine.rb +1 -1
  53. data/lib/dtas/cue_index.rb +1 -1
  54. data/lib/dtas/disclaimer.rb +1 -1
  55. data/lib/dtas/edit_client.rb +1 -1
  56. data/lib/dtas/fadefx.rb +2 -2
  57. data/lib/dtas/format.rb +9 -5
  58. data/lib/dtas/mcache.rb +31 -0
  59. data/lib/dtas/mlib.rb +11 -7
  60. data/lib/dtas/mlib/migrations/0001_initial.rb +1 -1
  61. data/lib/dtas/nonblock.rb +1 -1
  62. data/lib/dtas/parse_freq.rb +1 -1
  63. data/lib/dtas/parse_time.rb +1 -1
  64. data/lib/dtas/partstats.rb +2 -3
  65. data/lib/dtas/pipe.rb +1 -1
  66. data/lib/dtas/player.rb +2 -1
  67. data/lib/dtas/player/client_handler.rb +74 -16
  68. data/lib/dtas/process.rb +1 -1
  69. data/lib/dtas/replaygain.rb +1 -1
  70. data/lib/dtas/rg_state.rb +4 -9
  71. data/lib/dtas/serialize.rb +1 -1
  72. data/lib/dtas/sigevent.rb +1 -1
  73. data/lib/dtas/sigevent/efd.rb +1 -1
  74. data/lib/dtas/sigevent/pipe.rb +1 -1
  75. data/lib/dtas/sink.rb +1 -1
  76. data/lib/dtas/source.rb +2 -1
  77. data/lib/dtas/source/av.rb +1 -1
  78. data/lib/dtas/source/av_ff_common.rb +7 -3
  79. data/lib/dtas/source/cmd.rb +1 -1
  80. data/lib/dtas/source/common.rb +1 -1
  81. data/lib/dtas/source/ff.rb +1 -1
  82. data/lib/dtas/source/file.rb +1 -1
  83. data/lib/dtas/source/mp3gain.rb +1 -1
  84. data/lib/dtas/source/sox.rb +59 -32
  85. data/lib/dtas/spawn_fix.rb +1 -1
  86. data/lib/dtas/splitfx.rb +11 -6
  87. data/lib/dtas/state_file.rb +1 -1
  88. data/lib/dtas/tfx.rb +1 -1
  89. data/lib/dtas/track.rb +1 -1
  90. data/lib/dtas/tracklist.rb +1 -1
  91. data/lib/dtas/unix_accepted.rb +1 -1
  92. data/lib/dtas/unix_client.rb +1 -1
  93. data/lib/dtas/unix_server.rb +1 -1
  94. data/lib/dtas/util.rb +1 -1
  95. data/lib/dtas/writable_iter.rb +1 -1
  96. data/lib/dtas/xs.rb +1 -1
  97. data/perl/dtas-graph +1 -1
  98. data/test/covshow.rb +1 -1
  99. data/test/helper.rb +1 -1
  100. data/test/player_integration.rb +1 -1
  101. data/test/test_buffer.rb +11 -7
  102. data/test/test_env.rb +1 -1
  103. data/test/test_fadefx.rb +1 -1
  104. data/test/test_format.rb +1 -1
  105. data/test/test_format_change.rb +1 -1
  106. data/test/test_mcache.rb +19 -0
  107. data/test/test_mlib.rb +1 -1
  108. data/test/test_parse_freq.rb +1 -1
  109. data/test/test_player.rb +1 -1
  110. data/test/test_player_client_handler.rb +1 -1
  111. data/test/test_player_integration.rb +1 -1
  112. data/test/test_process.rb +1 -1
  113. data/test/test_rg_integration.rb +2 -2
  114. data/test/test_rg_state.rb +9 -2
  115. data/test/test_sink.rb +1 -1
  116. data/test/test_sink_pipe_size.rb +1 -1
  117. data/test/test_sink_tee_integration.rb +1 -1
  118. data/test/test_source_av.rb +1 -1
  119. data/test/test_source_sox.rb +2 -1
  120. data/test/test_splitfx.rb +1 -1
  121. data/test/test_tfx.rb +1 -1
  122. data/test/test_tracklist.rb +1 -1
  123. data/test/test_unixserver.rb +1 -1
  124. data/test/test_util.rb +1 -1
  125. metadata +6 -4
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
 
4
4
  # used in various places for safe wakeups from IO.select via signals
5
5
  # This requires a modern Linux system and the "sleepy_penguin" RubyGem
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
 
5
5
  # used in various places for safe wakeups from IO.select via signals
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require 'yaml'
5
5
  require_relative '../dtas'
@@ -1,7 +1,8 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
+ require_relative 'mcache'
5
6
 
6
7
  module DTAS::Source # :nodoc:
7
8
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative 'av_ff_common'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative '../source'
@@ -109,13 +109,17 @@ def av_ff_ok?
109
109
  f = $1.dup
110
110
  f =~ /^duration=([\d\.]+)\s*$/nm and @duration = $1.to_f
111
111
  # TODO: multi-line/multi-value/repeated tags
112
- f.gsub!(/^TAG:([^=]+)=(.*)$/ni) { |_| @comments[$1.upcase.freeze] = $2 }
112
+ f.gsub!(/^TAG:([^=]+)=(.*)$/ni) { |_|
113
+ @comments[DTAS.dedupe_str($1.upcase)] = DTAS.dedupe_str($2)
114
+ }
113
115
  end
114
116
 
115
117
  # new avprobe
116
118
  s.scan(%r{^\[format\.tags\]\n(.*?)\n\n}m) do |_|
117
119
  f = $1.dup
118
- f.gsub!(/^([^=]+)=(.*)$/ni) { |_| @comments[$1.upcase.freeze] = $2 }
120
+ f.gsub!(/^([^=]+)=(.*)$/ni) { |_|
121
+ @comments[DTAS.dedupe_str($1.upcase)] = DTAS.dedupe_str($2)
122
+ }
119
123
  end
120
124
  s.scan(%r{^\[format\]\n(.*?)\n\n}m) do |_|
121
125
  f = $1.dup
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative '../source'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  module DTAS::Source::Common # :nodoc:
4
4
  attr_reader :dst_zero_byte # first byte this source object saw
5
5
  attr_reader :dst
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative 'av_ff_common'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative '../source'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require_relative '../process'
5
5
 
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  # encoding: binary
5
5
  require_relative '../../dtas'
@@ -20,37 +20,70 @@ class DTAS::Source::Sox # :nodoc:
20
20
  "tryorder" => 0,
21
21
  )
22
22
 
23
- # we use this to be less noisy when seeking a file
24
- def try_to_fail_harder(infile, s, cmd)
25
- msg = nil
26
- case s
27
- when %r{\A0\s*\z} then msg = "detected zero samples"
28
- when Process::Status then msg = "failed with #{s.exitstatus}"
23
+ def soxi_failed(infile, msg)
24
+ return if @last_failed == infile
25
+ @last_failed = infile
26
+ case msg
27
+ when Process::Status then msg = "failed with #{msg.exitstatus}"
28
+ when 0 then msg = 'detected zero samples'
29
29
  end
30
- if msg
31
- return if @last_failed == infile
32
- @last_failed = infile
33
- return warn("`#{xs(cmd)}' #{msg}")
34
- end
35
- true
30
+ warn("soxi #{infile}: #{msg}\n")
36
31
  end
37
32
 
38
- def initialize
33
+ def initialize(mcache = nil)
34
+ @mcache = nil
39
35
  @last_failed = nil
40
36
  command_init(SOX_DEFAULTS)
41
37
  end
42
38
 
39
+ def mcache_lookup(infile)
40
+ (@mcache ||= DTAS::Mcache.new).lookup(infile) do |input, dst|
41
+ err = ''.b
42
+ out = qx(@env.dup, %W(soxi #{input}), err_str: err, no_raise: true)
43
+ return soxi_failed(infile, out) if Process::Status === out
44
+ return soxi_failed(infile, err) if err =~ /soxi FAIL formats:/
45
+ out =~ /^Duration\s*:[^=]*= (\d+) samples /n
46
+ samples = dst['samples'] = $1.to_i
47
+ return soxi_failed(infile, 0) if samples == 0
48
+
49
+ out =~ /^Channels\s*:\s*(\d+)/n and dst['channels'] = $1.to_i
50
+ out =~ /^Sample Rate\s*:\s*(\d+)/n and dst['rate'] = $1.to_i
51
+ out =~ /^Precision\s*:\s*(\d+)-bit/n and dst['bits'] = $1.to_i
52
+
53
+ if out =~ /\nComments\s*:[ \t]*\n?(.*)\z/mn
54
+ comments = dst['comments'] = {}
55
+ key = nil
56
+ $1.split(/\n/n).each do |line|
57
+ if line.sub!(/^([^=]+)=/ni, '')
58
+ key = DTAS.dedupe_str($1.upcase)
59
+ end
60
+ (comments[key] ||= ''.b) << "#{line}\n" unless line.empty?
61
+ end
62
+ comments.each do |k,v|
63
+ v.chomp!
64
+ comments[k] = DTAS.dedupe_str(v)
65
+ end
66
+ end
67
+ dst
68
+ end
69
+ end
70
+
43
71
  def try(infile, offset = nil, trim = nil)
44
- err = "".b
45
- cmd = %W(soxi -s #{infile})
46
- s = qx(@env.dup, cmd, err_str: err, no_raise: true)
47
- return if err =~ /soxi FAIL formats:/
48
- try_to_fail_harder(infile, s, cmd) or return
49
- source_file_dup(infile, offset, trim)
72
+ ent = mcache_lookup(infile) or return
73
+ ret = source_file_dup(infile, offset, trim)
74
+ ret.instance_eval do
75
+ @samples = ent['samples']
76
+ @format = DTAS::Format.load(ent)
77
+ @comments = ent['comments']
78
+ end
79
+ ret
50
80
  end
51
81
 
52
82
  def format
53
- @format ||= DTAS::Format.from_file(@env, @infile)
83
+ @format ||= begin
84
+ ent = mcache_lookup(@infile)
85
+ ent ? DTAS::Format.load(ent) : nil
86
+ end
54
87
  end
55
88
 
56
89
  def duration
@@ -60,23 +93,17 @@ def duration
60
93
  # This is the number of samples according to the samples in the source
61
94
  # file itself, not the decoded output
62
95
  def samples
63
- @samples ||= qx(@env, %W(soxi -s #@infile)).to_i
64
- rescue => e
65
- warn e.message
66
- 0
96
+ (@samples ||= begin
97
+ ent = mcache_lookup(@infile)
98
+ ent ? ent['samples'] : nil
99
+ end) || 0
67
100
  end
68
101
 
69
- # just run soxi -a
70
102
  def __load_comments
71
103
  tmp = {}
72
104
  case @infile
73
105
  when String
74
- qx(@env, %W(soxi -a #@infile)).split("\n").each do |line|
75
- key, value = line.split('=', 2)
76
- key && value or next
77
- # TODO: multi-line/multi-value/repeated tags
78
- tmp[key.upcase.freeze] = value
79
- end
106
+ ent = mcache_lookup(@infile) and tmp = ent['comments']
80
107
  end
81
108
  tmp
82
109
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # workaround for older Rubies: https://bugs.ruby-lang.org/issues/8770
4
4
  module DTAS::SpawnFix # :nodoc:
5
5
  def spawn(*args)
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative 'format'
@@ -38,7 +38,14 @@ def commit(advance_track_samples)
38
38
  tlen = advance_track_samples - tbeg
39
39
  trimfx = "trim #{tbeg}s #{tlen}s".dup
40
40
  if fade_in
41
- trimfx << " #{fade_in}"
41
+ # generate fade-in effect
42
+ # $1 = "t 4" => "fade t 4 0 0"
43
+ tmp = fade_in.dup
44
+ fade_in_len = tmp.pop or
45
+ raise ArgumentError, 'fade_in needs a time value'
46
+ fade_type = tmp.pop # may be nil
47
+ fade = " fade #{fade_type} #{fade_in_len} 0 0"
48
+ trimfx << fade
42
49
  end
43
50
  if fade_out
44
51
  tmp = fade_out.dup
@@ -287,10 +294,8 @@ def parse_track(argv)
287
294
 
288
295
  argv.each do |arg|
289
296
  case arg
290
- when %r{\Afade_in=(.+)\z}
291
- # generate fade-in effect
292
- # $1 = "t 4" => "fade t 4 0 0"
293
- t.fade_in = "fade #$1 0 0"
297
+ when %r{\Afade_in=(.+)\z} # $1 = "t 4" or just "4"
298
+ t.fade_in = $1.split(/\s+/)
294
299
  when %r{\Afade_out=(.+)\z} # $1 = "t 4" or just "4"
295
300
  t.fade_out = $1.split(/\s+/)
296
301
  when %r{\A\.(\w+)=(.+)\z} then t.comments[$1] = $2
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require 'yaml'
5
5
  require 'tempfile'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative 'parse_time'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2015-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
 
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative 'serialize'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require 'socket'
5
5
  require 'io/wait'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require_relative 'xs'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require 'socket'
5
5
  require_relative '../dtas'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
 
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
 
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
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'
5
5
  require 'shellwords'
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/perl -w
2
2
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
3
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
3
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
4
4
  use strict;
5
5
  use Graph::Easy; # for ASCII-art graphs
6
6
  $^O =~ /linux/ or print STDERR "$0 probably only works on Linux...\n";
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  #
5
5
  # this works with the __covmerge method in test/helper.rb
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  $stdout.sync = $stderr.sync = Thread.abort_on_exception = true
5
5
  require 'thread'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require './test/helper'
5
5
  require 'dtas/player'
@@ -1,11 +1,15 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require './test/helper'
5
5
  require 'stringio'
6
6
  require 'dtas/buffer'
7
7
 
8
8
  class TestBuffer < Testcase
9
+
10
+ @@max_size = File.read("/proc/sys/fs/pipe-max-size").to_i
11
+ @@max_size = nil if @@max_size == 0
12
+
9
13
  def teardown
10
14
  @to_close.each { |io| io.close unless io.closed? }
11
15
  end
@@ -43,16 +47,16 @@ def new_buffer
43
47
 
44
48
  def test_set_buffer_size
45
49
  buf = new_buffer
46
- buf.buffer_size = DTAS::Buffer::MAX_SIZE
47
- assert_equal DTAS::Buffer::MAX_SIZE, buf.buffer_size
48
- end if defined?(DTAS::Buffer::MAX_SIZE)
50
+ buf.buffer_size = @@max_size
51
+ assert_equal @@max_size, buf.buffer_size
52
+ end if @@max_size
49
53
 
50
54
  def test_buffer_size
51
55
  buf = new_buffer
52
56
  assert_operator buf.buffer_size, :>, 128
53
- buf.buffer_size = DTAS::Buffer::MAX_SIZE
54
- assert_equal DTAS::Buffer::MAX_SIZE, buf.buffer_size
55
- end if defined?(DTAS::Buffer::MAX_SIZE)
57
+ buf.buffer_size = @@max_size
58
+ assert_equal @@max_size, buf.buffer_size
59
+ end if @@max_size
56
60
 
57
61
  def test_broadcast_1
58
62
  buf = new_buffer
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require_relative 'helper'
5
5
  require 'dtas/process'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require_relative 'helper'
5
5
  require 'dtas/fadefx'
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
2
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
3
  # frozen_string_literal: true
4
4
  require './test/helper'
5
5
  require 'tempfile'