sensible-cinema 0.24.5 → 0.24.6

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,4 +1,4 @@
1
- Sensible-cinema [5] allows you to apply pre-programmed edit lists
1
+ Sensible-cinema allows you to apply pre-programmed edit lists
2
2
  (e.g. Edit Decision Lists [2]) to the DVD's you own.
3
3
  I.e. you can edit a DVD to "mute out" or skip certain scenes, deemed objectionable.
4
4
  This allows you to sit back and relax as you watch a more "sensiblized" showing of your DVD.
@@ -44,10 +44,9 @@ It's your call.
44
44
  Enjoy your movies!
45
45
 
46
46
  [1] http://en.wikipedia.org/wiki/Linear_video_editing
47
- [2] http://en.wikipedia.org/wiki/Edit_decision_list
47
+ [2] http://www.mplayerhq.hu/DOCS/HTML/en/edl.html and http://en.wikipedia.org/wiki/Edit_decision_list
48
48
  [3] mostly GPL programs, see http://www.gnu.org/licenses/ VLC Media Player, Mplayer/mencoder, ffmpeg, et al.
49
49
  [4] http://lds.org/library/display/0,4945,161-1-11-1,00.html search for the word "wholesome"
50
- [5] Also known to us as "paranoid cinema" (just an joke :)
51
50
 
52
51
  == Installation ==
53
52
 
data/TODO CHANGED
@@ -25,8 +25,10 @@
25
25
  VLC "insert foreign missing scene" demo, overlay section with image (mplayer?)
26
26
 
27
27
  == yes do ordered in conjunction with the above probably ==
28
- m4m: the play button, "regenerate" admin button, "click here x other arrangements of this hymn"
29
- does a released version work in mac?
28
+ XBMC mode doesn't mind the 600 starting offset...
29
+ oh wait we weren't even using it right to begin with LOL
30
+ m4m:
31
+ the play button, "regenerate" admin button, "click here x other arrangements of this hymn"
30
32
  mac court jester upconvert: without -nocache, with aggressive sync....
31
33
  jester at home...still laggy at end?
32
34
  unit tests
@@ -54,7 +56,11 @@
54
56
  make it load faster! this is cuh-razy! or splash screen! yes!
55
57
 
56
58
  == yes do, un-ordered currently, from the various future release options ==
57
- new icon plz
59
+ figure out if an offset of '1's should be accomodated for...
60
+ 0.3 ...
61
+ some upconvert specs
62
+ fix released version work in mac?
63
+ distro
58
64
  facebook survey :)
59
65
  "--developer" mode
60
66
  export JSON command line, note it in the docu, show it in --developer mode, no new bat file for developer mode
@@ -62,8 +68,6 @@
62
68
  fan editor (after C player ?? though I suppose we could bring back batch mplayer to also do this...)
63
69
  "fan editor" .bat file LOL
64
70
 
65
- upconvert 4200 known to fail...
66
-
67
71
  new button "auto-test" a subtitles file for timing :)
68
72
  new upconv button: take some snapshots (just to straight mjpeg or jpeg or the what not)
69
73
  auto-update website on release.
@@ -166,6 +170,8 @@
166
170
  investigate: can I use zoomplayer max?
167
171
 
168
172
  == DVD+-DVD-realtime backlog (totally unordered, some very low prio, basically all never do) ==
173
+ highlighting doesn't work (upconvert DVD with no title track)
174
+ new icon plz
169
175
  @ffmpeg: bounty/plz multi-thread the lanczos filter? plz?
170
176
  @ffmpeg: super video enhancer filter. plz? LOL [bounty?]
171
177
  use mplayerx well [?] like wrap it...
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.24.5
1
+ 0.24.6
@@ -52,8 +52,9 @@ require_relative '../lib/storage'
52
52
  require 'tmpdir'
53
53
  require 'whichr'
54
54
  require 'os'
55
- unless OS.mac?
55
+ if OS.doze?
56
56
  autoload :WMI, 'ruby-wmi'
57
+ autoload :EightThree, './lib/eight_three'
57
58
  end
58
59
 
59
60
  vendor_cache = File.expand_path(File.dirname(__FILE__)) + '/../vendor/cache'
@@ -128,7 +129,7 @@ module SensibleSwing
128
129
  end
129
130
 
130
131
  LocalStorage = Storage.new("sensible_cinema_storage")
131
- LocalStorage.set_default('screen_multiples', 2)
132
+ LocalStorage.set_default('screen_multiples', 1.5) # high compatibility :)
132
133
 
133
134
  def setup_upconvert_buttons
134
135
 
@@ -136,7 +137,7 @@ module SensibleSwing
136
137
  warn_if_no_upconvert_options_currently_selected
137
138
  filename_mpg = new_existing_file_selector_and_select_file( "pick movie file (like moviename.mpg)")
138
139
  play_mplayer_edl [filename_mpg, nil]
139
- end.tool_tip= "This plays back a movie file, like moviefile.mpg, using your current upconverter settings.\nTo playback a file edited upconverted, set upconvert options here first, then run them using sensible cinema main--it will automatically use your new upconverting options." # LODO
140
+ end.tool_tip= "This plays back a movie file, like moviefile.mpg, or moviename.vob using your current upconverter settings.\nTo playback a file edited upconverted, set upconvert options here first, then run them using sensible cinema main--it will automatically use your new upconverting options." # LODO
140
141
 
141
142
  @watch_dvd_upconvert = new_jbutton( "Watch a DVD upconverted (unedited)") do
142
143
  warn_if_no_upconvert_options_currently_selected
@@ -155,9 +156,10 @@ module SensibleSwing
155
156
  end
156
157
 
157
158
  def add_change_upconvert_options_button
158
- @show_upconvert_options = new_jbutton( "Change/Set upconverting playback options" ) do
159
- add_setup_upconvert_options
160
- end.tool_tip= "Allows you to set your upconvert options.\nUpconverting attempts to playback your movie with higher quality on high resolution monitors."
159
+ @show_upconvert_options = new_jbutton("Set Upconvert Options") do
160
+ add_setup_upconvert_buttons
161
+ end
162
+ @show_upconvert_options.tool_tip= "Allows you to set your upconvert options.\nUpconverting attempts to playback your movie with higher quality on high resolution monitors."
161
163
  end
162
164
 
163
165
  def warn_if_no_upconvert_options_currently_selected
@@ -169,12 +171,27 @@ module SensibleSwing
169
171
  def change_upconvert_line_to_current
170
172
  @upconv_line.set_text get_current_upconvert_as_phrase
171
173
  end
174
+
175
+ def select_new_sxs_style
176
+ answer = show_select_buttons_prompt 'Select EDL file style creation for this program', :yes => 'Smplayer style', :no => 'XBMC style'
177
+ if answer == 0
178
+ LocalStorage[SideBySide] = 'smplayer'
179
+ elsif answer == 1
180
+ LocalStorage[SideBySide] = 'xbmc'
181
+ else
182
+ show_blocking_message_dialog 'please choose one--smplayer if you don\'t know'
183
+ select_new_sxs_style
184
+ end
185
+
186
+ end
172
187
 
188
+ SideBySide = 'side_by_side' # 'xbmc' or 'smplayer'
173
189
  UpConvertKey = 'upconvert_setting'
174
190
  UpConvertKeyExtra = 'upconvert_setting_extra'
175
191
  UpConvertEnglish = 'upconvert_english_name'
176
192
 
177
- def add_setup_upconvert_options
193
+
194
+ def add_setup_upconvert_buttons
178
195
  none = new_jbutton("reset upconvert options to default (none)")
179
196
  none.tool_tip = "Having no upconvert options is reasonably good, might use directx for scaling, nice for slow cpu's"
180
197
  none.on_clicked {
@@ -183,8 +200,8 @@ module SensibleSwing
183
200
  LocalStorage[UpConvertEnglish] = nil
184
201
  display_current_upconvert_setting
185
202
  }
