Class: Player
- Inherits:
-
Hash
show all
- Defined in:
- lib/player/player.rb
Overview
Player 仮想クラスMplayer等で継承して使う
Instance Method Summary
collapse
Instance Method Details
#command ⇒ Object
6
|
# File 'lib/player/player.rb', line 6
def command; end
|
#duration(file) ⇒ Object
22
23
24
25
26
27
|
# File 'lib/player/player.rb', line 22
def duration(file)
stdout, stderr, status = Open3.capture3("ffprobe #{file}")
stderr =~ /Duration: (\d{2}):(\d{2}):(\d{2}.\d{2})/m
hour, min, sec = [$1, $2, $3].map(&:to_f)
hour*60*60 + min*60 + sec
end
|
#options ⇒ Object
11
12
13
|
# File 'lib/player/player.rb', line 11
def options
map{ |k,v| "--#{k} #{v}"}*' '
end
|
#play ⇒ Object
7
|
# File 'lib/player/player.rb', line 7
def play; end
|
#rec(file, sec, quiet = true) ⇒ Object
8
|
# File 'lib/player/player.rb', line 8
def rec(file, sec, quiet = true); end
|
#to_s ⇒ Object
16
17
18
|
# File 'lib/player/player.rb', line 16
def to_s
%Q(#{command} #{options} )
end
|