sensible-cinema 0.26.2 → 0.26.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/TODO +92 -73
  2. data/VERSION +1 -1
  3. data/bin/sensible-cinema-cli +3 -1
  4. data/change_log_with_feature_list.txt +23 -1
  5. data/developer_how_to_contribute_to_the_project.txt +2 -0
  6. data/lib/edl_parser.rb +4 -1
  7. data/lib/eight_three.rb +2 -2
  8. data/lib/gui/sensible-cinema-base.rb +14 -5
  9. data/lib/gui/sensible-cinema-create.rb +42 -21
  10. data/lib/gui/sensible-cinema-normal.rb +9 -4
  11. data/lib/muter.rb +1 -1
  12. data/lib/subtitle_profanity_finder.rb +24 -3
  13. data/spec/dragon.srt +1 -1
  14. data/spec/edl_parser.spec.rb +10 -2
  15. data/spec/notes +3 -1
  16. data/spec/subtitle_profanity_finder.spec.rb +61 -11
  17. data/todo.inventionzy.txt +5 -1
  18. data/todo.subtitle +2 -6
  19. data/todo.upconvert +3 -0
  20. data/zamples/edit_decision_lists/dvds/muppet_treasure_island.txt +21 -0
  21. data/zamples/edit_decision_lists/netflix_instant/avatar-last-air-bender-movie.txt +3 -2
  22. data/zamples/edit_decision_lists/netflix_instant/wrinkle-in-time.txt +23 -0
  23. data/zamples/edit_decision_lists/old_not_yet_updated/example_edit_decision_list.txt +14 -40
  24. metadata +4 -13
  25. data/lib/drive_info.rb +0 -81
  26. data/spec/drive_info.spec.rb +0 -61
  27. data/spec/go_line.bat +0 -1
  28. data/vendor/mac_dvdid/bin/dvdid +0 -0
  29. data/vendor/mac_dvdid/include/dvdid/dvdid.h +0 -67
  30. data/vendor/mac_dvdid/include/dvdid/dvdid2.h +0 -131
  31. data/vendor/mac_dvdid/include/dvdid/export.h +0 -32
  32. data/vendor/mac_dvdid/lib/libdvdid.0.dylib +0 -0
  33. data/vendor/mac_dvdid/lib/libdvdid.a +0 -0
  34. data/vendor/mac_dvdid/lib/libdvdid.dylib +0 -0
  35. data/vendor/mac_dvdid/lib/libdvdid.la +0 -41
data/TODO CHANGED
@@ -1,135 +1,126 @@
1
1
  == roadmap [for just tasks, see below though] ==
2
2
 
3
3
  remember this stuff is all "oh gosh I have to do that too?" crud time, don't even want it.
4
+ and "won't even be useful to people in the end so why bother?"
4
5
  netflix
5
6
  upconv netflix
6
7
  mac'ify OCR/Mouse
7
8
  upconvert DVD
8
- srt expand, release
9
- tweaks/docu
10
9
  C EDL
11
10
 
12
11
  === non ordered/eventually (also add line items for them) ===
13
12
  create a skype recorder
14
- compare netflix/blu-ray timings et al
15
13
  netflix/skype "disable screen saver while running" program [?]
16
14
  linearize [?] hmm...
17
15
  re-update todo/all docu/user feedback etc.
18
- create openedls.org/api-ify
19
16
  LLC
20
17
  if...back off to just the ffmpeg (plus an "[A,B]" viewer) only...but for now stick with just DVD playback [?] until people want more...
21
18
  no propaganda...
22
19
  no auto subtitle downloads...
23
20
  fix VLC dvdnav itself +- mplayer DVD EDL
21
+ fix mplayer broken DVD EDL
24
22
 
25
23
  == high prio like blocking bugs ==
26
24
 
27
25
  == next things I was working on ==
28
26
  unit tests work
29
27
  screen recording sintel
30
- more netflix instant timing
31
- bluray jonah total time vs. other
32
-
33
- == yes do ordered for release ==
28
+ netflix instant CGI how good is their HD?
29
+ Ben's DVD (hook)
30
+
31
+ == yes do ordered for release/other projects ja ==
34
32
  test out DVD upscale