186
- medium_dvd = new_jbutton("Change upconvert options to DVD-style input") {
187
- LocalStorage[UpConvertKey] = "pullup,softskip,hqdn3d=0:1:4:4,scale=SCREEN_X:-10:0:0:2"
203
+ medium_dvd = new_jbutton("Change upconvert options to DVD-style video") {
204
+ LocalStorage[UpConvertKey] = "hqdn3d=0:1:4:4,scale=SCREEN_X:-10:0:0:2"
188
205
  # hqdn3d[=luma_spatial:chroma_spatial:luma_tmp:chroma_tmp]
189
206
  LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=7.0"
190
207
  LocalStorage[UpConvertEnglish] = "DVD"
@@ -193,18 +210,18 @@ module SensibleSwing
193
210
  high_compression = new_jbutton("Change upconvert options for playing back highly compressed video") {
194
211
  # -autoq 6 -vf pp [?]
195
212
  LocalStorage[UpConvertEnglish] = "high compressed"
196
- LocalStorage[UpConvertKey] = "pullup,softskip,hqdn3d=0:1:4:4,pp=hb:y/vb:y,scale=SCREEN_X:-10:0:0:3" # ordering?
213
+ LocalStorage[UpConvertKey] = "hqdn3d=0:1:4:4,pp=hb:y/vb:y,scale=SCREEN_X:-10:0:0:3" # ordering?
197
214
  LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=25.0"
198
215
  display_current_upconvert_setting
199
216
  # -Processing method: mplayer with accurate deblocking ???
200
217
  }
201
218
  new_jbutton("Change upconvert options to experimental style playback") {
202
- LocalStorage[UpConvertKey] = "pullup,softskip,hqdn3d=7:7:5,scale=SCREEN_X:-10:0:0:10"
219
+ LocalStorage[UpConvertKey] = "hqdn3d=7:7:5,scale=SCREEN_X:-10:0:0:10"
203
220
  LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=100.0 -ssf cs=75.0"
204
221
  LocalStorage[UpConvertEnglish] = "experimental"
205
222
  display_current_upconvert_setting
206
223
  }
207
- add_text_line "Multiple factor screen widths (higher is better, but uses more cpu, 2x is good)."
224
+ add_text_line "Multiple factor screen widths (higher is better, but uses more cpu, 2x is typically good)."
208
225
  add_text_line "If mplayer just dies or if it displays only a blank screen then lower this."
209
226
  slider = JSlider.new
210
227
  slider.setBorder(BorderFactory.createTitledBorder("Screen resolution multiple"));
@@ -286,9 +303,12 @@ module SensibleSwing
286
303
  if template
287
304
  # choose width of widest monitor (why would they display it on the other?)
288
305
  screen_multiple = LocalStorage['screen_multiples']
289
- template.gsub('SCREEN_X', (get_current_max_width_resolution*screen_multiple).to_i.to_s) # has to be an integer...
306
+ upc = template.gsub('SCREEN_X', (get_current_max_width_resolution*screen_multiple).to_i.to_s) # has to be an integer...
307
+ p 'using upconvert settings ' + upc
308
+ 'pullup,softskip,' + upc
290
309
  else
291
- nil
310
+ p 'not using any upconversion'
311
+ "pullup,softskip"
292
312
  end
293
313
  end
294
314
 
@@ -304,7 +324,7 @@ module SensibleSwing
304
324
  "If your DVD doesn't have an EDL created for it, this will be your first step--create an EDL file for it.")
305
325
  @create_new_edl_for_current_dvd.on_clicked do
306
326
  create_brand_new_edl
307
- @display_unique.simulate_click # for now...
327
+ @display_dvd_info.simulate_click # for now...
308
328
  end
309
329
 
310
330
  @open_list = new_jbutton("Open/Edit a previously created EDL file", "If your DVD has a previously existing EDL for it, you can open it to edit it with this button.")
@@ -325,6 +345,10 @@ module SensibleSwing
325
345
  @create_dot_edl.on_clicked {
326
346
  choose_file_and_edl_and_create_sxs_or_play true
327
347
  }
348
+
349
+ new_jbutton("Select side by side EDL file style (smplayer vs. XBMC)") do
350
+ select_new_sxs_style
351
+ end
328
352
 
329
353
  @play_smplayer = new_jbutton( "Watch full DVD unedited (realtime smplayer)")
330
354
  @play_smplayer.tool_tip = <<-EOL
@@ -351,19 +375,20 @@ module SensibleSwing
351
375
  play_dvd_smplayer_unedited true
352
376
  }
353
377
 
