sensible-cinema 0.19.3 → 0.19.4

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ == 0.19.4 ==
2
+
3
+ Now you can specify an arbitrary "precision" around mute settings to make them more conservative or not.
4
+ Add audio alert.
5
+ Fix broken button.
6
+
7
+ == 0.19.3 ==
8
+
9
+ Hopefully work with audio from more DVD's now.
10
+
1
11
  == 0.19.2 ==
2
12
 
3
13
  More user friendliness.
data/TODO CHANGED
@@ -2,44 +2,42 @@
2
2
 
3
3
  == up next release ==
4
4
 
5
- edit lists actually *working*:
5
+ low hanging fruit/bugs:
6
6
  cool runnings at home
7
- temple at home
8
- cars bring home :)
7
+ edl straight is broken on HP at 2 hours
8
+ if it's all blank outs works right then? baby/HP?
9
9
 
10
10
  == slightly lower than that, somewhat ordered ==
11
11
 
12
- broken button
13
- edl is broken on HP at 2 hours, "from the dvd straight"
14
- mplayer edl if it's all blank outs works right then?
15
- fix edl_parser spec
16
- detect disks have changed, re-query.
17
- cleaner error on locked file :)
12
+ temple at home
13
+ cars bring home :)
18
14
  linearize edl's
19
15
  don't use them linear, just linearize
20
16
  not this release
21
- play a bigger noise when totally done...(dvd flick'ish...)
22
17
  mpeg is lossy (at least my current one pass conversion still is...) AND SO SLOW FOR EDITING and smplayer can't play it right unedited
23
18
  frame accurate splitter
24
19
  can I use ffmpeg to re-sync audio, and be able to re-play the edited copy, and thus avoid the small but extra harddup overhead (basically "just avoid")?
25
20
  I can live with "watching while grabbing" being lack luster...or maybe I can grab it with acodec copy (typically), then reencode it somehow later into something that is friendlier to computer players...or is it encoders?
26
21
  appears the only messed up audio one is smplayer...and probably mplayer with DVD's [?]
27
- button start EDL playback here [?]
22
+ do this after frame accurate
28
23
  partner for filters (Jon, Karlie if interested...give beta)
29
24
  lotsa filters somehow
30
25
  my dvd's (loose timestamps...)
31
26
  partners'...
32
27
  only after linearize
28
+ button start EDL playback here [?] (for create mode)
33
29
  beta release/rinse and repeat with various ppl (once it's releasable...)
34
30
  a real'ish-er website
35
31
  link to ML
36
32
  compare computer DVD timings with physical player's timings...
37
33
  if same, add imdb todo's up here
34
+ cleaner user error on locked file :)
38
35
  propaganda-ize
39
36
  advertise in christian places
40
37
  blogs that have ever mentioned clearplay :P
41
38
  free google adwords (?)
42
39
  advertise urug, ruby flow :)
40
+ only after new year
43
41
  add they 'play from unedited from grab till it hits the first bad spot', if useful [?]
44
42
  md5 and verify the fulli version... [?]
45
43
  only useful once I get the frame accurate stuff done, and any audio tweakage, etc.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.19.3
1
+ 0.19.4
@@ -26,6 +26,7 @@ require_relative '../lib/mencoder_wrapper'
26
26
  require_relative '../lib/storage'
27
27
  require_relative '../lib/edl_parser'
28
28
  require_relative '../lib/mplayer_edl'
29
+ require_relative '../lib/play_audio'
29
30
 
30
31
  require 'tmpdir'
31
32
  require_relative '../lib/swing_helpers'
@@ -77,8 +78,9 @@ module SensibleSwing
77
78
 
78
79
  # make them choose which system call to use explicitly
79
80
  undef system
81
+
80
82
  def initialize
81
- super "Sensible-Cinema (gpl)"
83
+ super "Sensible-Cinema #{VERSION} (GPL)"
82
84
  if !(Storage['main_license_accepted'] == VERSION)
