sensible-cinema 0.19.1 → 0.19.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.19.2 ==
2
+
3
+ More user friendliness.
4
+
1
5
  == 0.19.1 ==
2
6
 
3
7
  Clarify buttons' meanings, layout (add one), fix some bugs in create mode, like it not re-loading edited files.
data/LICENSE.TXT CHANGED
@@ -23,6 +23,7 @@ It's about the same as using VLC media player to watch a DVD, which also uses li
23
23
  Also note that if you watch an edited DVD in a commercial DVD player, your are using a DVD player that conforms
24
24
  with encryption specifications, so that might have some sway.
25
25
  Note also that fair use at times does allow one to "record" things for personal use/backup (for example off the TV).
26
+ Note that sensible cinema does require the original DVD to be present when using it, also.
26
27
 
27
28
  If general, if it's not legal in your country, then don't use it!
28
29
  You are responsible for your actions and use of this program.
@@ -31,16 +32,16 @@ regarding its use themselves, since they re-distribute no edited media,
31
32
  nor distribute cracking codes. Check your country's rules first.
32
33
  If it's illegal, don't use it!
33
34
 
34
- Note: do not redistribute/re-sell edited commercial DVD's. We have learned from clean flicks that
35
- redistributing edited commercial DVD's is illegal in the US. We hope that sensible-cinema
36
- is more legal, since you can get the DVD's from wherever you want, and it doesn't change their
37
- structure at all. Please don't redistribute. If creating copies of commercial DVD's is illegal
35
+ Note: do not redistribute/re-sell edited DVD's. We have learned the hard way from clean flicks that
36
+ redistributing edited commercial DVD's is against copyright in the US. We hope that sensible-cinema
37
+ is more legal, since you can get the DVD's from wherever you want, and keep the original.
38
+ Please don't redistribute. If creating copies of commercial DVD's is illegal
38
39
  in your country, then don't do it! Use the "watch in realtime" option.
39
40
 
40
41
  DO NOT MAKE ILLEGAL COPIES.
41
42
 
