sensible-cinema 0.28.1 → 0.34.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{README → README.TXT} +35 -14
- data/Rakefile +49 -41
- data/TODO +337 -250
- data/VERSION +1 -1
- data/bin/sensible-cinema +15 -14
- data/bin/sensible-cinema-cli +1 -1
- data/business_ideas.txt +8 -0
- data/change_log_with_feature_list.txt +198 -1
- data/documentation/is_it_legal_to_copy_dvds.txt +44 -30
- data/goc.bat +1 -1
- data/gpl-2.0.txt +339 -0
- data/history_and_related_works_list.txt +37 -33
- data/{cone.png → inventionzy_files/cone.png} +0 -0
- data/legal_draft +23 -0
- data/lib/add_any_bundled_gems_to_load_path.rb +4 -3
- data/lib/check_installed_mac.rb +10 -10
- data/lib/count_down_timer_jruby_swing.rb +4 -4
- data/lib/edl_parser.rb +155 -142
- data/lib/extract/dumpstream.bat +1 -0
- data/lib/extract/get_init.bat +3 -0
- data/lib/extract/pause_early.rb +13 -0
- data/lib/gui/base.rb +707 -0
- data/lib/gui/create-file.rb +244 -0
- data/lib/gui/create.rb +565 -0
- data/lib/gui/dependencies.rb +177 -0
- data/lib/gui/normal.rb +190 -0
- data/lib/gui/{sensible-cinema-upconvert.rb → upconvert.rb} +33 -14
- data/lib/keyboard_input.rb +0 -2
- data/lib/mencoder_wrapper.rb +8 -3
- data/lib/movie_hasher.rb +27 -0
- data/lib/mplayer_edl.rb +1 -0
- data/lib/subtitle_profanity_finder.rb +141 -103
- data/lib/vlc_programmer.rb +1 -1
- data/lib/zoom_player_max_edl.rb +50 -0
- data/{developer_how_to_contribute_to_the_project.txt → notes_for_potential_developers.txt} +18 -11
- data/roadmap_possibilities +12 -0
- data/spec/arse.srt +6 -1
- data/spec/dragon.srt +3 -0
- data/spec/edl_parser.spec.rb +57 -52
- data/spec/mencoder_wrapper.spec.rb +26 -19
- data/spec/mplayer_edl.spec.rb +40 -10
- data/spec/notes +3043 -9
- data/spec/sensible_cinema_gui.spec.rb +8 -3
- data/spec/subtitle_profanity_finder.spec.rb +91 -36
- data/spec/zoom_player_max_edl.spec.rb +29 -0
- data/template_bats/README_DISTRO.TXT +3 -1
- data/template_bats/RUN SENSIBLE CINEMA CLICK HERE WINDOWS.bat +25 -0
- data/template_bats/mac/RUN SENSIBLE CINEMA CLICK HERE.command +2 -1
- data/template_bats/mac/advanced--create or edit sensible cinema edit list files.command +2 -1
- data/template_bats/mac/advanced--run-upconverting-video-player.command +2 -1
- data/template_bats/pc/advanced--create or edit sensible cinema edit list files.bat +2 -0
- data/template_bats/pc/advanced--run-upconverting-video-player.bat +2 -0
- data/todo.inventionzy.txt +69 -2
- data/todo.propaganda +34 -10
- data/todo.upconvert +8 -1
- data/{upconvert_netflix/latest2 → upconvert_from_screen}/go_upscaling.bat +0 -0
- data/{also_see_rogerdpack_youtube_account_and_sourceforge_files_movies_account → upconvert_from_screen/go_upscaling_works} +0 -0
- data/{upconvert_netflix → upconvert_from_screen/old}/latest2/combine_video.avs +0 -0
- data/{upconvert_netflix → upconvert_from_screen/old}/latest2/go_no_upscaling.bat +0 -0
- data/upconvert_from_screen/old/latest2/go_upscaling.bat +12 -0
- data/{upconvert_netflix → upconvert_from_screen/old}/latest2/push2.GRF +0 -0
- data/upconvert_from_screen/old/latest2/push3.grf +0 -0
- data/{upconvert_netflix → upconvert_from_screen/old}/latest2/setup_capture_coords.rb +0 -0
- data/{upconvert_netflix → upconvert_from_screen/old}/latest2/setup_directshow_filter_params.rb +0 -0
- data/{upconvert_netflix → upconvert_from_screen/old}/latest2/upconvert_from_screen_me2.avs +1 -1
- data/{upconvert_netflix → upconvert_from_screen}/old/latest_now_possibly_oudated/push2.GRF +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/latest_now_possibly_oudated/upconvert_from_screen_me2.avs +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/position_window.png +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/push_source_desktop.GRF +0 -0
- data/{upconvert_netflix → upconvert_from_screen/old}/record_screen/record.bat +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/upconvert_from_screen.avs +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/upconvert_from_screen_me.avs +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/upconvert_from_screen_me2.avs +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/upconvert_from_screen_me_push_source.avs +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/uscreen.GRF +0 -0
- data/{upconvert_netflix → upconvert_from_screen}/old/uscreen_me.GRF +0 -0
- data/upconvert_from_screen/push3.grf +0 -0
- data/upconvert_from_screen/upconvert_from_screen_me2.avs +19 -0
- data/vendor/mplayer_patches/apply.bat +12 -0
- data/vendor/{rdp-win32screenshot-0.0.9/RDP_BRANCH_HAS_MASTER_WITH_CORRECT_VERSION_NUMBER → mplayer_patches/configure_from_betterlogic} +0 -0
- data/vendor/mplayer_patches/libdvdnav/2905259c3b45529b3d8dedba572b6e4f67a2d8f4.diff +19 -0
- data/vendor/mplayer_patches/libdvdnav/83f1c9256f500285e46f1e44bcc74ffce90159db.diff +16 -0
- data/vendor/mplayer_patches/libdvdnav/eb91fb74680d30322461a1b9e425918ad4e2b2df.diff +21 -0
- data/vendor/mplayer_patches/libdvdnav/jump_to_time.diff +654 -0
- data/vendor/mplayer_patches/libdvdnav/non_strict.diff +13 -0
- data/vendor/mplayer_patches/mplayer_edl.diff +354 -0
- data/vendor/mplayer_patches/port_dir/PortIndex.quick +2 -0
- data/vendor/mplayer_patches/port_dir/how_to +13 -0
- data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/Portfile +300 -0
- data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/files/configure.x11.patch +20 -0
- data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/files/llvm-gcc-workaround.patch +11 -0
- data/vendor/mplayer_patches/port_dir/multimedia/rdp-projects/Portfile +43 -0
- data/vendor/{rdp-win32screenshot-0.0.9/RDP_VERSION_IS_IN_RDP_BRANCH → mplayer_patches/updated_lib_too} +0 -0
- data/vendor/{readme.txt → readme.txt.setpriority} +0 -0
- data/www/content_editor.html +28 -28
- data/www/index.html +6 -1
- data/www/upconverting_movie_player.html +13 -3
- data/www/youtube_edl/.htaccess +44 -0
- data/{inventionzy_files/control_youtube.html → www/youtube_edl/control_youtube.rhtml} +39 -33
- data/www/youtube_edl/dispatch.fcgi +25 -0
- data/www/youtube_edl/render_edited.rb +25 -0
- data/{inventionzy_files/serve.rb → www/youtube_edl/server_this_dir.rb} +0 -0
- data/www/youtube_edl/todo +23 -0
- data/www/zoomplayer_max.png +0 -0
- data/zamples/edit_decision_lists/dvds/Harry Potter 2 chamber of secrets.txt +10 -5
- data/zamples/edit_decision_lists/dvds/aladdin.txt +30 -0
- data/zamples/edit_decision_lists/dvds/bambi.txt +1 -1
- data/zamples/edit_decision_lists/dvds/big_buck_bunny_dvd.txt +2 -0
- data/zamples/edit_decision_lists/dvds/bobs_big_plan.txt +2 -2
- data/zamples/edit_decision_lists/dvds/cars_2.txt +26 -0
- data/zamples/edit_decision_lists/dvds/cars_disney.txt +1 -1
- data/zamples/edit_decision_lists/dvds/condor_man_widescreen.txt +22 -0
- data/zamples/edit_decision_lists/dvds/court_jester.txt +10 -13
- data/zamples/edit_decision_lists/dvds/edls_being_edited/making_marriage_work.txt +15 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/national_treasure.txt +23 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/ratatouille.txt +35 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/the_explorers.txt +49 -0
- data/zamples/edit_decision_lists/dvds/finding_neverland.txt +32 -0
- data/zamples/edit_decision_lists/dvds/flight_of_the_navigator.txt +22 -16
- data/zamples/edit_decision_lists/dvds/harry_potter_3_prisoner_of_azkaban.txt +21 -4
- data/zamples/edit_decision_lists/dvds/hitchhiker's_guide_to_the_galaxy.txt +1 -1
- data/zamples/edit_decision_lists/dvds/{edls_being_edited/king_of_kings.txt → king_of_kings.txt} +5 -5
- data/zamples/edit_decision_lists/dvds/nanny_mcphee.txt +31 -0
- data/zamples/edit_decision_lists/dvds/pack_jackson_wedding_2007-03-03.txt +9 -2
- data/zamples/edit_decision_lists/dvds/remember_the_titans.txt +35 -0
- data/zamples/edit_decision_lists/dvds/sintel_open_source_blender_ntsc_dvd.txt +8 -4
- data/zamples/edit_decision_lists/dvds/speed_racer.txt +1 -1
- data/zamples/edit_decision_lists/dvds/tangled.txt +21 -0
- data/zamples/edit_decision_lists/dvds/tron_legacy.txt +4 -1
- data/zamples/edit_decision_lists/files/conference_music_video.txt +10 -0
- data/zamples/edit_decision_lists/notes_on_movies_without_edls_yet/tron.txt +10 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/example_edit_decision_list.txt +1 -1
- metadata +139 -117
- data/conclusions +0 -6
- data/documentation/how_to_create_your_own_delete_lists.txt +0 -69
- data/lib/gui/sensible-cinema-base.rb +0 -620
- data/lib/gui/sensible-cinema-create.rb +0 -331
- data/lib/gui/sensible-cinema-dependencies.rb +0 -28
- data/lib/gui/sensible-cinema-normal.rb +0 -351
- data/lib/gui/sensible-cinema-side-by-side.rb +0 -27
- data/lib/shutdown_kill.rb +0 -32
- data/lib/storage.rb +0 -105
- data/ocr.todo_if_need_speed +0 -6
- data/upconvert_netflix/record_screen/recording/1.png +0 -0
- data/upconvert_netflix/record_screen/recording/10.png +0 -0
- data/upconvert_netflix/record_screen/recording/2.png +0 -0
- data/upconvert_netflix/record_screen/recording/3.png +0 -0
- data/upconvert_netflix/record_screen/recording/4.png +0 -0
- data/upconvert_netflix/record_screen/recording/5.png +0 -0
- data/upconvert_netflix/record_screen/recording/6.png +0 -0
- data/upconvert_netflix/record_screen/recording/7.png +0 -0
- data/upconvert_netflix/record_screen/recording/8.png +0 -0
- data/upconvert_netflix/record_screen/recording/9.png +0 -0
- data/upconvert_netflix/record_screen/recording/d.png +0 -0
- data/vendor/monkey.png +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/.document +0 -5
- data/vendor/rdp-win32screenshot-0.0.9/History.rdoc +0 -53
- data/vendor/rdp-win32screenshot-0.0.9/LICENSE +0 -20
- data/vendor/rdp-win32screenshot-0.0.9/README.rdoc +0 -95
- data/vendor/rdp-win32screenshot-0.0.9/Rakefile +0 -63
- data/vendor/rdp-win32screenshot-0.0.9/VERSION +0 -1
- data/vendor/rdp-win32screenshot-0.0.9/enumerated +0 -55576
- data/vendor/rdp-win32screenshot-0.0.9/lib/aero_offscreen_srccopy_captureblt_doesnt_have_everything.bmp.gz +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/lib/enumerate.rb +0 -6
- data/vendor/rdp-win32screenshot-0.0.9/lib/firefox.bmp +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/lib/normal.bmp +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/lib/normal2.bmp +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/lib/notes +0 -5
- data/vendor/rdp-win32screenshot-0.0.9/lib/snapshot.rb +0 -10
- data/vendor/rdp-win32screenshot-0.0.9/lib/srccopy.bmp +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/lib/srccopyplus.bmp +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/lib/srccopyplusdirectx.bmp +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/lib/vc.bmp +0 -0
- data/vendor/rdp-win32screenshot-0.0.9/lib/win32/screenshot.rb +0 -95
- data/vendor/rdp-win32screenshot-0.0.9/lib/win32/screenshot/bitmap_maker.rb +0 -200
- data/vendor/rdp-win32screenshot-0.0.9/lib/win32/util.rb +0 -93
- data/vendor/rdp-win32screenshot-0.0.9/spec/spec.opts +0 -1
- data/vendor/rdp-win32screenshot-0.0.9/spec/spec_helper.rb +0 -85
- data/vendor/rdp-win32screenshot-0.0.9/spec/win32_screenshot_spec.rb +0 -194
- data/vendor/rdp-win32screenshot-0.0.9/spec/win32_screenshot_util_spec.rb +0 -75
- data/vendor/rdp-win32screenshot-0.0.9/win32screenshot.gemspec +0 -69
- data/vendor/tsmuxer_1.10.6/licence.txt +0 -42
- data/zamples/edit_decision_lists/dvds/making_marriage_work.txt +0 -15
- data/zamples/edit_decision_lists/notes/tron.txt +0 -4
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/making marriage work.txt +0 -9
@@ -0,0 +1,177 @@
|
|
1
|
+
require 'java'
|
2
|
+
|
3
|
+
require 'sane'
|
4
|
+
|
5
|
+
module SensibleSwing
|
6
|
+
|
7
|
+
class MainWindow < javax.swing.JFrame
|
8
|
+
|
9
|
+
|
10
|
+
def force_accept_license_first
|
11
|
+
if !(LocalStorage['main_license_accepted'] == VERSION)
|
12
|
+
require_blocking_license_accept_dialog 'Sensible Cinema', 'gplv3', 'http://www.gnu.org/licenses/gpl.html', 'Sensible Cinema license agreement',
|
13
|
+
"Sensible Cinema is distributed under the gplv3 (http://www.gnu.org/licenses/gpl.html).\nBY CLICKING \"accept\" YOU SIGNIFY THAT YOU HAVE READ, UNDERSTOOD AND AGREED TO ABIDE BY THE TERMS OF THIS AGREEMENT"
|
14
|
+
require_blocking_license_accept_dialog 'Sensible Cinema', 'is_it_legal_to_copy_dvds.txt file', File.expand_path(File.dirname(__FILE__) + "/../../documentation/is_it_legal_to_copy_dvds.txt"),
|
15
|
+
'is_it_legal_to_copy_dvds.txt file', 'I acknowledge that I have read, understand, accept and agree to abide by the implications noted in the documentation/is_it_legal_to_copy_dvds.txt file'
|
16
|
+
if JOptionPane.show_select_buttons_prompt("Would you like to use this with Zoom Player MAX's scene cuts [3rd party player program, costs $], or just MPlayer [free]", :yes => "ZoomPlayer MAX", :no => "Just MPlayer") == :yes
|
17
|
+
LocalStorage['have_zoom_button'] = true
|
18
|
+
end
|
19
|
+
LocalStorage['main_license_accepted'] = VERSION
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.download full_url, to_here
|
24
|
+
require 'open-uri'
|
25
|
+
require 'openssl'
|
26
|
+
eval("OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE") if full_url =~ /https/
|
27
|
+
keep_going_bg_thread = true
|
28
|
+
print 'working'
|
29
|
+
Thread.new { while keep_going_bg_thread; print '.'; sleep 1; end}
|
30
|
+
writeOut = open(to_here, "wb")
|
31
|
+
writeOut.write(open(full_url).read)
|
32
|
+
writeOut.close
|
33
|
+
keep_going_bg_thread = false
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.download_to_string full_url
|
37
|
+
require 'tempfile'
|
38
|
+
to = Tempfile.new 'abc'
|
39
|
+
download(full_url, to.path)
|
40
|
+
out = File.binread(to.path)
|
41
|
+
to.delete
|
42
|
+
out
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def download_7zip
|
47
|
+
Dir.mkdir('./vendor/cache') unless File.directory? 'vendor/cache' # development may not have it created yet... [?]
|
48
|
+
unless File.exist? 'vendor/cache/7za.exe'
|
49
|
+
Dir.chdir('vendor/cache') do
|
50
|
+
print 'downloading unzipper (7zip--400K) ...'
|
51
|
+
MainWindow.download("http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip", "7za920.zip")
|
52
|
+
system_blocking("../unzip.exe -o 7za920.zip") # -o means "overwrite" without prompting
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def download_zip_file_and_extract english_name, url, to_this
|
58
|
+
download_7zip
|
59
|
+
Dir.chdir('vendor/cache') do
|
60
|
+
file_name = url.split('/')[-1]
|
61
|
+
print "downloading #{english_name} ..."
|
62
|
+
MainWindow.download(url, file_name)
|
63
|
+
system_blocking("7za e #{file_name} -y -o#{to_this}")
|
64
|
+
puts 'done ' + english_name
|
65
|
+
# creates vendor/cache/mencoder/mencoder.exe...
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def check_for_exe windows_full_loc, unix_name
|
70
|
+
# in windows, that exe *at that location* must exist...
|
71
|
+
if OS.windows?
|
72
|
+
File.exist?(windows_full_loc)
|
73
|
+
else
|
74
|
+
require 'lib/check_installed_mac.rb'
|
75
|
+
if !CheckInstalledMac.check_for_installed(unix_name)
|
76
|
+
exit 1 # it'll have already displayed a message...
|
77
|
+
else
|
78
|
+
true
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def check_for_file_manipulation_dependencies
|
84
|
+
|
85
|
+
if !check_for_exe('vendor/cache/mencoder/mencoder.exe', 'mencoder') # both use it now, since we have to use our own mplayer.exe for now...
|
86
|
+
require_blocking_license_accept_dialog 'mplayer', 'gplv2', 'http://www.gnu.org/licenses/gpl-2.0.html', "Appears that you need to install a dependency: mplayer with mencoder."
|
87
|
+
download_zip_file_and_extract "Mplayer/mencoder (6MB)", "http://sourceforge.net/projects/mplayer-win32/files/MPlayer%20and%20MEncoder/revision%2034118/MPlayer-rtm-svn-34118.7z", "mencoder"
|
88
|
+
old = File.binread 'vendor/cache/mencoder/mplayer.exe'
|
89
|
+
old.gsub! "V:%6.1f", "V:%6.2f" # better precision! :)
|
90
|
+
File.binwrite('vendor/cache/mencoder/mplayer.exe', old)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def check_for_various_dependencies
|
95
|
+
|
96
|
+
if OS.doze? && !check_for_exe('vendor/cache/mplayer_edl/mplayer.exe', nil)
|
97
|
+
require_blocking_license_accept_dialog 'Mplayer-EDL', 'gplv2', 'http://www.gnu.org/licenses/gpl-2.0.html', "Appears that you need to install a dependency: mplayer EDL "
|
98
|
+
FileUtils.mkdir_p 'vendor/cache/mplayer_edl'
|
99
|
+
puts 'downloading mplayer edl [10 MB]'
|
100
|
+
MainWindow.download('http://sourceforge.net/projects/mplayer-edl/files/mplayer.exe', 'vendor/cache/mplayer_edl/mplayer.exe')
|
101
|
+
config_dir = File.expand_path('~/mplayer')
|
102
|
+
FileUtils.mkdir(config_dir) unless File.directory?(config_dir)
|
103
|
+
FileUtils.cp('vendor/subfont.ttf', config_dir) # TODO mac
|
104
|
+
end
|
105
|
+
|
106
|
+
# runtime dependencies, at least as of today...
|
107
|
+
ffmpeg_exe_loc = File.expand_path('vendor/cache/ffmpeg/ffmpeg.exe') # I think file basd normal needs ffmpeg
|
108
|
+
if !check_for_exe(ffmpeg_exe_loc, 'ffmpeg')
|
109
|
+
require_blocking_license_accept_dialog 'ffmpeg', 'gplv2', 'http://www.gnu.org/licenses/gpl-2.0.html', "Appears that you need to install a dependency: ffmpeg."
|
110
|
+
download_zip_file_and_extract "ffmpeg (5MB)", "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-git-335bbe4-win32-static.7z", "ffmpeg"
|
111
|
+
end
|
112
|
+
if OS.mac?
|
113
|
+
check_for_exe("mplayer", "mplayer") # mencoder and mplayer are separate for mac... [this checks for mac's mplayerx, too]
|
114
|
+
else
|
115
|
+
path = RubyWhich.new.which('smplayer')
|
116
|
+
if(path.length == 0)
|
117
|
+
# this one has its own installer...
|
118
|
+
require_blocking_license_accept_dialog 'Smplayer', 'gplv2', 'http://www.gnu.org/licenses/gpl-2.0.html', "Appears that you need to install a dependency: smplayer."
|
119
|
+
save_to_dir = SwingHelpers.new_existing_dir_chooser_and_go 'pick dir to save smplayer exe installer to:'
|
120
|
+
save_to_file = "#{save_to_dir}/smplayer-0.6.9-win32.exe"
|
121
|
+
puts "downloading smplayer.exe [14MB] to #{save_to_file}"
|
122
|
+
MainWindow.download "http://sourceforge.net/projects/smplayer/files/SMPlayer/0.6.9/smplayer-0.6.9-win32.exe", save_to_file
|
123
|
+
show_blocking_message_dialog "Run this file to install it (ok to reveal): smplayer-0.6.9-win32.exe"
|
124
|
+
show_in_explorer save_to_file
|
125
|
+
sleep 2
|
126
|
+
show_blocking_message_dialog "hit ok after smplayer is installed:"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def assert_ownership_dialog
|
132
|
+
message = "Do you certify you own the DVD this came of and have it in your possession, if it came from a DVD?"
|
133
|
+
title = "Verify ownership"
|
134
|
+
returned = JOptionPane.show_select_buttons_prompt(message, {:yes => "no", :no => "yes"})
|
135
|
+
assert_confirmed_dialog returned, nil
|
136
|
+
end
|
137
|
+
|
138
|
+
def require_blocking_license_accept_dialog program, license_name, license_url_should_also_be_embedded_by_you_in_message,
|
139
|
+
title = 'Confirm Acceptance of License Agreement', message = nil
|
140
|
+
puts 'Please confirm license agreement in open window before proceeding.'
|
141
|
+
|
142
|
+
message ||= "Sensible Cinema requires a separately installed program (#{program}), not yet installed.
|
143
|
+
You can install this program manually to the vendor/cache subdirectory, or Sensible Cinema can download it for you.
|
144
|
+
By clicking accept, below, you are confirming that you have read and agree to be bound by the
|
145
|
+
terms of its license (the #{license_name}), located at #{license_url_should_also_be_embedded_by_you_in_message}.
|
146
|
+
Click 'View License' to view it. If you do not agree to these terms, click 'Cancel'. You also agree that this is a
|
147
|
+
separate program, with its own distribution, license, ownership and copyright.
|
148
|
+
You agree that you are responsible for the download and use of this program, within sensible cinema or otherwise."
|
149
|
+
answer = JOptionPane.show_select_buttons_prompt message, :no => "I have read and Accept the terms of the #{license_name} License Agreement.", :yes => "View #{license_name}"
|
150
|
+
assert_confirmed_dialog answer, license_url_should_also_be_embedded_by_you_in_message
|
151
|
+
p 'confirmation of sensible cinema related license duly noted of: ' + license_name # LODO require all licenses together :P
|
152
|
+
end
|
153
|
+
|
154
|
+
def assert_confirmed_dialog returned, license_url_should_also_be_embedded_by_you_in_message
|
155
|
+
# :yes is "view license", :no is "accept", :cancel
|
156
|
+
if returned == :yes
|
157
|
+
if license_url_should_also_be_embedded_by_you_in_message
|
158
|
+
SwingHelpers.open_url_to_view_it_non_blocking license_url_should_also_be_embedded_by_you_in_message
|
159
|
+
puts "Please restart after reading license agreement, to be able to then accept it."
|
160
|
+
else
|
161
|
+
puts 'dialog assertion failed'
|
162
|
+
end
|
163
|
+
System.exit 0
|
164
|
+
elsif returned == :cancel
|
165
|
+
p 'license not accepted...exiting'
|
166
|
+
System.exit 1
|
167
|
+
elsif returned == :exited
|
168
|
+
p 'license exited early...exiting'
|
169
|
+
System.exit 1
|
170
|
+
elsif returned == :no
|
171
|
+
# ok
|
172
|
+
else
|
173
|
+
raise 'unknown?'
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
data/lib/gui/normal.rb
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
#!/usr/bin/ruby # so my editor will like the file...
|
2
|
+
=begin
|
3
|
+
Copyright 2010, Roger Pack
|
4
|
+
This file is part of Sensible Cinema.
|
5
|
+
|
6
|
+
Sensible Cinema is free software: you can redistribute it and/or modify
|
7
|
+
it under the terms of the GNU General Public License as published by
|
8
|
+
the Free Software Foundation, either version 3 of the License, or
|
9
|
+
(at your option) any later version.
|
10
|
+
|
11
|
+
Sensible Cinema is distributed in the hope that it will be useful,
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
GNU General Public License for more details.
|
15
|
+
|
16
|
+
You should have received a copy of the GNU General Public License
|
17
|
+
along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
=end
|
19
|
+
|
20
|
+
module SensibleSwing
|
21
|
+
|
22
|
+
class MainWindow < JFrame
|
23
|
+
|
24
|
+
attr_accessor :parent, :upconv_line
|
25
|
+
|
26
|
+
# converts to full path, 8.3 if on doze
|
27
|
+
def normalize_path path
|
28
|
+
path = File.expand_path path
|
29
|
+
path = EightThree.convert_path_to_8_3 path if OS.doze?
|
30
|
+
end
|
31
|
+
def hard_exit; java::lang::System.exit 0; end
|
32
|
+
def setup_normal_buttons
|
33
|
+
add_text_line ""
|
34
|
+
|
35
|
+
@mplayer_edl = new_jbutton( watch_edited_text="Watch currently mounted DVD edited (realtime)" )
|
36
|
+
@mplayer_edl.tool_tip = "This will watch your DVD in realtime from your computer while skipping/muting questionable scenes."
|
37
|
+
@mplayer_edl.on_clicked {
|
38
|
+
play_smplayer_edl_non_blocking
|
39
|
+
sleep 5
|
40
|
+
puts 'enjoy your movie playing in other window'
|
41
|
+
sleep 1
|
42
|
+
hard_exit # paranoid on usage LOL
|
43
|
+
}
|
44
|
+
|
45
|
+
add_callback_for_dvd_edl_present { |disk_available, edl_available|
|
46
|
+
b = @mplayer_edl
|
47
|
+
if disk_available
|
48
|
+
if edl_available
|
49
|
+
b.enable
|
50
|
+
b.text=watch_edited_text
|
51
|
+
else
|
52
|
+
b.enable # leave it enabled in case it's some nonstandard form of a disk that does have one [?]
|
53
|
+
b.text= watch_edited_text + " [disk has no Edit List Available!]"
|
54
|
+
end
|
55
|
+
else
|
56
|
+
@mplayer_edl.disable
|
57
|
+
@mplayer_edl.text=watch_edited_text + " [no disk presently inserted]"
|
58
|
+
end
|
59
|
+
}
|
60
|
+
|
61
|
+
@watch_file_edl = new_jbutton( "Watch movie file edited (realtime)" ) do
|
62
|
+
choose_file_and_edl_and_create_sxs_or_play false
|
63
|
+
end
|
64
|
+
|
65
|
+
@create = new_jbutton( "Create edited version of a file on Your Hard Drive" )
|
66
|
+
@create.tool_tip = <<-EOL
|
67
|
+
This takes a file and creates a new file on your hard disk like dvd_name_edited.mpg that you can watch when it's done.
|
68
|
+
The file you create will contain the whole movie edited.
|
69
|
+
It takes quite awhile maybe 2 hours. Sometimes the progress bar will look paused--it typically continues eventually.
|
70
|
+
EOL
|
71
|
+
@create.on_clicked {
|
72
|
+
check_for_file_manipulation_dependencies
|
73
|
+
do_create_edited_copy_via_file false
|
74
|
+
}
|
75
|
+
|
76
|
+
if LocalStorage[UpConvertEnglish] # LODO no tight coupling like this
|
77
|
+
add_text_line ''
|
78
|
+
add_open_documentation_button
|
79
|
+
@upconv_line = add_text_line " #{get_current_upconvert_as_phrase}"
|
80
|
+
else
|
81
|
+
@upconv_line = add_text_line ''
|
82
|
+
add_open_documentation_button
|
83
|
+
end
|
84
|
+
|
85
|
+
@show_upconvert_options = new_jbutton("Tweak Preferences [timing, upconversion]") do
|
86
|
+
get_set_preference 'mplayer_beginning_buffer', "How much extra \"buffer\" time to add at the beginning of all cuts/mutes in normal mode [for added safety sake]."
|
87
|
+
show_blocking_message_dialog "You will now be able to set some upconversion options, which makes the playback look nicer but uses more cpu [if desired].\nClose the window when finished."
|
88
|
+
upconvert_window = new_child_window
|
89
|
+
upconvert_window.add_change_upconvert_buttons
|
90
|
+
end
|
91
|
+
@show_upconvert_options.tool_tip= "Allows you to set your upconvert options.\nUpconverting attempts to playback your movie with higher quality on high resolution monitors."
|
92
|
+
|
93
|
+
new_jbutton("Create new Edit Decision List") do
|
94
|
+
window = new_child_window
|
95
|
+
window.setup_advanced_buttons
|
96
|
+
end
|
97
|
+
|
98
|
+
@progress_bar = JProgressBar.new(0, 100)
|
99
|
+
@progress_bar.set_bounds(44,@starting_button_y,@button_width,23)
|
100
|
+
@progress_bar.visible = false
|
101
|
+
@panel.add @progress_bar
|
102
|
+
add_text_line ""# spacing
|
103
|
+
end
|
104
|
+
|
105
|
+
def get_set_preference name, english_name
|
106
|
+
old_preference = LocalStorage[name]
|
107
|
+
old_class = old_preference.class
|
108
|
+
new_preference = get_user_input("Enter value for #{english_name}", old_preference)
|
109
|
+
display_and_raise 'enter something like 0.0' if new_preference.empty?
|
110
|
+
if old_class == Float
|
111
|
+
new_preference = new_preference.to_f
|
112
|
+
elsif old_class == String
|
113
|
+
# leave same
|
114
|
+
else
|
115
|
+
raise 'unknown type?' + old_class.to_s
|
116
|
+
end
|
117
|
+
LocalStorage[name] = new_preference
|
118
|
+
end
|
119
|
+
|
120
|
+
def add_open_documentation_button
|
121
|
+
@open_help_file = new_jbutton("View Sensible Cinema Documentation") do
|
122
|
+
show_in_explorer __DIR__ + "/../../documentation"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# side by side stuff we haven't really factored out yet, also doubles for both normal/create LODO
|
127
|
+
def choose_file_and_edl_and_create_sxs_or_play just_create_dot_edl_file_instead_of_play
|
128
|
+
filename_mpg = new_existing_file_selector_and_select_file( "Pick moviefile (like moviename.mpg or video_ts/anything.ext)")
|
129
|
+
edl_filename = new_existing_file_selector_and_select_file( "Pick an EDL file to use with it", EdlParser::EDL_DIR)
|
130
|
+
assert_ownership_dialog
|
131
|
+
if just_create_dot_edl_file_instead_of_play
|
132
|
+
descriptors = EdlParser.parse_file edl_filename
|
133
|
+
# LODO these timings...DRY up...plus is XBMC the same? what about on a slower computer?
|
134
|
+
# NB these are just for the Side by side EDL's!
|
135
|
+
|
136
|
+
edl_contents = MplayerEdl.convert_to_edl descriptors, add_secs_end = MplayerEndBuffer, MplayerBeginingBuffer, splits = []
|
137
|
+
output_file = filename_mpg.gsub(/\.[^\.]+$/, '') + '.edl' # sanitize...
|
138
|
+
File.write(output_file, edl_contents)
|
139
|
+
raise unless File.exist?(output_file) # sanity
|
140
|
+
show_blocking_message_dialog("created #{output_file}")
|
141
|
+
else
|
142
|
+
play_smplayer_edl_non_blocking [filename_mpg, edl_filename]
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def we_are_in_upconvert_mode
|
147
|
+
ARGV.index("--upconvert-mode")
|
148
|
+
end
|
149
|
+
|
150
|
+
def setup_default_buttons
|
151
|
+
if we_are_in_upconvert_mode
|
152
|
+
add_play_upconvert_buttons
|
153
|
+
else
|
154
|
+
if we_are_in_create_mode
|
155
|
+
setup_advanced_buttons
|
156
|
+
add_text_line 'Contact:'
|
157
|
+
else
|
158
|
+
setup_normal_buttons
|
159
|
+
end
|
160
|
+
|
161
|
+
@upload = new_jbutton("Feedback/submissions welcome!") # keeps this one last! :)
|
162
|
+
@upload.tool_tip = "We welcome all feedback!\nQuestion, comments, request help.\nAlso if you create a new EDL, please submit it back to us so that others can benefit from it later!"
|
163
|
+
@upload.on_clicked {
|
164
|
+
show_blocking_message_dialog "ok, will open up the groups page now and optionally an email to it"
|
165
|
+
system_non_blocking("start mailto:sensible-cinema@googlegroups.com")
|
166
|
+
system_non_blocking("start http://groups.google.com/group/sensible-cinema")
|
167
|
+
}
|
168
|
+
increment_button_location
|
169
|
+
|
170
|
+
end # big else
|
171
|
+
|
172
|
+
@exit = new_jbutton("Exit", "Exits the application and kills any background processes that are running at all--don't exit unless you are done processing all the way!")
|
173
|
+
@exit.on_clicked {
|
174
|
+
Thread.new { self.close } # don't waste the time to close it :P
|
175
|
+
puts 'Thank you for using Sensible Cinema. Come again!'
|
176
|
+
System.exit 0
|
177
|
+
}
|
178
|
+
|
179
|
+
increment_button_location
|
180
|
+
increment_button_location
|
181
|
+
self
|
182
|
+
|
183
|
+
end
|
184
|
+
def get_disk_chooser_window names
|
185
|
+
DropDownSelector.new(self, names, "Click to select DVD drive")
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
@@ -8,18 +8,28 @@ module SensibleSwing
|
|
8
8
|
@watch_file_upconvert = new_jbutton( "Watch a movie file upconverted (unedited)") do
|
9
9
|
popup = warn_if_no_upconvert_options_currently_selected
|
10
10
|
filename_mpg = new_existing_file_selector_and_select_file( "pick movie file (like moviename.mpg)")
|
11
|
-
thread =
|
11
|
+
thread = play_smplayer_edl_non_blocking [filename_mpg, nil]
|
12
12
|
when_thread_done(thread) { popup.dispose }
|
13
13
|
end
|
14
14
|
@watch_file_upconvert.tool_tip= "This plays back a movie file, like moviefile.mpg, or moviename.vob using your current upconverter settings.\nTo playback a file edited upconverted, set upconvert options here first, then run them using sensible cinema main--it will automatically use your new upconverting options.\n" # LODO
|
15
15
|
|
16
16
|
@watch_dvd_upconvert = new_jbutton( "Watch a DVD upconverted (unedited)") do
|
17
17
|
popup = warn_if_no_upconvert_options_currently_selected
|
18
|
-
thread = play_dvd_smplayer_unedited false
|
18
|
+
thread = play_dvd_smplayer_unedited false
|
19
19
|
when_thread_done(thread) { popup.dispose }
|
20
20
|
end
|
21
21
|
@watch_dvd_upconvert.tool_tip = "Plays back the currently inserted DVD, using your current upconverter settings.\nIf it fails (dies immediately, blank screen, etc.), try setting upconvert options to a smaller screen resolution multiple.\nOr try playing the DVD with VLC first, then it might work.\nTo playback a DVD edited upconverted, set upconvert options here first, then run them using sensible cinema main--it will automatically use your new upconverting options."
|
22
22
|
|
23
|
+
@watch_online = new_jbutton( "Watch upconverted online player, like netflix instant") do
|
24
|
+
show_blocking_message_dialog("sorry not mac compat. yet") and raise unless OS.doze?
|
25
|
+
answer = JOptionPane.show_select_buttons_prompt("Warning: you must have the screen capture device installed (install MSVC 2010 runtime x86 first), and also configured using its setup utility, and avisynth installed.", :yes => 'take me to its website', :no => 'I already and configured it, let me at it!')
|
26
|
+
if answer == :yes
|
27
|
+
SwingHelpers.open_url_to_view_it_non_blocking "https://github.com/rdp/screen-capture-recorder-to-video-windows-free"
|
28
|
+
raise 'install it'
|
29
|
+
end
|
30
|
+
run_smplayer_non_blocking "upconvert_from_screen/upconvert_from_screen_me2.avs", nil, '', force_mplayer = true, true, false, nil
|
31
|
+
end
|
32
|
+
|
23
33
|
add_text_line ''
|
24
34
|
@upconv_line = add_text_line ''
|
25
35
|
change_upconvert_line_to_current
|
@@ -37,10 +47,10 @@ module SensibleSwing
|
|
37
47
|
LocalStorage[UpConvertEnglish].present?
|
38
48
|
end
|
39
49
|
|
40
|
-
LocalStorage.set_default('screen_multiples',
|
50
|
+
LocalStorage.set_default('screen_multiples', 1.0)
|
41
51
|
|
42
52
|
def add_change_upconvert_options_button
|
43
|
-
@show_upconvert_options = new_jbutton("
|
53
|
+
@show_upconvert_options = new_jbutton("Tweak Playback Upconversion Quality Settings") do
|
44
54
|
upconvert_window = new_child_window
|
45
55
|
upconvert_window.add_change_upconvert_buttons
|
46
56
|
end
|
@@ -92,18 +102,26 @@ module SensibleSwing
|
|
92
102
|
display_current_upconvert_setting_and_close_window
|
93
103
|
# -Processing method: mplayer with accurate deblocking ???
|
94
104
|
}
|
95
|
-
new_jbutton("Set upconvert options to experimental
|
96
|
-
LocalStorage[UpConvertKey] = "scale
|
97
|
-
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=
|
98
|
-
LocalStorage[UpConvertEnglish] = "experimental"
|
105
|
+
new_jbutton("Set upconvert options to experimental screen-upconverting playback") {
|
106
|
+
LocalStorage[UpConvertKey] = "scale=SCREEN_X:-10:0:0:3" # no hqdn3d
|
107
|
+
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=25.0"
|
108
|
+
LocalStorage[UpConvertEnglish] = "experimental screenupconversion"
|
99
109
|
display_current_upconvert_setting_and_close_window
|
100
110
|
}
|
101
111
|
|
112
|
+
new_jbutton("Set upconvert options to whatever you want [like -sws 9 -ssf ls=100.0 -- for advanced users]") {
|
113
|
+
new_settings = get_user_input("you can set -vf settings, and then other settings. What would you like your -vf settings to be?")
|
114
|
+
LocalStorage[UpConvertKey] = new_settings
|
115
|
+
other_settings = get_user_input("other settings you'd like to also have add:")
|
116
|
+
LocalStorage[UpConvertKeyExtra] = other_settings
|
117
|
+
LocalStorage[UpConvertEnglish] = "personalized: -vf #{new_settings}, #{other_settings}"
|
118
|
+
}
|
119
|
+
|
102
120
|
# TODO tooltip from docu here +- this into tooltip
|
103
121
|
# TODO "click here" link for more docu [?]
|
104
122
|
add_text_line "Multiple factor screen widths"
|
105
|
-
add_text_line " (higher
|
106
|
-
add_text_line " If mplayer just dies or displays only a black or white screen then lower this setting."
|
123
|
+
add_text_line " (higher might be better, uses more cpu)."
|
124
|
+
add_text_line " If mplayer just dies or displays only a black or white screen then lower this setting, it is too high."
|
107
125
|
slider = JSlider.new
|
108
126
|
slider.setBorder(BorderFactory.createTitledBorder("Screen resolution multiple"));
|
109
127
|
|
@@ -175,7 +193,7 @@ module SensibleSwing
|
|
175
193
|
output_dir = get_same_drive_friendly_clean_temp_dir 'temp_upscaled_video_out'
|
176
194
|
output_command = '-ss 2:44 -frames 300 -vo png:outdir="' + File.strip_drive_windows(output_dir) + '"'
|
177
195
|
output_command += " -noframedrop" # don't want them to skip frames on cpu's without enough power to keep up
|
178
|
-
thread =
|
196
|
+
thread = play_smplayer_edl_non_blocking [filename_mpg, nil], [output_command], true
|
179
197
|
when_thread_done(thread) { popup.dispose; show_in_explorer(output_dir) }
|
180
198
|
end
|
181
199
|
@generate_images.tool_tip = "This creates a folder with images upconverted from some DVD or file, so you can tweak settings and compare." # TODO more tooltips
|
@@ -184,7 +202,7 @@ module SensibleSwing
|
|
184
202
|
popup = warn_if_no_upconvert_options_currently_selected
|
185
203
|
filename_mpg = new_existing_file_selector_and_select_file( "pick movie file (like moviename.mpg)")
|
186
204
|
output_dir = get_same_drive_friendly_clean_temp_dir 'temp_screencast_dir'
|
187
|
-
thread1 =
|
205
|
+
thread1 = play_smplayer_edl_non_blocking [filename_mpg, nil], [" -ss 2:44 -endpos 11"]
|
188
206
|
# screen capture for 10s
|
189
207
|
fps_to_grab = 5
|
190
208
|
thread2 = Thread.new { c = %!ffmpeg -f dshow -i video="screen-capture-recorder" -r #{fps_to_grab} -vframes #{fps_to_grab*10} -y #{File.strip_drive_windows(output_dir)}/%d.png!; system_blocking c }
|
@@ -220,7 +238,7 @@ module SensibleSwing
|
|
220
238
|
out = "Upconvert options are now #{ settings ? "set to #{settings} style" : "NOT SET"}"
|
221
239
|
if settings
|
222
240
|
multiple = LocalStorage[ScreenMultipleFactor]
|
223
|
-
out += " (screen multiplier #{
|
241
|
+
out += " (screen multiplier #{multiple}*#{get_current_max_width_resolution} = #{(multiple * get_current_max_width_resolution).to_i}px)."
|
224
242
|
end
|
225
243
|
out
|
226
244
|
end
|
@@ -236,6 +254,7 @@ module SensibleSwing
|
|
236
254
|
screen_multiple = LocalStorage[ScreenMultipleFactor]
|
237
255
|
upc = template.gsub('SCREEN_X', (get_current_max_width_resolution*screen_multiple).to_i.to_s) # has to be an integer...
|
238
256
|
upc = 'pullup,softskip,' + upc
|
257
|
+
show_non_blocking_message_dialog 'using upconvert settings ' + upc
|
239
258
|
p 'using upconvert settings: ' + upc
|
240
259
|
upc
|
241
260
|
else
|
@@ -251,4 +270,4 @@ module SensibleSwing
|
|
251
270
|
|
252
271
|
end
|
253
272
|
end
|
254
|
-
|
273
|
+
|