sensible-cinema 0.25.1 → 0.25.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +8 -8
- data/TODO +47 -57
- data/VERSION +1 -1
- data/bin/sensible-cinema +28 -48
- data/bin/sensible-cinema-cli +93 -71
- data/bin/sensible-cinema-dependencies.rb +15 -0
- data/change_log_with_feature_list.txt +24 -1
- data/cone.png +0 -0
- data/developer_how_to_contribute_to_the_project.txt +1 -0
- data/lib/auto_window_finder.rb +41 -0
- data/lib/blanker.rb +1 -1
- data/lib/edl_parser.rb +57 -6
- data/lib/screen_tracker.rb +15 -12
- data/lib/subtitle_profanity_finder.rb +4 -4
- data/play_with_inserted_scene.bat +8 -0
- data/play_with_overlay.bat +24 -0
- data/spec/auto_window_finder.spec.rb +65 -0
- data/spec/edl_parser.spec.rb +52 -11
- data/{zamples/edit_decision_lists/dvds → spec/files/edls}/edls_being_edited/edl_for_unit_tests.txt +0 -0
- data/spec/screen_tracker.spec.rb +13 -2
- data/spec/sensible_cinema_gui.spec.rb +12 -41
- data/todo.inventionzy.txt +13 -14
- data/todo.upconvert +5 -12
- data/transparent.png +0 -0
- data/upconvert_netflix/latest2/combine_video.avs +23 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/court_jester.txt +2 -0
- data/zamples/edit_decision_lists/youtube/nuki_song_youtube.txt +1 -0
- data/zamples/edit_decision_lists/youtube/nuki_song_youtube_pointer.txt +2 -0
- data/zamples/players/youtube/normal_in_youtube.com.chrome.txt +2 -1
- metadata +20 -10
data/Rakefile
CHANGED
@@ -9,22 +9,22 @@ Jeweler::Tasks.new do |s|
|
|
9
9
|
s.email = "rogerdpack@gmail.com"
|
10
10
|
s.homepage = "http://github.com/rdp"
|
11
11
|
s.authors = ["Roger Pack"]
|
12
|
-
s.add_dependency 'os', '>= 0.9.
|
13
|
-
s.add_dependency 'sane', '>= 0.
|
14
|
-
s.add_dependency 'rdp-win32screenshot', '
|
12
|
+
s.add_dependency 'os', '>= 0.9.4'
|
13
|
+
s.add_dependency 'sane', '>= 0.24.2'
|
14
|
+
s.add_dependency 'rdp-win32screenshot', '= 0.0.9'
|
15
15
|
s.add_dependency 'mini_magick', '>= 3.1' # for ocr...
|
16
16
|
s.add_dependency 'whichr', '>= 0.3.6'
|
17
|
-
s.add_dependency '
|
18
|
-
s.add_dependency 'rdp-ruby-wmi' # windows
|
19
|
-
s.add_dependency 'plist' # mac
|
20
|
-
s.add_dependency 'ffi' # mouse, etc. needed at least for MRI
|
17
|
+
s.add_dependency 'rautomation', '> 0.6.3'
|
18
|
+
s.add_dependency 'rdp-ruby-wmi' # for windows
|
19
|
+
s.add_dependency 'plist' # for mac
|
20
|
+
s.add_dependency 'ffi' # mouse, etc. needed at least for windows MRI
|
21
21
|
s.files.exclude '**/*.exe', '**/*.wav', '**/images/*'
|
22
22
|
s.add_development_dependency 'hitimes' # now jruby compat!
|
23
23
|
s.add_development_dependency 'rspec', '> 2'
|
24
24
|
s.add_development_dependency 'jeweler'
|
25
25
|
s.add_development_dependency 'rake'
|
26
26
|
|
27
|
-
# add as real dependencies for now, as gem install --development is still broken for jruby, basically installing transitive dependencies in error <sigh>
|
27
|
+
# add as real dependencies for now, as gem install --development is still broken for jruby, basically installing transitive dependencies in error <sigh> (actually might be fixed now though...so we may not need this)
|
28
28
|
|
29
29
|
for gem in s.development_dependencies #['hitimes', 'rspec', 'jeweler', 'rake']
|
30
30
|
# bundling rake won't be too expensive, right? and this allows for easier dev setup through gem install
|
data/TODO
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
== roadmap [for just tasks, see below though] ==
|
2
2
|
|
3
|
-
release: cheap/mediumcheap inventionzy
|
4
3
|
release: C EDL
|
5
4
|
compare netflix/blu-ray timings et al
|
6
5
|
|
@@ -17,28 +16,29 @@
|
|
17
16
|
== high prio like blocking bugs ==
|
18
17
|
|
19
18
|
== under next release specific items: ==
|
20
|
-
|
21
|
-
url -> url inference [hopefully this is cake...]
|
22
|
-
can handle multiple dvdid's et al
|
23
|
-
VLC "insert foreign missing scene" supah easy demo
|
24
|
-
overlay section with image (mplayer?)
|
25
|
-
add some "fake" "now pg" "now pg-12" "violence for age y" +- with edits at all even.
|
19
|
+
it can filter out specific profanities even, too :P
|
26
20
|
|
27
21
|
== yes do ordered in conjunction with the above probably ==
|
28
|
-
|
29
|
-
|
22
|
+
|
23
|
+
== yes do, un-ordered currently, from the various future release options ==
|
24
|
+
both mute and blank when blanking by default... (add the other type in there, esp. if a man answers)
|
25
|
+
cars EDL x2
|
30
26
|
lightning strike from various outlets...
|
27
|
+
release at some point...Oliver? facebook? (one at a time...)
|
31
28
|
research VOB
|
32
29
|
timesplits?
|
33
|
-
|
34
|
-
== yes do, un-ordered currently, from the various future release options ==
|
35
30
|
todo.upconvert
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
31
|
+
netflix quality upconverter
|
32
|
+
have people test it
|
33
|
+
me test it
|
34
|
+
1x, 2x Sintel
|
35
|
+
snapshots of Sintel "normal", then deploy the various comparison pics
|
36
|
+
netflix instant for OS X
|
37
|
+
add new open button "edit the one for current DVD"
|
38
|
+
the open button should open in the "editing" EDL dir.
|
39
|
+
an overlapping mute failure when you hit the "watch edited realtime" should popup.
|
40
|
+
split out the "dependency" code
|
41
|
+
try buy edit lists from all x,y,z [?] offer them money LOL
|
42
42
|
http://www.familysafemovies.com
|
43
43
|
cleanflix (earl? that guy [John webster http://www.amazon.com/Make-Edited-Movies-ebook/dp/B004EYT3BU]?)
|
44
44
|
cougar video (that looks tough...)
|
@@ -52,72 +52,60 @@
|
|
52
52
|
family flix
|
53
53
|
http://theeditedmovieencyclopedia.blogspot.com/2008/08/clean-play-dvds-grand-opening-e-mail.html has grande list
|
54
54
|
movie mask wayback machine
|
55
|
-
make it load faster! this is cuh-razy! or splash screen! yes!
|
56
|
-
netflix quality upconverter
|
57
|
-
want a prototype mplayer upconverter...I guess...
|
58
|
-
add back in scale for OS X, see if it's expensive or not...I'd guess not though...
|
55
|
+
make it load faster! this is cuh-razy! or at least splash screen! yes!
|
59
56
|
research XBMC
|
60
57
|
@XBMC: your stuff is broken in at least these two ways (bug reports)
|
61
58
|
also are they 30fps or not? and how do they handle timesplits?
|
62
59
|
is there another format that will actually mute?
|
60
|
+
XBMC mode doesn't mind the 600 starting offset...
|
61
|
+
oh wait we weren't even using it right to begin with LOL
|
62
|
+
plus it needs to "always just skip instead of mute" for now I guess
|
63
|
+
report XBMC bugs, too.
|
63
64
|
split into various separate windows themselves...
|
64
65
|
consistency for flight of nav. srt? huh?
|
65
66
|
consistency of others, also "DVD reported full-time versus ts time" for others...
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
all unit tests
|
71
|
-
subs: if at beginning of a sub, add extra offset...hmm...why not?
|
72
|
-
say something if the EDL is actually "blank" :)
|
73
|
-
figure out if an offset of '1s' should also be accomodated for...
|
74
|
-
0.3 ... ? huh?
|
75
|
-
fix released version to work in mac
|
76
|
-
release capture filter, advertise it :)
|
77
|
-
report ffmpeg bug, mplayer various :P
|
78
|
-
note "you want to optimize your reverse blitting first... :)"
|
79
|
-
test speed of from DESKTOP versus HWND.
|
80
|
-
can use hwnd. Somehow automated.
|
67
|
+
subtitles: if at beginning of a sub, add extra offset...hmm...why not?
|
68
|
+
say something if the EDL is actually "empty" :)
|
69
|
+
fix released version to downloadable work in mac
|
70
|
+
report ffmpeg bug, mplayer various (as bugs):P
|
81
71
|
"--developer" mode
|
82
72
|
export JSON command line, note it in the docu, show it in --developer mode, no new bat file for developer mode
|
83
73
|
new button "auto-test" a subtitles file for timing :)
|
84
74
|
new upconv button: auto-take some snapshots (just to straight mjpeg or jpeg or the what not)
|
85
|
-
publish a ripped raw big bunny
|
86
|
-
update development howto
|
87
75
|
@jruby scan court jester is *so* slow...what the...[mac at least...]
|
88
|
-
urug again?
|
76
|
+
advertise urug again?
|
89
77
|
after works in mac. Why not?
|
90
|
-
if 2 EDL's, still can choose a title track
|
91
78
|
advertise virtual audio
|
79
|
+
advertise virtual desktop :)
|
80
|
+
mplayer directx patch check it...
|
92
81
|
auto-add largest title to the generator EDL
|
93
82
|
complain if times looks wrong...on playback? sum time
|
94
83
|
tighten old splits... [remove, really, I guess...sure while I only have few...and also add better instructions...]
|
95
84
|
"save to" -> same dir as "get from" yeah
|
96
|
-
open EDL can have a rememberable DIR
|
85
|
+
open EDL to edit it can have a rememberable DIR
|
97
86
|
@instructions "this is great for comparing srt's, except...when it isn't, then you have to..."
|
98
87
|
@instructions: full srt how-to document instead of tooltip [?] or combine the two! yes!
|
99
88
|
volume_name => dvd_volume_name
|
100
|
-
C-based stuff cleanup loose ends
|
101
89
|
why is the Sintel's EDL seemingly off?
|
102
90
|
ascertain how accurate mplayer EDL is...I guess compared to...umm...something?
|
103
91
|
fix discrepancy between EDL mplayer and ffmpeg...maybe a new button "accurate EDL playback"?
|
104
92
|
maybe search at end of movies for certain things?
|
105
93
|
double check--are my ffmpeg splits really really really the same as mplayer's EDL DVD splits? really?
|
106
94
|
linearize: EDL with JSON on top, full timestamps.
|
107
|
-
setpriority for several :)
|
108
95
|
bring to top after a conversion, and before prompts...
|
109
96
|
can auto-use tsmuxer at all [?]
|
110
97
|
mac just die with instructions to use tsmuxer first...
|
111
|
-
|
98
|
+
actually don't do this, just make sure to warn them if they pass us an mkv...indeed.
|
99
|
+
check if some create buttons are now outdated...
|
112
100
|
check with blu-ray...do they match timing-wise? sub-title wise?
|
113
|
-
donate tsmuxer
|
114
|
-
already donated: unlocker, mac fan thing, open office, many sourceforge tops, 7zip, VLC, cannot donate: ffmpeg
|
101
|
+
donate tsmuxer (sent email), http://ffmpeg.zeranoe.com/builds, mulder +- [?] smplayer menumeter http://instantitunes.wordpress.com/2010/02/26/use-tsmuxer-on-snow-leopard
|
115
102
|
youtube/hulu timings
|
116
103
|
split LLC's website+consumer
|
117
104
|
get LLC before a "real" domain name
|
118
105
|
employee instructions: watch @ realtime after profanity filter first pass :P
|
119
|
-
@makemkv: timing feels broken weird-like!
|
106
|
+
@makemkv: timing feels broken weird-like! I'll donate you more money if you fix it <sniff>
|
120
107
|
try out libdvdcss + handbrake on the one that was totally broken...is it better?
|
108
|
+
it should work like a champ shouldn't it?
|
121
109
|
clear runnings
|
122
110
|
have ben and chris test it out, have it work, then ask about video quality
|
123
111
|
me try
|
@@ -145,9 +133,8 @@
|
|
145
133
|
create a semi-accurate phantom edit EDL
|
146
134
|
http://www.chefelf.com/forums/index.php?showtopic=6176
|
147
135
|
inventionzy: blu-ray stuff from todo.inventionzy
|
148
|
-
|
149
136
|
port to mac OS X
|
150
|
-
ppc dvdid? documentation button?
|
137
|
+
ppc dvdid? documentation button? notepad?
|
151
138
|
the final "edited.avi" really "could/should" be playable in WMP...if possible
|
152
139
|
add button "fast preview segment" (from dvd)
|
153
140
|
add button "fast preview one" (from file) smplayer
|
@@ -161,7 +148,7 @@
|
|
161
148
|
or maybe...umm...ask the dvdnav people why it might work with one and not the other? ask VLC? huh? what the...
|
162
149
|
call out to VLC on DVDNAV_ERROR occurrence? what the... if can reproduce, submit bug report with trace et al.
|
163
150
|
|
164
|
-
== other lists ==
|
151
|
+
== other lists to do ==
|
165
152
|
|
166
153
|
todo.upconvert
|
167
154
|
todo.propaganda
|
@@ -169,21 +156,25 @@
|
|
169
156
|
open_edl_list_org_todo.txt file
|
170
157
|
todo.build_library
|
171
158
|
todo.subtitle
|
159
|
+
todo.virtual_audio
|
172
160
|
|
173
161
|
== DVD decide later to move up or down ==
|
174
162
|
|
175
|
-
== DVD-realtime backlog
|
176
|
-
|
177
|
-
|
163
|
+
== DVD+-DVD-realtime backlog (totally unordered, some very low prio, basically all never do) ==
|
164
|
+
already donated: unlocker, mac fan thing, open office, many sourceforge tops, 7zip, VLC, mplayer, cannot donate: ffmpeg
|
165
|
+
note "you want to optimize your reverse blitting first... :)"
|
166
|
+
if 2 EDL's, still can choose a title track
|
178
167
|
fast preview: change it to be aggressive sometimes yes, other times no
|
179
168
|
fast preview mode: watch for modifications to file, kill mplayer instances for them on change :)
|
180
169
|
fast preview tends to "go too far" [like the end of profanity is still there when played via the "real way"]
|
181
|
-
mplayer EDL while grabbing, from grabbed :P
|
182
170
|
note to them [in how_to_create]: can do the two types of preview at same time...concurrently...to save time...
|
183
|
-
can I make playback more smooth by upping mplayer cache? does smplayer pass it a parameter?
|
184
171
|
investigate: can I use zoomplayer max?
|
185
172
|
|
186
|
-
|
173
|
+
can I make playback more smooth by upping mplayer cache? does smplayer pass it a parameter? It does jerk a bit doesn't it, on slower?
|
174
|
+
mplayer EDL while grabbing, from grabbed :P
|
175
|
+
can I just use ffmpeg for an initial -> ts ? http://eotmsnotes.wordpress.com/2011/04/25/tsmuxer-notes/
|
176
|
+
investigate xbmc dvd edl how do you do that? [+- real dvd]
|
177
|
+
release capture filter, advertise it :)
|
187
178
|
@ffdshow-tryouts: don't crash me!
|
188
179
|
conference it can "pick out songs" (like a music video? mp3's?)
|
189
180
|
check with WME plugins, add instructions, then note in the README "support for x..."
|
@@ -301,7 +292,6 @@
|
|
301
292
|
forever strong DVD timestamps [and other?], compare timestamps with amazon VoD, too, also jonah amazon VoD [if desired?]
|
302
293
|
take out the extra console window box output :) [scary, and closing it closes SC!]
|
303
294
|
auto-feedback on crashes [?]
|
304
|
-
publish new version of rdp-win32screenshot, if it ever existed
|
305
295
|
script avidemux, virtualdub, as a demo?
|
306
296
|
accomodate failed deletes [files in use] better than dying with a backtrace
|
307
297
|
vendorize ffmpeg, to avoid "scary" warning on install of imagemagick/scary active x
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.25.
|
1
|
+
0.25.2
|
data/bin/sensible-cinema
CHANGED
@@ -20,7 +20,7 @@ This file is part of Sensible Cinema.
|
|
20
20
|
print 'Starting Sensible Cinema...'
|
21
21
|
require File.expand_path(File.dirname(__FILE__) + "/../lib/add_any_bundled_gems_to_load_path.rb")
|
22
22
|
begin
|
23
|
-
require 'sane'
|
23
|
+
require 'sane'
|
24
24
|
rescue LoadError
|
25
25
|
p 'please run $ rake rebundle_copy_in_dependencies first, as we dislike needing locally installed rubygems'
|
26
26
|
raise
|
@@ -45,12 +45,13 @@ end
|
|
45
45
|
require_relative '../lib/swing_helpers'
|
46
46
|
|
47
47
|
# attempt to load on demand...i.e. faster...
|
48
|
-
for kls in [:MencoderWrapper, :
|
48
|
+
for kls in [:MencoderWrapper, :MplayerEdl, :PlayAudio, :SubtitleProfanityFinder, :ConvertThirtyFps, :RubyClip, :DriveInfo]
|
49
49
|
autoload kls, "./lib/#{kls.to_s.snake_case}"
|
50
50
|
end
|
51
51
|
|
52
|
-
# a few I'll need...
|
52
|
+
# a few I'll always need eventually...
|
53
53
|
require_relative '../lib/storage'
|
54
|
+
require_relative '../lib/edl_parser'
|
54
55
|
require 'tmpdir'
|
55
56
|
require 'whichr'
|
56
57
|
require 'os'
|
@@ -78,6 +79,7 @@ else
|
|
78
79
|
end
|
79
80
|
|
80
81
|
import 'javax.swing.ImageIcon'
|
82
|
+
require_relative 'sensible-cinema-dependencies'
|
81
83
|
|
82
84
|
module SensibleSwing
|
83
85
|
VERSION = File.read(File.dirname(__FILE__) + "/../VERSION").strip
|
@@ -86,7 +88,7 @@ module SensibleSwing
|
|
86
88
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()) # sigh
|
87
89
|
|
88
90
|
class MainWindow < JFrame
|
89
|
-
|
91
|
+
|
90
92
|
def we_are_in_create_mode
|
91
93
|
ARGV.index("--create-mode")
|
92
94
|
end
|
@@ -345,7 +347,7 @@ module SensibleSwing
|
|
345
347
|
|
346
348
|
@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.")
|
347
349
|
@open_list.on_clicked {
|
348
|
-
filename = new_existing_file_selector_and_select_file( "Pick any file to open in editor", EDL_DIR)
|
350
|
+
filename = new_existing_file_selector_and_select_file( "Pick any file to open in editor", EdlParser::EDL_DIR)
|
349
351
|
open_file_to_edit_it filename
|
350
352
|
}
|
351
353
|
|
@@ -566,7 +568,7 @@ module SensibleSwing
|
|
566
568
|
|
567
569
|
def choose_file_and_edl_and_create_sxs_or_play just_create_dot_edl_file_instead_of_play
|
568
570
|
filename_mpg = new_existing_file_selector_and_select_file( "Pick moviefile (like moviename.mpg or video_ts/anything.ext)")
|
569
|
-
edl_filename = new_existing_file_selector_and_select_file( "Pick an EDL file to use with it", EDL_DIR)
|
571
|
+
edl_filename = new_existing_file_selector_and_select_file( "Pick an EDL file to use with it", EdlParser::EDL_DIR)
|
570
572
|
assert_ownership_dialog
|
571
573
|
if just_create_dot_edl_file_instead_of_play
|
572
574
|
descriptors = EdlParser.parse_file edl_filename
|
@@ -656,7 +658,6 @@ module SensibleSwing
|
|
656
658
|
|
657
659
|
def run_smplayer_blocking play_this, title_track_maybe_nil, extra_options, force_use_mplayer, show_subs
|
658
660
|
unless File.exist?(File.expand_path(play_this))
|
659
|
-
#_dbg
|
660
661
|
raise play_this + ' non existing?' # till these go away in mac :)
|
661
662
|
end
|
662
663
|
|
@@ -782,7 +783,7 @@ module SensibleSwing
|
|
782
783
|
# "mplayer_dvd_splits" => ["59:59", "1:04:59"], # or [] if there are none. Additive currently. 12345.6 ok. In mplayer, the DVD timestamp "resets" to zero for some reason, so you need to specify when if you want to use mplayer DVD realtime playback, or use mencoder -edl to split your file. See http://goo.gl/yMfqX
|
783
784
|
EOL
|
784
785
|
# TODO auto-ify above, move docs to a file in documentation.
|
785
|
-
filename = EDL_DIR + "/edls_being_edited/" + english_name.gsub(' ', '_') + '.txt'
|
786
|
+
filename = EdlParser::EDL_DIR + "/edls_being_edited/" + english_name.gsub(' ', '_') + '.txt'
|
786
787
|
filename.downcase!
|
787
788
|
File.write(filename, input) unless File.exist?(filename) # lodo let them choose name (?)
|
788
789
|
open_file_to_edit_it filename
|
@@ -801,14 +802,12 @@ module SensibleSwing
|
|
801
802
|
begin
|
802
803
|
p = proc{ ole = WMI::Win32_Process.find(:first, :conditions => {'Name' => exe_name}); sleep 1 unless ole; ole }
|
803
804
|
piddy = p.call || p.call || p.call # we actually do need this to loop...guess we're too quick
|
804
|
-
# but the first time through this still inexplicably fails all 3...
|
805
|
-
|
806
|
-
|
805
|
+
# but the first time through this still inexplicably fails all 3...odd
|
806
|
+
piddys = WMI::Win32_Process.find(:all, :conditions => {'Name' => exe_name})
|
807
|
+
for piddy in piddys
|
808
|
+
# piddy.SetPriority low_prio # this call can seg fault at times...JRUBY-5422
|
807
809
|
pid = piddy.ProcessId # this doesn't seg fault, tho
|
808
|
-
system_original("vendor\\setpriority -lowest #{pid}") #
|
809
|
-
else
|
810
|
-
# XXXX first one always fails [?] huh?
|
811
|
-
p 'unable to find to set priority ' + exe_name
|
810
|
+
system_original("vendor\\setpriority -lowest #{pid}") # uses PID for the command line
|
812
811
|
end
|
813
812
|
rescue Exception => e
|
814
813
|
p 'warning, got exception trying to set priority [jruby prob? ...]', e
|
@@ -831,12 +830,6 @@ module SensibleSwing
|
|
831
830
|
undef system
|
832
831
|
end
|
833
832
|
|
834
|
-
def download full_url, to_here
|
835
|
-
require 'open-uri'
|
836
|
-
writeOut = open(to_here, "wb")
|
837
|
-
writeOut.write(open(full_url).read)
|
838
|
-
writeOut.close
|
839
|
-
end
|
840
833
|
|
841
834
|
def play_dvd_smplayer_unedited use_mplayer_instead, show_instructions, show_subs
|
842
835
|
drive_or_file, dvd_volume_name, dvd_id, edl_path_maybe_nil, descriptors_maybe_nil = choose_dvd_or_file_and_edl_for_it false
|
@@ -854,6 +847,7 @@ module SensibleSwing
|
|
854
847
|
if OS.doze? # avoid spaces :)
|
855
848
|
EdlTempFile = EightThree.convert_path_to_8_3(Dir.tmpdir + '/mplayer.temp.edl')
|
856
849
|
else
|
850
|
+
raise if Dir.tmpdir =~ / / # that would be odd...
|
857
851
|
EdlTempFile = Dir.tmpdir + '/mplayer.temp.edl'
|
858
852
|
end
|
859
853
|
|
@@ -993,8 +987,8 @@ module SensibleSwing
|
|
993
987
|
Dir.mkdir('./vendor/cache') unless File.directory? 'vendor/cache' # development may not have it created yet... [?]
|
994
988
|
unless File.exist? 'vendor/cache/7za.exe'
|
995
989
|
Dir.chdir('vendor/cache') do
|
996
|
-
print 'downloading unzipper (400K) ...'
|
997
|
-
download("http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip", "7za920.zip")
|
990
|
+
print 'downloading unzipper (7zip--400K) ...'
|
991
|
+
MainWindow.download("http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip", "7za920.zip")
|
998
992
|
system_blocking("../unzip.exe -o 7za920.zip") # -o means "overwrite" without prompting
|
999
993
|
end
|
1000
994
|
end
|
@@ -1005,7 +999,7 @@ module SensibleSwing
|
|
1005
999
|
Dir.chdir('vendor/cache') do
|
1006
1000
|
file_name = url.split('/')[-1]
|
1007
1001
|
print "downloading #{english_name} ..."
|
1008
|
-
download(url, file_name)
|
1002
|
+
MainWindow.download(url, file_name)
|
1009
1003
|
system_blocking("7za e #{file_name} -y -o#{to_this}")
|
1010
1004
|
puts 'done ' + english_name
|
1011
1005
|
# creates vendor/cache/mencoder/mencoder.exe...
|
@@ -1076,27 +1070,6 @@ module SensibleSwing
|
|
1076
1070
|
end
|
1077
1071
|
end
|
1078
1072
|
|
1079
|
-
def single_edit_list_matches_dvd dvd_id
|
1080
|
-
matching = Dir[EDL_DIR + '/**/*.txt'].select{|file|
|
1081
|
-
begin
|
1082
|
-
parse_edl(file)["disk_unique_id"] == dvd_id
|
1083
|
-
rescue SyntaxError => e
|
1084
|
-
# ignore poorly formed edit lists for the auto choose phase...
|
1085
|
-
p 'warning, unable to parse a file:' + file + " " + e.to_s
|
1086
|
-
false
|
1087
|
-
end
|
1088
|
-
}
|
1089
|
-
if matching.length == 1
|
1090
|
-
file = matching[0]
|
1091
|
-
p "selecting the one only matching EDL #{file} for this DVD ID: #{dvd_id}"
|
1092
|
-
file
|
1093
|
-
else
|
1094
|
-
nil
|
1095
|
-
end
|
1096
|
-
end
|
1097
|
-
|
1098
|
-
EDL_DIR = File.expand_path(__DIR__ + "/../zamples/edit_decision_lists/dvds").to_filename
|
1099
|
-
|
1100
1073
|
def repeat_last_copy_dvd_to_hard_drive
|
1101
1074
|
generate_and_run_bat_file *LocalStorage['last_params']
|
1102
1075
|
end
|
@@ -1157,9 +1130,9 @@ module SensibleSwing
|
|
1157
1130
|
drive_or_file, dvd_volume_name, dvd_id = choose_dvd_drive_or_file false
|
1158
1131
|
|
1159
1132
|
unless @_edit_list_path # cache file selection...
|
1160
|
-
edit_list_path = single_edit_list_matches_dvd(dvd_id)
|
1133
|
+
edit_list_path = EdlParser.single_edit_list_matches_dvd(dvd_id)
|
1161
1134
|
if !edit_list_path && force_choose_edl_file_if_no_easy_match
|
1162
|
-
edit_list_path = new_existing_file_selector_and_select_file("Please pick a DVD Edit List File (none or more than one were found that seem to match #{dvd_volume_name})--may need to create one for it", EDL_DIR)
|
1135
|
+
edit_list_path = new_existing_file_selector_and_select_file("Please pick a DVD Edit List File (none or more than one were found that seem to match #{dvd_volume_name})--may need to create one for it", EdlParser::EDL_DIR)
|
1163
1136
|
raise 'cancelled choosing an EDL' unless edit_list_path
|
1164
1137
|
end
|
1165
1138
|
@_edit_list_path = edit_list_path
|
@@ -1224,6 +1197,7 @@ module SensibleSwing
|
|
1224
1197
|
|
1225
1198
|
descriptors = parse_edl(edit_list_path)
|
1226
1199
|
if watch_unedited
|
1200
|
+
# reset them
|
1227
1201
|
descriptors['mutes'] = descriptors['blank_outs'] = []
|
1228
1202
|
end
|
1229
1203
|
|
@@ -1254,7 +1228,13 @@ module SensibleSwing
|
|
1254
1228
|
LocalStorage['end_time'] = end_time
|
1255
1229
|
end
|
1256
1230
|
dvd_friendly_name = descriptors['name']
|
1257
|
-
|
1231
|
+
unless dvd_friendly_name
|
1232
|
+
_dbg
|
1233
|
+
drive_or_file, dvd_volume_name, dvd_id, edit_list_path, descriptors = choose_dvd_or_file_and_edl_for_it
|
1234
|
+
|
1235
|
+
descriptors = parse_edl(edit_list_path)
|
1236
|
+
raise 'no dvd name in EDL?'
|
1237
|
+
end
|
1258
1238
|
|
1259
1239
|
dvd_title_track = get_title_track(descriptors)
|
1260
1240
|
if dvd_id == NonDvd
|
data/bin/sensible-cinema-cli
CHANGED
@@ -20,9 +20,7 @@ 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
|
-
|
24
|
-
|
25
|
-
for file in ['overlayer', 'keyboard_input', 'screen_tracker', 'mouse', 'file_chooser', 'ocr', 'vlc_programmer']
|
23
|
+
for file in ['overlayer', 'keyboard_input', 'screen_tracker', 'mouse', 'file_chooser', 'ocr', 'vlc_programmer', 'edl_parser', 'auto_window_finder']
|
26
24
|
require_relative '../lib/' + file
|
27
25
|
end
|
28
26
|
|
@@ -31,7 +29,7 @@ def go_sc(args)
|
|
31
29
|
$VERBOSE = 1 if args.delete('-v')
|
32
30
|
$DEBUG = 1 if args.delete('-d')
|
33
31
|
if args.delete('--clear-cache')
|
34
|
-
OCR.clear_cache!
|
32
|
+
OCR.clear_cache!
|
35
33
|
puts 'cleared cache'
|
36
34
|
end
|
37
35
|
|
@@ -41,95 +39,119 @@ def go_sc(args)
|
|
41
39
|
|
42
40
|
puts <<-END
|
43
41
|
|
44
|
-
syntax: [player_description.yml] [delete_list.txt|test] [-t -v --clear-cache] (or just nothing at all--it will prompt for all things
|
42
|
+
syntax: [player_description.yml] [delete_list.txt|test] [-t, -v, --clear-cache] (or just nothing at all--it will prompt for all things it needs)
|
45
43
|
|
46
|
-
If you specify "test" for the edit list, it will pause
|
44
|
+
If you specify "test" for the edit list, it will pause 2s, take a single snapshot of the selected player, then exit.
|
47
45
|
Useful for debugging your screen capture of the current player.
|
48
46
|
You can also specify -v or -t if you want to enable more verbose (chatty) output.
|
49
47
|
|
50
48
|
END
|
51
49
|
|
52
|
-
for file in Dir[
|
50
|
+
for file in Dir[__DIR__ + '../zamples/mute*/*']
|
53
51
|
puts "\n", "Example file:", file + "\n\n", File.read(file)
|
54
52
|
end
|
55
53
|
|
56
54
|
exit 1
|
57
|
-
|
58
|
-
else
|
59
|
-
|
60
|
-
# allow for command line filenames
|
55
|
+
end
|
61
56
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
57
|
+
players_root_dir = __DIR__ + "/../zamples/players"
|
58
|
+
# allow for command line filenames
|
59
|
+
player_description = args.shift
|
60
|
+
unless player_description
|
61
|
+
player_description = AutoWindowFinder.search_for_player_and_url_match(players_root_dir)
|
62
|
+
if player_description
|
63
|
+
p 'auto selected player ' + player_description
|
64
|
+
else
|
65
|
+
player_description = ''
|
66
66
|
end
|
67
|
+
end
|
67
68
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
screen_tracker = ScreenTracker.new_from_yaml File.binread(player_description), overlay
|
95
|
-
does_not_need_mouse_jerk = YAML.load_file(player_description)["does_not_need_mouse_movement"]
|
96
|
-
unless does_not_need_mouse_jerk
|
97
|
-
p 'yes using mouse jitter' if $VERBOSE or $DEBUG
|
98
|
-
Mouse.jitter_forever_in_own_thread # when this ends you know a snapshot was taken...
|
69
|
+
if !File.exist?(player_description)
|
70
|
+
puts 'Please Select Computer Player'
|
71
|
+
player_description = FileChooser.choose_file(" SELECT COMPUTER PLAYER", players_root_dir)
|
72
|
+
raise unless player_description
|
73
|
+
end
|
74
|
+
|
75
|
+
edit_decision_list = args.shift.to_s
|
76
|
+
|
77
|
+
if edit_decision_list == 'test'
|
78
|
+
overlay = nil
|
79
|
+
p 'got test...just doing screen dump'
|
80
|
+
$VERBOSE=true # adds some extra output
|
81
|
+
elsif File.exist? edit_decision_list
|
82
|
+
# accept it from the command line
|
83
|
+
else
|
84
|
+
# assume they want an online player, right? LODO player can tell us...
|
85
|
+
auto_found = AutoWindowFinder.search_for_single_url_match
|
86
|
+
if auto_found
|
87
|
+
p 'auto-discovered open window for EDL, using it ' + auto_found
|
88
|
+
settings = EdlParser.parse_file auto_found
|
89
|
+
if settings["from_url"]
|
90
|
+
require 'tempfile'
|
91
|
+
to = Tempfile.new 'abc'
|
92
|
+
require_relative 'sensible-cinema-dependencies'
|
93
|
+
SensibleSwing::MainWindow.download(settings["from_url"], to.path)
|
94
|
+
edit_decision_list = to.path
|
99
95
|
else
|
100
|
-
|
96
|
+
edit_decision_list = auto_found
|
101
97
|
end
|
102
|
-
|
103
|
-
# exit early if we just wanted a screen dump...a little kludgey...
|
104
|
-
unless overlay
|
105
|
-
puts 'warning--only doing screen dump in t-minus 2s...'
|
106
|
-
sleep 2
|
107
|
-
puts 'snap!'
|
108
|
-
screen_tracker.dump_bmps
|
109
|
-
exit 1
|
110
|
-
end
|
111
|
-
screen_tracker.process_forever_in_thread
|
112
98
|
else
|
113
|
-
puts '
|
99
|
+
puts 'Select Edit Decision List to use'
|
100
|
+
edit_decision_list = FileChooser.choose_file(" SELECT EDIT DECISION LIST", __DIR__ + "/../zamples/edit_decision_lists")
|
101
|
+
end
|
102
|
+
|
103
|
+
if !edit_decision_list
|
104
|
+
puts "error: have to specify a scene descriptions file\n or specify \"test\" on the command line if you just want to snapshot your player"
|
105
|
+
exit 1
|
114
106
|
end
|
115
107
|
|
116
|
-
|
108
|
+
puts 'Selected scene descriptions file ' + File.basename(edit_decision_list) + "\n\t(full path: #{edit_decision_list})"
|
109
|
+
Blanker.startup
|
110
|
+
# todo start it late as it has an annoying startup blip
|
111
|
+
overlay = OverLayer.new(edit_decision_list )
|
112
|
+
end
|
117
113
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
ensure
|
129
|
-
puts "syntax from command line: \"#{player_description}\" \"#{edit_decision_list}\""
|
114
|
+
if File.exist? player_description.to_s
|
115
|
+
puts 'Selected player ' + File.basename(player_description) + "\n\t(full path: #{player_description})"
|
116
|
+
# this one doesn't use any updates, so just pass in file contents, not filename
|
117
|
+
screen_tracker = ScreenTracker.new_from_yaml File.binread(player_description), overlay
|
118
|
+
does_not_need_mouse_jerk = YAML.load_file(player_description)["does_not_need_mouse_movement"]
|
119
|
+
unless does_not_need_mouse_jerk
|
120
|
+
p 'yes using mouse jitter' if $VERBOSE or $DEBUG
|
121
|
+
Mouse.jitter_forever_in_own_thread # when this ends you know a snapshot was taken...
|
122
|
+
else
|
123
|
+
p 'not using mouse jitter' if $VERBOSE or $DEBUG
|
130
124
|
end
|
131
125
|
|
126
|
+
# exit early if we just wanted a screen dump...a little kludgey...
|
127
|
+
unless overlay
|
128
|
+
puts 'warning--only doing screen dump in t-minus 2s...'
|
129
|
+
sleep 2
|
130
|
+
puts 'snap!'
|
131
|
+
screen_tracker.dump_bmps
|
132
|
+
exit 1
|
133
|
+
end
|
134
|
+
screen_tracker.process_forever_in_thread
|
135
|
+
else
|
136
|
+
puts 'warning--not using any screen tracking...'
|
132
137
|
end
|
138
|
+
|
139
|
+
OCR.unserialize_cache_from_disk # do this every time so we don't delete it if they don't have one...
|
140
|
+
|
141
|
+
puts "Opening the curtains... (please play in your other video player now)"
|
142
|
+
overlay.start_thread true
|
143
|
+
key_input = KeyboardInput.new overlay
|
144
|
+
key_input.start_thread # status thread
|
145
|
+
at_exit {
|
146
|
+
Blanker.shutdown # lodo move this and the 'q' key to within overlayer
|
147
|
+
OCR.serialize_cache_to_disk
|
148
|
+
}
|
149
|
+
begin
|
150
|
+
key_input.handle_keystrokes_forever # blocking...
|
151
|
+
ensure
|
152
|
+
puts "syntax from command line: \"#{player_description}\" \"#{edit_decision_list}\""
|
153
|
+
end
|
154
|
+
|
133
155
|
end
|
134
156
|
|
135
157
|
if __FILE__ == $0
|