83
85
  show_blocking_license_accept_dialog 'Sensible Cinema', 'gplv3', 'http://www.gnu.org/licenses/gpl.html'
84
86
  show_blocking_license_accept_dialog 'Sensible Cinema', 'LICENSE.TXT file', File.expand_path(File.dirname(__FILE__) + "/../LICENSE.TXT"), 'LICENSE.TXT file', 'I acknowledge that I have read the LICENSE.TXT file.'
@@ -105,13 +107,13 @@ module SensibleSwing
105
107
  do_copy_dvd_to_hard_drive false
106
108
  }
107
109
 
108
- @mplayer_edl = new_jbutton( "Watch DVD on computer edited realtime", true ) # TODO enable once it works with HP
110
+ @mplayer_edl = new_jbutton( "Watch DVD on computer edited realtime (might not work)", false )
109
111
  @mplayer_edl.on_clicked {
110
112
  drive, dvd_volume_name, md5sum, edl_path, descriptors = choose_dvd_and_edl_for_it
111
113
  descriptors = EdlParser.parse_file edl_path
112
114
  temp_dir = Dir.tmpdir
113
115
  temp_file = temp_dir + '/mplayer.temp.edl'
114
- edl_contents = MplayerEdl.convert_to_edl descriptors, 5.75 # add a sec to mutes to accomodate for mplayer's oddness...
116
+ edl_contents = MplayerEdl.convert_to_edl descriptors, 1.75 # add a sec to mutes to accomodate for mplayer's oddness...
115
117
  File.write(temp_file, edl_contents)
116
118
  title_track = get_title_track(descriptors)
117
119
  # oh the insanity of the console UI...LODO more user friendly player
@@ -126,7 +128,7 @@ module SensibleSwing
126
128
 
127
129
  @watch_unedited = new_jbutton("Watch a DVD unedited (while grabbing to hard drive)", true)
128
130
  @watch_unedited.on_clicked {
129
- success_no_run, wrote_to_here_fulli = do_copy_dvd_to_hard_drive false, true
131
+ success_no_run, wrote_to_here_fulli = do_copy_dvd_to_hard_drive false, true, true
130
132
  sleep 5 unless success_no_run
131
133
  command = "smplayer #{wrote_to_here_fulli}"
132
134
  system_non_blocking command
@@ -193,7 +195,7 @@ EOL
193
195
  This is used to identify a disk to match it to its EDL, later.", "\"disk_unique_id\" => \"#{md5}\",")
194
196
  }
195
197
 