354
- @display_unique = new_jbutton( "Display information about current DVD (ID, etc.)" )
355
- @display_unique.tool_tip = "This is useful to setup a DVD's 'unique ID' within an EDL for it. \nIf your EDL doesn't have a line like disk_unique_id => \"...\" then you will want to run this to be able to add that line in."
356
- @display_unique.on_clicked {
357
- drive, volume_name, dvd_id = choose_dvd_drive_or_file true
378
+ @display_dvd_info = new_jbutton( "Display information about current DVD (ID, etc.)" )
379
+ @display_dvd_info.tool_tip = "This is useful to setup a DVD's 'unique ID' within an EDL for it. \nIf your EDL doesn't have a line like disk_unique_id => \"...\" then you will want to run this to be able to add that line in."
380
+ @display_dvd_info.on_clicked {
381
+ drive, volume_name, dvd_id = choose_dvd_drive_or_file true # real DVD disk
358
382
  # display it, allow them to copy and paste it out
359
- out = nil
360
- t = Thread.new {out= `mplayer dvdnav:// -dvd-device #{drive} -identify -frames 0 2>&1| grep LENGTH`}
383
+ title_lengths = nil
384
+ t = Thread.new { title_lengths= `mplayer dvdnav:// -nocache -dvd-device #{drive} -identify -frames 0 2>&1| grep LENGTH` }
361
385
  id_string = "\"disk_unique_id\" => \"#{dvd_id}\", # #{volume_name}"
362
386
  show_copy_pastable_string "#{drive} #{volume_name} for your copying+pasting pleasure (highlight, then ctrl+c to copy)\n
363
387
  This is USED eventually to identify a disk to match it to its EDL, later.", id_string
364
388
  t.join
365
- File.write EdlTempFile, id_string + "\n" + out
389
+ File.write EdlTempFile, id_string + "\n" + title_lengths
366
390
  open_file_to_edit_it EdlTempFile
391
+ id_string
367
392
  }
368
393
 
369
394
  @convert_seconds_to_ts = new_jbutton( "Convert 3600 <-> 1:00:00 style timestamps" )
@@ -434,13 +459,13 @@ module SensibleSwing
434
459
  Typically if you want to test an edit, you can start a few seconds before, and end a few seconds after it, to test it precisely.
435
460
  EOL
436
461
  @preview_section.on_clicked {
437
- do_copy_dvd_to_hard_drive_via_file true
462
+ do_create_edited_copy_via_file true
438
463
  }
439
464
 
440
465
  @preview_section_unedited = new_jbutton("Preview a certain time frame from fulli file (unedited)" )
441
466
  @preview_section.tool_tip = "Allows you to view a certain time frame unedited (ex: 10:00 to 10:05), so you can narrow down to pinpoint where questionable scenes are, etc. This is the only way to view a specific scene if there are not cuts within that scene yet."
442
467
  @preview_section_unedited.on_clicked {
443
- do_copy_dvd_to_hard_drive_via_file true, false, true
468
+ do_create_edited_copy_via_file true, false, true
444
469
  }
445
470
 
446
471
  @rerun_preview = new_jbutton( "Re-run most recently watched preview time frame from fulli file" )
@@ -458,11 +483,11 @@ module SensibleSwing
458
483
  timestamp splits in it [because some DVD's are buggy]
459
484
  EOL
460
485
  @fast_preview.on_clicked {
461
- success, wrote_to_here_fulli = do_copy_dvd_to_hard_drive_via_file false, true
486
+ success, wrote_to_here_fulli = do_create_edited_copy_via_file false, true
462
487
  sleep 0.5 # lodo take out ???
463
488
  background_thread.join if background_thread # let it write out the original fulli, if necessary [?]
464
489
  nice_file = wrote_to_here_fulli
465
- run_smplayer_blocking nice_file, "-edl \"#{EdlTempFile}\"", false
490
+ run_smplayer_blocking nice_file, nil, "-edl #{normalize_path EdlTempFile}", false
466
491
  }
467
492
 
468
493
  @reload = new_jbutton("reload bin/sensible-cinema code") do
@@ -470,6 +495,12 @@ module SensibleSwing
470
495
  end
471
496
 
472
497
  end # advanced buttons
498
+
499
+ # converts to full path, 8.3 if on doze
500
+ def normalize_path path
501
+ path = File.expand_path path
502
+ path = EightThree.convert_path_to_8_3 path if OS.doze?
503
+ end
473
504
 
474
505
  def setup_normal_buttons
475
506
 
@@ -486,7 +517,7 @@ module SensibleSwing
486
517
  It takes quite awhile maybe 2 hours. Sometimes the progress bar will look paused--it typically continues eventually.
487
518
  EOL
488
519
  @create.on_clicked {
489
- do_copy_dvd_to_hard_drive_via_file false
520
+ do_create_edited_copy_via_file false
490
521
  }
491
522
 
492
523
  @watch_file_edl = new_jbutton( "Watch movie file edited (realtime)" ) do
@@ -494,6 +525,7 @@ module SensibleSwing
494
525
  end
495
526
 
496
527
  if LocalStorage[UpConvertEnglish]
528
+ add_text_line ''
497
529
  add_open_documentation_button
498
530
  @upconv_line = add_text_line " #{get_current_upconvert_as_phrase}"
499
531
  else
@@ -512,7 +544,7 @@ module SensibleSwing
512
544
  end
513
545
 
514
546
  def choose_file_and_edl_and_create_sxs_or_play just_create_dot_edl_file_instead_of_play
515
- filename_mpg = new_existing_file_selector_and_select_file( "pick moviefile (like moviename.mpg)")
547
+ filename_mpg = new_existing_file_selector_and_select_file( "Pick moviefile (like moviename.mpg or VIDEO_TS/vts_01_0.vob)")
516
548
  edl_filename = new_existing_file_selector_and_select_file( "Pick an EDL file to use with it", EDL_DIR)
517
549
  assert_ownership_dialog
518
550
  if just_create_dot_edl_file_instead_of_play
@@ -592,7 +624,7 @@ module SensibleSwing
592
624
  increment_button_location
593
625
  increment_button_location
594
626
 
595
- setIconImage(ImageIcon.new(__DIR__ + "/../vendor/monkey.png").getImage())
627
+ setIconImage(ImageIcon.new(__DIR__ + "/../vendor/profs.png").getImage())
596
628
  check_for_various_dependencies
597
629
  end
598
630
 
@@ -602,51 +634,85 @@ module SensibleSwing
602
634
  }
603
635
  end
604
636
 
605
- def run_smplayer_blocking play_this, extra_options, force_use_mplayer
606
- extra_options += " -alang en " # for those that put french first...
607
- extra_options += " -mouse-movements #{get_upconvert_secondary_settings} " # just in case smplayer also needs -mouse-movements... :)
608
- extra_options += " -lavdopts threads=#{OS.cpu_count} " # just in case this helps [supposed to with H.264] :)
609
- if OS.mac? || force_use_mplayer
637
+ def run_smplayer_blocking play_this, title_track_maybe_nil, extra_options, force_use_mplayer
638
+ unless File.exist?(File.expand_path(play_this))
639
+ _dbg
640
+ raise play_this
641
+ end
642
+ parent_parent = File.basename(File.dirname(play_this))
643
+ force_use_mplayer ||= OS.mac?
644
+ if parent_parent == 'VIDEO_TS'
645
+ # case d:\yo\VIDEO_TS\title0.vob
646
+ dvd_device_dir = normalize_path(File.dirname(play_this))
647
+ if force_use_mplayer
648
+ extra_options += " -dvd-device \"#{dvd_device_dir}/..\""
649
+ else
650
+ # smplayer
651
+ raise if dvd_device_dir =~ / / && OS.mac? # not accomodated <sniff>
652
+ extra_options += " -dvd-device #{dvd_device_dir}/.."
653
+ end
654
+ play_this = "dvdnav://#{title_track_maybe_nil}"
655
+ elsif File.exist?(play_this + '/VIDEO_TS')
656
+ # case d:\ where d:\VIDEO_TS exists [DVD mounted in drive] or mac's /Volumes/YO
657
+ raise if play_this =~ / / # unexpected
658
+ extra_options += " -nocache -dvd-device #{play_this}"
659
+ play_this = "dvdnav://#{title_track_maybe_nil}"
660
+ else
661
+ # case g:\video\filename.mpg
662
+ # leave same...
663
+ end
664
+ if play_this =~ /dvdnav/ && title_track_maybe_nil
665
+ extra_options << " -msglevel identify=4 " # prevent smplayer from using *forever* to look up info on DVD's 4
666
+ end
667
+
668
+ extra_options += " -alang en " # for those that put french first...though this doesn't help...
669
+ extra_options += " -mouse-movements #{get_upconvert_secondary_settings} " # just in case smplayer also needs -mouse-movements... :) LODO
670
+ extra_options += " -lavdopts threads=#{OS.cpu_count} " # just in case this helps [supposed to with h.264] # fast *crashes* doze...
671
+ if force_use_mplayer
610
672
  show_mplayer_instructions_once
611
673
  conf_file = File.expand_path './mplayer_input_conf'
612
674
  File.write conf_file, "MOUSE_BTN0_DBL vo_fullscreen\nMOUSE_BTN2 vo_fullscreen\nKP_ENTER dvdnav select\n" # dvdnav doesn't work here...
675
+ extra_options += " -font #{File.expand_path('subfont.ttf')} "
676
+ extra_options += " -volume 100 " # why start low? mplayer why oh why
613
677
  if OS.windows?
614
- # direct3d for windows 7 old nvidia cards' sake [yipes]
615
- extra_options += " -vo direct3d " # more mouse, less speed [?] less mouse ??
678
+ # direct3d for windows 7 old nvidia cards' sake [yipes] and also dvdnav sake
679
+ extra_options += " -vo direct3d "
616
680
  extra_options += " -slang en "
617
- extra_options += " -font #{ENV['SystemRoot']}\\fonts\\ARIAL.TTF " # would need EXTRA ESCAPING FOR SMPLAYER USE
618
- conf_file = conf_file[2..-1] # strip off drive letter, which it doesn't like no sir
619
- else
620
- extra_options += " -font /Library/Fonts/Arial.ttf "
681
+ conf_file = conf_file[2..-1] # strip off drive letter, which it doesn't seem to like no sir
621
682
  end
622
683
  extra_options += " -fs " # full screen
623
- c = "mplayer #{extra_options} #{"-vf " + get_upconvert_vf_settings if get_upconvert_vf_settings} -input conf=\"#{conf_file}\" -mouse-movements \"#{play_this}\" "
684
+ c = "mplayer #{extra_options} -vf #{get_upconvert_vf_settings} -input conf=\"#{conf_file}\" \"#{play_this}\" "
624
685
  else
625
686
  if OS.windows?
626
687
  extra_options += " -vo direct3d " # more light nvidia...should be ok...
627
688
  end
628
689
  config_path = set_smplayer_opts extra_options
629
- c = "smplayer_portable \"#{play_this}\" -fullscreen -config-path \"#{File.dirname config_path}\" -close-at-end "
690
+ c = "smplayer_portable \"#{play_this}\" -fullscreen -config-path \"#{File.dirname config_path}\" "
691
+ if !we_are_in_create_mode
692
+ #c += " -close-at-end "
693
+ end
630
694
  end
631
- p c # for debugging...
695
+ puts c
632
696
  system_blocking c
633
697
  end
634
698
 
635
699
  def set_smplayer_opts to_this, show_subs = false
636
- p 'set smplayer opts to this:' + to_this
700
+ p 'set smplayer extra opts to this:' + to_this
637
701
  smplayer_prefs_file = File.expand_path("~/.smplayer/smplayer.ini")
638
702
  old_prefs = File.read(smplayer_prefs_file) rescue ''
639
- old_prefs = "[advanced]\nmplayer_additional_options=\nmplayer_additional_video_filters=\n[subtitles]\nautoload_sub=false\n[performance]\npriority=3" unless old_prefs.contain? 'mplayer_additional_options='
703
+ unless old_prefs.contain? 'mplayer_additional_options='
704
+ old_prefs = "[advanced]\nmplayer_additional_options=\nmplayer_additional_video_filters=\n[subtitles]\nautoload_sub=false\n[performance]\npriority=3"
705
+ end
706
+ raise to_this if to_this =~ /"/ # unexpected, unfortunately... <smplayer bug>
640
707
  new_prefs = old_prefs.gsub(/mplayer_additional_options=.*/, "mplayer_additional_options=#{to_this}")
641
708
  new_prefs.gsub!(/autoload_sub=.*$/, "autoload_sub=#{show_subs.to_s}")
642
- upconvert_settings = get_upconvert_vf_settings
643
- if upconvert_settings.present?
644
- p 'put upconvert options in as vf', upconvert_settings
645
- else
646
- p 'not using upconvert'
647
- end
648
- new_prefs.gsub!(/mplayer_additional_video_filters=.*$/, "mplayer_additional_video_filters=\"#{upconvert_settings}\"")
709
+ upconvert_settings =
710
+ new_prefs.gsub!(/mplayer_additional_video_filters=.*$/, "mplayer_additional_video_filters=\"#{get_upconvert_vf_settings}\"")
649
711
  new_prefs.gsub!(/priority=.*$/, "priority=3") # normal priority...scary otherwise! lodo tell smplayer...
712
+
713
+ # enable dvdnav navigation, just for kicks I guess.
714
+ new_prefs.gsub!(/use_dvdnav=.*$/, "use_dvdnav=true")
715
+
650
716
  FileUtils.mkdir_p File.dirname(smplayer_prefs_file) # case it doesn't exist'
651
717
  File.write(smplayer_prefs_file, new_prefs)
652
718
  smplayer_prefs_file
@@ -686,7 +752,7 @@ module SensibleSwing
686
752
  end
687
753
 
688
754
  def system_blocking command, low_prio = false
689
- return true if command =~ /^@rem/ # jruby+MRI bug, I think...
755
+ return true if command =~ /^@rem/ # JRUBY-5890 bug
690
756
  if low_prio
691
757
  out = IO.popen(command) # + " 2>&1"
692
758
  low_prio = 64 # from msdn
@@ -698,7 +764,7 @@ module SensibleSwing
698
764
  begin
699
765
  p = proc{ ole = WMI::Win32_Process.find(:first, :conditions => {'Name' => exe_name}); sleep 1 unless ole; ole }
700
766
  piddy = p.call || p.call || p.call # we actually do need this to loop...guess we're too quick
701
- # but the first time through this still inexplicably fails... LODO
767
+ # but the first time through this still inexplicably fails all 3... LODO
702
768
  if piddy
703
769
  # piddy.SetPriority low_prio # this call can seg fault at times...yikes...JRUBY-5422
704
770
  pid = piddy.ProcessId # this doesn't seg fault, tho
@@ -734,24 +800,17 @@ module SensibleSwing
734
800
  writeOut.write(open(full_url).read)
735
801
  writeOut.close
736
802
  end
737
-
803
+
738
804
  def play_dvd_smplayer_unedited use_mplayer_instead = false, show_instructions = true
739
805
  drive_or_file, dvd_volume_name, dvd_id, edl_path_maybe_nil, descriptors_maybe_nil = choose_dvd_or_file_and_edl_for_it false
740
806
  if descriptors_maybe_nil
741
807
  title_track_maybe_nil = get_title_track(descriptors_maybe_nil, false)
742
808
  end
743
- if dvd_id == NonDvd # TODO smelly...this if statement all over the place...
744
- file_to_play = drive_or_file
745
- else
746
- file_to_play = "dvdnav://#{title_track_maybe_nil}"
747
- end
748
- options = " -osd-fractions 2 -nocache -dvd-device #{drive_or_file} "
749
809
  if show_instructions
750
810
  # want this even with smplayer sometimes I guess...
751
811
  show_mplayer_instructions_once
752
812
  end
753
-
754
- run_smplayer_non_blocking file_to_play, options, use_mplayer_instead
813
+ run_smplayer_non_blocking drive_or_file, title_track_maybe_nil, "-osd-fractions 2", use_mplayer_instead
755
814
 
756
815
  end
757
816
 
@@ -783,28 +842,21 @@ module SensibleSwing
783
842
  drive_or_file, dvd_volume_name, dvd_id, edl_path, descriptors = choose_dvd_or_file_and_edl_for_it
784
843
  end
785
844
  start_add_this_to_all_ts = 0
845
+ descriptors = EdlParser.parse_file edl_path
846
+ title_track = get_title_track(descriptors)
786
847
  if dvd_id == NonDvd
787
- play_this = drive_or_file # play straight file...
788
848
  # check if starts offset...
789
- all = `ffmpeg -i "#{play_this}" 2>&1`
849
+ all = `ffmpeg -i "#{drive_or_file}" 2>&1`
790
850
  # Duration: 01:35:49.59, start: 600.000000
791
851
  all =~ /Duration.*start: ([\d\.]+)/
792
852
  start = $1.to_f
793
- if start > 0
853
+ if start > 1 # LODO huh? dvd's themselves start at 0.3 [sintel]?
794
854
  show_non_blocking_message_dialog "Warning: file seems to start at an extra offset, adding it to the timestamps... #{start}
795
855
  maybe not compatible with XBMC, if that's what you use, and you probably don't" # TODO test it XBMC...
796
856
  start_add_this_to_all_ts = start
797
857
  end
798
858
  else
799
859
  using_dvd = true
800
- title_track = get_title_track(descriptors)
801
- extra_mplayer_commands << "-nocache -dvd-device #{drive_or_file}"
802
- play_this = "dvdnav://#{title_track}"
803
- end
804
- if edl_path
805
- descriptors = EdlParser.parse_file edl_path
806
- else
807
- descriptors = {}
808
860
  end
809
861
  if using_dvd
810
862
  splits = descriptors['mplayer_dvd_splits']
@@ -829,7 +881,7 @@ module SensibleSwing
829
881
  # prefer english, attempt to disable subtitles, pass in edl...
830
882
  extra_mplayer_commands << "-alang en -nosub -noautosub -forcedsubsonly -sid 1000 -edl #{File.expand_path EdlTempFile}"
831
883
 
832
- run_smplayer_non_blocking play_this, extra_mplayer_commands.join(' '), false
884
+ run_smplayer_non_blocking drive_or_file, title_track, extra_mplayer_commands.join(' '), false
833
885
  end
834
886
 
835
887
  def assert_ownership_dialog
@@ -838,15 +890,32 @@ module SensibleSwing
838
890
  returned = JOptionPane.showConfirmDialog self, message, title, JOptionPane::YES_NO_CANCEL_OPTION
839
891
  assert_confirmed_dialog returned, nil
840
892
  end
893
+
894
+ # returns 0,1,2 for yes, no, cancel equivs
895
+ def show_select_buttons_prompt message, names_hash
896
+ old = ['no', 'yes', 'ok'].map{|name| 'OptionPane.' + name + 'ButtonText'}.map{|name| [name, UIManager.get(name)]}
897
+ if names_hash[:yes]
898
+ UIManager.put("OptionPane.yesButtonText", names_hash[:yes])
899
+ end
900
+ if names_hash[:no]
901
+ UIManager.put("OptionPane.noButtonText", names_hash[:no])
902
+ end
903
+ # if names_hash[:ok] # ???
904
+ # UIManager.put("OptionPane.okButtonText", names_hash[:ok])
905
+ # end
906
+ if names_hash[:cancel]
907
+ UIManager.put("OptionPane.noButtonText", names_hash[:cancel])
908
+ end
909
+ returned = JOptionPane.showConfirmDialog self, message, title, JOptionPane::YES_NO_CANCEL_OPTION
910
+ old.each{|name, old_setting| UIManager.put(name, old_setting)}
911
+ returned
912
+ end
841
913
 
842
914
  def require_blocking_license_accept_dialog program, license_name, license_url_should_also_be_embedded_by_you_in_message,
843
- title = 'Confirm Acceptance of License Agreement', message = nil
915
+ title = 'Confirm Acceptance of License Agreement', message = nil
844
916
  puts 'Please confirm license agreement in open window.'
845
- old = ['no', 'yes', 'ok'].map{|name| 'OptionPane.' + name + 'ButtonText'}.map{|name| [name, UIManager.get(name)]}
846
- UIManager.put("OptionPane.yesButtonText", 'Accept')
847
- UIManager.put("OptionPane.noButtonText", "View #{license_name}")
848
917
  # cancel button stays the same...
849
-
918
+
850
919
  message ||= "Sensible Cinema requires a separately installed program (#{program}). You can install this program
851
920
  separately to the vendor/cache directory, or Sensible Cinema can download it for you.
852
921
  By clicking accept, below, you are confirming that you have read and agree to be bound by the
@@ -854,12 +923,11 @@ module SensibleSwing
854
923
  Click 'View License' to view it. If you do not agree to these terms, click 'Cancel'. You also agree that this is a
855
924
  separate program, with its own distribution, license, ownership and copyright.
856
925
  You agree that you are responsible for the download and use of this program, within sensible cinema or otherwise."
857
-
858
- returned = JOptionPane.showConfirmDialog self, message, title, JOptionPane::YES_NO_CANCEL_OPTION
926
+ returned = show_select_buttons_prompt message, :yes => 'Accept', :no => "View #{license_name}"
859
927
  assert_confirmed_dialog returned, license_url_should_also_be_embedded_by_you_in_message
860
928
  p 'confirmation of sensible cinema related license saved of: ' + license_name
861
929
  throw unless returned == 0
862
- old.each{|name, old_setting| UIManager.put(name, old_setting)}
930
+
863
931
  end
864
932
 
865
933
  def assert_confirmed_dialog returned, license_url_should_also_be_embedded_by_you_in_message
@@ -1118,7 +1186,7 @@ module SensibleSwing
1118
1186
  end
1119
1187
  end
1120
1188
 
1121
- def do_copy_dvd_to_hard_drive_via_file should_prompt_for_start_and_end_times, exit_early_if_fulli_exists = false, watch_unedited = false
1189
+ def do_create_edited_copy_via_file should_prompt_for_start_and_end_times, exit_early_if_fulli_exists = false, watch_unedited = false
1122
1190
  drive_or_file, dvd_volume_name, dvd_id, edit_list_path, descriptors = choose_dvd_or_file_and_edl_for_it
1123
1191
 
1124
1192
  descriptors = parse_edl(edit_list_path)
@@ -1161,7 +1229,7 @@ module SensibleSwing
1161
1229
  else
1162
1230
  file_from = get_import_from_filename dvd_friendly_name, dvd_title_track # we don't even care about the drive letter anymore...
1163
1231
  end
1164
- show_blocking_message_dialog("warning: file is not a .mpg or .ts file--it may not work properly all the way--if it's mkv and fails consider first converting to ts by using tsmuxer.") unless file_from =~ /\.(ts|mpg|mpeg)$/i
1232
+ show_blocking_message_dialog("warning: file #{file_from} is not a .mpg or .ts file--it may not work properly all the way--if it's mkv and fails consider first converting to ts by using tsmuxer.") unless file_from =~ /\.(ts|mpg|mpeg)$/i
1165
1233
  save_to_edited = get_save_to_filename dvd_friendly_name
1166
1234
  fulli = MencoderWrapper.calculate_fulli_filename save_to_edited
1167
1235
  if exit_early_if_fulli_exists
@@ -1213,7 +1281,7 @@ module SensibleSwing
1213
1281
  to #{file_from} (#{dvd_title}).
1214
1282
  Copying to #{save_to}.
1215
1283
  EOL
1216
- if !fulli_dot_done_file_exists? save_to
1284
+ if !fulli_dot_done_file_exists?(save_to)
1217
1285
  popup_message += "This could take quite awhile (several hours), and will prompt you with a chime noise when it is done.\n
1218
1286
  You can close this window and minimize sensible cinema and continue using your computer while it runs in the background.\n"
1219
1287
  end
@@ -1230,7 +1298,7 @@ module SensibleSwing
1230
1298
 
1231
1299
  # allow our popups to still be serviced while it is running
1232
1300
  @background_thread = Thread.new {
1233
- run_batch_file_commands commands, save_to, file_from, run_mplayer
1301
+ run_batch_file_commands_and_use_output_somehow commands, save_to, file_from, run_mplayer
1234
1302
  popup.dispose
1235
1303
  }
1236
1304
  # LODO warn if they will overwrite a file in the end...
@@ -1238,7 +1306,7 @@ module SensibleSwing
1238
1306
 
1239
1307
  attr_accessor :background_thread, :buttons
1240
1308
 
1241
- def run_batch_file_commands batch_commands, save_to, file_from, run_mplayer_after_done
1309
+ def run_batch_file_commands_and_use_output_somehow batch_commands, save_to, file_from, run_mplayer_after_done
1242
1310
  @buttons.each{|b| b.set_enabled false}
1243
1311
  success = true
1244
1312
  lines = batch_commands.lines.to_a
@@ -1260,7 +1328,7 @@ module SensibleSwing
1260
1328
  if success
1261
1329
  saved_to = save_to + '.avi'
1262
1330
  if run_mplayer_after_done
1263
- run_smplayer_non_blocking saved_to, '', false
1331
+ run_smplayer_non_blocking saved_to, nil, '', false
1264
1332
  else
1265
1333
  if File.exist?(saved_to) && (File.size(saved_to).to_f/File.size(file_from) < 0.5) # less than 50% size is suspicious...indeed...check if exists for unit tests.
1266
1334
  show_blocking_message_dialog("Warning: file size differs by more than 50%--it's possible that transcoding failed somehow")
@@ -1268,9 +1336,9 @@ module SensibleSwing
1268
1336
  show_in_explorer saved_to
1269
1337
  PlayAudio.play(File.expand_path(File.dirname(__FILE__)) + "/../vendor/music.wav")
1270
1338
  msg = "Done--you may now watch file\n #{saved_to}\n in VLC player (or possibly smplayer)"
1271
- puts msg
1339
+ puts msg # for being able to tell it's done on the command line
1272
1340
  show_blocking_message_dialog msg
1273
- show_in_explorer saved_to # and again :)
1341
+ show_in_explorer saved_to # and again, just for kicks [?]
1274
1342
  end
1275
1343
  else
1276
1344
  show_blocking_message_dialog("Failed--please examine console output and report back!\nAlso consult the documentation/troubleshooting file.", "Failed", JOptionPane::ERROR_MESSAGE)
@@ -1377,6 +1445,7 @@ module SensibleSwing
1377
1445
  end
1378
1446
  end
1379
1447
 
1448
+ # LODO move to sane :) also remove the andand dep.
1380
1449
  class String
1381
1450
  def present?
1382
1451
  length > 0
@@ -1404,7 +1473,15 @@ end
1404
1473
 
1405
1474
  if $0 == __FILE__
1406
1475
  if ARGV.index('-h') || ARGV.index('--help')
1407
- puts 'syntax: [ --create-mode | --upconvert-mode ]'
1476
+ puts <<-EOL
1477
+ # jruby bin/sensible-cinema # DVD/file EDL player
1478
+ $ jruby bin/sensible-cinema --create-mode # DVD output "parser/cutter" create mode [advanced]
1479
+ $ jruby bin/sensible-cinema --upconvert-mode # DVD/video upconverting player
1480
+ $ jruby bin/sensible-cinema-cli # the experimental OCR tracker for arbitrary online/local/internet players.
1481
+ See "Advanced" section in the developer_how_to.txt file.
1482
+
1483
+ --exit-immediately [don't show the GUI, for benchmarking startup times]
1484
+ EOL
1408
1485
  else
1409
1486
  a = SensibleSwing::MainWindow.new
1410
1487
  a.set_visible true
@@ -1,3 +1,9 @@
1
+ == 0.24.6 ==
2
+
3
+ Make it so it can load VIDEO_TS style directories, too.
4
+ Make it work better on slow machines.
5
+ Tweak upconvert.
6
+
1
7
  == 0.24.5 ==
2
8
 
3
9
  Fix some options for advanced mode so that it can playback files better.
@@ -27,11 +27,7 @@ The tests are in the spec directory, though some of them are out of date as deve
27
27
  Note: you transfer (c) of materials to sensible cinema when you submit patches/contributions, of course, so don't submit something you don't want published :)
28
28
 
29
29
  To run it via command line:
30
- $ jruby bin/sensible-cinema # DVD/file EDL player
31
- $ jruby bin/sensible-cinema --create-mode # DVD output "parser/cutter" create mode [advanced]
32
- $ jruby bin/sensible-cinema --upconvert-mode # DVD/video upconverting player
33
- $ jruby bin/sensible-cinema-cli # the experimental OCR tracker for arbitrary online/local/internet players.
34
- See "Advanced Usage"
30
+ $ jruby bin/sensible-cinema --help # tells you all available options
35
31
 
36
32
  Feedback/contribution welcome :)
