sensible-cinema 0.14.6 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sensible-cinema}
8
- s.version = "0.14.6"
8
+ s.version = "0.15.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roger Pack"]
12
- s.date = %q{2010-11-24}
12
+ s.date = %q{2010-12-02}
13
13
  s.email = %q{rogerdpack@gmail.com}
14
14
  s.executables = ["sensible-cinema", "sensible-cinema-cli"]
15
15
  s.extensions = ["ext/mkrf_conf.rb"]
@@ -28,13 +28,16 @@ Gem::Specification.new do |s|
28
28
  "VERSION",
29
29
  "bin/sensible-cinema",
30
30
  "bin/sensible-cinema-cli",
31
+ "experimental_readme.txt",
31
32
  "ext/mkrf_conf.rb",
32
33
  "gplv3.txt",
34
+ "lib/add_any_bundled_gems_to_load_path.rb",
33
35
  "lib/blanker.rb",
34
36
  "lib/drive_info.rb",
35
37
  "lib/fake_blanker.rb",
36
38
  "lib/file_chooser.rb",
37
39
  "lib/keyboard_input.rb",
40
+ "lib/mencoder_wrapper.rb",
38
41
  "lib/mouse.rb",
39
42
  "lib/mouse_forever.rb",
40
43
  "lib/muter.rb",
@@ -98,6 +101,7 @@ Gem::Specification.new do |s|
98
101
  "spec/images/youtube_small_2_0.bmp",
99
102
  "spec/images/youtube_small_4.bmp",
100
103
  "spec/keyboard_input.spec.rb",
104
+ "spec/mencoder_wrapper.spec.rb",
101
105
  "spec/mouse.spec.rb",
102
106
  "spec/muter.spec.rb",
103
107
  "spec/ocr.spec.rb",
@@ -112,10 +116,11 @@ Gem::Specification.new do |s|
112
116
  "vendor/gocr049.exe",
113
117
  "zamples/edit_decision_lists/category descriptions.txt",
114
118
  "zamples/edit_decision_lists/dvds/White Christmas.txt",
115
- "zamples/edit_decision_lists/dvds/all_dogs_go_to_heaven_dvd.txt",
119
+ "zamples/edit_decision_lists/dvds/all_dogs_go_to_heaven.txt",
116
120
  "zamples/edit_decision_lists/dvds/bobs_big_plan.txt",
117
121
  "zamples/edit_decision_lists/dvds/cars_disney.txt",
118
- "zamples/edit_decision_lists/dvds/happy_feet_dvd.txt",
122
+ "zamples/edit_decision_lists/dvds/happiest baby on the block.txt",
123
+ "zamples/edit_decision_lists/dvds/happy_feet.txt",
119
124
  "zamples/edit_decision_lists/dvds/labyrinth.txt",
120
125
  "zamples/edit_decision_lists/dvds/making marriage work.txt",
121
126
  "zamples/edit_decision_lists/example_edit_decision_list.txt",
