Class: Segue::Ffmpeg
- Inherits:
-
Object
- Object
- Segue::Ffmpeg
- Defined in:
- lib/segue/ffmpeg.rb
Overview
Pulls tags out of a file by parsing what ffmpeg prints about it.
Instance Attribute Summary collapse
-
#album ⇒ Object
readonly
Returns the value of attribute album.
-
#albumartist ⇒ Object
readonly
Returns the value of attribute albumartist.
-
#artist ⇒ Object
readonly
Returns the value of attribute artist.
-
#asin ⇒ Object
readonly
Returns the value of attribute asin.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#mbalbumartistid ⇒ Object
readonly
Returns the value of attribute mbalbumartistid.
-
#mbalbumid ⇒ Object
readonly
Returns the value of attribute mbalbumid.
-
#mbartistid ⇒ Object
readonly
Returns the value of attribute mbartistid.
-
#puid ⇒ Object
readonly
Returns the value of attribute puid.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#track ⇒ Object
readonly
Returns the value of attribute track.
Instance Method Summary collapse
-
#initialize(path) ⇒ Ffmpeg
constructor
A new instance of Ffmpeg.
- #tag(*names) ⇒ Object
Constructor Details
#initialize(path) ⇒ Ffmpeg
Returns a new instance of Ffmpeg.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/segue/ffmpeg.rb', line 23 def initialize(path) @path = path parse @title = tag :title, :tit2 @album = tag :album, :talb @artist = tag :artist, :tpe1, :tpe2 @albumartist = tag :album_artist, :tso2 @time = to_duration tag :duration @date = tag :date, :tdrc, :tyer @track = tag :track, :trck @puid = tag :"musicip puid" @mbartistid = tag :musicbrainz_artistid, :"musicbrainz artist id" @mbalbumid = tag :musicbrainz_albumid, :"musicbrainz album id" @mbalbumartistid = tag :musicbrainz_albumartistid, :"musicbrainz album artist id" @asin = tag :asin end |
Instance Attribute Details
#album ⇒ Object (readonly)
Returns the value of attribute album.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def album @album end |
#albumartist ⇒ Object (readonly)
Returns the value of attribute albumartist.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def albumartist @albumartist end |
#artist ⇒ Object (readonly)
Returns the value of attribute artist.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def artist @artist end |
#asin ⇒ Object (readonly)
Returns the value of attribute asin.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def asin @asin end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def date @date end |
#mbalbumartistid ⇒ Object (readonly)
Returns the value of attribute mbalbumartistid.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def mbalbumartistid @mbalbumartistid end |
#mbalbumid ⇒ Object (readonly)
Returns the value of attribute mbalbumid.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def mbalbumid @mbalbumid end |
#mbartistid ⇒ Object (readonly)
Returns the value of attribute mbartistid.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def @mbartistid end |
#puid ⇒ Object (readonly)
Returns the value of attribute puid.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def puid @puid end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def time @time end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def title @title end |
#track ⇒ Object (readonly)
Returns the value of attribute track.
8 9 10 |
# File 'lib/segue/ffmpeg.rb', line 8 def track @track end |
Instance Method Details
#tag(*names) ⇒ Object
41 42 43 44 |
# File 'lib/segue/ffmpeg.rb', line 41 def tag(*names) names.each { |name| return @meta[name] if @meta[name] } nil end |