37
33
 
@@ -206,5 +206,5 @@ if $0 == __FILE__
206
206
  p 'syntax: filename'
207
207
  require 'rubygems'
208
208
  require 'sane'
209
- p EdlParser.parse_file *ARGV
209
+ p EdlParser.parse_file(*ARGV)
210
210
  end
@@ -81,8 +81,8 @@ class MencoderWrapper
81
81
  partials = (1..@idx).map{|n| "#{to_here_final_file}.#{n}.avi"}
82
82
  to_here_final_file = to_here_final_file + ".avi"
83
83
  if File.exist? to_here_final_file
84
- p 'warning, overwriting ' + to_here_final_file
85
- FileUtils.rm to_here_final_file # raises on deletion failure...which is what we want I think...typicaly...early warning...
84
+ p 'warning, overwriting+deleting previous ' + to_here_final_file
85
+ FileUtils.rm to_here_final_file # raises on deletion failure...which is what we want I think...typically...early warning...
86
86
  end
87
87
  out += "call mencoder #{partials.join(' ')} -o #{to_here_final_file} -ovc copy -oac copy\n"
88
88
  out += "@rem old DISABLED join way... 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"
@@ -49,7 +49,12 @@ This file is part of Sensible Cinema.
49
49
  def rollback
50
50
  if File.exists?(path)