35
- no super scale res?
33
+ real "screen record" of upconverting sintel, see if it shows a difference
34
+ see if I need to fix my capturer...
35
+ no super scale res necessary?
36
36
 
37
- add srt instructions to docu, release
38
37
  fake "tenseness" metric
39
38
  netflix instant descriptor for OS X/work at all
40
- post release notes to the google group
41
- real "screen record" of upconverting sintel, see if it shows a difference
42
- then see if I need to fix my receiver...
39
+ netflix upconvert
40
+ more netflix instant timing
41
+ do another srt comparison with netflix...see if it matches less 1s
42
+ C player feedback message
43
+ nextsprocket...
44
+ releases that include Debug, python too :)
43
45
 
44
46
  == yes do, un-ordered currently, from the various future release options ==
47
+ todo.upconvert
48
+ netflix quality upconverter, have a go at it
49
+ finalize screen capturer
50
+ me test it
51
+ 1x, 2x Sintel
52
+ snapshots of Sintel "normal", then deploy the various comparison pics
53
+ DVD test it (+- with others testing it for me too)
54
+
55
+ "open EDL" should save dir
56
+ ri_for updatez
57
+ subtitle -> url everywhere
58
+ english name (movie name) mass everywhere
59
+ handle gates of he.....
60
+ ruby_prof stuff
45
61
  warn other wordpresses
46
62
  legal2
47
63
  test mplayer -vo gl at home
48
- extra printf's for scanning for matching
49
- Ben's DVD (hook)
64
+ add new batch file for play with netflix OCR
65
+ remove those extra printf's for scanning for matching
50
66
  Ben's other DVD's
51
- from an EDL, it can "just play" for netflix (auto-open browser etc.)
52
67
  template-ify for netflix too "create for netflix"
53
68
  add netflix instant instructions,
54
- then add a blog post comment after releasing it as template
55
- netflix HD versus none...
56
- prototype new style EDL
57
69
  "note" competitor upconverters
58
- add a "record start stop" + record x time for the virtual audio and other
59
- rename as sanitizer
60
- note "we are in the creation phase and need your help"
70
+ add a "record start stop" for screen capture
61
71
  that extra .5s DVD reports for file size...
62
- TODO test DVD upconv it at 720*x resolution too...
63
- investigate the srt morpher...
72
+ test DVD upconv it at 720*x resolution too...
64
73
  EDL gottman
65
- bounty hqdn3d for ffmpeg
66
- Greg's DVD's
67
- srt/parsing buttons new window [?]
68
- demo of conference "music video from file"
74
+ EDL Greg's DVD's
75
+ opening/creating buttons -> new separate sub-window
76
+ add a demo of conference "music video from local file"
69
77
  change upconvert options needs its own "close" button
70
- real docu on how to use the srt scanner
78
+ and status field?
71
79
  lightning strike from various outlets...
72
- accomodate splits vs. blanks and work
73
- todo.upconvert
74
- netflix quality upconverter, have a go at it
75
- finalize screen capturer
76
- me test it
77
- 1x, 2x Sintel
78
- snapshots of Sintel "normal", then deploy the various comparison pics
79
- DVD test it (+- with others testing it for me too)
80
- add new open button "edit the EDL for current DVD"
80
+ accomodate splits vs. blanks and work everywhere
81
+ linearize: full EDL with JSON on top, full timestamps. or something I like...
82
+ add new open button "edit EDL for current DVD"
81
83
  add "play at 1.5x speed" mplayer button, I guess
