r2mp3 0.2.1 → 0.2.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.
- data/{lib/README.txt → README.txt} +0 -0
- data/lib/r2mp3/converter.rb +4 -3
- data/lib/r2mp3/inspector.rb +9 -12
- data/lib/r2mp3/tools/lame.rb +1 -1
- data/lib/r2mp3/tools/loader.rb +3 -3
- data/lib/r2mp3/tools/mplayer.rb +1 -1
- metadata +3 -3
File without changes
|
data/lib/r2mp3/converter.rb
CHANGED
@@ -63,9 +63,10 @@ module R2mp3
|
|
63
63
|
def dump_to_wav
|
64
64
|
puts "dumping to wav...."
|
65
65
|
raise ConverterError::InputFileRequired unless File.exists?(@input_file)
|
66
|
-
%
|
66
|
+
%{#{R2mp3::Tools::MPLAYER} #{wav_options} #{@input_file}}
|
67
67
|
end
|
68
68
|
|
69
|
+
#TODO: More DRY
|
69
70
|
def wav_options
|
70
71
|
# todo:
|
71
72
|
opts = {
|
@@ -88,11 +89,11 @@ module R2mp3
|
|
88
89
|
input = @wav_output
|
89
90
|
options = mp3_options
|
90
91
|
@output_path = @output_file
|
91
|
-
%
|
92
|
+
%{#{R2mp3::Tools::LAME} #{input} #{@output_file} #{options}}
|
92
93
|
end
|
93
94
|
|
94
95
|
#it just works, and shouldn't be here exactly.
|
95
|
-
#To do:
|
96
|
+
#To do: MORE DRY
|
96
97
|
def mp3_options
|
97
98
|
# (j)oint, (s)imple, (f)orce, (d)dual-mono, (m)ono
|
98
99
|
mode = {
|
data/lib/r2mp3/inspector.rb
CHANGED
@@ -19,21 +19,18 @@ module R2mp3
|
|
19
19
|
def info
|
20
20
|
return nil unless @type.eql?(:mp3)
|
21
21
|
Mp3Info.open(@file) do |info|
|
22
|
-
|
23
|
-
@channel_mode = info.channel_mode
|
24
|
-
@length = info.length
|
25
|
-
#@tag1 = info.tag1
|
26
|
-
@tag = info.tag
|
27
|
-
@vbr = info.vbr
|
28
|
-
@layer = info.layer
|
29
|
-
@samplerate = info.samplerate
|
30
|
-
@mpeg_version = info.mpeg_version
|
31
|
-
#@tag1_parsed = info.tag1_parsed
|
32
|
-
@filename = info.filename
|
33
|
-
@bitrate = info.bitrate
|
22
|
+
mp3_data.each { |d| eval("@#{d} = info.#{d}") }
|
34
23
|
end
|
35
24
|
self
|
36
25
|
end
|
37
26
|
|
27
|
+
def mp3_data
|
28
|
+
[
|
29
|
+
:header, :channel_mode, :length, :tag1,
|
30
|
+
:tag, :vbr, :layer, :samplerate, :mpeg_version,
|
31
|
+
:filename, :bitrate
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
38
35
|
end
|
39
36
|
end
|
data/lib/r2mp3/tools/lame.rb
CHANGED
data/lib/r2mp3/tools/loader.rb
CHANGED
@@ -2,13 +2,13 @@ module R2mp3
|
|
2
2
|
module Tools
|
3
3
|
class Loader
|
4
4
|
|
5
|
-
def self.load(recipe
|
5
|
+
def self.load(recipe)
|
6
6
|
name = recipe.split.first
|
7
|
-
tool = "R2mp3::Tools::#{name.classify}".constantize.send(:new, recipe
|
7
|
+
tool = "R2mp3::Tools::#{name.classify}".constantize.send(:new, recipe)
|
8
8
|
end
|
9
9
|
|
10
10
|
module InstanceMethods
|
11
|
-
def initialize(recipe
|
11
|
+
def initialize(recipe)
|
12
12
|
@recipe = recipe
|
13
13
|
end
|
14
14
|
|
data/lib/r2mp3/tools/mplayer.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r2mp3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Warachet Samtalee
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-09-
|
12
|
+
date: 2008-09-18 00:00:00 +07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -44,7 +44,7 @@ files:
|
|
44
44
|
- lib/r2mp3/tools/mplayer.rb
|
45
45
|
- lib/r2mp3/version.rb
|
46
46
|
- lib/r2mp3.rb
|
47
|
-
-
|
47
|
+
- README.txt
|
48
48
|
has_rdoc: false
|
49
49
|
homepage: http://ziddik.blogspot.com
|
50
50
|
post_install_message:
|