51
51
  @storage = YAML.load_file(path)
52
- raise 'storage file is corrupted--please delete ' + path unless @storage.is_a? Hash
52
+ unless @storage.is_a? Hash
53
+
54
+ $stderr.puts 'storage file is corrupted--deleting ' + path
55
+ @storage = {}
56
+ File.delete path
57
+ end
53
58
  update_timestamp
54
59
  else
55
60
  @storage = {}
data/spec/notes CHANGED
@@ -12,6 +12,7 @@ up next:
12
12
  beginning: add to the end 0.25s
13
13
  end: add to the begining 0.35s
14
14
 
15
+ mplayer uses -framedrop -autosync 30 (no -mc) by default [!]
15
16
 
16
17
  == ts vs. mkv transcoding ==
17
18
  mencoder fails c. mkv, succeeds c. ts (editing seems to succeed overall [?])
@@ -234,6 +235,12 @@ http://www.kdenlive.org/forum/xml-format-and-edls kdenlive supports EDL, apparen
234
235
 
235
236
  == upconvert mplayer ==
236
237
 
238
+ === upconvert screen ===
239
+ http://lists.mplayerhq.hu/pipermail/mplayer-users/2005-June/053776.html
240
+ umm...mplayer doesn't seem to support directshow very well...as in, at all LOL.
241
+ VLC at least *tries* to support it <sigh>. Oh give me a break. Oh well.
242
+ I could either go with avisynth + MPC (I think)
243
+
237
244
  === upconverting to the huge monitor===