82
- play in mplayer unedited button should display OSD by default
83
- bounty ffmpeg stuff (motion detect, directshow)
84
- "fix" mplayer EDL pausing their code
84
+ short list of todo's for screen capture
85
+ "fix" mplayer EDL pausing (within the mplayer code itself)
86
+ bounty it for now/test with latest ffmpeg et al, maybe on mac with source [?
85
87
  the open button should open in the "editing" EDL dir.
86
- warn against makemkv (and check vs. handbrake, and offer a bounty)
87
88
  add the other type in there, esp. if a man answers
88
89
  add to the template, various can use it
89
90
  an overlapping mute failure when you hit the "watch edited realtime" should popup.
90
- witch lady
91
91
  split out the "dependency" codes
92
92
  consistency for flight of nav. srt? huh?
93
93
  consistency of others, also "DVD reported full-time versus ts time" for others...
94
- subtitles: if at beginning of a sub, add extra offset...hmm...why not?
94
+ subtitles: if at beginning of a sub, add extra initial offset...hmm...why not?
95
+ and end too why not?
95
96
  fix released version to downloadable work in mac [7zip won't cut it]
96
97
  "--developer" mode
97
98
  has "export JSON command line, reload code" , note it in the docu
98
- new button "auto-test" a subtitles file for timing :)
99
- new upconv button: auto-take some snapshots (just to straight mjpeg or jpeg or the what not [?])
100
99
  advertise urug again?
101
100
  after works in mac for capture+overlay :)
102
- create skype recorder windows
103
- mplayer directx patch check it...
101
+ create skype/google+ hangouts recorder windows
102
+ mplayer directx fix patch check it...
104
103
  auto-add largest title to the generator EDL
105
104
  complain if times look wrong...on playback? sum time
105
+ mv jruby-swing-helpers to lib dir
106
106
  splits... [add better instructions on how to be precise...]
107
107
  open EDL to edit it can have a rememberable DIR
108
108
  @instructions "this is great for comparing srt's, except...when it isn't, then you have to..."
109
109
  @instructions: full srt how-to document instead of tooltip [?] or combine the two! yes!
110
- volume_name => dvd_volume_name
110
+ volume_name => dvd_volume_label
111
111
  why is the Sintel's EDL seemingly off?
112
112
  ascertain how accurate mplayer EDL is...I guess compared to...umm...something?
113
113
  fix discrepancy between EDL mplayer and ffmpeg...maybe a new button "accurate EDL playback"?
114
114
  maybe search at end of movies for certain things?
115
115
  double check--are my ffmpeg splits really really really the same as mplayer's EDL DVD splits? really?
116
- linearize: EDL with JSON on top, full timestamps.
117
- also bring to top after a conversion, and before prompts/file prompts...
118
- can auto-use tsmuxer at all [?]
119
- mac just die with instructions to use tsmuxer first...
120
- actually don't do this, just make sure to warn them if they pass us an mkv...indeed.
121
116
  check with blu-rays...do they match timing-wise? sub-title wise? do subs match something else?
122
117
  youtube/hulu timings
123
118
  split LLC's website+consumer
124
119
  get LLC before a "real" domain name
125
120
  employee instructions: watch @ realtime after profanity filter first pass :P
126
- @makemkv: timing feels broken weird-like! I'll donate you more money if you fix it <sniff>
127
- try out libdvdcss + handbrake on the one that was totally broken...is it better?
128
- it should work like a champ shouldn't it?
129
121
  clear runnings
130
122
  me try
131
123
  have ben and chris test it out [realtime?]
132
- try out disney digital copy
133
124
  C player:
134
125
  use DVD navigator (check)
135
126
  just use mplayer EDL syntax, plus a title track (or just detect track change, if long enough, assume... :P) :)
@@ -152,21 +143,21 @@
152
143
  once I can jump around, advertise as a phantom editor :)
153
144
  maybe even before?
154
145
  ask for more beta testers for use, ask for more beta testers for creation, too
155
- create a semi-accurate phantom edit EDL [?] just with splits
146
+ create a semi-accurate phantom edit EDL [?] with just splits
156
147
  http://www.chefelf.com/forums/index.php?showtopic=6176
157
148
  add button "fast preview segment" (mplayer from dvd)
158
149
  investigate WMC "call out to smplayer + EDL" or the like...
159
150
  add to docu
160
- refresh bug try to reproduce
161
151
  can edit books, too.
162
- +- list/publish :) [like a manual list et al]
152
+ +- list/publish mine so far :)
163
153
  create the following EDL: 10 commandments DVD to skip the intro music LOL
