summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-15 18:56:04 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-15 18:56:04 -0700
commit0e42e37a43a0a573c79946b7c918f2b8e5fe0339 (patch)
tree26b4b066cff2690f952c9557cc211719ee1c1967
parentb17056ac17fd9762d64163ee0f919ff46fd6b5bb (diff)
downloadomptagger-0e42e37a43a0a573c79946b7c918f2b8e5fe0339.tar.gz
omptagger-0e42e37a43a0a573c79946b7c918f2b8e5fe0339.tar.xz
Begin MP3 support.
-rwxr-xr-xomptagger11
1 files changed, 11 insertions, 0 deletions
diff --git a/omptagger b/omptagger
index 65284fa..b6dc1c1 100755
--- a/omptagger
+++ b/omptagger
@@ -139,6 +139,15 @@ class Vorbis < VorbisComment
end
end
+class MP3 < Metadata
+ def initialize(file)
+ super
+
+ @file = TagLib::MPEG::File.new(file)
+ @tags = @file.ID3v2Tag.frameListMap.hash
+ end
+end
+
def help
puts <<-end
Usage: omptagger [actions/options] [files]
@@ -259,6 +268,8 @@ ARGV.each do |file|
track = FLAC.new(file)
when 'application/ogg'
track = Vorbis.new(file)
+ when 'audio/mpeg'
+ track = MP3.new(file)
else
raise 'File extension not recognised.'
end