rumu 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rumu +16 -16
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ce3ca00e1302fb06489bdc6cc1bdba2b7ae0b63e7f708cda2bd5f44b703ac7b
4
- data.tar.gz: 3863590d73009b330208e26393785958221e8c0bbb278fa69b5c4a98141949d1
3
+ metadata.gz: caa90367efb46acc18ef760c9c8aaa7b419c76647e5363b298820e75f6470c5e
4
+ data.tar.gz: 8a2f3f3bf5538bdba349ddfbc87976305bbf5dc0f5c8c2f4804f2a1c24dd0c87
5
5
  SHA512:
6
- metadata.gz: 9f0cf8ec4200de7b176b1fd1d94f64ecc8ef5ee013e5f1ad05d44770b41637e7ca1eb8339a05621541d2089c2fb7a1dc0e06ab327947c020c0d09f73f0828e72
7
- data.tar.gz: b9d3550542d9854ec5ac8cbe003fb2c75c617a10152025ad1bed3c04fc8866cd3a131dd3c3b6763e7a106a3f829a77fcdbc3143d470b7ff9a38bda776dd6deda
6
+ metadata.gz: c7d7101a7a9d234e418c973b20790291eb719199bea093255c6c5c09da3e11520c5806c293c513caaa574c73edd5c79a29c4aec4f907191146b6c857c3588df0
7
+ data.tar.gz: d1d6370be84e12e1b693eabb6381ac4e2497a46fd56bd694c5366a2fb5083a4e4e1c09adb706c75a7fc445d9849071f530d8cfe471f4169df3ee41178eb05313
data/bin/rumu CHANGED
@@ -5,22 +5,19 @@ require 'io/console'
5
5
  require 'pathname'
6
6
 
7
7
  pkg='rumu'
8
- ver='0.3'
8
+ ver='0.3.1'
9
9
  pkgd="#{Dir.home}/.config/#{pkg}"
10
10
 
11
11
  word=4
12
12
  rate=44100
13
13
  chan=2
14
- cycle=0
15
-
16
- ff_exe="ffmpeg -hide_banner"
17
14
  ff_fmt="-ac #{chan} -ar #{rate} -f f#{word*8}le"
18
- ff_out="-f pulse default"
19
15
 
16
+ cycle=0
20
17
  list=[]
21
18
  list_i=0
22
19
  mode=:load
23
- toff=''
20
+ ssoff=''
24
21
  if ARGV.length==0
25
22
  if File.file?("#{pkgd}/list")
26
23
  list=File.read("#{pkgd}/list").split("\n")
@@ -41,8 +38,8 @@ end
41
38
  prefix=/\A(.*).*(\n\1.*)*\Z/.match(list.join("\n"))[1]
42
39
 
43
40
  ii,io,ie,it=nil,nil,nil,nil
44
- oi,oo,oe,ot=Open3.popen3("#{ff_exe} #{ff_fmt} -i - #{ff_out}")
45
- [oo,oe].each{|x|x.close}
41
+ oi,oo,oe,ot=Open3.popen3("ffmpeg #{ff_fmt} -i - -f pulse default")
42
+ oo.close
46
43
 
47
44
  pt=Thread.new{
48
45
  until :quit == mode
@@ -52,11 +49,12 @@ pt=Thread.new{
52
49
  end
53
50
  case mode
54
51
  when :load #load new track
55
- io.close unless !io or io.closed?
56
- ii,io,ie,it = Open3.popen3 "#{ff_exe} -i #{Shellwords.escape(list[list_i])} #{ssoff} #{ff_fmt} -"
57
- [ii,ie].each{|x|x.close}
52
+ [io,ie].each{|x|x.close} unless !io or io.closed?
53
+ ii,io,ie,it = Open3.popen3 "ffmpeg -i #{Shellwords.escape(list[list_i])} #{ssoff} #{ff_fmt} -"
54
+ puts "\r#{list[list_i][prefix.length..-1]}"
55
+ ii.close
58
56
  cycle=0 unless ssoff.length > 0
59
- puts
57
+ ssoff=''
60
58
  mode=:play
61
59
  when :play
62
60
  oi.write(io.read(word*chan*rate))
@@ -66,8 +64,8 @@ pt=Thread.new{
66
64
  }
67
65
 
68
66
  until :quit == mode
69
- print "\r#{list[list_i][prefix.length..-1]} [#{cycle/60}:#{"%02d"%(cycle%60)}] [N]ext #{list_i>0?"[P]rev ":""}[Q]uit > "
70
- case IO.console.raw{|c|c.read_nonblock(1) rescue ''}
67
+ print "\r#{cycle/60}:#{"%02d"%(cycle%60)} > "
68
+ case ch=IO.console.raw{|c|c.read_nonblock(1) rescue ''}
71
69
  when 'n'
72
70
  list_i+=1
73
71
  mode= list_i<list.count ? :load : :quit
@@ -78,8 +76,10 @@ until :quit == mode
78
76
  end
79
77
  when 'q'
80
78
  mode=:quit
81
- else
79
+ when ''
82
80
  sleep rand
81
+ else
82
+ print "#{ch} < [N]ext #{list_i>0?"[P]rev ":""}[Q]uit"
83
83
  end
84
84
  end
85
85
 
@@ -89,5 +89,5 @@ if list_i<list.count
89
89
  File.write(pkgd+"/pos",list_i.to_s+"\n"+cycle.to_s)
90
90
  end
91
91
 
92
- puts " ] #{pkg} ✝ v#{ver} [ "
92
+ puts "\r ] #{pkg} ✝ v#{ver} [ "
93
93
  pt.join
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Cook
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2021-03-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: rum is an aggressively minimized audio player that plays a playlist gaplessly
14
- leveraging command-line ffmpeg and pipes. After a quit, it will return to where
15
- it left off when run next.
13
+ description: rumu is an aggressively minimized audio player that plays a playlist
14
+ gaplessly leveraging command-line ffmpeg and pipes. After a quit, it will return
15
+ to where it left off when run next.
16
16
  email: root@baryon.it
17
17
  executables:
18
18
  - rumu