164
154
  inventionzy: blu-ray stuff from todo.inventionzy
165
155
  sons of provo "music video" EDL
166
- port to mac OS X
167
- PPC dvdid
168
- documentation button? notepad?
169
- ffmpeg compile it mingw, see if it runs dshow windows
156
+ ffmpeg compile it in mingw, see if it runs dshow windows
157
+ clarify input for srt (remove those other ones, that's lame-o)
158
+ it needs to remember the timings "start timing" and text, "end timing" and text
159
+ also double check unit tests, and if I do one in the middle does it still work?
160
+ and why was there an extra uncaught profanity in wrinkle in time?
170
161
 
171
162
  == other lists to not do (duplicate the todo here if want to actually do it though, basically no do) ==
172
163
 
@@ -180,15 +171,44 @@
180
171
  screen_capture TODO
181
172
 
182
173
  == DVD decide later to move up or down ==
183
- add option "just skip don't mute"
184
-
174
+
185
175
  == DVD+-DVD-realtime backlog (totally unordered, some very low prio, basically all never do) ==
176
+ "srt" double checker "ok now at exactly this time this should be here."
177
+ java webstart for being able to playback netflix instant edited "automagically"
178
+ also it can uses key presses/buttons to log keystrokes to know when edits should occur/associate them with timestamps
179
+ it can publish them easily/share them easily with friends. Oh boy.
180
+ can auto-use tsmuxer at all
181
+ port to mac OS X
182
+ documentation button?
183
+ PPC dvdid work?
184
+ .srt input auto-scan from a "full two entries from the .srt file" (easier)
185
+ rename as sanitizer, or something else SEO friendlier or something like that
186
+ from an EDL, it can "just play" for netflix (auto-open browser etc.)
187
+ add button "re-order srt"
188
+ @makemkv:
189
+ try out libdvdcss + handbrake on the one that was totally broken...is it better?
190
+ can I reproduce it this days? double check OSOH, repost to forum
191
+ advertise http://betterlogic.com/roger/2011/06/mkv-mencoder-too-many-audio-packets-in-the-buffer/
192
+ add option "just skip don't mute always instead of muting"
193
+ bounty/ask hqdn3d for ffmpeg
194
+ bounty /ask mplayer OS X screen capture input can I use it in ffmpeg?
195
+ ask dll, say, for pausing [?]
196
+ ask if I can make a pausing filter, to start paused...hmm... [?]
197
+ bounty ffmpeg server for doze
198
+ bounty motion-detect, audio
199
+ try out disney digital copy
200
+ EDL's (if not lewd) (only after can do propaganda, really)
201
+ monty python
202
+ LOTR
203
+ forever strong
204
+ MOTAB music videos :P
205
+ refresh bug try to reproduce
206
+ if I don't use jruby complete is it faster?
186
207
  tweak web stuff/propaganda for upconverter filenames et al
187
208
  propaganda DVD upconverter
188
- advertise virtual audio
189
- advertise screen capture
209
+ propaganda virtual audio
210
+ propaganda screen capture
190
211
  report ffplay -t 6 doesn't stop bug
191
- report ffplay -vol 1 doesn't work
192
212
  research XBMC
193
213
  break out into its own separate window?
194
214
  @XBMC: your stuff is broken in at least these two ways (bug reports)
@@ -201,8 +221,7 @@
201
221
  research VOB dirs
202
222
  still needs timesplits? what about in XBMC? what about XBMC with DVD's
203
223
  @avisynth: 6 fps from 2? huh? also why are some progs [ffmpeg] seemingly resetting the graphedit pins? huh? also tell that one already logged bug how I work around it...
204
- virtual audio TS's line up
205
- sout-keep for VLC EDL'ish?
224
+ sout-keep for VLC EDL'ish or playlist?
206
225
  local cache volume_name -> dvd id's, in case that can speed things up
207
226
  check if some create buttons are now outdated...
208
227
  make it load faster! this is cuh-razy! or at least splash screen!
@@ -233,7 +252,7 @@
233
252
  "save to" -> same dir as "get from" yeah
234
253
  figure out a way to get to the roku [ps3ms?], +- netflix edited to roku LOL
235
254
  prompt something if the EDL is actually "empty" :)