238
245
  with the black laptop:
239
246
  "normal" dvdnav seemed to work all right, slightly jerky at times.
@@ -272,6 +279,8 @@ http://www.kdenlive.org/forum/xml-format-and-edls kdenlive supports EDL, apparen
272
279
 
273
280
  === various options ===
274
281
 
282
+ an avisynth upconvert howto: http://avisynth.org/mediawiki/Enhancing_dvd_videos
283
+
275
284
  -vo gl fails on a mac [huh?]
276
285
 
277
286
  3360 looks quite crisp so far.
@@ -364,7 +373,8 @@ http://freshmeat.net/articles/fine-tuning-mplayer:
364
373
  comment:
365
374
  -vop pp=hb:y/vb:y and only on low-res (no post processing for HQ videos...hmm...)
366
375
 
367
- -autosync 1 (or more) might resync my cruddy DVD's... LODO
376
+ -autosync 1 (or more) might resync my cruddy DVD's...
377
+ seems to work! (mac)
368
378
 
369
379
  more [open]gl: "use these options" http://forum.doom9.org/archive/index.php/t-132325.html hardware renderer
370
380
 
@@ -106,7 +106,7 @@ module SensibleSwing
106
106
  end
107
107
 
108
108
  it "should modify path to have mencoder available" do
109
- ENV['PATH'].should include("mencoder")
109
+ RubyWhich.new.which('mencoder').length.should be > 0
110
110
  end
111
111
 
112
112
  it "should not modify path to have mplayer available" do
@@ -117,16 +117,18 @@ module SensibleSwing
117
117
  ARGV << "--create-mode" # want all the buttons for some tests.
118
118
  @subject = MainWindow.new
119
119
  ARGV.pop
120
+ FileUtils.touch "selected_file.fulli_unedited.tmp.mpg.done" # a few of them need this...
121
+ FileUtils.touch 'selected_file.avi'
120
122
  @subject.stub!(:choose_dvd_drive_or_file) {
121
123
  ["mock_dvd_drive", "Volume", Test_DVD_ID] # happiest baby on the block
122
124
  }
123
125
  @subject.stub!(:get_mencoder_commands) { |*args|
124
- args[-5].should match(/abc/)
126
+ args[-5].should match(/selected_file/)
125
127
  @get_mencoder_commands_args = args
126
128
  'fake get_mencoder_commands'
127
129
  }
128
130
  @subject.stub!(:new_existing_file_selector_and_select_file) {
129
- 'abc'
131
+ 'selected_file'
130
132
  }