196
- @upload = new_jbutton( "Upload/e-mail suggestion/Submit anything").on_clicked {
198
+ @upload = new_jbutton( "Upload/E-mail suggestion/Submit anything", true).on_clicked {
197
199
  system_non_blocking("start mailto:sensible-cinema@googlegroups.com")
198
200
  system_non_blocking("start http://groups.google.com/group/sensible-cinema")
199
201
  }
@@ -343,9 +345,9 @@ EOL
343
345
  end
344
346
 
345
347
  def choose_dvd_and_edl_for_it
346
- @_choose_dvd_and_edl_for_it ||=
348
+ drive, dvd_volume_name, md5sum = choose_dvd_drive
349
+ @_edit_list_path ||=
347
350
  begin
348
- drive, dvd_volume_name, md5sum = choose_dvd_drive
349
351
  puts "#{drive}, #{dvd_volume_name}, #{md5sum}"
350
352
  edit_list_path = single_edit_list_matches_dvd(md5sum)
351
353
  if !edit_list_path
@@ -355,22 +357,20 @@ EOL
355
357
  edit_list_path = fc.go
356
358
  end
357
359
  raise 'cancelled' unless edit_list_path
358
- [drive, dvd_volume_name, md5sum, edit_list_path, nil]
360
+ edit_list_path
359
361
  end
360
362
 
361
363
  # reload it just in case it has changed on disk
362
- edit_list_path = @_choose_dvd_and_edl_for_it[3]
363
364
  descriptors = nil
364
365
  while(!descriptors)
365
366
  begin
366
- descriptors = parse_edl edit_list_path
367
+ descriptors = parse_edl @_edit_list_path
367
368
  rescue SyntaxError => e
368
369
  puts e
369
- show_blocking_message_dialog("your file has an error--please fix then hit ok: \n" + edit_list_path + "\n " + e)
370
+ show_blocking_message_dialog("your file has an error--please fix then hit ok: \n" + @_edit_list_path + "\n " + e)
370
371
  end
371
372
  end
372
- @_choose_dvd_and_edl_for_it[-1] = descriptors
373
- @_choose_dvd_and_edl_for_it
373
+ [drive, dvd_volume_name, md5sum, @_edit_list_path, descriptors]
374
374
  end
375
375
 
376
376
  def get_title_track descriptors
@@ -465,7 +465,7 @@ EOL
465
465
  # LODO warn if they will overwrite a file in the end...
466
466
  end
467
467
 
468
- attr_accessor :background_thread, :after_success_once, :buttons
468
+ attr_accessor :background_thread, :buttons
469
469
 
470
470
  def run_create_commands batch_commands, save_to, run_mplayer
471
471
  @buttons.each{|b| b.set_enabled false}
@@ -497,6 +497,7 @@ EOL
497
497
  show_file = "explorer /e,/select,\"#{File.expand_path(saved_to).to_filename}\""
498
498
  system_blocking show_file # returns immediately
499
499
  show_blocking_message_dialog "Done--you may now watch file #{saved_to} in SMPlayer or VLC player"
500
+ PlayAudio.play(File.expand_path(File.dirname(__FILE__)) + "/../vendor/music.wav")
500
501
  end
501
502
  else
502
503
  show_blocking_message_dialog("Failed--please examine console output and report back!\nAlso consult the troubleshooting section of the README file.", "Failed", JOptionPane::ERROR_MESSAGE)
@@ -505,7 +506,11 @@ EOL
505
506
 
506
507
  # returns e:\, volume, md5sum
507
508
  def choose_dvd_drive
508
- opticals = DriveInfo.get_dvd_drives_as_win32ole
509
+ opticals = DriveInfo.get_dvd_drives_as_openstruct
510
+ if @saved_opticals == opticals
511
+ # memoize :)
512
+ return @_choose_dvd_drive
513
+ end
509
514
  show_blocking_message_dialog 'insert dvd first' unless opticals.find{|d| d.VolumeName }
510
515
  names = opticals.map{|d| d.Name + "\\" + " (" + (d.VolumeName || 'Insert DVD and re-start') + ")"}
511
516
 
@@ -524,7 +529,9 @@ EOL
524
529
  prefix = names[selected_idx][0..2]
525
530
  puts "calculating disk's unique id..."
526
531
  md5sum = DriveInfo.md5sum_disk(prefix)
527
- return prefix, opticals[selected_idx].VolumeName, md5sum
532
+ @_choose_dvd_drive = [prefix, opticals[selected_idx].VolumeName, md5sum]
533
+ @saved_opticals = opticals
534
+ return @_choose_dvd_drive
528
535
  else
529
536
  puts 'did not select a drive...exiting'
530
537
  java.lang.System.exit 1
@@ -17,6 +17,7 @@ This file is part of Sensible Cinema.
17
17
  =end
18
18
  require 'digest/md5'
19
19
  require 'ruby-wmi'
20
+ require 'ostruct'
20
21
 
21
22
  class DriveInfo
22
23
 
@@ -30,9 +31,9 @@ class DriveInfo
30
31
  digest.hexdigest
31
32
  end
32
33
 
33
- def self.get_dvd_drives_as_win32ole
34
+ def self.get_dvd_drives_as_openstruct
34
35
  disks = WMI::Win32_LogicalDisk.find(:all)
35
- disks.select{|d| d.Description =~ /CD-ROM/} # hope this works...
36
+ disks.select{|d| d.Description =~ /CD-ROM/}.map{|d| d2 = OpenStruct.new; d2.VolumeName = d.VolumeName; d2.Name = d.Name; d2}
36
37
  end
37
38
 
38
39
  def self.get_drive_with_most_space_with_slash
@@ -78,10 +78,10 @@ class EdlParser
78
78
 
79
79
  # divides up mutes and blanks so that they don't overlap, preferring blanks over mutes
80
80
  # returns it like [[start,end,type], [s,e,t]...] type like :blank and :mute
81
- def self.convert_incoming_to_split_sectors incoming, add_this_to_mutes = 0
81
+ def self.convert_incoming_to_split_sectors incoming, add_this_to_mutes_end = 0, add_this_to_mutes_beginning = 0
82
82
  mutes = incoming["mutes"] || {}
83
83
  blanks = incoming["blank_outs"] || {}
84
- mutes = mutes.map{|k, v| [OverLayer.translate_string_to_seconds(k), OverLayer.translate_string_to_seconds(v) + add_this_to_mutes, :mute]}
84
+ mutes = mutes.map{|k, v| [OverLayer.translate_string_to_seconds(k) - add_this_to_mutes_beginning, OverLayer.translate_string_to_seconds(v) + add_this_to_mutes_end, :mute]}
85
85
  blanks = blanks.map{|k, v| [OverLayer.translate_string_to_seconds(k), OverLayer.translate_string_to_seconds(v), :blank]}
86
86
 
87
87
  combined = (mutes+blanks).sort_by{|entry| entry[0,1]}
@@ -20,9 +20,9 @@ require_relative 'overlayer'
20
20
  require_relative 'edl_parser'
21
21
 
22
22
  class MplayerEdl
23
- def self.convert_to_edl specs, add_this_many_to_end = 0
23
+ def self.convert_to_edl specs, add_this_many_to_end = 0, add_this_many_to_beginning = 0
24
24
  # simple re-map.
25
- combined = EdlParser.convert_incoming_to_split_sectors specs, add_this_many_to_end
25
+ combined = EdlParser.convert_incoming_to_split_sectors specs, add_this_many_to_end, add_this_many_to_beginning
26
26
  out = ''
27
27
  map = {:mute => 1, :blank => 0}
28
28
  for start, endy, type in combined
@@ -0,0 +1,16 @@
1
+ require 'java'
2
+
3
+ class PlayAudio
4
+ import "sun.audio.AudioStream"
5
+ import "sun.audio.AudioPlayer"
6
+ def self.play filename
7
+ i = java.io.FileInputStream.new(filename)
8
+ a = AudioStream.new(i)
9
+ AudioPlayer.player.start(a)
10
+ end
11
+ end
12
+
13
+ if $0 == __FILE__
14
+ puts 'syntax: filename.wav'
15
+ PlayAudio.play ARGV[0] # doesn't exit for awhile, for some reason
16
+ end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sensible-cinema}
8
- s.version = "0.19.3"
8
+ s.version = "0.19.4"
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"]
@@ -51,6 +51,7 @@ Gem::Specification.new do |s|
51
51
  "lib/muter.rb",
