content-editing-movie-player 0.38.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +3 -0
- data/.rvmrc +1 -0
- data/LICENSE.TXT +20 -0
- data/README.TXT +225 -0
- data/Rakefile +206 -0
- data/TODO +740 -0
- data/VERSION +1 -0
- data/_DO_NOT_RUN_IT_FROM_HERE_DOWNLOAD_THE_RELEASE_ZIP_FROM_SOURCEFORGE_INSTEAD +0 -0
- data/bin/sensible-cinema +60 -0
- data/bin/sensible-cinema-cli +161 -0
- data/business_ideas.txt +21 -0
- data/change_log_with_feature_list.txt +952 -0
- data/documentation/DOCUMENTATION_README.TXT +44 -0
- data/documentation/how_to_get_files_from_dvd.txt +30 -0
- data/documentation/is_it_legal_to_copy_dvds.txt +97 -0
- data/documentation/troubleshooting.txt +30 -0
- data/documentation/upconversion.txt +4 -0
- data/experimental_online_player_ocr_readme.txt +45 -0
- data/go +1 -0
- data/go.bat +2 -0
- data/go.sh +1 -0
- data/go_ocr_tracker.bat +1 -0
- data/goc +1 -0
- data/goc.bat +1 -0
- data/goc.sh +1 -0
- data/gpl-2.0.txt +339 -0
- data/gplv3.txt +219 -0
- data/history_and_related_works_list.txt +108 -0
- data/inventionzy_files/cone.png +0 -0
- data/inventionzy_files/md5s.txt +53 -0
- data/inventionzy_files/play_with_inserted_scene.bat +8 -0
- data/inventionzy_files/play_with_overlay.bat +24 -0
- data/inventionzy_files/transcript_mute_vlc.txt +117 -0
- data/legal_draft +23 -0
- data/lib/add_any_bundled_gems_to_load_path.rb +32 -0
- data/lib/auto_window_finder.rb +41 -0
- data/lib/blanker.rb +104 -0
- data/lib/check_installed_mac.rb +34 -0
- data/lib/convert_thirty_fps.rb +20 -0
- data/lib/edl_parser.rb +387 -0
- data/lib/eight_three.rb +28 -0
- 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/fake_blanker.rb +35 -0
- data/lib/frame_accurate.rb +3 -0
- data/lib/gui/base.rb +748 -0
- data/lib/gui/create-file.rb +24 -0
- data/lib/gui/create.rb +581 -0
- data/lib/gui/dependencies.rb +219 -0
- data/lib/gui/normal.rb +123 -0
- data/lib/gui/upconvert.rb +284 -0
- data/lib/keyboard_input.rb +60 -0
- data/lib/media_info_parser.rb +27 -0
- data/lib/mouse_forever.rb +19 -0
- data/lib/movie_hasher.rb +27 -0
- data/lib/mplayer_edl.rb +42 -0
- data/lib/muter.rb +87 -0
- data/lib/ocr.rb +125 -0
- data/lib/ocr_seed/netflix_b9.bmp +0 -0
- data/lib/overlayer.rb +373 -0
- data/lib/screen_tracker.rb +269 -0
- data/lib/subtitle_profanity_finder.rb +294 -0
- data/lib/vlc_programmer.rb +112 -0
- data/lib/zoom_player_max_edl.rb +50 -0
- data/never_do +40 -0
- data/notes_for_potential_developers.txt +46 -0
- data/preamble +17 -0
- data/roadmap_possibilities +12 -0
- data/spec/arse.srt +41 -0
- data/spec/auto_window_finder.spec.rb +65 -0
- data/spec/bad_beginning.srt +3778 -0
- data/spec/blanker.spec.rb +60 -0
- data/spec/common.rb +81 -0
- data/spec/convert_image.rb +25 -0
- data/spec/deity_end.srt +11 -0
- data/spec/dragon.srt +34 -0
- data/spec/edl_parser.spec.rb +270 -0
- data/spec/frame_accurate.spec.rb +71 -0
- data/spec/keyboard_input.spec.rb +73 -0
- data/spec/media_info_parser.spec.rb +29 -0
- data/spec/mplayer_edl.spec.rb +100 -0
- data/spec/muter.spec.rb +50 -0
- data/spec/notes +4996 -0
- data/spec/ocr.spec.rb +119 -0
- data/spec/overlayer.spec.rb +440 -0
- data/spec/screen_tracker.spec.rb +318 -0
- data/spec/sensible_cinema_gui.spec.rb +452 -0
- data/spec/subtitle_profanity_finder.spec.rb +224 -0
- data/spec/test_yaml.yml +4 -0
- data/spec/tsmuxer.output +33 -0
- data/spec/vlc_programmer.spec.rb +124 -0
- data/spec/youtube_edl.spec.rb +28 -0
- data/spec/zoom_player_max_edl.spec.rb +29 -0
- data/template_bats/README_DISTRO.TXT +8 -0
- data/template_bats/RUN SENSIBLE CINEMA CLICK HERE WINDOWS.bat +25 -0
- data/template_bats/_DO_NOT_RUN_IT_FROM_HERE_DOWNLOAD_THE_RELEASE_ZIP_FROM_SOURCEFORGE_INSTEAD +0 -0
- data/template_bats/mac/RUN SENSIBLE CINEMA CLICK HERE.command +5 -0
- data/template_bats/mac/advanced--create or edit sensible cinema edit list files.command +3 -0
- data/template_bats/mac/advanced--run-upconverting-video-player.command +3 -0
- 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.build_library.txt +11 -0
- data/todo.inventionzy.txt +162 -0
- data/todo.open_edl_list_org.txt +169 -0
- data/todo.propaganda +107 -0
- data/todo.subtitle +17 -0
- data/todo.upconvert +53 -0
- data/upconvert.bat +1 -0
- data/upconvert_from_screen/go_upscaling.bat +12 -0
- data/upconvert_from_screen/go_upscaling_works +0 -0
- data/upconvert_from_screen/old/latest2/combine_video.avs +23 -0
- data/upconvert_from_screen/old/latest2/go_no_upscaling.bat +1 -0
- data/upconvert_from_screen/old/latest2/go_upscaling.bat +12 -0
- data/upconvert_from_screen/old/latest2/push2.GRF +0 -0
- data/upconvert_from_screen/old/latest2/push3.grf +0 -0
- data/upconvert_from_screen/old/latest2/setup_capture_coords.rb +27 -0
- data/upconvert_from_screen/old/latest2/setup_directshow_filter_params.rb +29 -0
- data/upconvert_from_screen/old/latest2/upconvert_from_screen_me2.avs +19 -0
- data/upconvert_from_screen/old/latest_now_possibly_oudated/push2.GRF +0 -0
- data/upconvert_from_screen/old/latest_now_possibly_oudated/upconvert_from_screen_me2.avs +18 -0
- data/upconvert_from_screen/old/position_window.png +0 -0
- data/upconvert_from_screen/old/push_source_desktop.GRF +0 -0
- data/upconvert_from_screen/old/record_screen/record.bat +2 -0
- data/upconvert_from_screen/old/upconvert_from_screen.avs +21 -0
- data/upconvert_from_screen/old/upconvert_from_screen_me.avs +21 -0
- data/upconvert_from_screen/old/upconvert_from_screen_me2.avs +3 -0
- data/upconvert_from_screen/old/upconvert_from_screen_me_push_source.avs +3 -0
- data/upconvert_from_screen/old/uscreen.GRF +0 -0
- data/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/movie-content-editor-read-only/.metadata/.lock +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.mylyn/.tasks.xml.zip +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.mylyn/repositories.xml.zip +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.mylyn/tasks.xml.zip +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version +1 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version +1 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs +3 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs +14 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs +3 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs +5 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs +3 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml +2 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml +2 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml +10 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml +11 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.intro/dialog_settings.xml +4 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml +10 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml +232 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml +4 -0
- data/vendor/movie-content-editor-read-only/.metadata/version.ini +1 -0
- data/vendor/movie-content-editor-read-only/.project +17 -0
- data/vendor/movie-content-editor-read-only/.pydevproject +11 -0
- data/vendor/movie-content-editor-read-only/.settings/org.eclipse.core.resources.prefs +6 -0
- data/vendor/movie-content-editor-read-only/SubIt.py +171 -0
- data/vendor/movie-content-editor-read-only/VLCMacVideo.py +257 -0
- data/vendor/movie-content-editor-read-only/VideoMac.ui +102 -0
- data/vendor/movie-content-editor-read-only/badwords.txt +4 -0
- data/vendor/movie-content-editor-read-only/blank.srt +4 -0
- data/vendor/movie-content-editor-read-only/edit.py +197 -0
- data/vendor/movie-content-editor-read-only/mergeCommands.py +73 -0
- data/vendor/movie-content-editor-read-only/mute.txt +5 -0
- data/vendor/movie-content-editor-read-only/panda.srt +4235 -0
- data/vendor/movie-content-editor-read-only/panda_custom.txt +3 -0
- data/vendor/movie-content-editor-read-only/panda_edit.srt +4235 -0
- data/vendor/movie-content-editor-read-only/subtitle.py +90 -0
- data/vendor/movie-content-editor-read-only/vlc.py +5579 -0
- data/vendor/movie-content-editor-read-only/vlcwidget.py +154 -0
- data/vendor/mplayer_patches/how_to_doze.bat +6 -0
- data/vendor/mplayer_patches/port_dir/PortIndex.quick +2 -0
- data/vendor/mplayer_patches/port_dir/how_to +20 -0
- data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/Portfile +285 -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/mplayer_patches/port_dir_is_for_mac +0 -0
- data/www/content_editor.html +92 -0
- data/www/index.html +47 -0
- data/www/upconverting_movie_player.html +62 -0
- data/www/video reel.jpg +0 -0
- data/www/youtube_edl/.htaccess +44 -0
- data/www/youtube_edl/control_youtube.rhtml +141 -0
- data/www/youtube_edl/dispatch.fcgi +25 -0
- data/www/youtube_edl/render_edited.rb +25 -0
- data/www/youtube_edl/server_this_dir.rb +6 -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 +22 -0
- data/zamples/edit_decision_lists/dvds/aa_example_delete_list_that_has_no_cuts_in_it.txt +10 -0
- data/zamples/edit_decision_lists/dvds/aladdin.txt +30 -0
- data/zamples/edit_decision_lists/dvds/bambi.txt +17 -0
- data/zamples/edit_decision_lists/dvds/big_buck_bunny_dvd.txt +23 -0
- data/zamples/edit_decision_lists/dvds/bob the builder pets in a pickle.txt +10 -0
- data/zamples/edit_decision_lists/dvds/bobs_big_plan.txt +10 -0
- data/zamples/edit_decision_lists/dvds/cars_2.txt +26 -0
- data/zamples/edit_decision_lists/dvds/cars_disney.txt +40 -0
- data/zamples/edit_decision_lists/dvds/condor_man_widescreen.txt +22 -0
- data/zamples/edit_decision_lists/dvds/cool runnings.txt +53 -0
- data/zamples/edit_decision_lists/dvds/court_jester.txt +24 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/amazing_grace.txt +49 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/father_goose.txt +41 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/harry_potter_and_the_goblet_of_fire.txt +45 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/hugo.txt +31 -0
- 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 +26 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/percy_jackson_lightening_thief.txt +40 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/percy_jackson_lightening_thief_mute_scary.txt +23 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/prince_of_egypt.txt +28 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/puss_in_boots.txt +33 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/ratatouille.txt +35 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/rio.txt +24 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/test_delete_list_for_experimenting_with.txt +10 -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 +40 -0
- data/zamples/edit_decision_lists/dvds/happiest baby on the block.txt +9 -0
- data/zamples/edit_decision_lists/dvds/harry_potter_3_prisoner_of_azkaban.txt +37 -0
- data/zamples/edit_decision_lists/dvds/hitchhiker's_guide_to_the_galaxy.txt +32 -0
- data/zamples/edit_decision_lists/dvds/how_to_train_your_dragon.txt +25 -0
- data/zamples/edit_decision_lists/dvds/if_a_man_answers.txt +43 -0
- data/zamples/edit_decision_lists/dvds/innerspace.txt +77 -0
- data/zamples/edit_decision_lists/dvds/iq.txt +32 -0
- data/zamples/edit_decision_lists/dvds/king_of_kings.txt +28 -0
- data/zamples/edit_decision_lists/dvds/kung_fu_panda_1.txt +17 -0
- data/zamples/edit_decision_lists/dvds/legend_of_the_guardians_the_owls_of_gahoole.txt +18 -0
- data/zamples/edit_decision_lists/dvds/monsters_vs_aliens.txt +41 -0
- data/zamples/edit_decision_lists/dvds/muppet_treasure_island.txt +21 -0
- data/zamples/edit_decision_lists/dvds/nanny_mcphee.txt +31 -0
- data/zamples/edit_decision_lists/dvds/narnia_voyage_of_the_dawn_treader.txt +16 -0
- data/zamples/edit_decision_lists/dvds/pack_jackson_wedding_2007-03-03.txt +31 -0
- data/zamples/edit_decision_lists/dvds/peter_pan.txt +29 -0
- 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 +22 -0
- data/zamples/edit_decision_lists/dvds/snow_white_and_the_7_dwarfs_1937.txt +19 -0
- data/zamples/edit_decision_lists/dvds/speed_racer.txt +47 -0
- data/zamples/edit_decision_lists/dvds/tangled.txt +21 -0
- data/zamples/edit_decision_lists/dvds/tron_legacy.txt +29 -0
- data/zamples/edit_decision_lists/dvds/turn_around_alma_younger.txt +17 -0
- data/zamples/edit_decision_lists/files/conference_music_video.txt +10 -0
- data/zamples/edit_decision_lists/netflix_instant/avatar-last-air-bender-movie.txt +13 -0
- data/zamples/edit_decision_lists/netflix_instant/avatar-last-airbender-series.txt +1 -0
- data/zamples/edit_decision_lists/netflix_instant/greatest_story_ever_told_netflix.txt +10 -0
- data/zamples/edit_decision_lists/netflix_instant/wrinkle-in-time.txt +23 -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/dvds/White Christmas.txt +15 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/all_dogs_go_to_heaven.txt +9 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/cars_disney.txt +24 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/happy_feet.txt +12 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/labyrinth.txt +17 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/star_trek_generations_hulu.txt +8 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/example_edit_decision_list.txt +14 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/youtube/gummy_bear_song_youtube.txt +9 -0
- data/zamples/edit_decision_lists/youtube/demo_mutes.txt +12 -0
- data/zamples/edit_decision_lists/youtube/nuki_song_youtube.txt +14 -0
- data/zamples/edit_decision_lists/youtube/nuki_song_youtube_pointer.txt +3 -0
- data/zamples/players/how_to_create_more_players.txt +24 -0
- data/zamples/players/hulu/total_length_over_an_hour.txt +25 -0
- data/zamples/players/netflix/netflix_firefox_non_maximized.txt +25 -0
- data/zamples/players/vlc/full_screened_total_length_over_an_hour.txt +27 -0
- data/zamples/players/vlc/windowed_total_length_over_an_hour.txt +26 -0
- data/zamples/players/vlc/windowed_total_length_under_an_hour.txt +22 -0
- data/zamples/players/youtube/full_screened_1024x768.txt +20 -0
- data/zamples/players/youtube/full_screened_1152x864.txt +20 -0
- data/zamples/players/youtube/full_screened_1680x1050.txt +20 -0
- data/zamples/players/youtube/normal_in_youtube.com.chrome.txt +23 -0
- data/zamples/players/youtube/note_these_assume_less_than_10_minutes_length.txt +2 -0
- metadata +483 -0
@@ -0,0 +1,219 @@
|
|
1
|
+
require 'java'
|
2
|
+
|
3
|
+
require 'sane'
|
4
|
+
|
5
|
+
module SensibleSwing
|
6
|
+
|
7
|
+
class MainWindow < javax.swing.JFrame
|
8
|
+
|
9
|
+
def force_accept_license_first
|
10
|
+
if !(LocalStorage['main_license_accepted'] == VERSION)
|
11
|
+
require_blocking_license_accept_dialog 'Sensible Cinema', 'gplv3', 'http://www.gnu.org/licenses/gpl.html', 'Sensible Cinema license agreement',
|
12
|
+
"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"
|
13
|
+
LocalStorage['main_license_accepted'] = VERSION
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def force_accept_file_style_license
|
18
|
+
if !(LocalStorage['accepted_legal_copys'] == VERSION)
|
19
|
+
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"),
|
20
|
+
'is_it_legal_to_copy_dvds.txt file', 'I acknowledge that I have read, understand, accept the documentation/is_it_legal_to_copy_dvds.txt file.'
|
21
|
+
LocalStorage['accepted_legal_copys'] = VERSION
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.download full_url, to_here
|
26
|
+
require 'open-uri'
|
27
|
+
require 'openssl'
|
28
|
+
require 'fileutils'
|
29
|
+
eval("OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE") if full_url =~ /https/
|
30
|
+
keep_going_bg_thread = true
|
31
|
+
print 'downloading ' + File.basename(to_here)
|
32
|
+
Thread.new { while keep_going_bg_thread; print '.'; sleep 1; end}
|
33
|
+
writeOut = open(to_here + '.temp', "wb")
|
34
|
+
url = open(full_url, 'rb')
|
35
|
+
writeOut.write(url.read)
|
36
|
+
url.close
|
37
|
+
writeOut.close
|
38
|
+
FileUtils.mv to_here + '.temp', to_here # avoid partial downloads corrupting uss
|
39
|
+
keep_going_bg_thread = false
|
40
|
+
puts 'done!'
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.download_to_string full_url
|
44
|
+
require 'tempfile'
|
45
|
+
to = Tempfile.new 'abc'
|
46
|
+
download(full_url, to.path)
|
47
|
+
out = File.binread(to.path)
|
48
|
+
to.delete
|
49
|
+
out
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def download_7zip
|
54
|
+
Dir.mkdir('./vendor/cache') unless File.directory? 'vendor/cache' # development may not have it created yet... [?]
|
55
|
+
unless File.exist? 'vendor/cache/7za.exe'
|
56
|
+
Dir.chdir('vendor/cache') do
|
57
|
+
print 'downloading unzipper (7zip--400K) ...'
|
58
|
+
MainWindow.download("http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip", "7za920.zip")
|
59
|
+
system_blocking("../unzip.exe -o 7za920.zip") # -o means "overwrite" without prompting
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def download_zip_file_and_extract english_name, url, to_this
|
65
|
+
download_7zip
|
66
|
+
Dir.chdir('vendor/cache') do
|
67
|
+
file_name = url.split('/')[-1]
|
68
|
+
print "downloading #{english_name} ..."
|
69
|
+
MainWindow.download(url, file_name)
|
70
|
+
system_blocking("7za e #{file_name} -y -o#{to_this}")
|
71
|
+
puts 'done ' + english_name
|
72
|
+
# creates vendor/cache/mencoder/mencoder.exe...
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def check_for_exe windows_full_loc, unix_name
|
77
|
+
# in windows, that exe *at that location* must exist...
|
78
|
+
if OS.windows?
|
79
|
+
File.exist?(windows_full_loc)
|
80
|
+
else
|
81
|
+
require 'lib/check_installed_mac.rb'
|
82
|
+
if !CheckInstalledMac.check_for_installed(unix_name)
|
83
|
+
exit 1 # it'll have already displayed a message...
|
84
|
+
else
|
85
|
+
true
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def check_for_ffmpeg_installed
|
91
|
+
ffmpeg_exe_loc = File.expand_path('vendor/cache/ffmpeg/ffmpeg.exe') # I think file basd normal needs ffmpeg
|
92
|
+
if !check_for_exe(ffmpeg_exe_loc, 'ffmpeg')
|
93
|
+
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."
|
94
|
+
download_zip_file_and_extract "ffmpeg (5MB)", "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-git-335bbe4-win32-static.7z", "ffmpeg"
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
def check_for_various_dependencies
|
100
|
+
if OS.doze? && !check_for_exe('vendor/cache/mplayer_edl/mplayer.exe', nil)
|
101
|
+
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 "
|
102
|
+
FileUtils.mkdir_p 'vendor/cache/mplayer_edl'
|
103
|
+
puts 'downloading mplayer edl [12 MB]'
|
104
|
+
MainWindow.download('http://sourceforge.net/projects/mplayer-edl/files/0.4/mplayer.exe', 'vendor/cache/mplayer_edl/mplayer.exe')
|
105
|
+
config_dir = File.expand_path('~/mplayer')
|
106
|
+
FileUtils.mkdir(config_dir) unless File.directory?(config_dir)
|
107
|
+
FileUtils.cp('vendor/subfont.ttf', config_dir) # TODO mac
|
108
|
+
end
|
109
|
+
|
110
|
+
# runtime dependencies, at least as of today...
|
111
|
+
if OS.mac?
|
112
|
+
check_for_exe("mplayer", "mplayer") # mencoder and mplayer are separate for mac... [this checks for mac's mplayerx, too]
|
113
|
+
else
|
114
|
+
path = RubyWhich.new.which('smplayer')
|
115
|
+
if(path.length == 0)
|
116
|
+
# this one has its own installer...
|
117
|
+
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."
|
118
|
+
save_to_dir = SwingHelpers.new_existing_dir_chooser_and_go 'pick dir to save smplayer exe installer to:'
|
119
|
+
save_to_file = "#{save_to_dir}/smplayer-0.6.9-win32.exe"
|
120
|
+
puts "downloading smplayer.exe [14MB] to #{save_to_file}"
|
121
|
+
MainWindow.download "http://sourceforge.net/projects/smplayer/files/SMPlayer/0.6.9/smplayer-0.6.9-win32.exe", save_to_file
|
122
|
+
show_blocking_message_dialog "Run this file to install it now (click ok to reveal): smplayer-0.6.9-win32.exe"
|
123
|
+
show_in_explorer save_to_file
|
124
|
+
sleep 2
|
125
|
+
show_blocking_message_dialog "hit ok after smplayer is installed:"
|
126
|
+
add_smplayer_paths # load it onto the PATH now
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def assert_ownership_dialog
|
132
|
+
force_accept_file_style_license
|
133
|
+
message = "Do you certify you own the DVD this came of and have it in your possession, if necessary in your legal jurisdiction?"
|
134
|
+
title = "Verify ownership"
|
135
|
+
returned = JOptionPane.show_select_buttons_prompt(message, {:yes => "no", :no => "yes"})
|
136
|
+
assert_confirmed_dialog returned, nil
|
137
|
+
end
|
138
|
+
|
139
|
+
def require_blocking_license_accept_dialog program, license_name, license_url_should_also_be_embedded_by_you_in_message,
|
140
|
+
title = 'Confirm Acceptance of License Agreement', message = nil
|
141
|
+
puts 'Please confirm license agreement in open window before proceeding.'
|
142
|
+
|
143
|
+
message ||= "Sensible Cinema requires a separately installed program (#{program}), not yet installed.
|
144
|
+
You can install this program manually to the vendor/cache subdirectory, or Sensible Cinema can download it for you.
|
145
|
+
By clicking accept, below, you are confirming that you have read and agree to be bound by the
|
146
|
+
terms of its license (the #{license_name}), located at #{license_url_should_also_be_embedded_by_you_in_message}.
|
147
|
+
Click 'View License' to view it. If you do not agree to these terms, click 'Cancel'. You also agree that this is a
|
148
|
+
separate program, with its own distribution, license, ownership and copyright.
|
149
|
+
You agree that you are responsible for the download and use of this program, within sensible cinema or otherwise."
|
150
|
+
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}"
|
151
|
+
assert_confirmed_dialog answer, license_url_should_also_be_embedded_by_you_in_message
|
152
|
+
p 'confirmation of sensible cinema related license duly noted of: ' + license_name # LODO require all licenses together :P
|
153
|
+
end
|
154
|
+
|
155
|
+
def assert_confirmed_dialog returned, license_url_should_also_be_embedded_by_you_in_message
|
156
|
+
# :yes is "view license", :no is "accept", :cancel
|
157
|
+
if returned == :yes
|
158
|
+
if license_url_should_also_be_embedded_by_you_in_message
|
159
|
+
SwingHelpers.open_url_to_view_it_non_blocking license_url_should_also_be_embedded_by_you_in_message
|
160
|
+
puts "Please restart after reading license agreement, to be able to then accept it."
|
161
|
+
else
|
162
|
+
puts 'dialog assertion failed'
|
163
|
+
end
|
164
|
+
System.exit 0
|
165
|
+
elsif returned == :cancel
|
166
|
+
p 'license not accepted...exiting'
|
167
|
+
System.exit 1
|
168
|
+
elsif returned == :exited
|
169
|
+
p 'license exited early...exiting'
|
170
|
+
System.exit 1
|
171
|
+
elsif returned == :no
|
172
|
+
# ok
|
173
|
+
else
|
174
|
+
raise 'unknown?'
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
def set_individual_preferences
|
179
|
+
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]."
|
180
|
+
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 MPlayer et al [free]", :no => "ZoomPlayer MAX", :yes => "MPlayer/VLC/DVD-Navigator [all free]") == :no
|
181
|
+
LocalStorage['have_zoom_button'] = true
|
182
|
+
else
|
183
|
+
LocalStorage['have_zoom_button'] = false
|
184
|
+
end
|
185
|
+
# TODO break these out into create mode prefs versus human [?]
|
186
|
+
if JOptionPane.show_select_buttons_prompt("Would you like to enable some obscure options, like
|
187
|
+
Using keyboard shortcuts to create EDL files on the fly, or
|
188
|
+
Prompting to create euphemized .srt files, or
|
189
|
+
Being able to add your own 'profanity words' specific to different videos?
|
190
|
+
(Most users answer no to this).", :yes => 'No', :no => 'Yes') == :no
|
191
|
+
LocalStorage['prompt_obscure_options'] = true
|
192
|
+
else
|
193
|
+
LocalStorage['prompt_obscure_options'] = false
|
194
|
+
end
|
195
|
+
if JOptionPane.show_select_buttons_prompt("Would you like to enable upconversion [i.e. make playback prettier, requires more cpu?]") == :yes
|
196
|
+
setup_dvd_upconvert_options
|
197
|
+
else
|
198
|
+
reset_upconversion_options
|
199
|
+
end
|
200
|
+
true
|
201
|
+
end
|
202
|
+
|
203
|
+
def get_set_preference name, english_name
|
204
|
+
old_preference = LocalStorage[name]
|
205
|
+
old_class = old_preference.class
|
206
|
+
|
207
|
+
new_preference = get_user_input("Enter value for #{english_name}", old_preference)
|
208
|
+
display_and_raise 'enter something like 0.0' if new_preference.empty?
|
209
|
+
if old_class == Float
|
210
|
+
new_preference = new_preference.to_f
|
211
|
+
elsif old_class == String
|
212
|
+
# leave same
|
213
|
+
else
|
214
|
+
raise 'unknown type?' + old_class.to_s
|
215
|
+
end
|
216
|
+
LocalStorage[name] = new_preference
|
217
|
+
end
|
218
|
+
end # MainWindow
|
219
|
+
end
|
data/lib/gui/normal.rb
ADDED
@@ -0,0 +1,123 @@
|
|
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
|
+
def hard_exit; java::lang::System.exit 0; end
|
27
|
+
|
28
|
+
def setup_normal_buttons
|
29
|
+
add_text_line ""
|
30
|
+
|
31
|
+
@mplayer_edl = new_jbutton( watch_edited_text="Watch currently mounted DVD edited (realtime)" )
|
32
|
+
@mplayer_edl.tool_tip = "This will watch your DVD in realtime from your computer while skipping/muting questionable scenes."
|
33
|
+
@mplayer_edl.on_clicked {
|
34
|
+
play_smplayer_edl_non_blocking
|
35
|
+
sleep 5
|
36
|
+
puts 'enjoy your movie playing in other window'
|
37
|
+
sleep 1
|
38
|
+
hard_exit if OS.doze? # paranoid on cpu usage LOL LODO mac too? it kills mplayer child processes currently...hmm...
|
39
|
+
}
|
40
|
+
|
41
|
+
add_callback_for_dvd_edl_present { |disk_available, edl_available|
|
42
|
+
b = @mplayer_edl
|
43
|
+
if disk_available
|
44
|
+
if edl_available
|
45
|
+
b.enable
|
46
|
+
b.text=watch_edited_text
|
47
|
+
else
|
48
|
+
b.enable # leave it enabled in case it's some nonstandard form of a disk that does have one [?]
|
49
|
+
b.text= watch_edited_text + " [disk has no Edit List Available!]"
|
50
|
+
end
|
51
|
+
else
|
52
|
+
@mplayer_edl.disable
|
53
|
+
@mplayer_edl.text=watch_edited_text + " [no disk presently inserted]"
|
54
|
+
end
|
55
|
+
}
|
56
|
+
|
57
|
+
@watch_file_edl = new_jbutton( "Watch movie file edited (realtime)" ) do
|
58
|
+
force_accept_file_style_license
|
59
|
+
choose_file_and_edl_and_create_sxs_or_play false
|
60
|
+
end
|
61
|
+
|
62
|
+
if LocalStorage[UpConvertEnglish] # LODO no tight coupling like this
|
63
|
+
add_text_line ''
|
64
|
+
add_open_documentation_button
|
65
|
+
@upconv_line = add_text_line " #{get_current_upconvert_as_phrase}"
|
66
|
+
else
|
67
|
+
@upconv_line = add_text_line ''
|
68
|
+
add_open_documentation_button
|
69
|
+
end
|
70
|
+
|
71
|
+
@show_upconvert_options = new_jbutton("Tweak Preferences [timing, upconversion]") do
|
72
|
+
set_individual_preferences
|
73
|
+
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."
|
74
|
+
upconvert_window = new_child_window
|
75
|
+
upconvert_window.add_change_upconvert_buttons
|
76
|
+
end
|
77
|
+
@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."
|
78
|
+
|
79
|
+
new_jbutton("Create new Edit Decision List for a DVD or File that doesn't have one yet") do
|
80
|
+
window = new_child_window
|
81
|
+
window.setup_create_buttons
|
82
|
+
end
|
83
|
+
|
84
|
+
@upload = new_jbutton("Feedback/questions welcome!") # keeps this one last! :)
|
85
|
+
@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!"
|
86
|
+
@upload.on_clicked {
|
87
|
+
show_blocking_message_dialog "ok, next it will open up the groups page now or optionally an email you could send"
|
88
|
+
system_non_blocking("start mailto:sensible-cinema@googlegroups.com")
|
89
|
+
system_non_blocking("start http://groups.google.com/group/sensible-cinema")
|
90
|
+
}
|
91
|
+
increment_button_location
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
|
96
|
+
def add_open_documentation_button
|
97
|
+
@open_help_file = new_jbutton("View Sensible Cinema Documentation") do
|
98
|
+
show_in_explorer __DIR__ + "/../../documentation"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# side by side stuff we haven't really factored out yet, also doubles for both normal/create LODO
|
103
|
+
def choose_file_and_edl_and_create_sxs_or_play just_create_xbmc_dot_edl_file_instead_of_play
|
104
|
+
filename_mpg = new_existing_file_selector_and_select_file( "Pick moviefile (like moviename.mpg or video_ts/anything.ext)")
|
105
|
+
edl_filename = new_existing_file_selector_and_select_file( "Pick an EDL file to use with it", EdlParser::EDL_DIR)
|
106
|
+
assert_ownership_dialog
|
107
|
+
if just_create_xbmc_dot_edl_file_instead_of_play
|
108
|
+
descriptors = EdlParser.parse_file edl_filename
|
109
|
+
# XBMC can use english timestamps
|
110
|
+
edl_contents = MplayerEdl.convert_to_edl descriptors, add_secs_end = 0.0, begin_buffer_preference, splits = [], extra_time_to_all = 0.0, use_english_timestamps=true
|
111
|
+
output_file = filename_mpg.gsub(/\.[^\.]+$/, '') + '.edl' # sanitize...
|
112
|
+
File.write(output_file, edl_contents)
|
113
|
+
raise unless File.exist?(output_file) # sanity
|
114
|
+
show_blocking_message_dialog("created #{output_file}")
|
115
|
+
else
|
116
|
+
play_smplayer_edl_non_blocking [filename_mpg, edl_filename]
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
@@ -0,0 +1,284 @@
|
|
1
|
+
|
2
|
+
module SensibleSwing
|
3
|
+
|
4
|
+
class MainWindow
|
5
|
+
|
6
|
+
def add_play_upconvert_buttons
|
7
|
+
|
8
|
+
@watch_file_upconvert = new_jbutton( "Watch a movie file upconverted (unedited)") do
|
9
|
+
popup = warn_if_no_upconvert_options_currently_selected
|
10
|
+
filename_mpg = new_existing_file_selector_and_select_file( "pick movie file (like moviename.mpg)")
|
11
|
+
thread = play_smplayer_edl_non_blocking [filename_mpg, nil]
|
12
|
+
when_thread_done(thread) { popup.dispose }
|
13
|
+
end
|
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
|
+
|
16
|
+
@watch_dvd_upconvert = new_jbutton( "Watch a DVD upconverted (unedited)") do
|
17
|
+
popup = warn_if_no_upconvert_options_currently_selected
|
18
|
+
thread = play_dvd_smplayer_unedited false
|
19
|
+
when_thread_done(thread) { popup.dispose }
|
20
|
+
end
|
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
|
+
|
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
|
+
|
33
|
+
add_text_line ''
|
34
|
+
@upconv_line = add_text_line ''
|
35
|
+
change_upconvert_line_to_current
|
36
|
+
|
37
|
+
add_change_upconvert_options_button
|
38
|
+
if !upconvert_set_to_anything?
|
39
|
+
show_blocking_message_dialog 'please configure your upconvert settings first'
|
40
|
+
@show_upconvert_options.simulate_click # make them choose one
|
41
|
+
end
|
42
|
+
add_text_line ''
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
def upconvert_set_to_anything?
|
47
|
+
LocalStorage[UpConvertEnglish].present?
|
48
|
+
end
|
49
|
+
|
50
|
+
LocalStorage.set_default('screen_multiples', 1.0)
|
51
|
+
|
52
|
+
def add_change_upconvert_options_button
|
53
|
+
@show_upconvert_options = new_jbutton("Tweak Playback Upconversion Quality Settings") do
|
54
|
+
upconvert_window = new_child_window
|
55
|
+
upconvert_window.add_change_upconvert_buttons
|
56
|
+
end
|
57
|
+
@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."
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
def warn_if_no_upconvert_options_currently_selected
|
62
|
+
if !upconvert_set_to_anything?
|
63
|
+
show_non_blocking_message_dialog "Warning: upconvert options have not been set yet--set upconvert options first, if desired."
|
64
|
+
else
|
65
|
+
JFrame.new # something it can call dispose on :P
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def change_upconvert_line_to_current
|
70
|
+
current = get_current_upconvert_as_phrase
|
71
|
+
if @upconv_line
|
72
|
+
@upconv_line.set_text current
|
73
|
+
end
|
74
|
+
if @parent && @parent.upconv_line
|
75
|
+
@parent.upconv_line.set_text current
|
76
|
+
end # LODO I think the child also wants a status line..
|
77
|
+
end
|
78
|
+
|
79
|
+
UpConvertKey = 'upconvert_setting'
|
80
|
+
UpConvertKeyExtra = 'upconvert_setting_extra'
|
81
|
+
UpConvertEnglish = 'upconvert_english_name'
|
82
|
+
ScreenMultipleFactor = 'screen_multiples'
|
83
|
+
|
84
|
+
def setup_dvd_upconvert_options
|
85
|
+
luma_spatial = 0
|
86
|
+
chroma_spatial = 1
|
87
|
+
luma_tmp = 4
|
88
|
+
chroma_tmp = 4
|
89
|
+
# SCREEN_X is replaced later.
|
90
|
+
LocalStorage[UpConvertKey] = "hqdn3d=%s:%s:%s:%s,scale=SCREEN_X:-10:0:0:2" % [luma_spatial, chroma_spatial, luma_tmp, chroma_tmp]
|
91
|
+
# hqdn3d[=luma_spatial:chroma_spatial:luma_tmp:chroma_tmp]
|
92
|
+
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=7.0"
|
93
|
+
LocalStorage[UpConvertEnglish] = "DVD"
|
94
|
+
end
|
95
|
+
|
96
|
+
def reset_upconversion_options
|
97
|
+
LocalStorage[UpConvertKey] = nil
|
98
|
+
LocalStorage[UpConvertKeyExtra] = nil
|
99
|
+
LocalStorage[UpConvertEnglish] = nil
|
100
|
+
end
|
101
|
+
|
102
|
+
def add_change_upconvert_buttons
|
103
|
+
raise 'should have already been set for us' unless LocalStorage[ScreenMultipleFactor]
|
104
|
+
@medium_dvd = new_jbutton("Set upconvert options to DVD-style video") {
|
105
|
+
setup_dvd_upconvert_options
|
106
|
+
display_current_upconvert_setting_and_close_window
|
107
|
+
}
|
108
|
+
high_compression = new_jbutton("Set upconvert options to high compressed video file playback") {
|
109
|
+
# -autoq 6 -vf pp [?]
|
110
|
+
LocalStorage[UpConvertEnglish] = "high compressed"
|
111
|
+
LocalStorage[UpConvertKey] = "hqdn3d=0:1:4:4,pp=hb:y/vb:y,scale=SCREEN_X:-10:0:0:3" # pp should be after hqdn3d I think... and hqdn3d should be before scale...
|
112
|
+
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=25.0"
|
113
|
+
display_current_upconvert_setting_and_close_window
|
114
|
+
# -Processing method: mplayer with accurate deblocking ???
|
115
|
+
}
|
116
|
+
new_jbutton("Set upconvert options to experimental screen-upconverting playback") {
|
117
|
+
LocalStorage[UpConvertKey] = "scale=SCREEN_X:-10:0:0:3" # no hqdn3d
|
118
|
+
LocalStorage[UpConvertKeyExtra] = "-sws 9 -ssf ls=75.0 -ssf cs=25.0"
|
119
|
+
LocalStorage[UpConvertEnglish] = "experimental screenupconversion"
|
120
|
+
display_current_upconvert_setting_and_close_window
|
121
|
+
}
|
122
|
+
|
123
|
+
new_jbutton("Set upconvert options to whatever you want [like -sws 9 -ssf ls=100.0 -- for advanced users]") {
|
124
|
+
new_settings = get_user_input("you can set -vf settings, and then other settings. What would you like your -vf settings to be?")
|
125
|
+
LocalStorage[UpConvertKey] = new_settings
|
126
|
+
other_settings = get_user_input("other settings you'd like to also have add:")
|
127
|
+
LocalStorage[UpConvertKeyExtra] = other_settings
|
128
|
+
LocalStorage[UpConvertEnglish] = "personalized: -vf #{new_settings}, #{other_settings}"
|
129
|
+
}
|
130
|
+
|
131
|
+
# TODO tooltip from docu here +- this into tooltip
|
132
|
+
# TODO "click here" link for more docu [?]
|
133
|
+
add_text_line "Multiple factor screen widths"
|
134
|
+
add_text_line " (higher might be better, uses more cpu)."
|
135
|
+
add_text_line " If mplayer just dies or displays only a black or white screen then lower this setting, it is too high."
|
136
|
+
slider = JSlider.new
|
137
|
+
slider.setBorder(BorderFactory.createTitledBorder("Screen resolution multiple"));
|
138
|
+
|
139
|
+
# I want tick for 1x, 1.5x, 2x, 2.5x, 3x
|
140
|
+
# so let's do marker values of 10 -> 30, since it requires integers...
|
141
|
+
|
142
|
+
labelTable = java.util.Hashtable.new
|
143
|
+
i = java.lang.Integer
|
144
|
+
l = JLabel
|
145
|
+
|
146
|
+
# allow for 0.75 too, if you have a large monitor, slower cpu...
|
147
|
+
local_minimum = (720.0/get_current_max_width_resolution)*100 # allows 1024 to use upscaling to 860, but we warn when they do this
|
148
|
+
label_minimum = nil
|
149
|
+
(0..300).step(25) do |n|
|
150
|
+
if n > local_minimum
|
151
|
+
label_minimum ||= n
|
152
|
+
if (n % 100 == 0)
|
153
|
+
labelTable.put(i.new(n), l.new("#{n/100}x")) # 1x
|
154
|
+
elsif n == label_minimum # just for the bottom label, rest too chatty
|
155
|
+
labelTable.put(i.new(n), l.new("#{n/100.0}x")) # 1.5x
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
slider.setLabelTable( labelTable )
|
160
|
+
|
161
|
+
slider.maximum=300
|
162
|
+
slider.minimum=label_minimum
|
163
|
+
slider.setMajorTickSpacing(100)
|
164
|
+
slider.setMinorTickSpacing(25)
|
165
|
+
slider.setPaintTicks(true)
|
166
|
+
slider.setPaintLabels(true)
|
167
|
+
slider.snap_to_ticks=true
|
168
|
+
|
169
|
+
slider.set_value LocalStorage[ScreenMultipleFactor] * 100
|
170
|
+
|
171
|
+
slider.add_change_listener { |event|
|
172
|
+
if !slider.value_is_adjusting
|
173
|
+
# they released their hold on it...
|
174
|
+
old_value = LocalStorage[ScreenMultipleFactor]
|
175
|
+
new_value = slider.value/100.0
|
176
|
+
LocalStorage[ScreenMultipleFactor] = new_value
|
177
|
+
if new_value != old_value
|
178
|
+
if slider.value == label_minimum
|
179
|
+
show_blocking_message_dialog "Setting it too low like that might make it not do much upconverting (DVD's, are 720px, you're setting it to upconvert to #{new_value * get_current_max_width_resolution})"
|
180
|
+
end
|
181
|
+
display_current_upconvert_setting_and_close_window
|
182
|
+
end
|
183
|
+
end
|
184
|
+
}
|
185
|
+
slider.set_bounds(44, @starting_button_y, @button_width, 66)
|
186
|
+
2.times {increment_button_location}
|
187
|
+
@panel.add(slider)
|
188
|
+
|
189
|
+
increment_button_location
|
190
|
+
|
191
|
+
@none = new_jbutton("Reset upconvert options to none (no upconversion)")
|
192
|
+
@none.tool_tip = "Having no upconvert options is reasonably good, might use directx for scaling, nice for slow cpu's"
|
193
|
+
@none.on_clicked {
|
194
|
+
reset_upconversion_options
|
195
|
+
display_current_upconvert_setting_and_close_window
|
196
|
+
}
|
197
|
+
|
198
|
+
@generate_images = new_jbutton("Test current configuration by writing some images from playing a video file") do
|
199
|
+
popup = warn_if_no_upconvert_options_currently_selected
|
200
|
+
filename_mpg = new_existing_file_selector_and_select_file( "pick movie file (like moviename.mpg)")
|
201
|
+
|
202
|
+
output_dir = get_same_drive_friendly_clean_temp_dir 'temp_upscaled_video_out'
|
203
|
+
output_command = '-ss 2:44 -frames 300 -vo png:outdir="' + File.strip_drive_windows(output_dir) + '"'
|
204
|
+
output_command += " -noframedrop" # don't want them to skip frames on cpu's without enough power to keep up
|
205
|
+
thread = play_smplayer_edl_non_blocking [filename_mpg, nil], [output_command], true
|
206
|
+
when_thread_done(thread) { popup.dispose; show_in_explorer(output_dir) }
|
207
|
+
end
|
208
|
+
@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
|
209
|
+
|
210
|
+
@generate_screen_cast = new_jbutton("Test current configuration by watching video file and recording screen") do
|
211
|
+
check_for_ffmpeg_installed
|
212
|
+
popup = warn_if_no_upconvert_options_currently_selected
|
213
|
+
filename_mpg = new_existing_file_selector_and_select_file( "pick movie file (like moviename.mpg)")
|
214
|
+
output_dir = get_same_drive_friendly_clean_temp_dir 'temp_screencast_dir'
|
215
|
+
thread1 = play_smplayer_edl_non_blocking [filename_mpg, nil], [" -ss 2:44 -endpos 11"]
|
216
|
+
# screen capture for 10s
|
217
|
+
fps_to_grab = 5
|
218
|
+
|
219
|
+
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
|
+
thread2.join
|
221
|
+
show_blocking_message_dialog "ffmpeg done, close mplayer now!"
|
222
|
+
thread1.join
|
223
|
+
popup.dispose # just in case :P
|
224
|
+
show_in_explorer(output_dir)
|
225
|
+
end
|
226
|
+
|
227
|
+
|
228
|
+
end
|
229
|
+
|
230
|
+
def get_same_drive_friendly_clean_temp_dir suffix
|
231
|
+
output_dir = Dir.tmpdir
|
232
|
+
if File.get_root_dir(output_dir) != File.get_root_dir(Dir.pwd) # you are hosed!
|
233
|
+
output_dir = File.get_root_dir(Dir.pwd) # we'll raise if it's not writable...
|
234
|
+
end
|
235
|
+
output_dir = output_dir + '/' + suffix
|
236
|
+
FileUtils.rm_rf output_dir
|
237
|
+
Dir.mkdir output_dir
|
238
|
+
output_dir
|
239
|
+
end
|
240
|
+
|
241
|
+
def display_current_upconvert_setting_and_close_window
|
242
|
+
change_upconvert_line_to_current
|
243
|
+
show_blocking_message_dialog get_current_upconvert_as_phrase
|
244
|
+
self.dispose
|
245
|
+
end
|
246
|
+
|
247
|
+
def get_current_upconvert_as_phrase
|
248
|
+
settings = LocalStorage[UpConvertEnglish]
|
249
|
+
out = "Upconvert options are now #{ settings ? "set to #{settings} style" : "NOT SET"}"
|
250
|
+
if settings
|
251
|
+
multiple = LocalStorage[ScreenMultipleFactor]
|
252
|
+
out += " (screen multiplier #{multiple}*#{get_current_max_width_resolution} = #{(multiple * get_current_max_width_resolution).to_i}px)."
|
253
|
+
end
|
254
|
+
out
|
255
|
+
end
|
256
|
+
|
257
|
+
def get_current_max_width_resolution
|
258
|
+
# choose width of widest monitor (why would they display it on the other, right?)
|
259
|
+
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment.getScreenDevices.map{|gd| gd.display_mode.width}.max.to_i
|
260
|
+
end
|
261
|
+
|
262
|
+
def get_upconvert_vf_settings
|
263
|
+
template = LocalStorage[UpConvertKey]
|
264
|
+
if template
|
265
|
+
screen_multiple = LocalStorage[ScreenMultipleFactor]
|
266
|
+
upc = template.gsub('SCREEN_X', (get_current_max_width_resolution*screen_multiple).to_i.to_s) # has to be an integer...
|
267
|
+
upc = 'pullup,softskip,' + upc
|
268
|
+
show_non_blocking_message_dialog 'using upconvert settings ' + upc
|
269
|
+
p 'using upconvert settings: ' + upc
|
270
|
+
upc
|
271
|
+
else
|
272
|
+
p 'not using any specific upconversion-ing'
|
273
|
+
# pullup, softskip -- might slow things down too much for slow cpus
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
def get_upconvert_secondary_settings
|
278
|
+
LocalStorage[UpConvertKeyExtra]
|
279
|
+
end
|
280
|
+
|
281
|
+
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|