42
- In terms of copyright, it could be legal under the The Family Home Movie Act of 2005,
43
- at least in the United States, when viewed using the "playlist" option (v 0.10'ish, then later removed).
43
+ In terms of copyright, it could be legal under the The Family Home Movie Act of 2005,
44
+ at least in the United States, when viewed using the "playlist" option (v 0.10'ish, then later removed), or the "realtime" option (0.18.0'ish +).
44
45
  In general, if I have the original DVD sitting next to my TV, I don't feel bad about watching
45
46
  its edited copy, but please consult a laywer first if you have any concerns.
46
47
 
data/README CHANGED
@@ -166,20 +166,22 @@ If it says "audio problem try pcm" then you can add
166
166
  "audio_codec" => "lavc"
167
167
  to your EDL and try again.
168
168
 
169
- Also if your DVD playback has no audio, try the "lavc" setting, above. And report it (see feedback).
170
-
171
169
  It can fail also because a deletion is past end of DVD, or
172
170
  Also note that if your DVD has scratches that cause it to skip, the time signatures will be off after that point,
173
171
  so clean your discs and try again!
174
172
 
175
173
  Also you could try a different computer (desktop computers' DVD drives seem to work better at times than laptops')
176
174
 
175
+ Too slow? One big speedup would be getting a faster hard drive (like an SSD). A second might be to get a faster DVD drive.
176
+ I'm not certain but I don't believe that a faster cpu (or even dual core, etc.), will currently help much,
177
+ though it might like 3% or something.
177
178
 
178
179
  == Feedback ==
179
180
 
180
181
  Feedback, including feature requests, comments, etc. welcome.
181
182
 
182
- http://github.com/rdp/sensible-cinema (message me or create an issue for feedback/any requests/bugs)
183
- or e-mail rogerdpack@gmail.com
183
+ Mailing List: http://groups.google.com/group/sensible-cinema
184
+
184
185
  If you're a developer and want to help out with programmming it, please do!
185
- Also ping me if you want a mailing list created or what not.
186
+ Source code: http://github.com/rdp/sensible-cinema (create an issue for any feature requests/bugs)
187
+ or e-mail rogerdpack@gmail.com
@@ -2,5 +2,6 @@
2
2
  @rem disable any local rubyopt settings...
3
3
  @set RUBYOPT=
4
4
  @echo This window will display lots of debug message output!
5
- @cd sensible-cinema && java -cp "./vendor/cache/jruby-complete-1.5.5.jar" org.jruby.Main bin\sensible-cinema || echo you need to install java first! Please report back the error you see! && pause
5
+ @java -version || echo need to install java first && pause
6
+ @cd sensible-cinema && java -cp "./vendor/cache/jruby-complete-1.5.5.jar" org.jruby.Main bin\sensible-cinema || echo ERROR. Please look for error message, above, and report back the error you see, or fix it && pause
6
7
  @rem taskkill /f /im mencoder.exe
data/TODO CHANGED
@@ -2,25 +2,21 @@
2
2
 
3
3
  == up next release ==
4
4
 
5
- edit lists:
6
- cool runnings EDL
7
- stuff from paper
8
- less "need java first" messages
5
+ edit lists actually *work*:
6
+ cool runnings
7
+ temple
8
+ cars
9
+ HP
9
10
 
10
11
  == slightly lower than that, somewhat ordered ==
11
12
 
12
- @license: requires legal DVD's to be present
13
- can you forceidx on the original copy and have mplayer replay EDL in realtime accurately or not?
14
13
  linearize edl's
15
14
  don't use them linear, just linearize
16
15
  not this release
17
-
18
- edit lists:
19
- temple
20
- cars
21
16
  compare computer DVD timings with physical player's timings...
22
17
  if same, add imdb todo's up here
23
- mpeg is lossy (at least my current one pass conversion is)
18
+ mpeg is lossy (at least my current one pass conversion still is...)
19
+ frame accurate splitter
24
20
  check the DVD burning experience too...
25
21
  could check if DVD Flick handles *oversize* files well, for information sake
26
22
  partner for filters (Jon, Karlie if interested...give beta)
@@ -30,18 +26,29 @@
30
26
  only after linearize
31
27
  beta release/rinse and repeat with various ppl (once it's releasable...)
32
28
  a real'ish-er website
33
- mailing list, link to it
34
- button to mail/submit :)
29
+ link to ML
30
+ add button "upload/mail/submit" to ML [?]
35
31
  play a bigger noise when totally done...(dvd flick'ish...)
36
32
  propaganda-ize
37
33
  advertise in christian places
38
34
  blogs that have ever mentioned clearplay :P
39
35
  free google adwords (?)
40
36
  advertise urug, ruby flow :)
41
- add they 'play from unedited till it hits the first bad spot, if still useful
37
+ add they 'play from unedited from grab till it hits the first bad spot', if useful [?]
38
+ fix edl_parser spec
42
39
 
43
40
  == DVD backlog (unordered, some very low prio, basically never do) ==
44
41
 
42
+ can you forceidx on the original copy and have mplayer replay EDL in realtime accurately or not, with audio?
43
+ if not somehow, wait till video falls through, then see if I can...do something here with audio...yipers..
44
+ sound accurate?
45
+ back to audio copy? huh?
46
+ calculating disk's unique id... -> gui somewhere
47
+ @dvd flick: auto-detect the aspect ratio, if possible (?)
48
+ detect disks have changed, re-query.
49
+ ffmpeg handle 3F2R audio [sigh] [cars, should work with temple at lavc, too, bob dvd's are dual, I think...hmm...]
50
+ "preview edited in a wholly blank section that includes an audio section should fail"
51
+ an 'always skip mutes' option for paranoia.
45
52
  dvdnav versus dvd for mplayer edl?
46
53
  disallow choosing empty drive? fail more gracefully? (issue 11)
47
54
  some status bar that shows which DVD is in currently, how many match it, et al (pre button)
@@ -70,7 +77,7 @@
70
77
  several "play now" options...without a navigator of course :)
71
78
  visualbasic-like playlist
72
79
  one line at a time :P
73
- provide link for cheap DVD decoder if absent [ffdshow?] :)
80
+ provide link for cheap DVD decoder if they lack one :)
74
81
  "round conservatively, write no file" playback