@@ -136,7 +141,7 @@ Gem::Specification.new do |s|
136
141
  s.homepage = %q{http://github.com/rdp}
137
142
  s.rdoc_options = ["--charset=UTF-8"]
138
143
  s.require_paths = ["lib"]
139
- s.rubygems_version = %q{1.3.7}
144
+ s.rubygems_version = %q{1.3.6}
140
145
  s.summary = %q{an EDL scene-selector/bleeper that works with online players like hulu}
141
146
  s.test_files = [
142
147
  "spec/blanker.spec.rb",
@@ -144,6 +149,7 @@ Gem::Specification.new do |s|
144
149
  "spec/convert_image.rb",
145
150
  "spec/drive_info.spec.rb",
146
151
  "spec/keyboard_input.spec.rb",
152
+ "spec/mencoder_wrapper.spec.rb",
147
153
  "spec/mouse.spec.rb",
148
154
  "spec/muter.spec.rb",
149
155
  "spec/ocr.spec.rb",
@@ -158,7 +164,7 @@ Gem::Specification.new do |s|
158
164
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
159
165
  s.specification_version = 3
160
166
 
161
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
167
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
162
168
  s.add_runtime_dependency(%q<sane>, [">= 0.22.0"])
163
169
  s.add_runtime_dependency(%q<rdp-win32screenshot>, [">= 0.0.7.3"])
164
170
  s.add_runtime_dependency(%q<mini_magick>, [">= 3.1"])
@@ -0,0 +1,163 @@
1
+ require File.dirname(__FILE__) + "/common"
2
+ require_relative '../lib/mencoder_wrapper'
3
+
4
+ describe MencoderWrapper do
5
+
6
+ before do
7
+ FileUtils.rm 'to_here.fulli.tmp.avi.done' rescue nil
8
+ FileUtils.rm 'to_here.fulli.tmp.avi' rescue nil
9
+ @a = YAML.load_file "../zamples/edit_decision_lists/dvds/happy_feet.txt"
10
+ @out = MencoderWrapper.get_bat_commands @a, "e:\\", 'to_here'
11
+ end
12
+
13
+ it "should be able to convert" do
14
+ @out.should_not be nil
15
+ @out.should include("e:\\")
16
+ end
17
+
18
+ it "should have what looks like a working mencoder rip command" do
19
+ @out.should match(/mencoder dvd.*keyint=1/)
20
+ end
21
+
22
+ it "should create a .done file after ripping" do
23
+ @out.should include("&& echo got_file > to_here.fulli.tmp.avi.done")
24
+ end
25
+
26
+ def go
27
+ @out = MencoderWrapper.get_bat_commands @a, "e:\\", 'to_here'
28
+ end
29
+
30
+ it "should not rip it again if the .done file exists and the original file exist" do
31
+ go
32
+ @out.should include(" -o to_here.fulli.tmp.avi")
33
+
34
+ FileUtils.touch 'to_here.fulli.tmp.avi.done'
35
+ go
36
+ @out.should include(" -o to_here.fulli.tmp.avi")
37
+ FileUtils.touch 'to_here.fulli.tmp.avi'
38
+ go
39
+ @out.should_not include(" -o to_here.fulli.tmp.avi")
40
+ end
41
+
42
+ it "should use newline every line" do
43
+ @out.should include("\n")
44
+ @out.should_not match(/mencoder.*mencoder/)
45
+ @out.should_not match(/del.*del/)
46
+ end
47
+
48
+ it "should use ffmpeg style start and stop times" do
49
+ @out.should match(/ffmpeg.*-ss/)
50
+ @out.should include(" -t ")
51
+ end
52
+
53
+ it "should have what looks like a working ffmpeg style split commands" do
54
+ # ffmpeg -i from_here.avi -vcodec copy -acodec copy -ss 1:00 -t 1:00 out.avi
55
+ @out.should match(/ffmpeg -i to_here.*vcodec copy -acodec copy .*-ss .* -t /)
56
+ end
57
+
58
+ it "should accomodate for mutes the ffmpeg way" do
59
+ # mutes by silencing...seems reasonable, based on the Family Law fella
60
+ @out.should match(/ -vcodec copy -acodec ac3 -vol 0 /)
61
+ @out.should_not match(/-vcodec copy.*-target ntsc-dvd/)
62
+ end
63
+
64
+ it "should use avi extension" do
65
+ @out.should include(".avi ")
66
+ @out.should_not include(".avi.1 ")
67
+ end
68
+
69
+ it "should not overuse the avi extension" do
70
+ @out.should_not include("avi.1.avi")
71
+ end
72
+
73
+ it "should concatenate (merge) them all together" do
74
+ @out.should match(/mencoder.* -ovc copy -oac copy/)
75
+ @out.should match(/mencoder to_here.1.avi/)
76
+ end
77
+
78
+ it "should create a large conglom file" do
79
+ @out.should match(/smplayer_or_vlc/)
80
+ end
81
+
82
+ it "should delete any large, grabbed tmp file" do
83
+ @out.should match(/del.*tmp/)
84
+ end
85
+
86
+ it "should delete all partials" do
87
+ 1.upto(10) do |n|
88
+ @out.should match(Regexp.new(/del.*#{n}/))
89
+ end
90
+ # should delete the right numbers, too, which starts at 1
91
+ @out.should_not match(/del to_here.0.avi/)
92
+ @out.should match(/del to_here.1.avi/)
93
+ end
94
+
95
+ it "should rm partial files before writing each one" do
96
+ @out.should match(/del to_here.3.avi$/)
97
+ end
98
+
99
+ it "should echo that it is done" do
100
+ @out.should include("echo wrote")
101
+ end
102
+
103
+ def setup
104
+ @settings = {"mutes"=>{1=>2, 7=>12}, "blank_outs"=>{"2"=>"3"}}
105
+ @out = MencoderWrapper.get_bat_commands @settings, "e:\\", 'to_here.avi'
106
+ end
107
+
108
+ it "should not insert an extra pause if a mute becomes a blank" do
109
+ setup
110
+ @out.should_not match(/-endpos 0.0/)
111
+ File.write('out.bat', @out)
112
+ end
113
+
114
+ it "should not include blank sections" do
115
+ setup
116
+ @out.should_not include('-ss 2.0 -endpos 1.0')
117
+ # and not be freaky by setting the end to nosound
118
+ @out.should_not match(/-endpos \d{6}.*volume/)
119
+ end
120
+
121
+ it "should lop off a fraction of a second per segment, as per wiki instructions" do
122
+ setup
123
+ @out.should match(/-t 0.999/)
124
+ end
125
+
126
+ it "should not have doubled .avi.avi's" do
127
+ setup
128
+ # lodo cleanup this ugliness
129
+ @out.scan(/-i.*-t.*to_here.avi.1.avi/).length.should == 1
130
+ @out.scan(/-i.*-t.*to_here.avi.2.avi/).length.should == 1
131
+ end
132
+
133
+ context 'pinpointing sections' do
134
+ before do
135
+ settings = {"mutes"=>{15=>20, 30 => 35}}
136
+ @out = MencoderWrapper.get_bat_commands settings, "e:\\", 'to_here.avi', '00:14', '00:25'
137
+ end
138
+
139
+ it "should always somewhat rip the whole thing" do
140
+ @out.should_not match(/mencoder dvd.*endpos/)
141
+ end
142
+
143
+ it "should contain the included subsections" do
144
+ @out.should_not include("-t 34.99")
145
+ @out.should include("14.0")
146
+ @out.should_not include("99999")
147
+ @out.should include(" 0 ") # no start at 0 even
148
+ @out.should include("-ss 14.0 -t 0.999")
149
+ @out.should include("-ss 15.0 -t 4.999")
150
+ end
151
+
152
+ it "should raise if you focus down into nothing" do
153
+ setup
154
+ proc { MencoderWrapper.get_bat_commands @settings, "e:\\", 'to_here', '00:14', '00:15'}.should raise_error(/unable/)
155
+ end
156
+
157
+ it "should create a temp file" do
158
+
159
+ end
160
+
161
+ end
162
+
163
+ end
@@ -2,24 +2,29 @@ require File.expand_path(File.dirname(__FILE__) + '/common')
2
2
  load '../bin/sensible-cinema'
3
3
 
4
4
  module SensibleSwing
5
- describe MainWindow do
6
-
7
- it "should auto-select an EDL if the title matches" do
8
- MainWindow.new.single_edit_list_matches_dvd("BOBS_BIG_PLAN").should_not be nil
9
- end
5
+ describe MainWindow do
10
6
 
11
- it "should prompt if two match" do
12
- MainWindow.const_set(:EDL_DIR, 'temp')
13
- FileUtils.rm_rf 'temp'
14
- Dir.mkdir 'temp'
15
- MainWindow.new.single_edit_list_matches_dvd("BOBS_BIG_PLAN").should be nil
16
- Dir.chdir 'temp' do
17
- File.binwrite('a.txt', "dvd_drive_label: BOBS_BIG_PLAN")
18
- File.binwrite('b.txt', "dvd_drive_label: BOBS_BIG_PLAN")
7
+ it "should auto-select an EDL if the title matches" do
8
+ MainWindow.new.single_edit_list_matches_dvd("BOBS_BIG_PLAN").should_not be nil
9
+ end
10
+
11
+ it "should prompt if two match" do
12
+ MainWindow.const_set(:EDL_DIR, 'temp')
13
+ FileUtils.rm_rf 'temp'
14
+ Dir.mkdir 'temp'
15
+ MainWindow.new.single_edit_list_matches_dvd("BOBS_BIG_PLAN").should be nil
16
+ Dir.chdir 'temp' do
17
+ File.binwrite('a.txt', "dvd_drive_label: BOBS_BIG_PLAN")
18
+ File.binwrite('b.txt', "dvd_drive_label: BOBS_BIG_PLAN")
19
+ end
20
+ MainWindow.new.single_edit_list_matches_dvd("BOBS_BIG_PLAN").should be nil
21
+
19
22
  end
20
- MainWindow.new.single_edit_list_matches_dvd("BOBS_BIG_PLAN").should be nil
21
23
 
24
+ it "should modify path to have VLC available" do
25
+ ENV['PATH'].should include("VideoLAN")
26
+ end
27
+
28
+
22
29
  end
23
-
24
- end
25
30
  end
@@ -5,7 +5,7 @@ require_relative '../lib/vlc_programmer'
5
5
  describe 'VLC Programmer' do
6
6
 
7
7
  it "should be able to convert" do
8
- a = YAML.load_file "../zamples/edit_decision_lists/dvds/happy_feet_dvd.txt"
8
+ a = YAML.load_file "../zamples/edit_decision_lists/dvds/happy_feet.txt"
9
9
  out = VLCProgrammer.convert_to_full_xspf(a)
10
10
  out.length.should_not == 0
11
11
  out.should include("<title>Playlist</title>")
@@ -84,12 +84,12 @@ describe 'VLC Programmer' do
84
84
  bat_file.scan(/playlist/i).length.should == 0
85
85
  bat_file.scan(/--no-sout-audio/).length.should == 1
86
86
  bat_file.scan(/\n/).length.should be > 2
87
- bat_file.scan(/go.ps.1.* go.ps.2/).length.should == 2
87
+ bat_file.scan(/go.ps.1\+go.ps.2/).length.should == 1
88
88
  bat_file.scan(/go.ps.4/).length.should == 0
89
89
  bat_file.scan(/--start-time/).length.should == 3
90
90
  bat_file.scan(/quit/).length.should == 3
91
- bat_file.scan(/type/).length.should == 1
92
- bat_file.scan(/rm go.ps.1/).length.should == 1
91
+ bat_file.scan(/copy \/b/).length.should == 1
92
+ bat_file.scan(/del go.ps.1/).length.should == 1
93
93
  bat_file.scan(/echo/).length.should == 1
94
94
  # should not have extra popups...
95
95
  bat_file.scan(/--qt-start-minimized/i).length.should == 3
@@ -97,10 +97,6 @@ describe 'VLC Programmer' do
97
97
  puts 'run it like $ mute5-10.bat'
98
98
  end
99
99
 
100
- it "should modify path to have VLC available" do
101
- ENV['PATH'].should include("VideoLAN")
102
- end
103
-
104
- it "should produce a workable non VLC playable file"
100
+ it "should produce a file playable by windows media player"
105
101
 
106
102
  end
@@ -20,4 +20,5 @@ mutes:
20
20
  "1:30:02" : "1:30:04" # thank the manufacturer...
21
21
  "1:39:13.1" : "1:39:14.0" # hot snot we're back in business
22
22
  "1:55:38" : "1:55:40" # for the "love of Chrysler" please....
23
- dvd_title_track: 23
23
+ dvd_title_track: 23
24
+ dvd_drive_label: "CRZ0NNW7 "
@@ -0,0 +1,11 @@
1
+ mutes:
2
+ "6:18" : "6:19.1" # G... knows...
3
+ blank_outs:
4
+ # none
5
+
6
+ title: Happiest baby on the block
7
+ dvd_drive_label: HAPPIEST_BABY_ON_THE_BLOCK
8
+ source: DVD (vlc)
9
+ dvd_title_track: 1
10
+
11
+ other_notes: has a couple (modest) shots of nursing moms which aren't edited.
@@ -1,7 +1,7 @@
1
1
  mutes:
2
2
  # none
3
3
  blank_outs:
4
- "0:01:02" : "0:01:06.5" # bum waggin'
4
+ "0:01:01.6" : "0:01:06.5" # bum waggin'
5
5
  0:02:17.5 : 0:02:19 # same
6
6
 
7
7
  title: The Gummy Bear Song - Long English Version (probably works with other languages' Gummy Bear songs, too)
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 14
8
- - 6
9
- version: 0.14.6
7
+ - 15
8
+ - 0
9
+ version: 0.15.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Roger Pack
@@ -14,14 +14,13 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-24 00:00:00 -07:00
17
+ date: 2010-12-02 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: sane
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
24
  requirements:
26
25
  - - ">="
27
26
  - !ruby/object:Gem::Version
@@ -36,7 +35,6 @@ dependencies:
36
35
  name: rdp-win32screenshot
37
36
  prerelease: false
38
37
  requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
38
  requirements:
41
39
  - - ">="
42
40
  - !ruby/object:Gem::Version
@@ -52,7 +50,6 @@ dependencies:
52
50
  name: mini_magick
53
51
  prerelease: false
54
52
  requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
53
  requirements:
57
54
  - - ">="
58
55
  - !ruby/object:Gem::Version
@@ -66,7 +63,6 @@ dependencies:
66
63
  name: whichr
67
64
  prerelease: false
68
65
  requirement: &id004 !ruby/object:Gem::Requirement
69
- none: false
70
66
  requirements:
71
67
  - - ">="
72
68
  - !ruby/object:Gem::Version
@@ -81,7 +77,6 @@ dependencies:
81
77
  name: jruby-win32ole
82
78
  prerelease: false
83
79
  requirement: &id005 !ruby/object:Gem::Requirement
84
- none: false
85
80
  requirements:
86
81
  - - ">="
87
82
  - !ruby/object:Gem::Version
@@ -94,7 +89,6 @@ dependencies:
94
89
  name: rdp-ruby-wmi
95
90
  prerelease: false
96
91
  requirement: &id006 !ruby/object:Gem::Requirement
97
- none: false
98
92
  requirements:
99
93
  - - ">="
100
94
  - !ruby/object:Gem::Version
@@ -107,7 +101,6 @@ dependencies:
107
101
  name: ffi
108
102
  prerelease: false
109
103
  requirement: &id007 !ruby/object:Gem::Requirement
110
- none: false
111
104
  requirements:
112
105
  - - ">="
113
106
  - !ruby/object:Gem::Version
@@ -120,7 +113,6 @@ dependencies:
120
113
  name: rspec
121
114
  prerelease: false
122
115
  requirement: &id008 !ruby/object:Gem::Requirement
123
- none: false
124
116
  requirements:
125
117
  - - ">="
126
118
  - !ruby/object:Gem::Version
@@ -133,7 +125,6 @@ dependencies:
133
125
  name: jeweler
134
126
  prerelease: false
135
127
  requirement: &id009 !ruby/object:Gem::Requirement
136
- none: false
137
128
  requirements:
138
129
  - - ">="
139
130
  - !ruby/object:Gem::Version
@@ -146,7 +137,6 @@ dependencies:
146
137
  name: hitimes
147
138
  prerelease: false
148
139
  requirement: &id010 !ruby/object:Gem::Requirement
149
- none: false
150
140
  requirements:
151
141
  - - ">="
152
142
  - !ruby/object:Gem::Version
@@ -176,13 +166,16 @@ files:
176
166
  - VERSION
177
167
  - bin/sensible-cinema
178
168
  - bin/sensible-cinema-cli
169
+ - experimental_readme.txt
179
170
  - ext/mkrf_conf.rb
180
171
  - gplv3.txt
172
+ - lib/add_any_bundled_gems_to_load_path.rb
181
173
  - lib/blanker.rb
182
174
  - lib/drive_info.rb
183
175
  - lib/fake_blanker.rb
184
176
  - lib/file_chooser.rb
185
177
  - lib/keyboard_input.rb
178
+ - lib/mencoder_wrapper.rb
186
179
  - lib/mouse.rb
187
180
  - lib/mouse_forever.rb
188
181
  - lib/muter.rb
@@ -246,6 +239,7 @@ files:
246
239
  - spec/images/youtube_small_2_0.bmp
247
240
  - spec/images/youtube_small_4.bmp
248
241
  - spec/keyboard_input.spec.rb
242
+ - spec/mencoder_wrapper.spec.rb
249
243
  - spec/mouse.spec.rb
250
244
  - spec/muter.spec.rb
251
245
  - spec/ocr.spec.rb
@@ -260,10 +254,11 @@ files:
260
254
  - vendor/gocr049.exe
261
255
  - zamples/edit_decision_lists/category descriptions.txt
262
256
  - zamples/edit_decision_lists/dvds/White Christmas.txt
263
- - zamples/edit_decision_lists/dvds/all_dogs_go_to_heaven_dvd.txt
257
+ - zamples/edit_decision_lists/dvds/all_dogs_go_to_heaven.txt
264
258
  - zamples/edit_decision_lists/dvds/bobs_big_plan.txt
265
259
  - zamples/edit_decision_lists/dvds/cars_disney.txt
266
- - zamples/edit_decision_lists/dvds/happy_feet_dvd.txt
260
+ - zamples/edit_decision_lists/dvds/happiest baby on the block.txt
261
+ - zamples/edit_decision_lists/dvds/happy_feet.txt
267
262
  - zamples/edit_decision_lists/dvds/labyrinth.txt
268
263
  - zamples/edit_decision_lists/dvds/making marriage work.txt
269
264
  - zamples/edit_decision_lists/example_edit_decision_list.txt
@@ -290,7 +285,6 @@ rdoc_options:
290
285
  require_paths:
291
286
  - lib
292
287
  required_ruby_version: !ruby/object:Gem::Requirement
293
- none: false
294
288
  requirements:
295
289
  - - ">="
296
290
  - !ruby/object:Gem::Version
@@ -298,7 +292,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
298
292
  - 0
299
293
  version: "0"
300
294
  required_rubygems_version: !ruby/object:Gem::Requirement
301
- none: false
302
295
  requirements:
303
296
  - - ">="
304
297
  - !ruby/object:Gem::Version
@@ -308,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
308
301
  requirements: []
309
302
 
310
303
  rubyforge_project:
311
- rubygems_version: 1.3.7
304
+ rubygems_version: 1.3.6
312
305
  signing_key:
313
306
  specification_version: 3
314
307
  summary: an EDL scene-selector/bleeper that works with online players like hulu
@@ -318,6 +311,7 @@ test_files:
318
311
  - spec/convert_image.rb
319
312
  - spec/drive_info.spec.rb
320
313
  - spec/keyboard_input.spec.rb
314
+ - spec/mencoder_wrapper.spec.rb
321
315
  - spec/mouse.spec.rb
322
316
  - spec/muter.spec.rb
323
317
  - spec/ocr.spec.rb