131
133
  @subject.stub!(:new_nonexisting_filechooser) {
132
134
  FakeFileChooser.new
@@ -157,14 +159,23 @@ module SensibleSwing
157
159
  # during testing, we *always* have enough free space :)
158
160
  16_000_000_000
159
161
  }
162
+ unless $VERBOSE
163
+ # less chatty...
164
+ @subject.stub!(:print) {}
165
+ @subject.stub!(:p) {}
166
+ @subject.stub!(:puts) {}
167
+ end
160
168
 
161
- # less chatty...
162
- @subject.stub!(:p) {}
163
- @subject.stub!(:puts) {}
169
+ @subject.stub(:show_non_blocking_message_dialog) {
170
+ # don't display the popup message...
171
+ fake_window = OpenStruct.new
172
+ fake_window.dispose = :ok
173
+ fake_window
174
+ }
164
175
  end
165
176
 
166
177
  after do
167
- @subject.background_thread.join if @subject.background_thread
178
+ Thread.join_all_others
168
179
  end
169
180
 
170
181
  class FakeFileChooser
@@ -173,7 +184,7 @@ module SensibleSwing
173
184
  def set_current_directory x; end
174
185
  def get_current_directory ; 'a great dir!'; end
175
186
  def go
176
- 'abc'
187
+ 'selected_file'
177
188
  end
178
189
  end
179
190
 
@@ -189,23 +200,26 @@ module SensibleSwing
189
200
  end
190
201
 
191
202
  it "should be able to do a normal copy to hard drive, edited" do
192
- @subject.do_copy_dvd_to_hard_drive_via_file(false).should == [false, "abc.fulli_unedited.tmp.mpg"]
203
+ @subject.do_create_edited_copy_via_file(false).should == [false, "selected_file.fulli_unedited.tmp.mpg"]
193
204
  File.exist?('test_file_to_see_if_we_have_permission_to_write_to_this_folder').should be false
194
205
  end
195
206
 
196
207
  it "should only prompt twice for filenames--once for the 'save to' filename, once for the 'from' filename" do