75
82
  mplayer batch (playlist?)
76
83
  "round conservatively, yes write file"
@@ -164,10 +171,11 @@ report to jruby "when one thread dies, the GUI becomes unresponsive" (and others
164
171
  a "certified clean" list
165
172
  advertise my "splitting joining" google doc page. also test the various options there for accurateness :)
166
173
  check for "newer version available" or not...
167
- buy blu-ray decrypter, try it out.
174
+ buy blu-ray decrypter, and drive, try it out.
168
175
 
169
176
  == random non-DVD backlog ... note: just plow forward, to "grab" available ideas...except that for now, just what *I* plan on needing for myself (filters for what I need/want). ==
170
177
 
178
+ copy to one drive, write to another, for speedup
171
179
  fade in/fade out volume, video
172
180
  make the other stuff work again, since I no longer use YAML...
173
181
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.19.1
1
+ 0.19.2
data/bin/sensible-cinema CHANGED
@@ -81,7 +81,7 @@ module SensibleSwing
81
81
  super "Sensible-Cinema"
82
82
  if !(Storage['main_license_accepted'] == VERSION)
83
83
  show_blocking_license_accept_dialog 'Sensible Cinema', 'gplv3', 'http://www.gnu.org/licenses/gpl.html'
84
- show_blocking_license_accept_dialog 'Sensible Cinema', 'LICENSE file', File.expand_path(File.dirname(__FILE__) + "/../LICENSE.TXT"), 'LICENSE file', 'I acknowledge that I have read the LICENSE file.'
84
+ 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.'
85
85
  Storage['main_license_accepted'] = VERSION
86
86
  end
87
87
 
@@ -147,7 +147,7 @@ module SensibleSwing
147
147
  repeat_last_copy_dvd_to_hard_drive
148
148
  }
149
149
 
150
- @open_list = new_jbutton("Open a Delete List", true)
150
+ @open_list = new_jbutton("Open/Edit a Delete List", true)
151
151
  @open_list.on_clicked {
152
152
  dialog = FileDialog.new(self, "Pick file to edit")
153
153
  dialog.set_directory EDL_DIR
@@ -221,7 +221,7 @@ EOL
221
221
  end
222
222
 
223
223
  def show_blocking_license_accept_dialog program, license_name, license_url_should_also_be_embedded_by_you_in_message, title = 'Confirm Acceptance of License Agreement', message = nil
224
- puts 'Please confirm license agreement in an open window'
224
+ puts 'Please confirm license agreement in open window'
225
225
  old = ['no', 'yes', 'ok'].map{|name| 'OptionPane.' + name + 'ButtonText'}.map{|name| [name, UIManager.get(name)]}
226
226
  UIManager.put("OptionPane.yesButtonText", 'Accept')
227
227
  UIManager.put("OptionPane.noButtonText", 'View License')
@@ -248,7 +248,7 @@ EOL
248
248
  System.exit 1
249
249
  end
250
250
  throw unless returned == 0
251
- old.each{|name, old_setting| UIManager.put(name, old_setting)}
251
+ old.each{|name, old_setting| UIManager.put(name, old_setting)}
252
252
  end
253
253
 
254
254
  def check_for_dependencies
@@ -301,7 +301,7 @@ EOL
301
301
  begin
302
302
  parse_edl(file)["disk_unique_id"] == md5
303
303
  rescue SyntaxError
304
- # ignore
304
+ # ignore poorly formed delete lists for auto choose
305
305
  end
306
306
  }
307
307
  if matching.length == 1
@@ -325,6 +325,7 @@ EOL
325
325
 
326
326
  def show_blocking_message_dialog(message, title = message.split("\n")[0], style= JOptionPane::INFORMATION_MESSAGE)
327
327
  JOptionPane.showMessageDialog(nil, message, title, style)
328
+ true
328
329
  end
329
330
 
330
331
  include_class javax.swing.UIManager
