sensible-cinema 0.24.1 → 0.24.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +22 -16
- data/Rakefile +5 -1
- data/TODO +43 -62
- data/VERSION +1 -1
- data/bin/sensible-cinema +146 -73
- data/bin/sensible-cinema-cli +5 -2
- data/change_log_with_feature_list.txt +22 -0
- data/history_and_related_works_list.txt +1 -0
- data/legal/control_youtube.html +135 -0
- data/legal/md5s.txt +3 -0
- data/legal/serve.rb +6 -0
- data/lib/add_any_bundled_gems_to_load_path.rb +1 -1
- data/lib/blanker.rb +2 -2
- data/lib/count_down_timer_jruby_swing.rb +20 -4
- data/lib/edl_parser.rb +4 -3
- data/lib/keyboard_input.rb +1 -1
- data/lib/muter.rb +29 -9
- data/lib/ocr.rb +12 -2
- data/lib/ocr_seed/netflix_b9.bmp +0 -0
- data/lib/play_audio.rb +44 -2
- data/lib/ruby_clip.rb +26 -0
- data/lib/subtitle_profanity_finder.rb +111 -92
- data/lib/swing_helpers.rb +2 -2
- data/spec/notes +70 -8
- data/spec/ocr.spec.rb +9 -11
- data/spec/screen_tracker.spec.rb +1 -1
- data/spec/sensible_cinema_gui.spec.rb +2 -2
- data/spec/subtitle_profanity_finder.spec.rb +10 -0
- data/template_bats/{run-upconverting-video-player.bat → advanced--run-upconverting-video-player.bat} +0 -0
- data/todo.inventionzy.txt +2 -1
- data/todo.subtitle +1 -3
- data/todo.upconvert +15 -3
- data/zamples/edit_decision_lists/dvds/edls_being_edited/test_delete_list_for_experimenting_with.txt +10 -0
- metadata +8 -6
- data/zamples/edit_decision_lists/dvds/edls_being_edited/airplane_edited.txt +0 -19
- data/zamples/edit_decision_lists/dvds/example_delete_list.txt +0 -10
- data/zamples/edit_decision_lists/dvds/snow_white_and_the_seven_dwarfs.txt +0 -18
data/README
CHANGED
@@ -1,47 +1,53 @@
|
|
1
1
|
Sensible-cinema [5] allows you to apply pre-programmed edit lists
|
2
|
-
(e.g. Edit Decision Lists [2]) to DVD's you own.
|
3
|
-
I.e. you can edit a DVD to "mute out" or skip certain scenes.
|
2
|
+
(e.g. Edit Decision Lists [2]) to the DVD's you own.
|
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.
|
5
5
|
|
6
|
-
It is currently in alpha/beta,
|
7
|
-
It also includes a library of EDL's that go along with various DVD's
|
8
|
-
to help it
|
6
|
+
It is currently in alpha/beta, and is free (probably forever, as it is gplv3 currently).
|
7
|
+
It also includes a library of EDL's that go along with various DVD's. We need volunteers/contributors
|
8
|
+
to help it grow!
|
9
9
|
|
10
10
|
To use, basically install, then insert an original DVD that you want to edited, then run sensible cinema.
|
11
11
|
It will pop up some windows where you choose what to do.
|
12
12
|
|
13
13
|
Note: please install from the zip files at https://sourceforge.net/projects/sensible-cinema/files/
|
14
|
-
and not from github's "download" button. See the "install" section, below, for
|
14
|
+
and not from github's "download" button. See the "install" section, below, for fine-grained install details.
|
15
15
|
|
16
|
-
Sensible cinema basically allows you to create an edited video version of the DVD, onto your hard drive,
|
17
|
-
and
|
18
|
-
popular video players.
|
16
|
+
Sensible cinema basically allows you to either create an edited video version of the DVD, onto your hard drive,
|
17
|
+
and watch it there, or to playback a DVD or file (edited) via the use of EDL playback in some
|
18
|
+
pre-existing popular video players.
|
19
19
|
|
20
20
|
How? Sensible cinema basically takes the original DVD, slices out the bad parts, then combines it back
|
21
21
|
into a new file and gives you the result.
|
22
22
|
It is essentially a linear editor [1] that applies Edit Decision Lists [2] to videos. It wraps
|
23
23
|
a few freely available open source programs [3] to accomplish the editing for you.
|
24
24
|
Note that the process can take several hours, so budget some time for it.
|
25
|
-
It also has a few "realtime viewing" options available, again based on some freely available
|
26
|
-
open source software [3].
|
27
25
|
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
It also has a few "realtime viewing" options available, based on some freely available
|
27
|
+
open source popular video players [3]. These don't have any startup time to wait at all.
|
28
|
+
|
29
|
+
On a more moral note, just because an edited video lacks profanity/sex scenes...does not
|
30
|
+
automatically make it a wholesome experience.
|
31
|
+
Sensible cinema does not a clean movie make of a dirty one, even without profanity.
|
32
|
+
Don't watch it if it's not uplifting! Be nice to yourself!
|
31
33
|
|
32
34
|
dove.org and common sense media are good references for discovering the "uplifting" level of movies [4].
|
33
35
|
kids-in-mind.com is also a good reference for profanity levels, though sometimes it misses profanities,
|
34
|
-
and it also lacks timestamps to know when the profanities occur
|
36
|
+
and it also lacks timestamps to know when the profanities occur, and doesn't allow for community
|
37
|
+
contribution. Hence this project existing.
|
35
38
|
Also note that even if you happen to have an edited copy of a DVD floating around, if you have kids, chances are they
|
36
39
|
will eventually find (and watch) the unedited originals, so be careful there.
|
37
40
|
|
41
|
+
That being said, some videos are quite enjoyable once you strip out profanity/questionable content.
|
42
|
+
It's your call.
|
43
|
+
|
38
44
|
Enjoy your movies!
|
39
45
|
|
40
46
|
[1] http://en.wikipedia.org/wiki/Linear_video_editing
|
41
47
|
[2] http://en.wikipedia.org/wiki/Edit_decision_list
|
42
48
|
[3] mostly GPL programs, see http://www.gnu.org/licenses/ VLC Media Player, Mplayer/mencoder, ffmpeg, et al.
|
43
49
|
[4] http://lds.org/library/display/0,4945,161-1-11-1,00.html search for the word "wholesome"
|
44
|
-
[5] Also known to us as "paranoid cinema" (just an joke :)
|
50
|
+
[5] Also known to us as "paranoid cinema" (just an joke :)
|
45
51
|
|
46
52
|
== Installation ==
|
47
53
|
|
data/Rakefile
CHANGED
@@ -137,7 +137,11 @@ task 'deploy' do
|
|
137
137
|
p 'creating sf shell'
|
138
138
|
sys "ssh rdp@ilab1.cs.byu.edu 'ssh rogerdpack,sensible-cinema@shell.sourceforge.net create'" # needed for the next command to be able to work [weird]
|
139
139
|
p 'creating sf dir'
|
140
|
-
|
140
|
+
begin
|
141
|
+
sys "ssh rdp@ilab1.cs.byu.edu 'ssh rogerdpack,sensible-cinema@shell.sourceforge.net \"mkdir /home/frs/project/s/se/sensible-cinema/#{cur_ver}\"'"
|
142
|
+
rescue => ok_if_dir_already_existing
|
143
|
+
puts 'warning--dir already existing?' + ok_if_dir_already_existing.to_s
|
144
|
+
end
|
141
145
|
p 'copying into sf from ilab'
|
142
146
|
sys "ssh rdp@ilab1.cs.byu.edu 'scp ~/incoming/#{name} rogerdpack,sensible-cinema@frs.sourceforge.net:/home/frs/project/s/se/sensible-cinema/#{cur_ver}/#{name}'"
|
143
147
|
p 'successfully deployed to sf only! ' + cur_ver
|
data/TODO
CHANGED
@@ -17,26 +17,17 @@
|
|
17
17
|
== high prio like blocking bugs ==
|
18
18
|
|
19
19
|
== under next release specific items: ==
|
20
|
-
|
21
|
-
|
22
|
-
cheap static-ify demo for mutes
|
23
|
-
also a straight "half mute" demo, using volume downs/ups
|
24
|
-
cheap minimize via (probably foreground window + API real windows API)
|
20
|
+
a "half mute" demo, using volume downs/ups
|
21
|
+
cheap minimize via (probably minimize foreground window/windows API)
|
25
22
|
url -> url inference [hopefully this is cake...]
|
26
|
-
fix the failing 9 digit test the fancy shmancy way :P
|
27
|
-
can pass in a profanity command line
|
28
23
|
can handle multiple dvdid's et al
|
29
|
-
youtube: use the javascript API somehow, like http://universalsubtitles.org/en does
|
30
|
-
phase 1: does they use inferred timestamp? can I use that generally, too? [do phase 1--publish simple javascript demo of it muting for awhile after startup]
|
31
|
-
just in case youtube takes over the world
|
32
24
|
|
33
25
|
== yes do ordered in conjunction with the above probably ==
|
26
|
+
C player
|
34
27
|
unit tests
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
subtitles 2 phase
|
39
|
-
auto-paste
|
28
|
+
release at some point...
|
29
|
+
|
30
|
+
consistency for flight of nav. srt? huh?
|
40
31
|
lightning strike from various outlets...
|
41
32
|
try buy edit lists from all x,y,z [?] maybe ask for them for free first? ()
|
42
33
|
http://www.familysafemovies.com
|
@@ -52,23 +43,23 @@
|
|
52
43
|
family flix
|
53
44
|
http://theeditedmovieencyclopedia.blogspot.com/2008/08/clean-play-dvds-grand-opening-e-mail.html has grande list
|
54
45
|
movie mask wayback machine
|
46
|
+
make it load faster! this is cuh-razy! or splash screen! yes!
|
55
47
|
|
56
48
|
== yes do, un-ordered currently, from the various future release options ==
|
57
|
-
|
58
|
-
add
|
49
|
+
if 2 EDL's, still choose title track
|
50
|
+
add an auto "scan for expected title, times"
|
51
|
+
add time to the generator EDL
|
59
52
|
complain if times looks wrong...
|
60
|
-
|
53
|
+
complain [accomodate option] if start time looks off...600
|
61
54
|
"1:07:5.718" , "1:07:10.447", "profanity", "ba.....", "Faraday that [ba.....] That ba He's gonna wish he never met us",
|
62
|
-
don't cache selections if they choose a local file...hmm...
|
63
55
|
tighten splits
|
64
56
|
"save to" -> same dir as "get from" yeah
|
57
|
+
open EDL can have a rememberable DIR
|
65
58
|
@instructions "this is great for comparing srt's, except...when it isn't, then you have to..."
|
66
59
|
@instructions: full srt how-to
|
67
|
-
test with cars-ws (at work), mac (to make sure volume name doesn't have spaces)
|
68
60
|
can I just use ffmpeg for an initial -> ts ? http://eotmsnotes.wordpress.com/2011/04/25/tsmuxer-notes/
|
69
61
|
add dvd_title_time option
|
70
62
|
volume_name => dvd_volume_name
|
71
|
-
make it load faster! this is cuh-razy! or splash screen! yes!
|
72
63
|
why is the Sintel's EDL seemingly off?
|
73
64
|
ascertain how accurate mplayer EDL is...I guess compared to...umm...something?
|
74
65
|
fix discrepancy between EDL mplayer and ffmpeg...maybe a new button "accurate EDL playback"?
|
@@ -84,7 +75,7 @@
|
|
84
75
|
mac just die with instructions to use tsmuxer first...
|
85
76
|
check if some other buttons are now outdated...
|
86
77
|
unit tests (all pass)
|
87
|
-
|
78
|
+
upconvert: a file
|
88
79
|
can I avoid requiring use of tsmuxer first? hmm...
|
89
80
|
check with blu-ray...do they match timing-wise? sub-title wise?
|
90
81
|
donate tsmuxer, makemkv, http://ffmpeg.zeranoe.com/builds, mulder [?] smplayer menumeter
|
@@ -102,6 +93,7 @@
|
|
102
93
|
me try
|
103
94
|
try disney digital copy
|
104
95
|
C player:
|
96
|
+
folder, look for title.edl
|
105
97
|
use DVD navigator
|
106
98
|
just use mplayer EDL syntax, plus a title track (or just detect track change, if long enough, assume... :P) :)
|
107
99
|
http://msdn.microsoft.com/en-us/library/ms787412(VS.85).aspx
|
@@ -124,7 +116,8 @@
|
|
124
116
|
create a semi-accurate phantom edit EDL
|
125
117
|
http://www.chefelf.com/forums/index.php?showtopic=6176
|
126
118
|
karlie?
|
127
|
-
inventionzy: blu-ray
|
119
|
+
inventionzy: blu-ray stuff from todo.inventionzy
|
120
|
+
|
128
121
|
port to mac OS X--try everything out (all buttons), make sure all works...
|
129
122
|
ppc dvdid?
|
130
123
|
use mplayerx well [?] like wrap it...
|
@@ -132,6 +125,8 @@
|
|
132
125
|
do I need tsmuxer?
|
133
126
|
auto-"guess" the best title...
|
134
127
|
add button "fast preview segment" (from dvd)
|
128
|
+
upconvert research/compare various options
|
129
|
+
investigate WMC "call out to smplayer EDL" or the like...
|
135
130
|
|
136
131
|
== other lists ==
|
137
132
|
|
@@ -146,32 +141,32 @@
|
|
146
141
|
add button "fast preview one" (from file)
|
147
142
|
|
148
143
|
== DVD-realtime backlog once yes do, now not do, unordered ==
|
149
|
-
|
150
|
-
slow cpu: mater tall tales: are my av sync values better or worse than smplayer defaults, with/without upsampling, blacky?
|
151
|
-
upconvert research/compare options
|
152
|
-
investigate boxee edl (just fer fun...maybe possible?) http://getsatisfaction.com/boxee/topics/commercial_skipping_edl_support
|
153
|
-
investigate xbmc dvd edl how do you do that?
|
154
|
-
investigate WMC "call out to mplayer EDL" or the like...
|
155
|
-
for mplayer realtime it needs to start early, but end on time
|
156
|
-
mplayer instructions are obscured
|
157
|
-
mplayer EDL allow this:
|
158
|
-
got fatal exception in button
|
159
|
-
detected an overlap 1397.51 1401.275 mute 1395.474 1397.874 mute
|
160
|
-
SyntaxError
|
161
|
-
accept "mplayer_dvd_splits" => ["4749"] [large second integers...hmm...]
|
144
|
+
investigate xbmc dvd edl how do you do that? [+- real dvd]
|
162
145
|
fast preview: change it to be aggressive sometimes yes, other times no
|
163
146
|
fast preview mode: watch for modifications to file, kill mplayer instances for them on change :)
|
164
147
|
fast preview tends to "go too far" [like the end of profanity is still there when played via the "real way"]
|
165
148
|
mplayer EDL while grabbing, from grabbed :P
|
166
149
|
note to them [in how_to_create]: can do the two types of preview at same time...concurrently...to save time...
|
167
150
|
can I make playback more smooth by upping mplayer cache? does smplayer pass it a parameter?
|
168
|
-
lua VLC EDL plugin? LOL yeah right.
|
169
151
|
investigate: can I use zoomplayer max?
|
170
|
-
investigate dvdrsbvdl (windows media center edl plugin)
|
171
152
|
|
172
153
|
== DVD+-DVD-realtime backlog (totally unordered, some very low prio, basically all never do) ==
|
154
|
+
subtitle idio
|
155
|
+
slow cpu: mater tall tales: are my av sync values better or worse than smplayer defaults, with/without upsampling, blacky?
|
156
|
+
investigate boxee edl (just fer fun...maybe possible?) http://getsatisfaction.com/boxee/topics/commercial_skipping_edl_support
|
157
|
+
mplayer EDL allow this:
|
158
|
+
got fatal exception in button
|
159
|
+
detected an overlap 1397.51 1401.275 mute 1395.474 1397.874 mute
|
160
|
+
SyntaxError
|
161
|
+
lua VLC EDL plugin? LOL yeah right.
|
162
|
+
test with cars-ws (at work), mac (to make sure volume name doesn't have spaces)
|
163
|
+
investigate dvdrsbvdl (windows media center edl plugin)
|
164
|
+
the distro could be made smaller yet [at least not as many gem deps needed...maybe more possible...]
|
173
165
|
@mplayer: crash IQ nav, keys dont' work in windows, prolly dvdcss doesn't cache in windows, can't pass parameter in windows LOL
|
166
|
+
@mplayer: could you umm...go ahead and support avisynth input pleaz, assuming you don't?
|
174
167
|
@mplayer: dvdnav:///e: should play the *menu* please? please? [???]
|
168
|
+
@mplayer: that one [IQ? hitchhikers'?] fail fail fail until I used -dvd-device [?] huh?
|
169
|
+
try to reproduce...
|
175
170
|
@mplayer: do I need -zoom ?
|
176
171
|
@smplayer: you don't capture stderr [?] ex -vf scale:1280.0
|
177
172
|
@mplayer: http://www.infognition.com/VideoEnhancer/ can I do that through any means LOL?
|
@@ -217,32 +212,23 @@
|
|
217
212
|
allow for filter subtitles, a la "always skip" [?]
|
218
213
|
allow for AAF or OMF export, as well as EDL (?)
|
219
214
|
C specific portion [A,B] player
|
220
|
-
also edit the trailers et al [?] hmm...
|
215
|
+
also edit the playback of trailers et al [?] hmm...
|
221
216
|
@mplayer: double click default to full screen! :) and enter default to dvdnav select!
|
222
217
|
add button "play from exactly here to here" in [mplayer uh guess?] :P
|
223
218
|
what does mplayer do with -ss big_number past the end of an end [monster's inc]?
|
224
219
|
fix ffmpeg's Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5940 >= 5940
|
225
220
|
@makemkv: wrong title no:Title #0 was added (7 cell(s), 0:14:58)
|
226
221
|
Title #1 was added (8 cell(s), 0:14:57), also give us title no's in the dialog :P
|
227
|
-
@mencoder
|
228
|
-
@mpc: easier upconvert
|
222
|
+
@mencoder you lop off the end somehow (dvd rip)
|
229
223
|
@VLC: plugin for EDL maybe? [when opening file/DVD look for .edl file?]
|
230
224
|
blu ray timing
|
231
225
|
my one, others. Are they the same as DVD's? They seem really close...
|
232
|
-
can I accomodate for m4v somehow? Is it consistent?
|
233
226
|
pull in information from thetvdb to the GUI app
|
234
227
|
create the following EDL: 10 commandments DVD to skip the intro music LOL
|
235
|
-
todo.subtitle
|
236
228
|
@VLC you lop off the end, somehow, I guess...
|
237
|
-
|
238
|
-
the "frame accurate" splitter
|
229
|
+
create the "ffmpeg frame accurate" splitter
|
239
230
|
sounds like I want to move in that direction, esp. if handbrake ends up being sane
|
240
|
-
@mencoder you lop off the end somehow
|
241
|
-
@VLC convert -> dump raw always displays--expected? also saves nothing?
|
242
231
|
research the gplv3, add terms. Maybe want real lawyer, even?
|
243
|
-
note "others are released under this license, that license"
|
244
|
-
note/include jruby license, include gplv1 et al, note "also included locally"
|
245
|
-
disallow choosing empty drive? fail more gracefully when they do?
|
246
232
|
sons of provo "music video" EDL
|
247
233
|
it can "slow certain sections down" that might look way cool! LOL
|
248
234
|
how does this one download subtitles? http://www.pcworld.com/article/227465/freebie_splayer_plays_almost_any_video_fileand_looks_good_doing_it.html
|
@@ -255,7 +241,6 @@
|
|
255
241
|
"release" it to more developers
|
256
242
|
plug.org, more rubyists than urug?
|
257
243
|
after OS X confidence :)
|
258
|
-
@VLC also tell them to tell people how to play hi-def better, when they try [?] if it shtinks
|
259
244
|
an all online EDL editor
|
260
245
|
flash canvas
|
261
246
|
OCR?
|
@@ -272,14 +257,14 @@
|
|
272
257
|
take out the extra console window box output :) [scary, and closing it closes SC!]
|
273
258
|
auto-feedback on crashes [?]
|
274
259
|
publish new version of rdp-win32screenshot, if it ever existed
|
275
|
-
script avidemux, as a demo?
|
260
|
+
script avidemux, virtualdub, as a demo?
|
276
261
|
accomodate failed deletes [files in use] better than dying with a backtrace
|
277
262
|
vendorize ffmpeg, to avoid "scary" warning on install of imagemagick/scary active x
|
278
263
|
machine learning for video analysis [?]
|
279
264
|
figure out how to auto-crop after grab?
|
280
265
|
figure out some way to work with cable providers/iphones/gphones?
|
281
266
|
@smplayer: why do you sometimes start with subtitles enabled?
|
282
|
-
don't need to package rdp-win32screenshot et al for just DVD work...
|
267
|
+
don't need to include in package rdp-win32screenshot et al for just DVD work...
|
283
268
|
bring in batch file mplayer :)
|
284
269
|
make my website slightly more "pictures-zy"
|
285
270
|
check why out of sync my turn on earth on blacky MPH-HC
|
@@ -305,7 +290,6 @@
|
|
305
290
|
re-look through all my old "thoughts" notes/blogs
|
306
291
|
mplayer playlist mode possible, like real playlist?
|
307
292
|
add button start EDL playback from dvd here [?] (for create mode)
|
308
|
-
re-play as EDL button for both modes--describe on the how to better
|
309
293
|
fix prio for first ffmpeg instance not being settable [huh?]
|
310
294
|
check if a newer version of smplayer (+- forum links) can replace raw usage of mplayer now?
|
311
295
|
integrate sub-titles-zy-er auto-download
|
@@ -319,7 +303,7 @@
|
|
319
303
|
can watch conference like a music video :)
|
320
304
|
can play "this section then that, with this one's audio [wow that is fringey]
|
321
305
|
speedify things (the whole process takes approximately...eternity?)
|
322
|
-
can overlay with an arbitrary image
|
306
|
+
can overlay with an arbitrary image (I think mencoder can actually do this...)
|
323
307
|
ffmpeg handle 3F2R audio [sigh] [cars, should work with temple at lavc, too, bob dvd's are dual, I think...hmm...]
|
324
308
|
an 'always blank not skip the mutes' option for paranoid
|
325
309
|
video on how to use imdb wiki
|
@@ -347,16 +331,14 @@
|
|
347
331
|
instructions on how to do their own (private) DL or do one and submit it (public), or email their friends :P
|
348
332
|
add an option "just save full disk (unedited) to hard drive..."
|
349
333
|
note to people: can edit these to your liking, resubmit
|
350
|
-
DRY up dependency installation' code
|
351
334
|
"Re-run most recent" disabled when there isn't one [?]
|
352
335
|
can rip from a DVD-like local folder (would anybody ever need this?)
|
353
|
-
can parse IMDB
|
336
|
+
can parse IMDB parental guide
|
354
337
|
add stuffs to imdb hmmm
|
355
338
|
IMDB easy DVD mapping...
|
356
339
|
can blank out the video, with audio continuing through...
|
357
|
-
|
358
|
-
|
359
|
-
(when they have two...)
|
340
|
+
can use a fast temp drive, save through it to another :P
|
341
|
+
(when they have two...)
|
360
342
|
blu-ray support somehow (OCR maybe)
|
361
343
|
double buffering hard drive/incoming copying from DVD might speed things, if your HD is fast.
|
362
344
|
might not work for all modes tho...
|
@@ -377,9 +359,8 @@ warn when labels both exist and don't match...
|
|
377
359
|
@mplayer you cannot convert mkv files correctly you silly!
|
378
360
|
bounty dvdnav
|
379
361
|
fix dvdnav stuffs?
|
380
|
-
ask swank if individuals can rent too?
|
381
362
|
|
382
|
-
== random non-DVD backlog ... or never do DVD. ==
|
363
|
+
== random non-DVD/OCR backlog ... or never do DVD. ==
|
383
364
|
|
384
365
|
@mplayer: you return the wrong return code, sillys! https://gist.github.com/1056292
|
385
366
|
@smplayer: bounty or me fix: their for their display [if they use get_time_pos isn't that enough ?]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.24.
|
1
|
+
0.24.2
|
data/bin/sensible-cinema
CHANGED
@@ -38,6 +38,7 @@ require_relative '../lib/mplayer_edl'
|
|
38
38
|
require_relative '../lib/play_audio'
|
39
39
|
require_relative '../lib/subtitle_profanity_finder'
|
40
40
|
require_relative '../lib/convert_thirty_fps'
|
41
|
+
require_relative '../lib/ruby_clip'
|
41
42
|
|
42
43
|
require 'tmpdir'
|
43
44
|
require_relative '../lib/swing_helpers'
|
@@ -116,9 +117,10 @@ module SensibleSwing
|
|
116
117
|
end
|
117
118
|
|
118
119
|
LocalStorage = Storage.new("sensible_cinema_storage")
|
120
|
+
LocalStorage.set_default('multiple_half_screens', 4)
|
121
|
+
|
119
122
|
|
120
123
|
def setup_upconvert_buttons
|
121
|
-
|
122
124
|
|
123
125
|
@watch_file_upconvert = new_jbutton( "Watch a file upconverted (unedited)") do
|
124
126
|
# ?? drive, volume, dvd_id = choose_dvd_drive_or_file true
|
@@ -128,78 +130,105 @@ module SensibleSwing
|
|
128
130
|
end
|
129
131
|
|
130
132
|
@watch_file_upconvert = new_jbutton( "Watch a DVD upconverted (unedited)") do
|
131
|
-
# this way wurx...
|
132
|
-
#drive, volume, dvd_id = choose_dvd_drive_or_file false # will choose a DVD if mounted...
|
133
|
-
#run_smplayer_blocking "dvdnav:///#{drive}", "-nocache" # TODO dvdnav://1-60 is summarily ignored...sniff...
|
134
|
-
# LODO mplayer dvdnav:///e: seems really really hosed LOL, and also dvdnav input what the...
|
135
|
-
# plush crash smplayer "normal" selecting IQ Menu (ok snow white tho...odd...)
|
136
133
|
warn_if_no_upconvert_options_currently_selected
|
137
|
-
play_dvd_smplayer_unedited
|
134
|
+
play_dvd_smplayer_unedited false, false
|
138
135
|
end
|
139
136
|
|
140
|
-
|
137
|
+
@upconv_line = add_text_line ''
|
138
|
+
change_upconvert_line_to_current
|
139
|
+
|
140
|
+
@show_upconvert_options = new_jbutton( "Change upconvert options" ) do
|
141
|
+
add_setup_upconvert_options
|
142
|
+
end
|
141
143
|
|
142
144
|
end
|
143
145
|
|
144
146
|
def warn_if_no_upconvert_options_currently_selected
|
145
147
|
if !LocalStorage[UpConvertEnglish]
|
146
|
-
show_blocking_message_dialog "Warning: upconvert options have not been set yet--
|
148
|
+
show_blocking_message_dialog "Warning: upconvert options have not been set yet--set upconvert options first and restart, if desired."
|
147
149
|
end
|
148
150
|
end
|
149
151
|
|
150
|
-
def
|
151
|
-
@
|
152
|
-
setup_upconvert_options
|
153
|
-
end
|
154
|
-
|
152
|
+
def change_upconvert_line_to_current
|
153
|
+
@upconv_line.set_text get_current_upconvert_as_phrase
|
155
154
|
end
|
156
|
-
|
155
|
+
|
157
156
|
UpConvertKey = 'upconvert_setting'
|
158
157
|
UpConvertKeyExtra = 'upconvert_setting_extra'
|
159
158
|
UpConvertEnglish = 'upconvert_english_name'
|
160
159
|
|
161
|
-
def
|
160
|
+
def add_setup_upconvert_options
|
162
161
|
none = new_jbutton("reset upconvert options to default (none)")
|
163
|
-
none.tool_tip = "Having no upconvert options is reasonably good,
|
164
|
-
p 'upconvert options started as:', LocalStorage[UpConvertKey]
|
162
|
+
none.tool_tip = "Having no upconvert options is reasonably good, might use directx for scaling, nice for slow cpu's"
|
165
163
|
none.on_clicked {
|
166
164
|
LocalStorage[UpConvertKey] = nil
|
167
165
|
LocalStorage[UpConvertKeyExtra] = nil
|
168
166
|
LocalStorage[UpConvertEnglish] = nil
|
167
|
+
display_current_upconvert_setting
|
169
168
|
}
|
170
|
-
medium_dvd = new_jbutton("set upconvert options to DVD-style input
|
171
|
-
LocalStorage[UpConvertKey] = "hqdn3d=
|
172
|
-
|
173
|
-
LocalStorage[
|
169
|
+
medium_dvd = new_jbutton("set upconvert options to DVD-style input") {
|
170
|
+
LocalStorage[UpConvertKey] = "pullup,softskip,hqdn3d=0:1:4:4,scale=SCREEN_X:-10:0:0:2"
|
171
|
+
# hqdn3d[=luma_spatial:chroma_spatial:luma_tmp:chroma_tmp]
|
172
|
+
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=7.0"
|
173
|
+
LocalStorage[UpConvertEnglish] = "DVD"
|
174
174
|
display_current_upconvert_setting
|
175
175
|
}
|
176
176
|
high_compression = new_jbutton("set upconvert options for playing back highly compressed video") {
|
177
177
|
# -autoq 6 -vf pp [?]
|
178
|
-
LocalStorage[UpConvertEnglish] = "high
|
179
|
-
LocalStorage[UpConvertKey] = "hqdn3d=
|
180
|
-
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=
|
178
|
+
LocalStorage[UpConvertEnglish] = "high compressed"
|
179
|
+
LocalStorage[UpConvertKey] = "pullup,softskip,hqdn3d=0:1:4:4,pp=hb:y/vb:y,scale=SCREEN_X:-10:0:0:3" # ordering?
|
180
|
+
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=25.0"
|
181
181
|
display_current_upconvert_setting
|
182
|
+
# -Processing method: mplayer with accurate deblocking ??
|
182
183
|
}
|
183
|
-
new_jbutton("set upconvert options to
|
184
|
-
LocalStorage[UpConvertKey] = "hqdn3d=7:7:5,scale=SCREEN_X:-
|
184
|
+
new_jbutton("set upconvert options to experimental DVD/HQ-style playback") {
|
185
|
+
LocalStorage[UpConvertKey] = "pullup,softskip,hqdn3d=7:7:5,scale=SCREEN_X:-10:0:0:10"
|
185
186
|
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=100.0 -ssf cs=75.0"
|
186
|
-
LocalStorage[UpConvertEnglish] = "
|
187
|
+
LocalStorage[UpConvertEnglish] = "experimental DVD/HQ"
|
187
188
|
display_current_upconvert_setting
|
188
189
|
}
|
189
|
-
|
190
|
+
|
191
|
+
slider = JSlider.new
|
192
|
+
slider.setBorder(BorderFactory.createTitledBorder("Multiple factor of half screen widths (higher is better, but uses more cpu, default 4)"));
|
193
|
+
|
194
|
+
slider.maximum=6# LODO non 6 here...
|
195
|
+
slider.minimum=0
|
196
|
+
slider.setMajorTickSpacing(1)
|
197
|
+
slider.setPaintTicks(true)
|
198
|
+
slider.setPaintLabels(true)
|
199
|
+
slider.snap_to_ticks=true
|
200
|
+
|
201
|
+
slider.set_value LocalStorage['multiple_half_screens']
|
202
|
+
|
203
|
+
slider.add_change_listener { |event|
|
204
|
+
if slider.value >= 2
|
205
|
+
LocalStorage['multiple_half_screens'] = slider.value
|
206
|
+
else
|
207
|
+
show_blocking_message_dialog "you can't set it lower than 2 that wouldn't make any sense, since that's screen width"
|
208
|
+
end
|
209
|
+
}
|
210
|
+
slider.set_bounds(44, @starting_button_y, @button_width, 56)
|
211
|
+
2.times {increment_button_location}
|
212
|
+
@panel.add(slider); #// content.add(slider, BorderLayout::SOUTH);
|
190
213
|
end
|
191
214
|
|
192
215
|
def display_current_upconvert_setting
|
193
|
-
|
216
|
+
change_upconvert_line_to_current
|
217
|
+
show_blocking_message_dialog get_current_upconvert_as_phrase
|
218
|
+
end
|
219
|
+
|
220
|
+
def get_current_upconvert_as_phrase
|
221
|
+
settings = LocalStorage[UpConvertEnglish]
|
222
|
+
"Upconvert options #{ settings ? "are set to #{settings}" : "not currently set"}"
|
194
223
|
end
|
195
224
|
|
196
225
|
def get_upconvert_vf_settings
|
197
226
|
template = LocalStorage[UpConvertKey]
|
198
227
|
if template
|
199
228
|
# choose width of widest monitor (why would they display it on the other?)
|
200
|
-
|
201
|
-
|
202
|
-
|
229
|
+
screen_x = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment.getScreenDevices.map{|gd| gd.display_mode.width}.max.to_i
|
230
|
+
screen_multiple = LocalStorage['multiple_half_screens']/2
|
231
|
+
template.gsub('SCREEN_X', (screen_x*screen_multiple).to_i.to_s) # has to be an integer...
|
203
232
|
else
|
204
233
|
nil
|
205
234
|
end
|
@@ -269,7 +298,7 @@ module SensibleSwing
|
|
269
298
|
drive, volume_name, dvd_id = choose_dvd_drive_or_file true
|
270
299
|
# display it, allow them to copy and paste it out
|
271
300
|
out = nil
|
272
|
-
t = Thread.new {out= `mplayer dvdnav
|
301
|
+
t = Thread.new {out= `mplayer dvdnav:// -dvd-device #{drive} -identify -frames 0 2>&1| grep LENGTH`}
|
273
302
|
id_string = "\"disk_unique_id\" => \"#{dvd_id}\", # #{volume_name}"
|
274
303
|
show_copy_pastable_string "#{drive} #{volume_name} for your copying+pasting pleasure (highlight, then ctrl+c to copy)\n
|
275
304
|
This is USED eventually to identify a disk to match it to its EDL, later.", id_string
|
@@ -320,14 +349,12 @@ module SensibleSwing
|
|
320
349
|
EOL
|
321
350
|
@parse_srt.on_clicked do
|
322
351
|
filename = new_existing_file_selector_and_select_file("Pick srt file:")
|
323
|
-
parsed = SubtitleProfanityFinder.edl_output filename, {}, 0.35, 0.25 # PUT MOVIE SPECIFIC OFFSET TIMINGS HERE
|
352
|
+
parsed = SubtitleProfanityFinder.edl_output filename, {}, 0, 0 # 0.35, 0.25 # PUT MOVIE SPECIFIC OFFSET SUBTITLE TIMINGS HERE LODO prompt :P
|
324
353
|
File.write(EdlTempFile, "# add these into your mute section if they are offensive\n" + parsed)
|
325
|
-
open_file_to_edit_it filename
|
354
|
+
open_file_to_edit_it filename, true
|
326
355
|
open_file_to_edit_it EdlTempFile
|
327
356
|
end
|
328
357
|
|
329
|
-
add_set_upconvert_options_button
|
330
|
-
|
331
358
|
add_text_line 'Create Options that first create/use a local intermediary file:'
|
332
359
|
|
333
360
|
@preview_section = new_jbutton( "Preview a certain time frame from fulli file (edited)" )
|
@@ -451,7 +478,11 @@ module SensibleSwing
|
|
451
478
|
add_text_line "Welcome to Sensible Cinema!"
|
452
479
|
@starting_button_y += 10 # kinder ugly...
|
453
480
|
add_text_line " Rest mouse over buttons for \"help\" type descriptions (tooltips)."
|
454
|
-
|
481
|
+
if LocalStorage[UpConvertEnglish]
|
482
|
+
add_text_line " Upconvert settings are at:" + LocalStorage[UpConvertEnglish]
|
483
|
+
else
|
484
|
+
add_text_line ""
|
485
|
+
end
|
455
486
|
add_text_line ""
|
456
487
|
|
457
488
|
if we_are_in_upconvert_mode
|
@@ -493,9 +524,16 @@ module SensibleSwing
|
|
493
524
|
setIconImage(ImageIcon.new(__DIR__ + "/../vendor/monkey.png").getImage())
|
494
525
|
check_for_various_dependencies
|
495
526
|
end
|
527
|
+
|
528
|
+
def run_smplayer_non_blocking *args
|
529
|
+
@background_thread = Thread.new {
|
530
|
+
run_smplayer_blocking *args
|
531
|
+
}
|
532
|
+
end
|
496
533
|
|
497
534
|
def run_smplayer_blocking play_this, extra_options, force_use_mplayer
|
498
535
|
extra_options += " -mouse-movements #{get_upconvert_secondary_settings} " # just in case smplayer also needs -mouse-movements... :)
|
536
|
+
extra_options += " -lavdopts threads=#{OS.cpu_count} " # just in case this helps [supposed to with H.264] :)
|
499
537
|
if OS.mac? || force_use_mplayer
|
500
538
|
@_run_smplayer_instructions ||= show_mplayer_instructions
|
501
539
|
conf_file = File.expand_path './mplayer_input_conf'
|
@@ -507,26 +545,33 @@ module SensibleSwing
|
|
507
545
|
extra_options += " -font #{ENV['SystemRoot']}\\fonts\\ARIAL.TTF " # would need EXTRA ESCAPING FOR SMPLAYER USE
|
508
546
|
conf_file = conf_file[2..-1] # strip off drive letter, which it doesn't like no sir
|
509
547
|
end
|
548
|
+
extra_options += " -fs " # full screen
|
510
549
|
c = "mplayer #{extra_options} #{"-vf " + get_upconvert_vf_settings if get_upconvert_vf_settings} -input conf=\"#{conf_file}\" -mouse-movements \"#{play_this}\" "
|
511
550
|
else
|
512
551
|
if OS.windows?
|
513
552
|
extra_options += " -vo direct3d " # more light nvidia...should be ok...
|
514
553
|
end
|
515
554
|
config_path = set_smplayer_opts extra_options
|
516
|
-
c = "smplayer_portable \"#{play_this}\" -config-path \"#{File.dirname config_path}\" -close-at-end "
|
555
|
+
c = "smplayer_portable \"#{play_this}\" -fullscreen -config-path \"#{File.dirname config_path}\" -close-at-end "
|
517
556
|
end
|
518
557
|
puts c
|
519
558
|
system_blocking c
|
520
559
|
end
|
521
560
|
|
522
561
|
def set_smplayer_opts to_this, show_subs = false
|
562
|
+
p 'set smplayer opts to this:' + to_this
|
523
563
|
smplayer_prefs_file = File.expand_path("~/.smplayer/smplayer.ini")
|
524
564
|
old_prefs = File.read(smplayer_prefs_file) rescue ''
|
525
565
|
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='
|
526
566
|
new_prefs = old_prefs.gsub(/mplayer_additional_options=.*/, "mplayer_additional_options=#{to_this}")
|
527
567
|
new_prefs.gsub!(/autoload_sub=.*$/, "autoload_sub=#{show_subs.to_s}")
|
528
|
-
|
529
|
-
|
568
|
+
upconvert_settings = get_upconvert_vf_settings
|
569
|
+
if upconvert_settings.present?
|
570
|
+
p 'put upconvert options in as vf', upconvert_settings
|
571
|
+
else
|
572
|
+
p 'not using upconvert'
|
573
|
+
end
|
574
|
+
new_prefs.gsub!(/mplayer_additional_video_filters=.*$/, "mplayer_additional_video_filters=\"#{upconvert_settings}\"")
|
530
575
|
new_prefs.gsub!(/priority=.*$/, "priority=3") # normal priority...scary otherwise! lodo tell smplayer...
|
531
576
|
FileUtils.mkdir_p File.dirname(smplayer_prefs_file) # case it doesn't exist'
|
532
577
|
File.write(smplayer_prefs_file, new_prefs)
|
@@ -562,8 +607,7 @@ module SensibleSwing
|
|
562
607
|
filename.downcase!
|
563
608
|
File.write(filename, input) unless File.exist?(filename) # lodo let them choose name (?)
|
564
609
|
open_file_to_edit_it filename
|
565
|
-
end
|
566
|
-
|
610
|
+
end
|
567
611
|
|
568
612
|
def system_blocking command, low_prio = false
|
569
613
|
return true if command =~ /^@rem/ # jruby+MRI bug, I think...
|
@@ -582,13 +626,13 @@ module SensibleSwing
|
|
582
626
|
if piddy
|
583
627
|
# piddy.SetPriority low_prio # this call can seg fault at times...yikes...JRUBY-5422
|
584
628
|
pid = piddy.ProcessId # this doesn't seg fault, tho
|
585
|
-
system_original("vendor\\setpriority -lowest #{pid}") #
|
629
|
+
system_original("vendor\\setpriority -lowest #{pid}") # use the PID on the command line
|
586
630
|
else
|
587
631
|
# XXXX first one always fails [?] huh?
|
588
632
|
p 'unable to find to set priority ' + exe_name
|
589
633
|
end
|
590
634
|
rescue Exception => e
|
591
|
-
p 'warning, got exception trying to set priority [jruby? ...]', e
|
635
|
+
p 'warning, got exception trying to set priority [jruby prob? ...]', e
|
592
636
|
end
|
593
637
|
end
|
594
638
|
print out.read # let it finish
|
@@ -600,7 +644,7 @@ module SensibleSwing
|
|
600
644
|
end
|
601
645
|
|
602
646
|
def system_non_blocking command
|
603
|
-
Thread.new { system_original command }
|
647
|
+
@background_thread = Thread.new { system_original command }
|
604
648
|
end
|
605
649
|
|
606
650
|
if respond_to?(:system)
|
@@ -615,35 +659,35 @@ module SensibleSwing
|
|
615
659
|
writeOut.close
|
616
660
|
end
|
617
661
|
|
618
|
-
def play_dvd_smplayer_unedited use_mplayer_instead = false
|
619
|
-
# LODO really even if there are 2 it should still pick out the title track...hmm...on demand :P
|
662
|
+
def play_dvd_smplayer_unedited use_mplayer_instead = false, show_instructions = true
|
620
663
|
drive, dvd_volume_name, dvd_id, edl_path_maybe_nil, descriptors_maybe_nil = choose_dvd_or_file_and_edl_for_it false
|
621
664
|
if descriptors_maybe_nil
|
622
665
|
title_track_maybe_nil = get_title_track(descriptors_maybe_nil, false)
|
623
666
|
end
|
624
|
-
file_to_play = "dvdnav://#{title_track_maybe_nil}
|
625
|
-
options = " -osd-fractions 2 -nocache "
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
'.' key: step one frame.
|
631
|
-
EOL
|
667
|
+
file_to_play = "dvdnav://#{title_track_maybe_nil}"
|
668
|
+
options = " -osd-fractions 2 -nocache -dvd-device #{drive} "
|
669
|
+
if show_instructions
|
670
|
+
# want this even with smplayer sometimes I guess...
|
671
|
+
@play_smplayer_warn ||= show_mplayer_instructions
|
672
|
+
end
|
632
673
|
|
633
|
-
|
674
|
+
run_smplayer_non_blocking file_to_play, options, use_mplayer_instead
|
634
675
|
|
635
676
|
end
|
636
677
|
|
637
678
|
EdlTempFile = Dir.tmpdir + '/mplayer.temp.edl'
|
638
679
|
|
639
|
-
def show_mplayer_instructions
|
640
|
-
show_non_blocking_message_dialog <<-EOL
|
680
|
+
def show_mplayer_instructions
|
681
|
+
show_non_blocking_message_dialog <<-EOL
|
641
682
|
About to run mplayer.
|
642
683
|
To control it, use
|
643
684
|
spacebar : pause,
|
644
|
-
double clicky : toggle full screen,
|
685
|
+
double clicky/right click : toggle full screen,
|
645
686
|
arrow keys (left, right, up down) to seek/scan
|
646
687
|
/ and * : inc/dec volume.
|
688
|
+
'o' key: turn on on-screen-display timestamps (note: the OSD timestamps [upper left] are 30 fps so will need to be converted to use).
|
689
|
+
'v' key: turn off subtitles.
|
690
|
+
'.' key: step one frame.
|
647
691
|
EOL
|
648
692
|
end
|
649
693
|
|
@@ -663,8 +707,8 @@ module SensibleSwing
|
|
663
707
|
else
|
664
708
|
using_dvd = true
|
665
709
|
title_track = get_title_track(descriptors)
|
666
|
-
extra_mplayer_commands << "-nocache"
|
667
|
-
play_this = "dvdnav://#{title_track}
|
710
|
+
extra_mplayer_commands << " -nocache -dvd-device #{drive_or_file} "
|
711
|
+
play_this = "dvdnav://#{title_track}"
|
668
712
|
end
|
669
713
|
if edl_path
|
670
714
|
descriptors = EdlParser.parse_file edl_path
|
@@ -700,8 +744,7 @@ module SensibleSwing
|
|
700
744
|
# prefer english, attempt to disable subtitles, set edl...
|
701
745
|
extra_mplayer_commands << "-alang en -nosub -noautosub -forcedsubsonly -sid 1000 -edl #{File.expand_path EdlTempFile}" # some maybe no longer necessary, but avoid subtitles by default...
|
702
746
|
|
703
|
-
|
704
|
-
Thread.new { run_smplayer_blocking play_this, extra_mplayer_commands.join(' '), false}
|
747
|
+
run_smplayer_non_blocking play_this, extra_mplayer_commands.join(' '), false
|
705
748
|
end
|
706
749
|
|
707
750
|
def assert_ownership_dialog
|
@@ -835,9 +878,13 @@ module SensibleSwing
|
|
835
878
|
end
|
836
879
|
end
|
837
880
|
|
838
|
-
def open_file_to_edit_it filename
|
881
|
+
def open_file_to_edit_it filename, start_minimized=false
|
839
882
|
if OS.windows?
|
840
|
-
|
883
|
+
if start_minimized
|
884
|
+
system_non_blocking "start /min notepad \"#{filename}\""
|
885
|
+
else
|
886
|
+
system_non_blocking "notepad \"#{filename}\""
|
887
|
+
end
|
841
888
|
else
|
842
889
|
system_non_blocking "#{OS.open_file_command} \"#{filename}\""
|
843
890
|
end
|
@@ -897,7 +944,8 @@ module SensibleSwing
|
|
897
944
|
end
|
898
945
|
|
899
946
|
def show_copy_pastable_string(message, value)
|
900
|
-
|
947
|
+
RubyClip.set_clipboard value
|
948
|
+
get_user_input message + " (has been copied to clipboard)", value, true
|
901
949
|
end
|
902
950
|
|
903
951
|
def parse_edl path
|
@@ -1127,7 +1175,7 @@ module SensibleSwing
|
|
1127
1175
|
if success
|
1128
1176
|
saved_to = save_to + '.avi'
|
1129
1177
|
if run_mplayer_after_done
|
1130
|
-
|
1178
|
+
run_smplayer_non_blocking saved_to, '', false
|
1131
1179
|
else
|
1132
1180
|
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.
|
1133
1181
|
show_blocking_message_dialog("Warning: file size differs by more than 50%--it's possible that transcoding failed somehow")
|
@@ -1176,7 +1224,7 @@ module SensibleSwing
|
|
1176
1224
|
end
|
1177
1225
|
names = opticals.map{|d| d.Name + "\\" + " (" + (d.VolumeName || 'Insert DVD to use') + ")"}
|
1178
1226
|
if !force_choose_only_dvd_drive && !has_at_least_one_dvd_inserted
|
1179
|
-
names += ['No DVD mounted so choose Local File (or insert DVD, re-try)']
|
1227
|
+
names += ['No DVD mounted so choose Local File (or insert DVD, re-try)'] # LODO cannot read it...
|
1180
1228
|
used_local_file_option = true
|
1181
1229
|
end
|
1182
1230
|
|
@@ -1203,15 +1251,15 @@ module SensibleSwing
|
|
1203
1251
|
raise unless selected_idx == 0 # it was our only option...
|
1204
1252
|
filename = new_existing_file_selector_and_select_file("Select yer previously grabbed from DVD file")
|
1205
1253
|
assert_ownership_dialog
|
1206
|
-
|
1254
|
+
return [filename, File.basename(filename), NonDvd]
|
1207
1255
|
else
|
1208
1256
|
disk = opticals[selected_idx]
|
1209
1257
|
out = show_non_blocking_message_dialog "calculating disk's unique id..." # useful, believe it or not
|
1210
1258
|
dvd_id = DriveInfo.md5sum_disk(disk.MountPoint)
|
1211
1259
|
out.dispose
|
1212
1260
|
@_choose_dvd_drive_or_file = [disk.MountPoint, opticals[selected_idx].VolumeName, dvd_id]
|
1261
|
+
return @_choose_dvd_drive_or_file
|
1213
1262
|
end
|
1214
|
-
return @_choose_dvd_drive_or_file
|
1215
1263
|
else
|
1216
1264
|
raise 'did not select a drive...'
|
1217
1265
|
end
|
@@ -1239,11 +1287,36 @@ module SensibleSwing
|
|
1239
1287
|
box.add_item drive
|
1240
1288
|
}
|
1241
1289
|
add box
|
1242
|
-
pack
|
1290
|
+
pack # how do you get this arbitrary size? what the...
|
1243
1291
|
end
|
1244
1292
|
end
|
1245
1293
|
end
|
1246
1294
|
|
1295
|
+
class String
|
1296
|
+
def present?
|
1297
|
+
length > 0
|
1298
|
+
end
|
1299
|
+
end
|
1300
|
+
|
1301
|
+
class NilClass
|
1302
|
+
def present?
|
1303
|
+
false
|
1304
|
+
end
|
1305
|
+
end
|
1306
|
+
class Object
|
1307
|
+
def present?
|
1308
|
+
true
|
1309
|
+
end
|
1310
|
+
end
|
1311
|
+
|
1312
|
+
class Array
|
1313
|
+
def present?
|
1314
|
+
length > 0
|
1315
|
+
end
|
1316
|
+
end
|
1317
|
+
|
1318
|
+
|
1319
|
+
|
1247
1320
|
if $0 == __FILE__
|
1248
1321
|
if ARGV.index('-h') || ARGV.index('--help')
|
1249
1322
|
puts 'syntax: [--create-mode]'
|