197
- count = 0
198
- @subject.stub!(:new_nonexisting_filechooser) {
199
- count += 1
208
+ count1=count2=0
209
+ @subject.stub!(:new_nonexisting_filechooser) { # save to
210
+ count1 += 1
200
211
  FakeFileChooser.new
201
212
  }
202
- @subject.stub!(:new_existing_file_selector_and_select_file) {
203
- count += 1
204
- 'abc'
213
+ @subject.stub!(:new_existing_file_selector_and_select_file) { # get from
214
+ count2 += 1
215
+ FileUtils.touch 'selected_file'
216
+ 'selected_file'
205
217
  }
206
- @subject.do_copy_dvd_to_hard_drive_via_file(false).should == [false, "abc.fulli_unedited.tmp.mpg"]
207
- 3.times { @subject.do_copy_dvd_to_hard_drive_via_file(false) }
208
- count.should == 2
218
+
219
+ @subject.do_create_edited_copy_via_file(false).should == [false, "selected_file.fulli_unedited.tmp.mpg"]
220
+ 3.times { @subject.do_create_edited_copy_via_file(false) }
221
+ count1.should == 1
222
+ count2.should == 1
209
223
  end
210
224
 
211
225
  it "should have a good default title of 1" do
@@ -218,7 +232,7 @@ module SensibleSwing
218
232
  PlayAudio.stub!(:play) {
219
233
  @played = true
220
234
  }
221
- @subject.do_copy_dvd_to_hard_drive_via_file(false)
235
+ @subject.do_create_edited_copy_via_file(false)
222
236
  @subject.background_thread.join
223
237
  @get_mencoder_commands_args[-4].should == nil
224
238
  @system_blocking_command.should match /explorer/
@@ -227,18 +241,23 @@ module SensibleSwing
227
241
  end
228
242
 
229
243
  it "should be able to return the fulli name if it already exists" do
230
- FileUtils.touch "abc.fulli_unedited.tmp.mpg.done"
231
- @subject.do_copy_dvd_to_hard_drive_via_file(false,true).should == [true, "abc.fulli_unedited.tmp.mpg"]
232
- FileUtils.rm "abc.fulli_unedited.tmp.mpg.done"
244
+ @subject.do_create_edited_copy_via_file(false,true).should == [true, "selected_file.fulli_unedited.tmp.mpg"]
245
+ FileUtils.rm "selected_file.fulli_unedited.tmp.mpg.done"
233
246
  end
234
247
 
235
- it "should call explorer eventually, if it has to create the fulli file" do
236
- @subject.do_copy_dvd_to_hard_drive_via_file(true).should == [false, "abc.fulli_unedited.tmp.mpg"]
248
+ it "should call explorer eventually, even if it has to create the fulli file"
249
+
250
+ it "should play the edited file" do
251
+ @subject.do_create_edited_copy_via_file(true).should == [false, "selected_file.fulli_unedited.tmp.mpg"]
237
252
  join_background_thread
238
253
  @get_mencoder_commands_args[-2].should == "2"
239
254
  @get_mencoder_commands_args[-3].should == "01:00"
240
- @system_non_blocking_command.should match /smplayer/
241
- @system_non_blocking_command.should_not match /fulli/
255
+ if OS.doze?
256
+ @system_blocking_command.should =~ /smplayer/
257
+ else
258
+ @system_blocking_command.should =~ /mplayer/
259
+ end
260
+ @system_blocking_command.should_not match /fulli/
242
261
  end
243
262
 
244
263
  def run_preview_section_button_successfully
@@ -246,7 +265,11 @@ module SensibleSwing
246
265
  join_background_thread
247
266
  @get_mencoder_commands_args[-2].should == "2"
248
267
  @get_mencoder_commands_args[-3].should == "01:00"
249
- @system_non_blocking_command.should match /smplayer/
268
+ if OS.doze?
269
+ @system_blocking_command.should match /smplayer/
270
+ else
271
+ @system_blocking_command.should match /mplayer/
272
+ end
250
273
  end
251
274
 
252
275
  it "should prompt for start and end times" do
@@ -256,11 +279,13 @@ module SensibleSwing
256
279
  temp_dir = Dir.tmpdir
257
280
 
258
281
  def join_background_thread
259
- @subject.background_thread.join # must be running...
282
+ @subject.background_thread.join # force it to have been started at least
283
+ Thread.join_all_others # just in case...
260
284
  end
261
285
 
262
286
  it "should be able to preview unedited" do
263
287
  @subject.stub!(:get_user_input).and_return('06:00', '07:00')
288
+ @subject.stub!(:run_smplayer_blocking) {} # stub this out
264
289
  @subject.unstub!(:get_mencoder_commands)
265
290
  click_button(:@preview_section_unedited)
266
291
  join_background_thread # scary timing spec
@@ -268,9 +293,14 @@ module SensibleSwing
268
293
  File.read(temp_file).should include("59.99")
269
294
  end
270
295
 
271
- it "should call something for fast preview" do
296
+ it "should do something for fast preview" do
272
297
  click_button(:@fast_preview)
273
- @system_blocking_command.should =~ /smplayer/
298
+ if OS.doze?
299
+ @system_blocking_command.should =~ /smplayer/
300
+ else
301
+ @system_blocking_command.should =~ /mplayer/
302
+ end
303
+
274
304
  end
275
305
 
276
306
  it "should be able to rerun the latest start and end times with the rerun button" do
@@ -280,7 +310,8 @@ module SensibleSwing
280
310
  @get_mencoder_commands_args = nil
281
311
  click_button(:@rerun_preview).join
282
312
  @get_mencoder_commands_args.should == old_args
283
- @system_non_blocking_command.should match(/smplayer/)
313
+ join_background_thread
314
+ @system_blocking_command.should match(/smplayer/)
284
315
  end
285
316
 
286
317
  it "should not die if you pass it the same start and end time frames--graceful acceptance" do
@@ -301,17 +332,33 @@ module SensibleSwing
301
332
 
302
333
  it "should warn if you watch an edited time frame with no edits in it" do
303
334
  @subject.unstub!(:get_mencoder_commands) # this time through, let it check for existence of edits...
335
+ @subject.stub!(:run_smplayer_blocking) {} # avoid liveness check
304
336
  click_button(:@preview_section)
305
- @show_blocking_message_dialog_last_arg.should =~ /unable to/
337
+ @show_blocking_message_dialog_last_arg.should =~ /unable to find/
338
+ end
339
+
340
+ it "should warn if you give it an mkv file, just in case" do
341
+ @subject.stub!(:run_smplayer_blocking) {} # stub this out
342
+ @subject.unstub!(:get_mencoder_commands) # this time through, let it check for existence of edits...
306
343
  @subject.stub!(:get_user_input).and_return('06:00', '07:00')
307
344
  click_button(:@preview_section)
308
345
  join_background_thread
309
- @system_blocking_command.should == "echo wrote (probably successfully) to abc.avi"
346
+ @show_blocking_message_dialog_last_arg.should =~ /is not a/
347
+ end
348
+
349
+ it "should not warn if things go well" do
350
+ @subject.stub!(:get_user_input).and_return('06:00', '07:00')
351
+ @subject.stub!(:new_existing_file_selector_and_select_file) {
352
+ 'selected_file.mpg'
353
+ }
354
+ click_button(:@preview_section)
355
+ join_background_thread
356
+ @show_blocking_message_dialog_last_arg.should =~ /preview just a portion/
310
357
  end
311
358
 
312
359
  it "if the .done files exists, do_copy... should call smplayer ja" do
313
- FileUtils.touch "abc.fulli_unedited.tmp.mpg.done"
314
- @subject.do_copy_dvd_to_hard_drive_via_file(false, true, true).should == [true, "abc.fulli_unedited.tmp.mpg"]
360
+ FileUtils.touch "selected_file.fulli_unedited.tmp.mpg.done"
361
+ @subject.do_create_edited_copy_via_file(false, true, true).should == [true, "selected_file.fulli_unedited.tmp.mpg"]
315
362
  end
316
363
 
317
364
  it "should create a new file for ya" do
@@ -332,7 +379,7 @@ module SensibleSwing
332
379
  end
333
380
 
334
381
  it "should display unique disc in an input box" do
335
- @subject.instance_variable_get(:@display_unique).simulate_click.should == "01:00"
382
+ click_button(:@display_dvd_info).should =~ /deadbeef/
336
383
  end
337
384
 
338
385
  it "should create an edl and pass it through to mplayer" do
@@ -342,21 +389,42 @@ module SensibleSwing
342
389
  }
343
390
  click_button(:@mplayer_edl).join
344
391
  smplayer_opts.should match(/-edl /)
345
- @system_blocking_command.should match(/dvdnav/)
392
+ @system_blocking_command.should match(/mock_dvd_drive/) #
393
+ @system_blocking_command.should_not =~ /dvdnav/ # file based, so no dvdvnav
394
+ @system_blocking_command.should_not =~ /-nocache/ # file based, so no -nocache
395
+ end
396
+
397
+ it "should handle dvd drive -> dvdnav" do
398
+ for drive in ['d:', 'e:', 'f:', 'g:']
399
+ if File.exist?(drive + '/VIDEO_TS')
400
+ @subject.run_smplayer_blocking drive, nil, '', true
401
+ @system_blocking_command.should =~ /dvdnav/
402
+ @system_blocking_command.should =~ /-dvd-device/
403
+ end
404
+ end
346
405
  end
347
406
 
407
+ it 'should handle a/b/VIDEO_TS/yo.vob' do
408
+ FileUtils.mkdir_p f = 'a/b/VIDEO_TS/yo.vob'
409
+ @subject.run_smplayer_blocking f, 3, '', true
410
+ @system_blocking_command.should =~ /dvdnav:\/\/3/
411
+ @system_blocking_command.should =~ /VIDEO_TS\/\.\./
412
+ @system_blocking_command.should =~ / -alang/ # preceding space :)
413
+
414
+ end
415
+
348
416
  it "should play edl with extra time for the mutes because of the EDL aspect" do
349
417
  click_button(:@mplayer_edl).join
350
418
  wrote = File.read(MainWindow::EdlTempFile)
351
419
  # normally "378.0 379.1 1"
352
- p wrote
353
- wrote.should include("377.5 379.1 1")
420
+ wrote.should include("377.0 379.1 1")
354
421
  end
355
422
 
356
423
  def should_allow_for_changing_file corrupt_the_file = false
357
424
  with_clean_edl_dir_as 'temp' do
358
425
  File.binwrite('temp/a.txt', "\"disk_unique_id\" => \"abcdef1234\"")
359
426
  @subject.stub!(:choose_dvd_drive_or_file) {
427
+ FileUtils.touch 'mock_dvd_drive'
360
428
  ["mock_dvd_drive", "Volume", "abcdef1234"]
361
429
  }
362
430
  @subject.choose_dvd_or_file_and_edl_for_it[4]['mutes'].should == []
@@ -449,7 +517,8 @@ module SensibleSwing
449
517
  end
450
518
 
451
519
  it "should show additional buttons in create mode" do
452
- MainWindow.new.buttons.length.should == 6
520
+ MainWindow.new.buttons.length.should be > 3
521
+ MainWindow.new.buttons.length.should be < 10
453
522
  old_length = MainWindow.new.buttons.length
454
523
  ARGV << "--create-mode"
455
524
  MainWindow.new.buttons.length.should be > (old_length + 5)
@@ -493,9 +562,6 @@ module SensibleSwing
493
562
  end
494
563
 
495
564
  it "should have a created play unedited smplayer button" do
496
- @subject.stub(:show_non_blocking_message_dialog) {
497
- # don't display the popup message...
498
- }
499
565
  @subject.stub(:single_edit_list_matches_dvd) {
500
566
  nil
501
567
  }
Binary file
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env bash
2
2
  cd ../sensible-cinema
3
- java -Xdock:name="Sensible Cinema" -Xdock:icon="./vendor/monkey.png" -cp "./vendor/jruby-complete-1.6.2.jar" org.jruby.Main bin/sensible-cinema $1 $2 $3 || (echo ERROR. Please look for error message, above, and report back the error you see, or fix it && read -p "Press any key to continue...")
3
+ java -Xdock:name="Sensible Cinema" -Xdock:icon="./vendor/profs.png" -cp "./vendor/jruby-complete-1.6.2.jar" org.jruby.Main bin/sensible-cinema $1 $2 $3 || (echo ERROR. Please look for error message, above, and report back the error you see, or fix it && read -p "Press any key to continue...")
4
4
 
Binary file
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sensible-cinema
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.24.5
5
+ version: 0.24.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Roger Pack
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-19 00:00:00 -06:00
13
+ date: 2011-07-21 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -297,6 +297,7 @@ files:
297
297
  - spec/test_yaml.yml
298
298
  - spec/tsmuxer.output
299
299
  - spec/vlc_programmer.spec.rb
300
+ - subfont.ttf
300
301
  - template_bats/RUN SENSIBLE CINEMA CLICK HERE.bat
301
302
  - template_bats/_DO_NOT_RUN_IT_FROM_HERE_DOWNLOAD_THE_RELEASE_ZIP_FROM_SOURCEFORGE_INSTEAD
302
303
  - template_bats/advanced--create or edit sensible cinema edit list files.bat
@@ -321,6 +322,7 @@ files:
321
322
  - vendor/mac_dvdid/lib/libdvdid.dylib
322
323
  - vendor/mac_dvdid/lib/libdvdid.la
323
324
  - vendor/monkey.png
325
+ - vendor/profs.png
324
326
  - vendor/readme.txt
325
327
  - vendor/tsmuxer_1.10.6/licence.txt
326
328
  - www/index.html