@@ -349,19 +350,21 @@ EOL
349
350
  edit_list_path = fc.go
350
351
  end
351
352
  raise 'cancelled' unless edit_list_path
352
- descriptors = nil
353
- while(!descriptors)
353
+ [drive, dvd_volume_name, md5sum, edit_list_path, nil]
354
+ end
355
+
356
+ # reload it just in case it has changed on disk
357
+ edit_list_path = @_choose_dvd_and_edl_for_it[3]
358
+ descriptors = nil
359
+ while(!descriptors)
354
360
  begin
355
361
  descriptors = parse_edl edit_list_path
356
362
  rescue SyntaxError => e
357
363
  puts e
358
- show_blocking_message_dialog("syntax error: " + edit_list_path + " " + e)
364
+ show_blocking_message_dialog("your file has an error: \n" + edit_list_path + "\n " + e)
359
365
  end
360
- end
361
- [drive, dvd_volume_name, md5sum, edit_list_path, descriptors]
362
366
  end
363
- # reload it just in case it has changed on disk
364
- @_choose_dvd_and_edl_for_it[4] = parse_edl(@_choose_dvd_and_edl_for_it[3])
367
+ @_choose_dvd_and_edl_for_it[-1] = descriptors
365
368
  @_choose_dvd_and_edl_for_it
366
369
  end
367
370
 
@@ -392,8 +395,9 @@ EOL
392
395
 
393
396
  # LODO allow for spaces in the save_to filename
394
397
  if should_prompt_for_start_and_end_times
