dtas 0.14.2 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Documentation/.gitignore +1 -1
- data/Documentation/GNUmakefile +1 -1
- data/Documentation/dtas-archive.pod +2 -2
- data/Documentation/dtas-console.pod +2 -2
- data/Documentation/dtas-ctl.pod +2 -2
- data/Documentation/dtas-cueedit.pod +2 -2
- data/Documentation/dtas-enq.pod +2 -2
- data/Documentation/dtas-env.pod +2 -2
- data/Documentation/dtas-msinkctl.pod +2 -2
- data/Documentation/dtas-player.pod +2 -2
- data/Documentation/dtas-player_effects.pod +2 -2
- data/Documentation/dtas-player_protocol.pod +19 -4
- data/Documentation/dtas-player_sink_examples.pod +2 -2
- data/Documentation/dtas-sinkedit.pod +2 -2
- data/Documentation/dtas-sourceedit.pod +2 -2
- data/Documentation/dtas-splitfx.pod +1 -1
- data/Documentation/dtas-tl.pod +2 -2
- data/Documentation/dtas-xdelay.pod +2 -2
- data/Documentation/update-footer.rb +3 -3
- data/GIT-VERSION-GEN +2 -2
- data/GNUmakefile +1 -1
- data/HACKING +2 -2
- data/INSTALL +10 -10
- data/README +6 -5
- data/Rakefile +5 -5
- data/TODO +1 -1
- data/bin/dtas-archive +2 -2
- data/bin/dtas-console +1 -1
- data/bin/dtas-ctl +1 -1
- data/bin/dtas-cueedit +1 -1
- data/bin/dtas-enq +1 -1
- data/bin/dtas-mlib +1 -1
- data/bin/dtas-msinkctl +1 -1
- data/bin/dtas-partstats +1 -1
- data/bin/dtas-player +1 -1
- data/bin/dtas-readahead +19 -8
- data/bin/dtas-sinkedit +1 -1
- data/bin/dtas-sourceedit +1 -1
- data/bin/dtas-splitfx +1 -1
- data/bin/dtas-tl +1 -1
- data/bin/dtas-xdelay +1 -1
- data/dtas-linux.gemspec +2 -2
- data/dtas-mpris.gemspec +2 -2
- data/dtas.gemspec +2 -2
- data/lib/dtas.rb +15 -2
- data/lib/dtas/buffer.rb +1 -1
- data/lib/dtas/buffer/read_write.rb +1 -1
- data/lib/dtas/buffer/splice.rb +1 -2
- data/lib/dtas/command.rb +1 -1
- data/lib/dtas/compat_onenine.rb +1 -1
- data/lib/dtas/cue_index.rb +1 -1
- data/lib/dtas/disclaimer.rb +1 -1
- data/lib/dtas/edit_client.rb +1 -1
- data/lib/dtas/fadefx.rb +2 -2
- data/lib/dtas/format.rb +9 -5
- data/lib/dtas/mcache.rb +31 -0
- data/lib/dtas/mlib.rb +11 -7
- data/lib/dtas/mlib/migrations/0001_initial.rb +1 -1
- data/lib/dtas/nonblock.rb +1 -1
- data/lib/dtas/parse_freq.rb +1 -1
- data/lib/dtas/parse_time.rb +1 -1
- data/lib/dtas/partstats.rb +2 -3
- data/lib/dtas/pipe.rb +1 -1
- data/lib/dtas/player.rb +2 -1
- data/lib/dtas/player/client_handler.rb +74 -16
- data/lib/dtas/process.rb +1 -1
- data/lib/dtas/replaygain.rb +1 -1
- data/lib/dtas/rg_state.rb +4 -9
- data/lib/dtas/serialize.rb +1 -1
- data/lib/dtas/sigevent.rb +1 -1
- data/lib/dtas/sigevent/efd.rb +1 -1
- data/lib/dtas/sigevent/pipe.rb +1 -1
- data/lib/dtas/sink.rb +1 -1
- data/lib/dtas/source.rb +2 -1
- data/lib/dtas/source/av.rb +1 -1
- data/lib/dtas/source/av_ff_common.rb +7 -3
- data/lib/dtas/source/cmd.rb +1 -1
- data/lib/dtas/source/common.rb +1 -1
- data/lib/dtas/source/ff.rb +1 -1
- data/lib/dtas/source/file.rb +1 -1
- data/lib/dtas/source/mp3gain.rb +1 -1
- data/lib/dtas/source/sox.rb +59 -32
- data/lib/dtas/spawn_fix.rb +1 -1
- data/lib/dtas/splitfx.rb +11 -6
- data/lib/dtas/state_file.rb +1 -1
- data/lib/dtas/tfx.rb +1 -1
- data/lib/dtas/track.rb +1 -1
- data/lib/dtas/tracklist.rb +1 -1
- data/lib/dtas/unix_accepted.rb +1 -1
- data/lib/dtas/unix_client.rb +1 -1
- data/lib/dtas/unix_server.rb +1 -1
- data/lib/dtas/util.rb +1 -1
- data/lib/dtas/writable_iter.rb +1 -1
- data/lib/dtas/xs.rb +1 -1
- data/perl/dtas-graph +1 -1
- data/test/covshow.rb +1 -1
- data/test/helper.rb +1 -1
- data/test/player_integration.rb +1 -1
- data/test/test_buffer.rb +11 -7
- data/test/test_env.rb +1 -1
- data/test/test_fadefx.rb +1 -1
- data/test/test_format.rb +1 -1
- data/test/test_format_change.rb +1 -1
- data/test/test_mcache.rb +19 -0
- data/test/test_mlib.rb +1 -1
- data/test/test_parse_freq.rb +1 -1
- data/test/test_player.rb +1 -1
- data/test/test_player_client_handler.rb +1 -1
- data/test/test_player_integration.rb +1 -1
- data/test/test_process.rb +1 -1
- data/test/test_rg_integration.rb +2 -2
- data/test/test_rg_state.rb +9 -2
- data/test/test_sink.rb +1 -1
- data/test/test_sink_pipe_size.rb +1 -1
- data/test/test_sink_tee_integration.rb +1 -1
- data/test/test_source_av.rb +1 -1
- data/test/test_source_sox.rb +2 -1
- data/test/test_splitfx.rb +1 -1
- data/test/test_tfx.rb +1 -1
- data/test/test_tracklist.rb +1 -1
- data/test/test_unixserver.rb +1 -1
- data/test/test_util.rb +1 -1
- metadata +6 -4
data/lib/dtas/sigevent/efd.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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
|
data/lib/dtas/sigevent/pipe.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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
|
data/lib/dtas/sink.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/lib/dtas/source.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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
|
data/lib/dtas/source/av.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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+
|
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) { |_|
|
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) { |_|
|
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
|
data/lib/dtas/source/cmd.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/lib/dtas/source/common.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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
|
data/lib/dtas/source/ff.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/lib/dtas/source/file.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/lib/dtas/source/mp3gain.rb
CHANGED
data/lib/dtas/source/sox.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
case
|
27
|
-
when
|
28
|
-
when
|
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
|
-
|
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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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 ||=
|
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 ||=
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
-
|
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
|
data/lib/dtas/spawn_fix.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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)
|
data/lib/dtas/splitfx.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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
|
-
|
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
|
-
|
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
|
data/lib/dtas/state_file.rb
CHANGED
data/lib/dtas/tfx.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/lib/dtas/track.rb
CHANGED
data/lib/dtas/tracklist.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/lib/dtas/unix_accepted.rb
CHANGED
data/lib/dtas/unix_client.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/lib/dtas/unix_server.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/lib/dtas/util.rb
CHANGED
data/lib/dtas/writable_iter.rb
CHANGED
data/lib/dtas/xs.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/perl/dtas-graph
CHANGED
@@ -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+
|
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";
|
data/test/covshow.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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
|
data/test/helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/test/player_integration.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/test/test_buffer.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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 =
|
47
|
-
assert_equal
|
48
|
-
end if
|
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 =
|
54
|
-
assert_equal
|
55
|
-
end if
|
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
|
data/test/test_env.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/test/test_fadefx.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|
data/test/test_format.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2013-2016 all contributors <dtas-all@nongnu.org>
|
2
|
-
# License: GPL-3.0+
|
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'
|