dtas 0.12.1 → 0.13.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 +3 -2
  3. data/Documentation/.gitignore +2 -2
  4. data/Documentation/GNUmakefile +2 -2
  5. data/Documentation/dtas-archive.txt +8 -7
  6. data/Documentation/dtas-console.txt +6 -3
  7. data/Documentation/dtas-ctl.txt +2 -2
  8. data/Documentation/dtas-cueedit.txt +2 -2
  9. data/Documentation/dtas-enq.txt +2 -2
  10. data/Documentation/dtas-env.txt +2 -2
  11. data/Documentation/dtas-msinkctl.txt +2 -2
  12. data/Documentation/dtas-player.txt +2 -2
  13. data/Documentation/dtas-player_effects.txt +2 -2
  14. data/Documentation/dtas-player_protocol.txt +3 -3
  15. data/Documentation/dtas-player_sink_examples.txt +2 -4
  16. data/Documentation/dtas-sinkedit.txt +2 -2
  17. data/Documentation/dtas-sourceedit.txt +2 -2
  18. data/Documentation/dtas-splitfx.txt +3 -24
  19. data/Documentation/dtas-tl.txt +7 -6
  20. data/Documentation/dtas-xdelay.txt +2 -2
  21. data/Documentation/update-footer.rb +4 -3
  22. data/GIT-VERSION-GEN +6 -5
  23. data/GNUmakefile +2 -2
  24. data/HACKING +2 -2
  25. data/INSTALL +9 -10
  26. data/README +5 -5
  27. data/Rakefile +75 -15
  28. data/TODO +2 -2
  29. data/bin/dtas-archive +3 -2
  30. data/bin/dtas-console +63 -22
  31. data/bin/dtas-ctl +3 -2
  32. data/bin/dtas-cueedit +3 -2
  33. data/bin/dtas-enq +3 -2
  34. data/bin/dtas-mlib +25 -3
  35. data/bin/dtas-msinkctl +3 -2
  36. data/bin/dtas-partstats +3 -2
  37. data/bin/dtas-player +3 -2
  38. data/bin/dtas-readahead +6 -5
  39. data/bin/dtas-sinkedit +3 -2
  40. data/bin/dtas-sourceedit +3 -2
  41. data/bin/dtas-splitfx +3 -2
  42. data/bin/dtas-tl +29 -16
  43. data/bin/dtas-xdelay +3 -2
  44. data/dtas-linux.gemspec +3 -3
  45. data/dtas-mpris.gemspec +4 -4
  46. data/dtas.gemspec +3 -2
  47. data/lib/dtas.rb +14 -7
  48. data/lib/dtas/buffer.rb +3 -2
  49. data/lib/dtas/buffer/read_write.rb +4 -3
  50. data/lib/dtas/buffer/splice.rb +3 -2
  51. data/lib/dtas/command.rb +3 -2
  52. data/lib/dtas/compat_onenine.rb +2 -2
  53. data/lib/dtas/cue_index.rb +4 -3
  54. data/lib/dtas/disclaimer.rb +3 -2
  55. data/lib/dtas/edit_client.rb +4 -3
  56. data/lib/dtas/fadefx.rb +4 -3
  57. data/lib/dtas/format.rb +3 -13
  58. data/lib/dtas/mlib.rb +19 -10
  59. data/lib/dtas/mlib/migrations/0001_initial.rb +2 -2
  60. data/lib/dtas/nonblock.rb +2 -2
  61. data/lib/dtas/parse_freq.rb +4 -4
  62. data/lib/dtas/parse_time.rb +4 -3
  63. data/lib/dtas/partstats.rb +6 -5
  64. data/lib/dtas/pipe.rb +3 -2
  65. data/lib/dtas/player.rb +4 -3
  66. data/lib/dtas/player/client_handler.rb +21 -9
  67. data/lib/dtas/process.rb +5 -4
  68. data/lib/dtas/replaygain.rb +7 -6
  69. data/lib/dtas/rg_state.rb +38 -14
  70. data/lib/dtas/serialize.rb +3 -2
  71. data/lib/dtas/sigevent.rb +3 -2
  72. data/lib/dtas/sigevent/efd.rb +2 -2
  73. data/lib/dtas/sigevent/pipe.rb +4 -3
  74. data/lib/dtas/sink.rb +3 -2
  75. data/lib/dtas/source.rb +3 -2
  76. data/lib/dtas/source/av.rb +3 -2
  77. data/lib/dtas/source/av_ff_common.rb +6 -5
  78. data/lib/dtas/source/cmd.rb +3 -2
  79. data/lib/dtas/source/common.rb +2 -2
  80. data/lib/dtas/source/ff.rb +3 -2
  81. data/lib/dtas/source/file.rb +7 -6
  82. data/lib/dtas/source/mp3gain.rb +3 -2
  83. data/lib/dtas/source/sox.rb +7 -5
  84. data/lib/dtas/source/splitfx.rb +8 -4
  85. data/lib/dtas/spawn_fix.rb +2 -2
  86. data/lib/dtas/splitfx.rb +5 -4
  87. data/lib/dtas/state_file.rb +3 -2
  88. data/lib/dtas/tfx.rb +6 -5
  89. data/lib/dtas/track.rb +4 -3
  90. data/lib/dtas/tracklist.rb +8 -8
  91. data/lib/dtas/unix_accepted.rb +3 -2
  92. data/lib/dtas/unix_client.rb +3 -2
  93. data/lib/dtas/unix_server.rb +3 -2
  94. data/lib/dtas/util.rb +3 -2
  95. data/lib/dtas/watchable.rb +10 -8
  96. data/lib/dtas/writable_iter.rb +3 -2
  97. data/lib/dtas/xs.rb +3 -2
  98. data/perl/dtas-graph +2 -2
  99. data/test/covshow.rb +3 -2
  100. data/test/helper.rb +3 -2
  101. data/test/player_integration.rb +3 -2
  102. data/test/test_buffer.rb +3 -2
  103. data/test/test_env.rb +3 -2
  104. data/test/test_fadefx.rb +3 -2
  105. data/test/test_format.rb +3 -2
  106. data/test/test_format_change.rb +3 -2
  107. data/test/test_mlib.rb +3 -2
  108. data/test/test_parse_freq.rb +3 -3
  109. data/test/test_player.rb +3 -2
  110. data/test/test_player_client_handler.rb +4 -3
  111. data/test/test_player_integration.rb +8 -2
  112. data/test/test_process.rb +5 -4
  113. data/test/test_rg_integration.rb +3 -2
  114. data/test/test_rg_state.rb +3 -2
  115. data/test/test_sink.rb +3 -2
  116. data/test/test_sink_pipe_size.rb +3 -2
  117. data/test/test_sink_tee_integration.rb +3 -2
  118. data/test/test_source_av.rb +6 -5
  119. data/test/test_source_sox.rb +7 -6
  120. data/test/test_splitfx.rb +3 -2
  121. data/test/test_tfx.rb +3 -2
  122. data/test/test_tracklist.rb +3 -2
  123. data/test/test_unixserver.rb +3 -2
  124. data/test/test_util.rb +3 -2
  125. metadata +3 -3