395
- # only show it once :)
396
- @show_block ||= show_blocking_message_dialog("Ok, let's preview just a portion of it. \nNote that you'll want to preview a section that wholly includes a deletion section in it\n For example, if it mutes from second 1 to second 10, you'll want to play from 00:00 to 00:12 or what not.\nAlso note that the first time you preview a section of a video, it will take like 20 minutes as it sets up the video for previewing.\nSubsequent previews will be faster, though, as long as you use the same filename.", "Preview") || true
398
+ # only show this message once :)
399
+ @show_block ||= show_blocking_message_dialog("Ok, let's preview just a portion of it. \nNote that you'll want to preview a section that wholly includes a deleted section in it\n For example, if it mutes from second 1 to second 10, you'll want to play from 00:00 to 00:12 or what not.\nAlso note that the first time you preview a section of a video, it will take a long time as it sets up the video for previewing.\nSubsequent previews will be faster, though, as long as you use the same filename.\n
400
+ Also note that if you change your delete list, you'll need to close, and regenerate the video to see it with your new settings.", "Preview")
397
401
  start_time = get_user_input("At what point in the video would you like to start your preview? (like 01:00 for starting at 1 minute)", Storage['start_time'])
398
402
  end_time = get_user_input("At what point in the video would you like to finish your preview? (like 02:00 for ending at the 2 minute mark)", Storage['end_time'])
399
403
  unless start_time and end_time
@@ -416,8 +420,8 @@ EOL
416
420
  end
417
421
 
418
422
  dvd_title_track = get_title_track(descriptors)
419
- run_mplayer = should_prompt_for_start_and_end_times || exit_early_if_fulli_exists
420
- generate_and_run_bat_file save_to, edit_list_path, descriptors, drive, dvd_title, start_time, end_time, dvd_title_track, run_mplayer, !ignore_settings
423
+ should_run_mplayer = should_prompt_for_start_and_end_times || exit_early_if_fulli_exists
424
+ generate_and_run_bat_file save_to, edit_list_path, descriptors, drive, dvd_title, start_time, end_time, dvd_title_track, should_run_mplayer, !ignore_settings
421
425
  [false, fulli] # false means it's running in a background thread :P
422
426
  end
423
427
 
@@ -425,13 +429,19 @@ EOL
425
429
  DriveInfo.get_drive_with_most_space_with_slash
426
430
  end
427
431
 
432
+ # stubbable :)
428
433
  def get_mencoder_commands descriptors, drive, save_to, start_time, end_time, dvd_title_track, require_deletion_entry
429
434
  MencoderWrapper.get_bat_commands descriptors, drive, save_to, start_time, end_time, dvd_title_track, true, require_deletion_entry # delete partials...
430
435
  end
431
436
 
432
437
  def generate_and_run_bat_file save_to, edit_list_path, descriptors, drive, dvd_title, start_time, end_time, dvd_title_track, run_mplayer, require_deletion_entry
433
438
  Storage['last_params'] = [save_to, edit_list_path, descriptors, drive, dvd_title, start_time, end_time, dvd_title_track, run_mplayer, require_deletion_entry]
434
- commands = get_mencoder_commands descriptors, drive, save_to, start_time, end_time, dvd_title_track, require_deletion_entry
439
+ begin
440
+ commands = get_mencoder_commands descriptors, drive, save_to, start_time, end_time, dvd_title_track, require_deletion_entry
441
+ rescue MencoderWrapper::TimingError => e
442
+ show_blocking_message_dialog("Appears you chose a time frame with no deletion segment in it--please try again:" + e)
443
+ return
444
+ end
435
445
  temp_dir = Dir.tmpdir
436
446
  temp_file = temp_dir + '/vlc.temp.bat'
437
447
  File.write(temp_file, commands)
@@ -492,7 +502,7 @@ EOL
492
502
  def choose_dvd_drive
493
503
  opticals = DriveInfo.get_dvd_drives_as_win32ole
494
504
  show_blocking_message_dialog 'insert dvd first' unless opticals.find{|d| d.VolumeName }
495
- names = opticals.map{|d| d.Name + "\\" + " (" + (d.VolumeName || 'Insert DVD and re-select') + ")"}
505
+ names = opticals.map{|d| d.Name + "\\" + " (" + (d.VolumeName || 'Insert DVD and re-start') + ")"}
496
506
 
497
507
  if opticals.length != 1
498
508
  dialog = GetDisk.new(self, names)
@@ -2,5 +2,6 @@
2
2
  @rem disable any local rubyopt settings...
3
3
  @set RUBYOPT=
4
4
  @echo This window will display lots of debug message output!
5
- @cd sensible-cinema && java -cp "./vendor/cache/jruby-complete-1.5.5.jar" org.jruby.Main bin\sensible-cinema --create-mode || echo you need to install java first! please report back the error you see! && pause
5
+ @java -version || echo need to install java first && pause
6
+ @cd sensible-cinema && java -cp "./vendor/cache/jruby-complete-1.5.5.jar" org.jruby.Main bin\sensible-cinema --create-mode || echo ERROR. Please look for error message, above, and report back the error you see, or fix it && pause
6
7
  @taskkill /f /im mencoder.exe
data/lib/edl_parser.rb CHANGED
@@ -84,6 +84,7 @@ class EdlParser
84
84
  mutes = mutes.map{|k, v| [OverLayer.translate_string_to_seconds(k), OverLayer.translate_string_to_seconds(v) + add_this_to_mutes, :mute]}
85
85
  blanks = blanks.map{|k, v| [OverLayer.translate_string_to_seconds(k), OverLayer.translate_string_to_seconds(v), :blank]}
86
86
 
87
+ combined = (mutes+blanks).sort_by{|entry| entry[0,1]}
87
88
  combined = (mutes+blanks).sort
88
89
 
89
90
  combined.each{|s, e, t|
@@ -129,4 +130,14 @@ class EdlParser
129
130
  }
130
131
  end
131
132
 
133
+ end
134
+
135
+ # <= 1.8.7 Symbol compat
136
+
137
+ class Symbol
138
+ # Standard in ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/Symbol.html]
139
+ def <=>(with)
140
+ return nil unless with.is_a? Symbol
141
+ to_s <=> with.to_s
142
+ end unless method_defined? :"<=>"
132
143
  end
@@ -19,7 +19,8 @@ This file is part of Sensible Cinema.
19
19
  require_relative 'edl_parser'
20
20
 
21
21
  class MencoderWrapper
22
-
22
+ class TimingError < StandardError
23
+ end
23
24
  class << self
24
25
 
25
26
  def get_header this_drive, these_settings
@@ -29,9 +30,9 @@ class MencoderWrapper
29
30
  end
30
31
  # video_opts = "-ovc lavc -lavcopts keyint=1" # seems reasonable quality somehow...
31
32
  # equivalent of ffmpeg's -target ntsc-dvd...I think...except that aspect thing terrifies me...
32
- audio_codec = these_settings['audio_codec'] || 'copy'
33
+ audio_codec = these_settings['audio_codec'] || 'lavc' # not copy...sniff...
33
34
  video_opts = "-ovc lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=1:vstrict=0:acodec=ac3:abitrate=192:autoaspect -ofps 30000/1001"
34
- out + "call mencoder dvdnav://#{@dvd_title_track} -of mpeg -mpegopts format=dvd:tsaf -alang en -nocache -sid 1000 -oac #{audio_codec} #{video_opts} -ovc lavc -o #{@big_temp} -dvd-device #{this_drive} && echo got_file > #{@big_temp}.done\n"
35
+ out + "call mencoder dvdnav://#{@dvd_title_track} -of mpeg -mpegopts format=dvd:tsaf -alang en -nocache -sid 1000 -oac #{audio_codec} #{video_opts} -o #{@big_temp} -dvd-device #{this_drive} && echo got_file > #{@big_temp}.done\n"
35
36
  end
36
37
 
37
38
  def calculate_final_filename to_here_final_file
@@ -48,7 +49,7 @@ class MencoderWrapper
48
49
  start_here = OverLayer.translate_string_to_seconds(start_here)
49
50
  end_here = OverLayer.translate_string_to_seconds(end_here)
50
51
  combined.select!{|start, endy, type| start > start_here && endy < end_here }
51
- raise "unable to find deletion entry between #{start_here} and #{end_here}" if require_deletion_entry && combined.length == 0
52
+ raise TimingError.new("unable to find deletion entry between #{start_here} and #{end_here}") if require_deletion_entry && combined.length == 0
52
53
  # it's relative now, since we rip from not the beginning
53
54
  previous_end = start_here
54
55
  else
@@ -73,10 +74,11 @@ class MencoderWrapper
73
74
  partials = (1..@idx).map{|n| "#{to_here_final_file}.#{n}.avi"}
74
75
  to_here_final_file = to_here_final_file + ".avi"
75
76
  if File.exist? to_here_final_file
76
- FileUtils.rm to_here_final_file # raises on failure...which is what we want I think
77
+ FileUtils.rm to_here_final_file # raises on deletion failure...which is what we want I think...hopefully.
77
78
  end
78
79
  out += "call mencoder #{partials.join(' ')} -o #{to_here_final_file} -ovc copy -oac copy\n"
79
- # LODO only do this if they want to watch it on their computer, with something other than smplayer, or want to make it smaller, as it takes *forever* longer
80
+ # LODO only do this if they want to watch it on their computer, with something other than smplayer, or want to make it smaller, as it takes *forever* longer to run...
81
+ # or is ffdshow enough without this?
80
82
  out += "@rem call mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 #{partials.join(' ')} -o #{to_here_final_file}\n"
81
83
 
82
84
  delete_prefix = delete_partials ? "" : "@rem "
data/lib/mplayer_edl.rb CHANGED
@@ -17,7 +17,7 @@ This file is part of Sensible Cinema.
17
17
  =end
18
18
 
19
19
  require_relative 'overlayer'
20
- require_relative 'vlc_programmer'
20
+ require_relative 'edl_parser'
21
21
 
22
22
  class MplayerEdl
23
23
  def self.convert_to_edl specs, add_this_many_to_end = 0
data/lib/swing_helpers.rb CHANGED
@@ -40,9 +40,9 @@ module SensibleSwing
40
40
  begin
41
41
  block.call
42
42
  rescue Exception => e
43
- puts 'got fatal exception', e
44
- puts e.backtrace.join("\n")
45
- System.exit(1) # LODO no exit
43
+ puts 'got fatal exception in button', e, e.class
44
+ puts e.backtrace.join("\n"), e
45
+ System.exit(1) # LODO no exit [?]
46
46
  end
47
47
  end
48
48
  self
@@ -111,11 +111,3 @@ class VLCProgrammer
111
111
 
112
112
  end
113
113
 
114
- # <= 1.8.7 compat...
115
- class Symbol
116
- # Standard in ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/Symbol.html]
117
- def <=>(with)
118
- return nil unless with.is_a? Symbol
119
- to_s <=> with.to_s
120
- end unless method_defined? :"<=>"
121
- 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.1"
8
+ s.version = "0.19.2"
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"]
@@ -100,4 +100,8 @@ describe EdlParser do
100
100
  E.parse_string('"mutes"=>["0:33", "0:34"]', 'filename', [], true)['mutes'].should == []
101
101
  end
102
102
 
103
+ it "should sort exactly overlapping segments" do
104
+ EdlParser.convert_incoming_to_split_sectors({"mutes"=>{105=>145}, "blank_outs"=>{105=>145}}).should == [[105.0, 145.0, :blank]]
105
+ end
106
+
103
107
  end
@@ -45,7 +45,16 @@ describe MencoderWrapper do
45
45
  if use_mpg2_fulli_unedited
46
46
  @out.should match(/dvdnav.*lavcopt.*mpeg2video/)
47
47
  @out.should match(/autoaspect/) # try to preserve aspect
48
+ else
49
+ @out.should match(/dvdnav.*-ovc copy/)
48
50
  end
51
+ # "poor" audio for certain DVD's <sigh>
52
+ @out.should match(/dvdnav.*-oac lavc/)
53
+ end
54
+
55
+ it "should not double setting params" do
56
+ @out.should_not =~ /-ovc.*-ovc/
57
+ @out.should_not =~ /-oac.*-oac/
49
58
  end
50
59
 
51
60
  it "should avoid subtitles" do
@@ -117,12 +126,9 @@ describe MencoderWrapper do
117
126
  @out.should_not include(".avi.1 ")
118
127
  end
119
128
 
120
- it "should concatenate (merge) them all together" do
129
+ it "should concatenate (merge) them all together into one large conglom file" do
121
130
  @out.should match(/mencoder.* -ovc copy -oac copy/)
122
131
  @out.should match(/mencoder to_here.1.avi/)
123
- end
124
-
125
- it "should create a large conglom file" do
126
132
  @out.should match(/mencoder.*-o to_here.avi -ovc copy -oac copy/)
127
133
  end
128
134
 
@@ -152,9 +158,10 @@ describe MencoderWrapper do
152
158
  end
153
159
 
154
160
  it "should accept audio_code" do
155
- settings = {"audio_codec"=>"pcm"}
161
+ # for the audio philes, I guess..
162
+ settings = {"audio_codec"=>"copy2"}
156
163
  out = MencoderWrapper.get_bat_commands settings, "e:\\", 'to_here.avi'
157
- out.should include("-oac pcm")
164
+ out.should include("-oac copy2")
158
165
  end
159
166
 
160
167
  def setup
@@ -37,7 +37,6 @@ EOL
37
37
  a.should == <<EOL
38
38
  105.0 145.0 0
39
39
  EOL
40
-
41
40
  end
42
41
 
43
42
  it "should add to mutes" do
@@ -15,6 +15,8 @@ This file is part of Sensible Cinema.
15
15
  You should have received a copy of the GNU General Public License
16
16
  along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
17
17
  =end
18
+
19
+ require 'ostruct'
18
20
  require File.expand_path(File.dirname(__FILE__) + '/common')
19
21
  load '../bin/sensible-cinema'
20
22
 
@@ -189,7 +191,7 @@ module SensibleSwing
189
191
  temp_dir = Dir.tmpdir
190
192
 
191
193
  def join_background_thread
192
- @subject.background_thread.join
194
+ @subject.background_thread.join # must be running...
193
195
  end
194
196
 
195
197
  it "should be able to preview unedited" do
@@ -211,12 +213,13 @@ module SensibleSwing
211
213
  @command.should match(/smplayer/)
212
214
  end
213
215
 
214
- it "should raise if you watch an edited time frame with no edits in it" do
216
+ it "should warn if you watch an edited time frame with no edits in it" do
215
217
  @subject.unstub!(:get_mencoder_commands)
216
- proc { prompt_for_start_and_end_times }.should raise_error(/unable to find deletion entry/)
218
+ click_button(:@preview_section)
219
+ @show_blocking_message_dialog_last_args[0].should =~ /unable to/
217
220
  @subject.stub!(:get_user_input).and_return('06:00', '07:00')
218
- # rspec bug: wrong backtrace: proc { prompt_for_start_and_end_times #}.should_not raise_error LODO
219
- click_button(:@preview_section) # doesn't raise
221
+ # rspec bug: wrong'ish backtrace: proc { prompt_for_start_and_end_times #}.should_not raise_error LODO
222
+ click_button(:@preview_section)
220
223
  join_background_thread
221
224
  @system_blocking_command.should == "echo wrote (probably successfully) to abc.avi"
222
225
  end
@@ -281,18 +284,34 @@ module SensibleSwing
281
284
  count.should == 1
282
285
  end
283
286
 
284
- it "should allow for file to change contents while editing it" do
285
- with_clean_edl_dir_as 'temp' do
287
+ def should_allow_for_changing_file corrupt_file = false
288
+ with_clean_edl_dir_as 'temp' do
286
289
  File.binwrite('temp/a.txt', "\"disk_unique_id\" => \"abcdef1234\"")
287
290
  @subject.stub!(:choose_dvd_drive) {
288
291
  ["mock_dvd_drive", "Volume", "abcdef1234"]
289
292
  }
290
293
  @subject.choose_dvd_and_edl_for_it[4]['mutes'].should == []
291
- File.binwrite('temp/a.txt', '"disk_unique_id" => "abcdef1234","mutes"=>["0:33", "0:34"]')
294
+ new_file_contents = '"disk_unique_id" => "abcdef1234","mutes"=>["0:33", "0:34"]'
295
+ new_file_contents = '"a syntax error' if corrupt_file
296
+ File.binwrite('temp/a.txt', new_file_contents)
297
+ # it changed!
292
298
  @subject.choose_dvd_and_edl_for_it[4]['mutes'].should_not == []
293
299
  end
294
300
  end
295
301
 
302
+ it "should allow for file to change contents while editing it" do
303
+ should_allow_for_changing_file
304
+ end
305
+
306
+ it "should prompt you if you re-choose, and your file now has a failure in it" do
307
+ @subject.stub(:show_blocking_message_dialog) {
308
+ @got_here = true
309
+ @subject.stub(:parse_edl) { 'pass the second time through' }
310
+ }
311
+ should_allow_for_changing_file true
312
+ @got_here.should == true
313
+ end
314
+
296
315
  it "should only prompt for save to filename once" do
297
316
  count = 0
298
317
  @subject.stub!(:new_filechooser) {
@@ -305,14 +324,22 @@ module SensibleSwing
305
324
  end
306
325
 
307
326
  it "should prompt you if you need to insert a dvd" do
308
- # it does :)
327
+ DriveInfo.stub(:get_dvd_drives_as_win32ole) {
328
+ a = OpenStruct.new
329
+ a.Name = 'a name'
330
+ # no VolumeName though
331
+ [a]
332
+ }
333
+ @subject.unstub!(:choose_dvd_drive)
334
+ proc {@subject.choose_dvd_drive }.should raise_error(/might not yet have.*in it/)
335
+ @show_blocking_message_dialog_last_args.should_not be nil
309
336
  end
310
337
 
311
338
  it "should not show the normal buttons in create mode" do
312
339
  MainWindow.new.buttons.length.should == 3 # exit button, two normal buttons
313
340
  ARGV << "--create-mode"
314
341
  MainWindow.new.buttons.length.should == 8
315
- ARGV.pop # cleanup--why not :)
342
+ ARGV.pop # test cleanup--why not :)
316
343
  end
317
344
 
318
345
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 19
8
- - 1
9
- version: 0.19.1
8
+ - 2
9
+ version: 0.19.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Roger Pack