rumu 0.4.1 → 0.4.2
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.
- checksums.yaml +4 -4
- data/bin/rumu +31 -40
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c513bd3c485e3d4e1e4cd93bd78fd8697f681e06f4b02f621074381b2e3adc74
|
4
|
+
data.tar.gz: 31d65a7899a76517cf5259268835f41b5cf21ff49ab7f22173014e0c303c90de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f54f7c90953189088f948baa1e7cd1a3e93bdecd93ff0a2fcc367e39a3ce1b15a52992688615ea239739b7ca9f201cea20b2b3269c18d07c80c50cb78dd1704
|
7
|
+
data.tar.gz: ceab4d9aabb925ae942c17153a20da8568a87ce3dd98a089525f813718338894ca3dbfe4775143d541e03d96119e1c36e3868381bee1f13654762246f692fa25
|
data/bin/rumu
CHANGED
@@ -3,53 +3,46 @@ require 'open3'
|
|
3
3
|
require 'shellwords'
|
4
4
|
require 'io/console'
|
5
5
|
require 'pathname'
|
6
|
-
require '
|
6
|
+
require 'pulseaudio_simple_fiddle'
|
7
7
|
|
8
|
-
Pkg='rumu'
|
9
|
-
Ver='0.4.1'
|
8
|
+
Pkg,Ver='rumu','0.4.2'
|
10
9
|
ConfigDir="#{Dir.home}/.config/#{Pkg}"
|
11
10
|
Dir.mkdir(ConfigDir) unless File.directory?(ConfigDir)
|
12
11
|
|
13
12
|
Channels,Rate,WordSize=2,44100,4
|
14
13
|
FfmpegFmt="-ac #{Channels} -ar #{Rate} -f f#{WordSize*8}le"
|
15
14
|
|
16
|
-
class
|
15
|
+
class BasicO
|
16
|
+
def write(buf) = buf == nil ? buf : @dev.write(buf)
|
17
|
+
def close = @dev.close
|
18
|
+
end
|
19
|
+
|
20
|
+
class FfmpegPipeO < BasicO
|
17
21
|
def initialize(device, channels: Channels, rate: Rate, wordsize: WordSize )
|
18
22
|
device = device.to_s.chomp.length>0 ? device.to_s.chomp : '-f pulse default'
|
19
|
-
@
|
23
|
+
@dev,@out,@err,@thr = Open3.popen3("ffmpeg -loglevel -8 #{FfmpegFmt} -i - #{device}")
|
20
24
|
@out.close
|
21
25
|
@err.close
|
22
26
|
end
|
23
|
-
def write buf
|
24
|
-
@in.write buf
|
25
|
-
end
|
26
|
-
def close
|
27
|
-
@in.close
|
28
|
-
end
|
29
27
|
end
|
30
28
|
|
31
|
-
class ConfigO
|
29
|
+
class ConfigO < BasicO
|
32
30
|
def initialize file: ConfigDir+'/out'
|
33
|
-
@mode=:pulse
|
34
|
-
@device=nil
|
31
|
+
@mode,@devname=:pulse,nil
|
35
32
|
if File.file?(file)
|
36
33
|
cfg=File.read(file).split("\n")
|
37
34
|
@mode=cfg[0].to_sym
|
38
|
-
@
|
35
|
+
@devname=cfg[1].to_s.chomp.length>0 ? cfg[1] : nil
|
39
36
|
end
|
40
|
-
File.write(file,@mode.to_s+"\n"+@
|
41
|
-
@
|
42
|
-
FfmpegPipeO.new(@
|
43
|
-
|
44
|
-
end
|
45
|
-
def write buf
|
46
|
-
@out.write buf
|
47
|
-
end
|
48
|
-
def close
|
49
|
-
@out.close
|
37
|
+
File.write(file,@mode.to_s+"\n"+@devname.to_s)
|
38
|
+
@dev= :ffmpeg == @mode ?
|
39
|
+
FfmpegPipeO.new(@devname) :
|
40
|
+
PulseAudio::SimpleO.new(Pkg,'Music Playlist',channels:Channels,rate:Rate,device:@devname)
|
50
41
|
end
|
51
42
|
end
|
52
43
|
|
44
|
+
def print_brand = print "\r ] #{Pkg} ✝ v#{Ver} [ "
|
45
|
+
|
53
46
|
list,list_i,cycle,mode,ssoff,help=[],0,0,:load,'',''
|
54
47
|
if ARGV.length==0
|
55
48
|
if File.file?("#{ConfigDir}/list")
|
@@ -66,17 +59,16 @@ if ARGV.length==0
|
|
66
59
|
exit 1
|
67
60
|
end
|
68
61
|
else
|
69
|
-
list=ARGV.map{|x|Pathname(x).realpath.to_s}
|
62
|
+
list=ARGV.map{|x| Pathname(x).realpath.to_s}
|
70
63
|
end
|
71
64
|
prefix=/\A(.*).*(\n\1.*)*\Z/.match(list.join("\n"))[1]
|
72
65
|
puts prefix
|
73
66
|
|
74
|
-
ii,io,ie,it=nil,nil,nil,nil
|
75
67
|
oo=ConfigO.new
|
76
|
-
|
77
68
|
bq=SizedQueue.new 4
|
78
69
|
|
79
70
|
iit=Thread.new {
|
71
|
+
io,ie=nil,nil
|
80
72
|
until :quit == mode
|
81
73
|
if io and io.eof?
|
82
74
|
list_i+=1
|
@@ -87,10 +79,8 @@ iit=Thread.new {
|
|
87
79
|
ii,io,ie,it = Open3.popen3 "ffmpeg -loglevel -8 -i #{Shellwords.escape(list[list_i])} #{ssoff} #{FfmpegFmt} -"
|
88
80
|
ii.close
|
89
81
|
cycle=0 unless ssoff.length > 0
|
90
|
-
|
91
|
-
ssoff=''
|
92
|
-
help=''
|
93
|
-
mode=:play
|
82
|
+
puts "#{' '*help.length}\r#{list[list_i][prefix.length..-1]}" unless list[list_i].length == prefix.length
|
83
|
+
ssoff,help,mode='','',:play
|
94
84
|
end
|
95
85
|
bq.push io.read(Channels*Rate*WordSize)
|
96
86
|
end
|
@@ -98,8 +88,8 @@ iit=Thread.new {
|
|
98
88
|
}
|
99
89
|
|
100
90
|
oot=Thread.new{
|
101
|
-
until :quit == mode
|
102
|
-
if
|
91
|
+
until ( :quit == mode )
|
92
|
+
if ! bq.empty?
|
103
93
|
oo.write bq.pop
|
104
94
|
cycle+=1
|
105
95
|
else
|
@@ -123,22 +113,23 @@ until :quit == mode
|
|
123
113
|
mode=:load
|
124
114
|
end
|
125
115
|
when 's'
|
126
|
-
print
|
116
|
+
print 'Seek to: '
|
127
117
|
ti=(ts=IO.console.readline.chomp).split(':')
|
128
118
|
ssoff="-ss #{ts}"
|
129
119
|
cycle=(ti[-1].to_f + ti[-2].to_f*60 + ti[-3].to_f*60*60).to_i
|
130
120
|
mode=:load
|
131
121
|
when 'q'
|
132
122
|
mode=:quit
|
133
|
-
File.write(ConfigDir+
|
134
|
-
File.write(ConfigDir+
|
123
|
+
File.write(ConfigDir+'/list',list.join("\n"))
|
124
|
+
File.write(ConfigDir+'/pos',list_i.to_s+"\n"+cycle.to_s)
|
125
|
+
print_brand
|
135
126
|
when ''
|
136
127
|
sleep rand
|
137
128
|
else
|
138
129
|
print (help="#{ch} < #{list_i>0?"[P]rev ":""}[R]estart [S]eek [N]ext [Q]uit")
|
139
130
|
end
|
140
131
|
end
|
141
|
-
|
142
|
-
puts "\r ] #{Pkg} ✝ v#{Ver} [ "
|
143
|
-
iit.join
|
144
132
|
oot.join
|
133
|
+
print_brand
|
134
|
+
puts
|
135
|
+
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rumu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Cook
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: pulseaudio_simple_fiddle
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '0.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.0.
|
22
|
+
version: 0.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '0.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.0.
|
32
|
+
version: 0.0.0
|
33
33
|
description: rumu is an aggressively minimized audio player that plays a playlist
|
34
34
|
gaplessly leveraging command-line ffmpeg and pipes. After a quit, it will return
|
35
35
|
to where it left off when run next.
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
version: '0'
|
60
60
|
requirements:
|
61
61
|
- ffmpeg
|
62
|
-
rubygems_version: 3.
|
62
|
+
rubygems_version: 3.3.15
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: "(ru)by (mu)usic - a minimal ffmpeg-based gapless audio playlist player"
|