data/Rakefile CHANGED
@@ -1,21 +1,39 @@
1
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>.
2
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
3
+ # frozen_string_literal: true
3
4
  require 'tempfile'
4
5
  include Rake::DSL
6
+
7
+ def tags
8
+ timefmt = '%Y-%m-%dT%H:%M:%SZ'
9
+ @tags ||= `git tag -l --sort=-v:refname`.split(/\n/).map do |tag|
10
+ if %r{\Av[\d\.]+} =~ tag
11
+ header, subject, body = `git cat-file tag #{tag}`.split(/\n\n/, 3)
12
+ header = header.split(/\n/)
13
+ tagger = header.grep(/\Atagger /).first
14
+ {
15
+ time: Time.at(tagger.split(' ')[-2].to_i).utc.strftime(timefmt),
16
+ tagger_name: %r{^tagger ([^<]+)}.match(tagger)[1].strip,
17
+ tagger_email: %r{<([^>]+)>}.match(tagger)[1].strip,
18
+ id: `git rev-parse refs/tags/#{tag}`.chomp!,
19
+ tag: tag,
20
+ subject: subject,
21
+ body: body,
22
+ }
23
+ end
24
+ end.compact.sort { |a,b| b[:time] <=> a[:time] }
25
+ end
26
+
5
27
  task "NEWS" do