52
52
  "lib/ocr.rb",
53
53
  "lib/overlayer.rb",
54
+ "lib/play_audio.rb",
54
55
  "lib/screen_tracker.rb",
55
56
  "lib/storage.rb",
56
57
  "lib/swing_helpers.rb",
@@ -128,6 +129,7 @@ Gem::Specification.new do |s|
128
129
  "spec/vlc_programmer.spec.rb",
129
130
  "todo_if_need_speed",
130
131
  "vendor/gocr049.exe",
132
+ "vendor/music.wav",
131
133
  "vendor/unzip.exe",
132
134
  "zamples/edit_decision_lists/category descriptions.txt",
133
135
  "zamples/edit_decision_lists/dvds/COOL_RUNNINGS.txt",
@@ -29,7 +29,7 @@ describe 'dvd_drive_info' do
29
29
  end
30
30
 
31
31
  it "should be able to do it for real drive" do
32
- DriveInfo.get_dvd_drives_as_win32ole.each{|d|
32
+ DriveInfo.get_dvd_drives_as_openstruct.each{|d|
33
33
  DriveInfo.md5sum_disk(d.Name + "/").length.should be > 0 if d.VolumeName
34
34
  }
35
35
  end
@@ -33,13 +33,11 @@ describe EdlParser do
33
33
  "mutes"=>[["00:00:01", "00:00:02"],
34
34
  ["00:00:01", "00:00:02", "profanity", "dang"],
35
35
  ["01:01:00", "01:02:00"]],
36
- "blank_outs"=>[["01:01:00", "01:02:00", "nudity", "5"],
37
- ["00:03:03.5", "00:03:04.5"],
38
- ["01:01:00", "01:02:00", "profanity", "bodily function 1"]],
36
+ "blank_outs"=>[["01:01:00", "01:02:00", "nudity", "..."], ["00:03:03.5", "00:03:04.5"]],
39
37
  "missing_content"=>"this doesn't list some mild name calling",
40
38
  "title"=>"Forever Strong", "source"=>"Hulu", "url"=>"http://www.byutv.org/watch/1790-100",
41
39
  "whatever_else_you_want"=>"this is the old version of the film",
42
-
40
+ "disk_unique_id"=>"19d131ae8dc40cdd70b57ab7e8c74f76"
43
41
  }