236
- already donated: rubular, mplayer, vlc, menumeter, http://instantitunes.wordpress.com/2010/02/26/use-tsmuxer-on-snow-leopard, unlocker, mac fan thing, open office, many sourceforge tops, 7zip, VLC, mplayer, cannot donate: ffmpeg, http://ffmpeg.zeranoe.com/builds, tsmuxer (sent email), asked mulder, smplayer ($5), http://lame.buanzo.com.ar, sox, smcFanControl (eidac)
255
+ already donated: sox, rubular, mplayer, vlc, menumeter, http://instantitunes.wordpress.com/2010/02/26/use-tsmuxer-on-snow-leopard, unlocker, mac fan thing, open office, many sourceforge tops, 7zip, VLC, mplayer, cannot donate: ffmpeg, http://ffmpeg.zeranoe.com/builds, tsmuxer (sent email), asked mulder, smplayer ($5), http://lame.buanzo.com.ar, sox, smcFanControl (eidac)
237
256
  note "you want to optimize your reverse blitting first... :)"
238
257
  if 2 EDL's, still can choose a title trackfor automatically playing it right.
239
258
  fast preview: change it to be aggressive sometimes yes, other times no
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.26.2
1
+ 0.26.3
@@ -20,10 +20,12 @@ This file is part of Sensible Cinema.
20
20
  require File.dirname(__FILE__) + "/../lib/add_any_bundled_gems_to_load_path.rb"
21
21
  require 'sane'
22
22
 
23
- for file in ['overlayer', 'keyboard_input', 'screen_tracker', 'mouse', 'ocr', 'vlc_programmer', 'edl_parser', 'auto_window_finder', 'swing_helpers']
23
+ for file in ['overlayer', 'keyboard_input', 'screen_tracker', 'ocr', 'vlc_programmer', 'edl_parser', 'auto_window_finder', 'jruby-swing-helpers/swing_helpers']
24
24
  require_relative '../lib/' + file
25
25
  end
26
26
 
27
+ # shared
28
+ require_relative '../lib/jruby-swing-helpers/mouse'
27
29
 
28
30
  def choose_file title, dir
29
31
  SwingHelpers::FileDialog.new_previously_existing_file_selector_and_go title, dir
@@ -1,6 +1,28 @@
1
+ == 0.26.3 ==
2
+
3
+ Make it so that it can modify timestamps from .srt files programmatically in order to ensure that time signatures match
4
+ whichever player you're using now.
5
+
6
+ Includes a means of coordinating across different time signatures based on start time and length.
7
+
8
+ Had a git commit with an example pure JSON EDL, and several other mixed/mplayer compatible styles.
9
+
10
+ NB that sensible cinema can use a directshow capture device and pin it to the location of a given window to be able to
11
+ stream/upconvert.
12
+
13
+ NB that we have an optimized routine for taking screen captures so as to not
14
+ use up as much cpu by sampling/doing them less frequently et all.
15
+
16
+ Also includes work toward a directshow DVD player employing its API's
17
+ (in separate project) for playback/skipping/muting/pausing et al.
18
+ and basically progammatic control of a playing back DVD player.
19
+
20
+ example EDL with a tenseness metric by level
21
+ example EDL with a tenseness metric by age commits
22
+
1
23
  == 0.26.2 ==
2
24
 
3
- Fix license acceptance code, quick redeploy
25
+ Fix license acceptance code (quick redeploy).
4
26
 
5
27
  == 0.26.1 ==
6
28
 
@@ -33,6 +33,8 @@ $ jruby bin/sensible-cinema --help # tells you all available options
33
33
 
34
34
  Feedback/contribution welcome :)
35
35
 
36
+ Ex: want JSON'ified output somehow? Just ask.
37
+
36
38
  == mac os x developers ==
37
39
 
38
40
  You'll have to install a few dependencies. It will tell you which at runtime,