6
28
  latest = nil
7
29
  fp = Tempfile.new("NEWS", ".")
8
30
  fp.sync = true
9
- `git tag -l --sort=-v:refname`.split(/\n/).each do |tag|
10
- %r{\Av(.+)} =~ tag or next
11
- version = $1
12
- header, subject, body = `git cat-file tag #{tag}`.split(/\n\n/, 3)
13
- header = header.split(/\n/)
14
- tagger = header.grep(/\Atagger /)[0]
15
- time = Time.at(tagger.split(/ /)[-2].to_i).utc
16
- latest ||= time
17
- date = time.strftime("%Y-%m-%d")
18
- fp.puts "# #{version} / #{date}\n\n#{subject}"
31
+ tags.each do |tag|
32
+ version = tag[:tag].delete 'v'
33
+ fp.puts "# #{version} / #{tag[:time].split('T')[0]}"
34
+ fp.puts
35
+ fp.puts tag[:subject]
36
+ body = tag[:body]
19
37
  if body && body.strip.size > 0
20
38
  fp.puts "\n\n#{body}"
21
39
  end
@@ -24,17 +42,59 @@
24
42
  fp.puts "Unreleased" unless fp.size > 0
25
43
  fp.puts "# COPYRIGHT"
26
44
  fp.puts "Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>"
27
- fp.puts "License: GPLv3 or later (http://www.gnu.org/licenses/gpl-3.0.txt)"
45
+ fp.puts "License: GPL-3.0+ <http://www.gnu.org/licenses/gpl-3.0.txt>"
28
46
  fp.rewind
29
47
  assert_equal fp.read, File.read("NEWS") rescue nil
30
48
  fp.chmod 0644
31
49
  File.rename(fp.path, "NEWS")
50
+ end
51
+
52
+ desc 'prints news as an Atom feed'
53
+ task 'NEWS.atom' do
54
+ require 'builder' # gem install builder
55
+ url_base = 'http://dtas.80x24.org/'
56
+ cgit_url = 'http://80x24.org/dtas.git/'
57
+ new_tags = tags[0,10]
58
+ x = Builder::XmlMarkup.new
59
+ x.instruct! :xml, encoding: 'UTF-8', version: '1.0'
60
+ x.feed(xmlns: 'http://www.w3.org/2005/Atom') do
61
+ x.id "#{url_base}/NEWS.atom"
62
+ x.title "dtas news"
63
+ x.subtitle 'duct tape audio suite for *nix'
64
+ x.link rel: 'alternate', type: 'text/plain', href: "#{url_base}/NEWS"
65
+ x.updated(new_tags.empty? ? "1970-01-01T00:00:00Z" : new_tags.first[:time])
66
+ new_tags.each do |tag|
67
+ x.entry do
68
+ x.title tag[:subject]
69
+ x.updated tag[:time]
70
+ x.published tag[:time]
71
+ x.author {
72
+ x.name tag[:tagger_name]
73
+ x.email tag[:tagger_email]
74
+ }
75
+ url = "#{cgit_url}/tag/?id=#{tag[:tag]}"
76
+ x.link rel: 'alternate', type: 'text/html', href: url
77
+ x.id url
78
+ x.content(type: :xhtml) do
79
+ x.div(xmlns: 'http://www.w3.org/1999/xhtml') do
80
+ x.pre tag[:body]
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+
87
+ fp = Tempfile.new(%w(NEWS .atom), ".")
88
+ fp.sync = true
89
+ fp.puts x.target!
90
+ fp.chmod 0644
91
+ File.rename fp.path, 'NEWS.atom'
32
92
  fp.close!
33
93
  end
34
94
 
35
- task rsync_docs: "NEWS" do
95
+ task rsync_docs: %w(NEWS NEWS.atom) do
36
96
  dest = ENV["RSYNC_DEST"] || "80x24.org:/srv/dtas/"