44
42
  E.parse_string(string, nil).should == expected
45
43
  end
@@ -72,7 +70,7 @@ describe EdlParser do
72
70
 
73
71
  it "should parse a real file" do
74
72
  E.parse_file(File.expand_path(__dir__) + "/../zamples/edit_decision_lists/dvds/bobs_big_plan.txt").should ==
75
- {"mutes"=>[["00:03.8", "01:03", "theme song is a bit raucous at times"], ["48:46", "49:08", "theme song again"], ["29:14", "30:46", "theme song again"]], "title"=>"Bob's Big Plan", "dvd_drive_label"=>"BOBS_BIG_PLAN", "source"=>"DVD", "dvd_title_track"=>1, "other notes"=>"could use more nit-picking of the song, as some parts seem all right in the end", "blank_outs"=>[]}
73
+ {"title"=>"Bob's Big Plan", "dvd_title_track"=>1, "other notes"=>"could use more nit-picking of the song, as some parts seem all right in the end", "disk_unique_id"=>"259961ce38971cac3e28214ec4ec278b", "mutes"=>[["00:03.8", "01:03", "theme song is a bit raucous at times"], ["28:13.5", "29:40", "theme song again"], ["48:46", "49:08", "theme song again"]], "blank_outs"=>[]}
76
74
  end
77
75
 
78
76
  it "should be able to use personal preferences to decide which edits to make" do
@@ -104,4 +102,9 @@ describe EdlParser do
104
102
  EdlParser.convert_incoming_to_split_sectors({"mutes"=>{105=>145}, "blank_outs"=>{105=>145}}).should == [[105.0, 145.0, :blank]]
105
103
  end
106
104
 
105
+ it "should add to both ends" do
106
+ EdlParser.convert_incoming_to_split_sectors({"mutes"=>{105=>145}}, 1).should == [[105.0, 146.0, :mute]]
107
+ EdlParser.convert_incoming_to_split_sectors({"mutes"=>{105=>145}}, 1,1).should == [[104.0, 146.0, :mute]]
108
+ end
109
+
107
110
  end
@@ -53,7 +53,15 @@ EOL
53
53
  105.0 106.0 1
54
54
  106.0 107.0 0
55
55
  EOL
56
-
57
56
  end
58
57
 
58
+ it "should add to beginning and ending of mutes" do
59
+ a = MplayerEdl.convert_to_edl({ "mutes"=>{105=>106}, "blank_outs" => {110 => 111} }, 1, 1 )
60
+ a.should == <<EOL
61
+ 104.0 107.0 1
62
+ 110.0 111.0 0
63
+ EOL
64
+
65
+ end
66
+
59
67
  end