data/lib/edl_parser.rb CHANGED
@@ -237,7 +237,8 @@ class EdlParser
237
237
  combined.compact
238
238
  end
239
239
 
240
- # its reverse: translate_time_to_human_readable
240
+ # this one is 1:01:02.0 => 36692.0
241
+ # its reverse is: translate_time_to_human_readable
241
242
  def self.translate_string_to_seconds s
242
243
  # might actually already be a float, or int, depending on the yaml
243
244
  # int for 8 => 9 and also for 1:09 => 1:10
@@ -254,6 +255,8 @@ class EdlParser
254
255
  p 'failed!', s
255
256
  raise e
256
257
  end
258
+ raise unless seconds =~ /^\d+(|[,.]\d+)$/
259
+ seconds.gsub!(',', '.')
257
260
  total += seconds.to_f
258
261
  minutes = s.split(":")[-2] || "0"
259
262
  total += 60 * minutes.to_i
data/lib/eight_three.rb CHANGED
@@ -16,8 +16,8 @@ DWORD WINAPI GetShortPathName(
16
16
  attach_function :path_to_8_3, :GetShortPathNameA, [:pointer, :pointer, :uint], :uint
17
17
  def self.convert_path_to_8_3 path
18
18
  out = FFI::MemoryPointer.new 256 # bytes
19
- path_to_8_3(path, out, out.length)
20
- out = out.get_string
19
+ path_to_8_3(path, out, out.size)
20
+ out = out.get_string 0
21
21
  if out.size == 0
22
22
  raise 'unable to convert--probably file does not exist yet ' + path
23
23
  else
@@ -31,10 +31,12 @@ class String
31
31
  end
32
32
  end
33
33
 
34
+ # shared
34
35
  require_relative '../jruby-swing-helpers/swing_helpers'
36
+ require_relative '../jruby-swing-helpers/drive_info'
35
37
 
36
38
  # attempt to load on demand...i.e. faster...
37
- for kls in [:MencoderWrapper, :MplayerEdl, :PlayAudio, :SubtitleProfanityFinder, :ConvertThirtyFps, :RubyClip, :DriveInfo]
39
+ for kls in [:MencoderWrapper, :MplayerEdl, :PlayAudio, :SubtitleProfanityFinder, :ConvertThirtyFps, :RubyClip]
38
40
  autoload kls, "./lib/#{kls.to_s.snake_case}"
39
41
  end
40
42
 
@@ -544,28 +546,32 @@ module SensibleSwing
544
546
  end
545
547
  end
546
548
 
547
- def open_file_to_edit_it filename, start_minimized=false
549
+ def open_file_to_edit_it filename, options = {} # :start_minimized
548
550
  if OS.windows?
549
- if start_minimized
551
+ if options[:start_minimized]
550
552
  system_non_blocking "start /min notepad \"#{filename}\""
551
553
  else
552
554
  system_non_blocking "notepad \"#{filename}\""
553
555
  end
554
556
  else
557
+ # ignore minimized :P
555
558
  system_non_blocking "open -a TextEdit \"#{filename}\""
556
559
  end
557
560
  end
558
561
 
559
562
  def new_nonexisting_filechooser_and_go title = nil, default_dir = nil, default_file = nil
563
+ bring_to_front
560
564
  JFileChooser.new_nonexisting_filechooser_and_go title, default_dir, default_file
561
565
  end
562
566
 
563
567
  def show_blocking_message_dialog(message, title = message.split("\n")[0], style= JOptionPane::INFORMATION_MESSAGE)
564
- SwingHelpers.show_blockiing_message_dialog message, title, style
568
+ bring_to_front
569
+ SwingHelpers.show_blocking_message_dialog message, title, style
565
570
  end
566
571
 
567
572
  # call dispose on this to close it if it hasn't been canceled yet...
568
573
  def show_non_blocking_message_dialog message, close_button_text = 'Close'
574
+ bring_to_front
569
575
  # lodo NonBlockingDialog it can get to the top instead of being so buried...
570
576
  NonBlockingDialog.new(message, close_button_text)
571
577
  end
@@ -573,17 +579,20 @@ module SensibleSwing
573
579
  include_class javax.swing.UIManager
574
580
 
575
581
  def get_user_input(message, default = '', cancel_ok = false)
582
+ bring_to_front
576
583
  SwingHelpers.get_user_input message, default, cancel_ok
577
584
  end
578
585
 
579
586
  def show_copy_pastable_string(message, value)
587
+ bring_to_front
580
588
  RubyClip.set_clipboard value
581
589
  get_user_input message + " (has been copied to clipboard)", value, true
582
590
  end
583
591
 
584
592
  # also caches directory previously selected ...
585
593
  def new_existing_file_selector_and_select_file title, dir = nil
586
- dir ||= LocalStorage[caller.inspect] = File.dirname(got)
594
+ bring_to_front
595
+ dir ||= LocalStorage[caller.inspect]
587
596
  got = FileDialog.new_previously_existing_file_selector_and_go title, dir
588
597
  LocalStorage[caller.inspect] = File.dirname(got)
589
598
  got
@@ -56,27 +56,42 @@ module SensibleSwing
56
56
 
57
57
  @parse_srt = new_jbutton("Scan a subtitle file (.srt) to detect profanity times automatically" )
58
58
  @parse_srt.tool_tip = <<-EOL
59
- You can download a .srt file and use it to automatically search for profanities.
60
- Basically download it from opensubtitles.org (possibly from other sites, too),
61
- (enter dvd name in the search box, click a result, click one from the list with an English flag, then click 'Download(zip)')
62
- Once you download the zip, unzip it, and then compare the timestamps in it with those on the DVD (see the button "Watch DVD unedited (realtime mplayer)")
63
- NB that you'll first want/need to *carefully* double check your subtitle
64
- file with the actual DVD. (ex: smplayer, hit the 'o' button to display
65
- the current timestamp, then go to the end, stop at some point with text
66
- and hit the '.' key until a subtitle very first displays.
67
- Next convert that number to 29.97 fps (using the button given).
68
- The numbers should match precisely. If they don't, edit this file
69
- so that it will have some offsets given.
59
+ You can download a .srt file and use it to programmatically search for the location of various profanities.
60
+ Basically download it from opensubtitles.org (or engsub.net et al),
61
+ (for opensubtitles.org enter dvd title in the search box, click on a result, click one from the list with an English flag,
62
+ then choose 'Download(zip)', then unzip the file)
63
+ NB that you'll want/need to *carefully* double check your subtitle file for accuracy. Here's how:
64
+ Now carefully compare a beginning timestamp in it with the actual words in the .srt file
65
+ with the actual DVD.
66
+ (see the button "Watch DVD unedited (realtime mplayer)")
67
+ (smplayer can kind of do it, too, play it, hit the 'o' button to display
68
+ the OSD timestamp, then go to just before the verbiage,
69
+ and hit the '.' key until a subtitle very first appears.
70
+ Next convert that number to 29.97 fps (using the button for that).
70
71
  EOL
71
72
 
72
73
  @parse_srt.on_clicked do
73
- filename = new_existing_file_selector_and_select_file("Pick srt file to scan for profanity:")
74
- add_to_beginning = get_user_input("How much time to subtract from the beginning of each subtitle entry (ex: 1:00 -> 1:01 becomes 0:59 -> 1:01)", "0.0")
75
- add_to_end = get_user_input("How much time to add to the end of each subtitle entry (ex: 1:00 -> 1:01 becomes 1:00 -> 1:02)", "0.0")
76
- parsed = SubtitleProfanityFinder.edl_output filename, {}, add_to_beginning.to_f, add_to_end.to_f # flight: TODO necessary typically ??? 0.35, 0.25
77
- File.write(EdlTempFile, "# add these into your mute section if you deem them mute-worthy\n" + parsed)
78
- open_file_to_edit_it filename, true
79
- sleep 0.3 if OS.mac? # add delay...
74
+ srt_filename = new_existing_file_selector_and_select_file("Pick srt file to scan for profanity:")
75
+ # TODO nuke
76
+ add_to_beginning = "0.0"#get_user_input("How much time to subtract from the beginning of every subtitle entry (ex: (1:00,1:01) becomes (0:59,1:01))", "0.0")
77
+ add_to_end = "0.0"#get_user_input("How much time to add to the end of every subtitle entry (ex: (1:00,1:04) becomes (1:00,1:05))", "0.0")
78
+
79
+ @show_parse_instructions ||= show_blocking_message_dialog "Now enter some values which will adjust the .srt time signatures\nso that it matches the movie more precisely.\nWe also need these values to coordinate it with other devices that may have different timestamps.\nFor DVD playback this will be the timestamps mplayer shows within the console window [the mplayer unedited button]."
80
+ open_file_to_edit_it srt_filename
81
+ sleep 0.5 # let it open first
82
+ bring_to_front
83
+ start_text = get_user_input("enter the text from any subtitle entry near beginning [like \"Hello, welcome to our movie.\"]", "...")
84
+ start_srt = get_user_input("enter beginning timestamp within the .srt file #{File.basename(srt_filename)[0..10]}... for \"#{start_text}\"", "00:00:00,000")
85
+ start_movie_ts = get_user_input("enter beginning timestamp within the movie itself for said text", "0:00:00")
86
+
87
+ end_text = get_user_input("enter the text from a subtitle entry far within or near the end of the movie", "...")
88
+ end_srt = get_user_input("enter the beginning timestamps within the .srt for \"#{end_text}\"", "02:30:00,000")
89
+ end_movie_ts = get_user_input("enter beginning timestamps within the movie itself for \"#{end_text}\"", "2:30:00.0 or 9000.0")
90
+
91
+ parsed_profanities = SubtitleProfanityFinder.edl_output srt_filename, {}, add_to_beginning.to_f, add_to_end.to_f, start_srt, start_movie_ts, end_srt, end_movie_ts
92
+ File.write EdlTempFile, "# add these into your mute section if you deem them mute-worthy\n" + parsed_profanities +
93
+ %!\n\n#Also add these two lines for later coordination:\n"beginning_subtitle" => ["#{start_text}", "#{start_movie_ts}"],! +
94
+ %!\n"ending_subtitle_entry" => ["#{end_text}", "#{end_movie_ts}"]!
80
95
  open_file_to_edit_it EdlTempFile
81
96
  end
82
97
 
@@ -96,7 +111,7 @@ module SensibleSwing
96
111
  id_string
97
112
  }
98
113
 
99
- @convert_seconds_to_ts = new_jbutton( "Convert 3600 <-> 1:00:00 style timestamps" )
114
+ @convert_seconds_to_ts = new_jbutton( "Convert 3600.0 <-> 1:00:00 style timestamps" )
100
115
  @convert_seconds_to_ts.on_clicked {
101
116
  input = get_user_input("Enter \"from\" timestamps, like 3600 or 1:40:00:", "1:00:00.1 or 3600.1")
102
117
  while(input)
@@ -248,7 +263,13 @@ module SensibleSwing
248
263
  else
249
264
  file_from = get_grabbed_equivalent_filename_once dvd_friendly_name, dvd_title_track # we don't even care about the drive letter anymore...
250
265
  end
251
- 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
266
+ if file_from =~ /\.mkv/i
267
+ show_blocking_message_dialog "warning .mkv files from makemkv have been known to be off timing wise, please convert to a .ts file using tsmuxer first if it came from makemkv"
268
+ end
269
+ if file_from !~ /\.(ts|mpg|mpeg)$/i
270
+ show_blocking_message_dialog("warning: file #{file_from} is not a .mpg or .ts file--it may not work properly all the way, but we'll try...")
271
+ end
272
+
252
273
  save_to_edited = get_save_to_filename dvd_friendly_name
253
274
  fulli = MencoderWrapper.calculate_fulli_filename save_to_edited
254
275
  if exit_early_if_fulli_exists
@@ -301,4 +322,4 @@ module SensibleSwing
301
322
 
302
323
 
303
324
  end
304
- end
325
+ end