37
- top = %w(INSTALL NEWS README COPYING)
97
+ top = %w(INSTALL NEWS README COPYING NEWS.atom)
38
98
  files = []
39
99
 
40
100
  # git-set-file-times is distributed with rsync,
data/TODO CHANGED
@@ -5,5 +5,5 @@
5
5
 
6
6
  # COPYRIGHT
7
7
 
8
- Copyright 2013-2015 all contributors <dtas-all@nongnu.org>\
9
- License: GPLv3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>
8
+ Copyright 2013-2016 all contributors <dtas-all@nongnu.org>\
9
+ License: GPL-3.0+ <http://www.gnu.org/licenses/gpl-3.0.txt>
data/bin/dtas-archive CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # Copyright (C) 2015-2016 all contributors <dtas-all@nongnu.org>
3
+ # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
4
+ # frozen_string_literal: true
4
5
  usage = "#$0 SOURCE DESTINATION"
5
6
 
6
7
  # We could use the equivalent sox command here, but some folks working on
data/bin/dtas-console CHANGED
@@ -1,12 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  #
5
6
  # Note: no idea what I'm doing, especially w.r.t. curses
6
7
  require 'dtas'
7
8
  require 'dtas/unix_client'
8
9
  require 'dtas/rg_state'
9
10
  require 'dtas/sigevent'
11
+ require 'dtas/process'
12
+ require 'dtas/format'
13
+ include DTAS::Process
10
14
  require 'yaml'
11
15
  begin
12
16
  require 'curses'
@@ -99,7 +103,7 @@ def fmt_to_s(f)
99
103
  end
100
104
 
101
105
  def rg_string(rg, current)
102
- rv = "rg mode=#{rg['mode']||'off'}"
106
+ rv = "rg mode=#{rg['mode']||'off'}".dup
103
107
  defaults = DTAS::RGState::RG_DEFAULT
104
108
  # don't show things that are too rare
105
109
  %w(preamp fallback_gain).each do |param|
@@ -114,6 +118,7 @@ def may_fail(res, events)
114
118
  events << res if res != "OK"
115
119
  end
116
120
 
121
+ pre_mute_vol = 1.0
117
122
  enc_locale = Encoding.find("locale")
118
123
  $stdout.set_encoding(enc_locale)
119
124
  enc_opts = { undef: :replace, invalid: :replace, replace: '?' }
@@ -128,47 +133,79 @@ def may_fail(res, events)
128
133
  loop do
129
134
  lineno = -1
130
135
  pfmt = cur['format']
136
+ elapsed = samples = 0
137
+ fmt = total = ''
138
+ paused = false
131
139
  if current = cur['current']
132
- Curses.setpos(lineno += 1, 0)
133
- Curses.clrtoeol
134
- if infile = current['infile']
135
- # FS encoding != locale encoding, but we need to display an FS path
136
- # name to whatever locale the terminal is encoded to, so force
137
- # it and risk mojibake...
138
- infile.encode(enc_locale, enc_opts)
139
- Curses.addstr(infile)
140
- else
141
- Curses.addstr(current['command'])
142
- end
143
-
140
+ infile = current['infile'] || current['command']
144
141
  elapsed = DTAS.now - current['spawn_at']
145
142
  if (nr = cur['current_initial']) && (current_format = current['format'])
146
143
  rate = current_format['rate'].to_f
147
144
  elapsed += nr / rate
148
- total = " [#{Time.at(current['samples'] / rate).strftime(tfmt)}]"
145
+ samples = current['samples']
149
146
  fmt = "(#{fmt_to_s(current_format)} > #{fmt_to_s(pfmt)})"
150
147
  else
151
- total = ""
152
148
  fmt = fmt_to_s(pfmt)
153
149
  fmt = "(#{fmt} > #{fmt})"
154
150
  end