data/spec/notes CHANGED
@@ -1,3 +1,5 @@
1
+ edl works *great* with cars at 15 minutes, and appears to at an hour, too. Oh, and the audio matches perfectly.
2
+
1
3
  The kicker is that if I want to watch the "unedited all" option in mplayer (which I do for the "quick start" mode), then it needs to be as is...
2
4
 
3
5
  audio_codec = these_settings['audio_codec'] || 'lavc' # not copy...sniff...or you can't hear cars...as ffmpeg loses it on transfer [?] at least the intermediates you *cannot* hear.
@@ -127,10 +127,8 @@ module SensibleSwing
127
127
  end
128
128
 
129
129
  class FakeFileChooser
130
- def set_title x
131
- end
132
- def set_file y
133
- end
130
+ def set_title x; end
131
+ def set_file y; end
134
132
  def go
135
133
  'abc'
136
134
  end
@@ -154,22 +152,26 @@ module SensibleSwing
154
152
  end
155
153
 
156
154
  it "should call through to explorer for the full thing" do
155
+ PlayAudio.stub!(:play) {
156
+ @played = true
157
+ }
157
158
  @subject.do_copy_dvd_to_hard_drive(false)
158
159
  @subject.background_thread.join
159
160
  @args[-4].should == nil
160
161
  @system_blocking_command.should match /explorer/
161
162
  @system_blocking_command.should_not match /fulli/
163
+ @played.should == true
162
164
  end
163
165
 
164
- it "should be able to return the full list if it already exists" do
166
+ it "should be able to return the fulli name if it already exists" do
165
167
  FileUtils.touch "abc.fulli_unedited.tmp.mpg.done"
166
168
  @subject.do_copy_dvd_to_hard_drive(false,true).should == [true, "abc.fulli_unedited.tmp.mpg"]
167
169
  FileUtils.rm "abc.fulli_unedited.tmp.mpg.done"
168
170
  end
169
171
 
170
- it "should call explorer for the we can't reach this path of opening a partial without telling it what to do with it" do
172
+ it "should call explorer eventually, if it has to create the fulli file" do
171
173
  @subject.do_copy_dvd_to_hard_drive(true).should == [false, "abc.fulli_unedited.tmp.mpg"]
172
- @subject.background_thread.join
174
+ join_background_thread
173
175
  @args[-2].should == 1
174
176
  @args[-3].should == "01:00"
175
177
  @command.should match /smplayer/
@@ -224,19 +226,23 @@ module SensibleSwing
224
226
  @system_blocking_command.should == "echo wrote (probably successfully) to abc.avi"
225
227
  end
226
228
 
227
- it "if the .done files exists, it should directly call smplayer" do
229
+ it "if the .done files exists, watch unedited should call smplayer ja" do
228
230
  FileUtils.touch "abc.fulli_unedited.tmp.mpg.done"
229
231
  @subject.instance_variable_get(:@watch_unedited).simulate_click
230
232
  @command.should == "smplayer abc.fulli_unedited.tmp.mpg"
231
233
  FileUtils.rm "abc.fulli_unedited.tmp.mpg.done"
232
234
  end
233
235
 
234
- it "if the .done file does not exist, it should call smplayer ja" do
235
- @subject.stub!(:sleep) {} # speed this test up...
236
+ it "if the .done file does not exist, watch unedited should call smplayer after x seconds" do
237
+ @subject.stub!(:sleep) {
238
+ @slept = true
239
+ } # speed this test up...
240
+ @subject.unstub!(:get_mencoder_commands)
236
241
  click_button(:@watch_unedited).join
237
- @subject.after_success_once.should == nil
238
- @command.should =~ /smplayer.*fulli/
242
+ join_background_thread
239
243
  @system_blocking_command.should_not == nil
244
+ @slept.should == true
245
+ @show_blocking_message_dialog_last_args.should == nil
240
246
  end