151
+ elsif cur['paused'] && infile = cur['current_paused']
152
+ fmt = "[paused] (#{fmt_to_s(pfmt)})"
153
+ paused = true
154
+ infile = infile['command'] if Hash === infile
155
+ if Array === infile
156
+ infile, elapsed = infile
157
+ elapsed = elapsed.to_i
158
+ samples = rate = 0
159
+ if (bypass = cur['bypass']) && bypass.include?('rate')
160
+ rate = pfmt['rate'].to_f
161
+ else
162
+ rate = qx(%W(soxi -r #{infile}), err: DTAS.null).to_i rescue 0
163
+ end
164
+ elapsed /= rate.to_f if rate != 0
165
+ end
166
+ end
155
167
 
168
+ if infile
169
+ # FS encoding != locale encoding, but we need to display an FS path
170
+ # name to whatever locale the terminal is encoded to, so force it
171
+ # and risk mojibake...
172
+ infile.encode(enc_locale, enc_opts)
173
+ Curses.setpos(lineno += 1, 0)
174
+ Curses.clrtoeol
175
+ Curses.addstr(infile)
176
+ total = " [#{Time.at(samples / rate).strftime(tfmt)}]" if samples != 0
156
177
  Curses.setpos(lineno += 1, 0)
157
178
  Curses.clrtoeol
158
- Curses.addstr("#{Time.at(elapsed).strftime(tfmt)}#{total} #{fmt}")
179
+ if rate != 0
180
+ Curses.addstr("#{Time.at(elapsed).strftime(tfmt)}#{total} #{fmt}")
181
+ else
182
+ Curses.addstr("#{elapsed} samples #{total} #{fmt}")
183
+ end
159
184
  else
160
185
  Curses.setpos(lineno += 1, 0)
161
186
  Curses.clrtoeol
162
- Curses.addstr(cur['paused'] ? "paused #{pause}" : 'idle')
187
+ Curses.addstr('idle')
163
188
  Curses.setpos(lineno += 1, 0)
164
189
  Curses.clrtoeol
165
190
  end
166
191
 
167
- rgs = rg_string(cur["rg"] || {}, current)
192
+ rg = cur['rg'] || {}
193
+ rgs = rg_string(rg, current)
168
194
  Curses.setpos(lineno += 1, 0)
169
195
  Curses.clrtoeol
170
196
  Curses.addstr(rgs)
171
197
 
198
+ Curses.setpos(lineno += 1, 0)
199
+ Curses.clrtoeol
200
+ cur_vol = rg['volume'] || 1.0
201
+ extra = [ "volume=#{cur_vol}" ]
202
+ tl = cur['tracklist'] || {}
203
+ %w(repeat shuffle).each { |x| extra << "#{x}=#{tl[x] || 'false'}" }
204
+ trim = cur['trim'] || 'off'
205
+ extra << "trim=#{trim}"
206
+ Curses.addstr(extra.join(' '))
207
+ pre_mute_vol = cur_vol if cur_vol != 0
208
+
172
209
  show_events(lineno, screen, events)
173
210
 
174
211
  Curses.refresh # draw and wait
@@ -206,8 +243,12 @@ def may_fail(res, events)
206
243
  # yes, some of us have long audio files
207
244
  when Curses::KEY_PPAGE then c.req_ok("seek +600")
208
245
  when Curses::KEY_NPAGE then c.req_ok("seek -600")
209
- when "9" then c.req_ok("rg preamp-=1")
210
- when "0" then c.req_ok("rg preamp+=1")
246
+ when '9' then c.req_ok('rg volume-=0.01')
247
+ when '0' then c.req_ok('rg volume+=0.01')
248
+ when '=' then c.req_ok('rg volume=1')
249
+ when '7' then c.req_ok('rg preamp-=1')
250
+ when '8' then c.req_ok('rg preamp+=1')
251
+ when 'm' then c.req_ok("rg volume=#{cur_vol == 0 ? pre_mute_vol : 0}")
211
252
  when "F" then c.req_ok("rg fallback_gain+=1")
212
253
  when "f" then c.req_ok("rg fallback_gain-=1")
213
254
  when ">" then c.req_ok("tl next")
data/bin/dtas-ctl CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  require 'dtas/unix_client'
5
6
 
6
7
  c = DTAS::UNIXClient.new
data/bin/dtas-cueedit CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  require 'tempfile'
5
6
  require 'dtas/xs'
6
7
  usage = "Usage: #$0 FILENAME"
data/bin/dtas-enq CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  require 'dtas/unix_client'
5
6
  c = DTAS::UNIXClient.new
6
7
 
data/bin/dtas-mlib CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # Copyright (C) 2015-2016 all contributors <dtas-all@nongnu.org>
3
+ # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
4
+ # frozen_string_literal: true
4
5
  usage = "#$0 [-d DATABASE-URI] ACTION [ARGS]"
5
6
  Thread.abort_on_exception = $stderr.sync = $stdout.sync = true
6
7
  trap(:INT, 'SYSTEM_DEFAULT')
@@ -39,9 +40,30 @@ def mlib(db, migrate = false)
39
40
  when 'update', 'up'
40
41
  directory = ARGV.shift or abort "DIRECTORY required\n#{usage}"
41
42
  mlib(db, migrate = true).update(directory)
43
+ when 'stats'
44
+ s = mlib(db, true).stats
45
+ %w(artists albums songs db_playtime).each { |k| puts "#{k}: #{s[k.to_sym]}" }
42
46
  when 'dump' # mainly for debugging
43
47
  directory = ARGV.shift || '/'
44
- mlib(db).dump(directory)
48
+ mlib(db).dump(directory, {}, lambda do |parent, node, comments|
49
+ puts "Path: #{parent[:dirname]}/#{node[:name]}"
50
+ puts "Length: #{node[:tlen]}"
51
+ return if comments.empty?
52
+ puts 'Comments:'
53
+ comments.each do |k,v|
54
+ if v.size == 1
55
+ puts "\t#{k}: #{v[0]}"
56
+ else
57
+ v << ''
58
+ puts "\t#{k}:\n\t\t#{v.join("\t\t\n")}"
59
+ end
60
+ end
61
+ puts
62
+ end)
63
+ when 'find', 'search'
64
+ m = mlib(db)
65
+ cache = {}
66
+ m.__send__(action, *ARGV) { |node| puts m.path_of(node, cache) }
45
67
  else
46
68
  abort usage
47
69
  end
data/bin/dtas-msinkctl CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  require 'yaml'
5
6
  require 'dtas/unix_client'
6
7
  usage = "#$0 <active-set|active-add|active-sub|nonblock|active> SINK"
data/bin/dtas-partstats CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  # TODO
5
6
  # - option parsing: sox effects, stats effect options
6
7
  # - support piping out to external processes
data/bin/dtas-player CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  Thread.abort_on_exception = $stderr.sync = $stdout.sync = true
5
6
  require 'yaml'
6
7
  require 'dtas/player'
data/bin/dtas-readahead CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # Copyright (C) 2015-2016 all contributors <dtas-all@nongnu.org>
3
+ # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
4
+ # frozen_string_literal: true
4
5
  #
5
6
  # Really janky readahead script. Requires dtas-player to be
6
7
  # running and unlikely to work outside of Linux as it depends on
@@ -95,9 +96,9 @@ def do_ra(fp, pos, w)
95
96
  pp({start_ra: File.basename(path),
96
97
  len: '%.3f' % (len / (1024 * 1024.0)),
97
98
  pos: pos })
98
- Process.spawn('soxi', path, @redir)
99
- Process.spawn('avprobe', path, @redir)
100
- Process.spawn('ffprobe', path, @redir)
99
+ spawn('soxi', path, @redir)
100
+ spawn('avprobe', path, @redir)
101
+ spawn('ffprobe', path, @redir)
101
102
  fp.advise(:sequential, pos, len)
102
103
  Thread.new(fp.dup) { |d| d.advise(:willneed, pos, len); d.close }
103
104
 
data/bin/dtas-sinkedit CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  require 'optparse'
5
6
  require 'dtas/edit_client'
6
7
  require 'dtas/sigevent'
data/bin/dtas-sourceedit CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  require 'optparse'
5
6
  require 'dtas/edit_client'
6
7
  require 'dtas/sigevent'
data/bin/dtas-splitfx CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
3
- # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
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)
4
+ # frozen_string_literal: true
4
5
  require 'yaml'
5
6
  require 'optparse'
6
7
  require 'dtas/splitfx'