241
247
 
242
248
  it "should create a new file for ya" do
@@ -273,17 +279,6 @@ module SensibleSwing
273
279
  wrote.should include("380.85 1")
274
280
  end
275
281
 
276
- it "should only prompt for drive once" do
277
- count = 0
278
- @subject.stub!(:choose_dvd_drive) {
279
- raise 'bad' if count == 1
280
- count = 1
281
- ['drive', 'volume', '19d121ae8dc40cdd70b57ab7e8c74f76']
282
- }
283
- @subject.choose_dvd_and_edl_for_it
284
- @subject.choose_dvd_and_edl_for_it
285
- count.should == 1
286
- end
287
282
 
288
283
  def should_allow_for_changing_file corrupt_file = false
289
284
  with_clean_edl_dir_as 'temp' do
@@ -324,22 +319,39 @@ module SensibleSwing
324
319
  count.should == 1
325
320
  end
326
321
 
327
- it "should prompt you if you need to insert a dvd" do
328
- DriveInfo.stub(:get_dvd_drives_as_win32ole) {
329
- a = OpenStruct.new
330
- a.Name = 'a name'
331
- # no VolumeName though
332
- [a]
333
- }
334
- @subject.unstub!(:choose_dvd_drive)
335
- proc {@subject.choose_dvd_drive }.should raise_error(/might not yet have.*in it/)
336
- @show_blocking_message_dialog_last_args.should_not be nil
322
+ describe 'cacheing dvd drive' do
323
+ before do
324
+ DriveInfo.stub!(:get_dvd_drives_as_openstruct) {
325
+ a = OpenStruct.new
326
+ # NB no VolumeName set
327
+ a.Name = 'a name'
328
+ [a]
329
+ }
330
+ @subject.unstub!(:choose_dvd_drive)
331
+ end
332
+
333
+ it "should only prompt for drive once" do
334
+ count = 0
335
+ DriveInfo.stub!(:md5sum_disk) {
336
+ raise if count == 1
337
+ count = 1
338
+ '19d121ae8dc40cdd70b57ab7e8c74f76'
339
+ }
340
+ @subject.choose_dvd_and_edl_for_it
341
+ @subject.choose_dvd_and_edl_for_it
342
+ count.should == 1
343
+ end
344
+
345
+ it "should prompt you if you need to insert a dvd" do
346
+ proc {@subject.choose_dvd_drive }.should raise_error(/might not yet have.*in it/)
347
+ @show_blocking_message_dialog_last_args.should_not be nil
348
+ end
337
349
  end
338
350
 
339
351
  it "should not show the normal buttons in create mode" do
340
- MainWindow.new.buttons.length.should == 3 # exit button, two normal buttons
352
+ MainWindow.new.buttons.length.should == 2 # exit button, two normal buttons
341
353
  ARGV << "--create-mode"
342
- MainWindow.new.buttons.length.should == 8
354
+ MainWindow.new.buttons.length.should == 10
343
355
  ARGV.pop # test cleanup--why not :)
344
356
  end
345
357
 
Binary file
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 19
8
- - 3
9
- version: 0.19.3
8
+ - 4
9
+ version: 0.19.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Roger Pack
@@ -189,6 +189,7 @@ files:
189
189
  - lib/muter.rb
190
190
  - lib/ocr.rb
191
191
  - lib/overlayer.rb
192
+ - lib/play_audio.rb
192
193
  - lib/screen_tracker.rb
193
194
  - lib/storage.rb
194
195
  - lib/swing_helpers.rb
@@ -266,6 +267,7 @@ files:
266
267
  - spec/vlc_programmer.spec.rb
267
268
  - todo_if_need_speed
268
269
  - vendor/gocr049.exe
270
+ - vendor/music.wav
269
271
  - vendor/unzip.exe
270
272
  - zamples/edit_decision_lists/category descriptions.txt
271
273
  - zamples/edit_decision_lists/dvds/COOL_RUNNINGS.txt