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,60 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright 2010, Roger Pack
|
3
|
+
This file is part of Sensible Cinema.
|
4
|
+
|
5
|
+
Sensible Cinema is free software: you can redistribute it and/or modify
|
6
|
+
it under the terms of the GNU General Public License as published by
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
8
|
+
(at your option) any later version.
|
9
|
+
|
10
|
+
Sensible Cinema is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU General Public License
|
16
|
+
along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
=end
|
18
|
+
require File.dirname(__FILE__) + '/common'
|
19
|
+
require_relative '../lib/blanker.rb'
|
20
|
+
|
21
|
+
describe Blanker do
|
22
|
+
|
23
|
+
before(:each) do
|
24
|
+
Blanker.startup
|
25
|
+
end
|
26
|
+
|
27
|
+
after(:each) do
|
28
|
+
Blanker.shutdown
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should be able to blank then unblank" do
|
32
|
+
Blanker.blank_full_screen! "blank then unblank"
|
33
|
+
sleep 0.5
|
34
|
+
Blanker.unblank_full_screen!
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should be able to blank then unblank several times" do
|
38
|
+
3.times {
|
39
|
+
Blanker.blank_full_screen! 'unblank several times'
|
40
|
+
Blanker.unblank_full_screen!
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should be able to unblank several times in a row I suppose" do
|
45
|
+
3.times {
|
46
|
+
Blanker.unblank_full_screen!
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
describe "future work", :pending => true do
|
51
|
+
|
52
|
+
it "should be able to blank certain coords"
|
53
|
+
|
54
|
+
it "should have a background color specificable"
|
55
|
+
|
56
|
+
it "should have a picture overlay optionally"
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
data/spec/common.rb
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright 2010, Roger Pack
|
3
|
+
This file is part of Sensible Cinema.
|
4
|
+
|
5
|
+
Sensible Cinema is free software: you can redistribute it and/or modify
|
6
|
+
it under the terms of the GNU General Public License as published by
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
8
|
+
(at your option) any later version.
|
9
|
+
|
10
|
+
Sensible Cinema is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU General Public License
|
16
|
+
along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
=end
|
18
|
+
require 'rubygems'
|
19
|
+
require 'rspec' # rspec2
|
20
|
+
require 'rspec/autorun' # ???
|
21
|
+
# some useful utilities...
|
22
|
+
|
23
|
+
require 'sane'
|
24
|
+
require 'benchmark'
|
25
|
+
Thread.abort_on_exception = true
|
26
|
+
require 'timeout'
|
27
|
+
require 'fileutils'
|
28
|
+
require 'pathname'
|
29
|
+
require 'java' if OS.java?
|
30
|
+
|
31
|
+
Dir.chdir File.dirname(__FILE__) # always run from the spec dir...
|
32
|
+
autoload :YAML, 'yaml'
|
33
|
+
|
34
|
+
begin
|
35
|
+
require 'hitimes'
|
36
|
+
Benchmark.module_eval {
|
37
|
+
def self.realtime
|
38
|
+
Hitimes::Interval.measure { yield }
|
39
|
+
end
|
40
|
+
}
|
41
|
+
rescue LoadError
|
42
|
+
if OS.java?
|
43
|
+
Benchmark.module_eval {
|
44
|
+
def self.realtime
|
45
|
+
beginy = java.lang.System.nano_time
|
46
|
+
yield
|
47
|
+
(java.lang.System.nano_time - beginy)/1000000000.0
|
48
|
+
end
|
49
|
+
}
|
50
|
+
else
|
51
|
+
puts 'no hitimes available...'
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
#for file in Dir[File.dirname(__FILE__) + "/../lib/*"] do
|
57
|
+
# don't load them here in case one or other fails...
|
58
|
+
# require file
|
59
|
+
#end
|
60
|
+
|
61
|
+
require 'ffi'
|
62
|
+
|
63
|
+
if OS.windows?
|
64
|
+
# I guess they all don't need this...
|
65
|
+
module GetPid
|
66
|
+
extend FFI::Library
|
67
|
+
ffi_lib 'user32', 'kernel32'
|
68
|
+
ffi_convention :stdcall
|
69
|
+
attach_function :get_process_id_old, :GetProcessId, [ :ulong ], :uint
|
70
|
+
|
71
|
+
attach_function :GetWindowThreadProcessId, [:ulong, :pointer], :uint
|
72
|
+
|
73
|
+
def self.get_process_id_from_window hwnd
|
74
|
+
out = FFI::MemoryPointer.new(:uint)
|
75
|
+
GetWindowThreadProcessId(hwnd, out) # does translation automatically to ptr for us
|
76
|
+
out.get_uint32(0) # read_uint
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright 2010, Roger Pack
|
3
|
+
This file is part of Sensible Cinema.
|
4
|
+
|
5
|
+
Sensible Cinema is free software: you can redistribute it and/or modify
|
6
|
+
it under the terms of the GNU General Public License as published by
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
8
|
+
(at your option) any later version.
|
9
|
+
|
10
|
+
Sensible Cinema is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU General Public License
|
16
|
+
along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
=end
|
18
|
+
require 'rubygems'
|
19
|
+
require 'sane'
|
20
|
+
require 'RMagick'
|
21
|
+
|
22
|
+
to = ARGV[1] || 'pnm'
|
23
|
+
img = Magick::Image.read(File.binread ARGV[0])
|
24
|
+
png = img[0].to_blob {self.format = to } # TIFF
|
25
|
+
File.open("picture10." + to, "wb") {|file| file.puts png}
|
data/spec/deity_end.srt
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
6
|
2
|
+
00:00:55,068 --> 00:00:59,164
|
3
|
+
<i>We have our nordic gods, hunting</i>
|
4
|
+
<i>and a charming view of the sunsets.</i>
|
5
|
+
|
6
|
+
7
|
7
|
+
00:00:59,306 --> 00:01:02,298
|
8
|
+
<i>The onIy probIems are the pests.</i>
|
9
|
+
<I>The onIy probIems are the pests.< /i>< /I>
|
10
|
+
hymn title: a mighty fortress is our God.
|
11
|
+
|
data/spec/dragon.srt
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
1
|
2
|
+
00:00:34,715 --> 00:00:37,047
|
3
|
+
<i>This is Berk.</i>
|
4
|
+
<i>This is Berk.</i>
|
5
|
+
|
6
|
+
2
|
7
|
+
00:00:37,184 --> 00:00:41,587
|
8
|
+
<i>It's tweIve days north of hopeIess and a</i>
|
9
|
+
<i>few degrees south of freezing to death.</i>
|
10
|
+
|
11
|
+
3
|
12
|
+
00:00:41,722 --> 00:00:45,488
|
13
|
+
<i>It's Iocated soIidIy</i>
|
14
|
+
<i>on the meridian of misery.</i>
|
15
|
+
|
16
|
+
4
|
17
|
+
00:00:46,460 --> 00:00:50,089
|
18
|
+
<i>My viIIage. In a word, sturdy.</i>
|
19
|
+
<i>My viIIage. In a word, sturdy.</i>
|
20
|
+
|
21
|
+
5
|
22
|
+
00:00:50,230 --> 00:00:54,929
|
23
|
+
<i>It's been here for seven generations,</i>
|
24
|
+
<i>but every singIe hell buiIding is new.</i>
|
25
|
+
|
26
|
+
6
|
27
|
+
00:00:55,068 --> 00:00:59,164
|
28
|
+
<i>We study the nordic gods</i>
|
29
|
+
<i>and a charming view of the sunsets.</i>
|
30
|
+
|
31
|
+
7
|
32
|
+
00:00:59,306 --> 00:01:02,298
|
33
|
+
<i>The onIy probIems are the pests.</i>
|
34
|
+
<i>The onIy probIems are the pests.</i>
|
@@ -0,0 +1,270 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright 2010, Roger Pack
|
3
|
+
This file is part of Sensible Cinema.
|
4
|
+
|
5
|
+
Sensible Cinema is free software: you can redistribute it and/or modify
|
6
|
+
it under the terms of the GNU General Public License as published by
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
8
|
+
(at your option) any later version.
|
9
|
+
|
10
|
+
Sensible Cinema is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU General Public License
|
16
|
+
along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
=end
|
18
|
+
require File.expand_path(File.dirname(__FILE__) + '/common')
|
19
|
+
require_relative '../lib/edl_parser'
|
20
|
+
|
21
|
+
# MplayerEdl spec also exercises this pretty good...
|
22
|
+
|
23
|
+
describe EdlParser do
|
24
|
+
|
25
|
+
E = EdlParser
|
26
|
+
|
27
|
+
it "should parse" do
|
28
|
+
E.parse_string('"a" => "3"', nil).should == {"a"=>"3", "mutes"=>[], "blank_outs"=>[]}
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should sort 1:00:00 then 30:00 setting to the right order, though they defy ascii sorting"
|
32
|
+
|
33
|
+
it "should get mutes and blank_outs" do
|
34
|
+
string = <<-EOL
|
35
|
+
"mutes" => [
|
36
|
+
"00:00:01", "00:00:02",
|
37
|
+
"00:00:01", "00:00:02", "profanity", "dang",
|
38
|
+
],
|
39
|
+
"blank_outs" => [
|
40
|
+
"01:01:00", "01:02:00", "nudity", "...",
|
41
|
+
],
|
42
|
+
"missing_content" => "some stuff"
|
43
|
+
EOL
|
44
|
+
expected =
|
45
|
+
{
|
46
|
+
"mutes"=>[["00:00:01", "00:00:02"],
|
47
|
+
["00:00:01", "00:00:02", "profanity", "dang"]],
|
48
|
+
"blank_outs"=>[["01:01:00", "01:02:00", "nudity", "..."], ],
|
49
|
+
"missing_content"=>"some stuff",
|
50
|
+
}
|
51
|
+
E.parse_string(string, nil).should == expected
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should disallow full digits only" do
|
55
|
+
proc {E.parse_string(%!"mutes" => ["1234", "1235", "profanity", "yo"]!, nil) }.should raise_exception SyntaxError
|
56
|
+
proc {E.parse_string(%!"mutes" => ["0.0", "1.1", "profanity", "yo"]!, nil) }.should_not raise_exception
|
57
|
+
proc {E.parse_string(%!"mutes" => ["0.0", "1.1", "profanity", "yo", "1234", "1235", "bad entry"]!, nil) }.should raise_exception SyntaxError
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should extract digits well" do
|
61
|
+
out = ["00:00:01.1", "00:00:01"]
|
62
|
+
EdlParser.extract_entry!(out).should == ["00:00:01.1", "00:00:01"]
|
63
|
+
out.should == []
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should extract digits plus 'stuff' well" do
|
67
|
+
out = ["1:01", "1:01", "a", "2:01", " 2:02", "b"]
|
68
|
+
EdlParser.extract_entry!(out).should == ["1:01", "1:01", "a"]
|
69
|
+
EdlParser.extract_entry!(out).should == ["2:01", " 2:02", "b"]
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should parse with spaces ok" do
|
73
|
+
EdlParser.translate_string_to_seconds(" 2:02").should == 60*2+2
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should raise if the first two aren't digits, which is unexpected" do
|
77
|
+
proc { EdlParser.extract_entry!(["a"])}.should raise_exception(SyntaxError)
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should detect timestamps well" do
|
81
|
+
t = EdlParser::TimeStamp
|
82
|
+
for ts in ["2:01", "1:01.5", "00:00:00.5","00:00:00", "1:23", "01:23"]
|
83
|
+
raise ts unless t =~ ts
|
84
|
+
end
|
85
|
+
"5".should_not match(t)
|
86
|
+
"category".should_not match(t)
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should parse a real file" do
|
90
|
+
E.parse_file(File.expand_path(__DIR__) + "/../zamples/edit_decision_lists/dvds/bobs_big_plan.txt").should ==
|
91
|
+
{"title"=>"Bob's Big Plan", "dvd_title_track"=>1, "other notes"=>"could use more nit-picking of the song, as some parts seem all right in the end", "disk_unique_id"=>"12e77a76|b6e48ce8", "volume_name"=>"BOBS_BIG_PLAN","mutes"=>[["00:03.8", "01:03", "theme song is a bit raucous at times"], ["28:13.5", "29:40", "theme song again"], ["48:46", "49:08", "theme song again"]], "blank_outs"=>[]}
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should be able to use personal preferences to decide which edits to make" do
|
95
|
+
out = <<-EOL
|
96
|
+
"mutes" => [
|
97
|
+
"00:10", "00:15", "test category", "cat1",
|
98
|
+
"00:20", "00:25", "test category", "cat2",
|
99
|
+
"00:30", "00:35", "test category", "cat3"
|
100
|
+
]
|
101
|
+
EOL
|
102
|
+
parsed = E.parse_string out, nil
|
103
|
+
parsed["mutes"].length.should == 3 # has all of them
|
104
|
+
|
105
|
+
1.upto(2) do |n|
|
106
|
+
parsed = E.parse_string(out, nil, [["test category", "cat" + n.to_s]] )
|
107
|
+
parsed["mutes"].length.should == 2 # excludes one
|
108
|
+
end
|
109
|
+
parsed = E.parse_string(out, nil, [["test category", "cat1"], ["test category", "cat2"]] )
|
110
|
+
parsed["mutes"].length.should == 1 # excludes two
|
111
|
+
|
112
|
+
# now with...just saying "this entire category is fine"
|
113
|
+
parsed = E.parse_string(out, nil, [["test category"]])
|
114
|
+
parsed["mutes"].length.should == 0
|
115
|
+
|
116
|
+
pending do
|
117
|
+
# now with...just saying "levels below this are ok"
|
118
|
+
parsed = E.parse_string(out, nil, [["test category", 2]])
|
119
|
+
parsed["mutes"].length.should == 2
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
it "should parse mplayer_dvd_splits as strings" do
|
124
|
+
E.parse_string('"mplayer_dvd_splits" => []', 'fakename')['mplayer_dvd_splits'].should == []
|
125
|
+
E.parse_string('"mplayer_dvd_splits" => ["123.5","124.5"]', 'fakename')['mplayer_dvd_splits'].should == ["123.5","124.5"]
|
126
|
+
end
|
127
|
+
|
128
|
+
it "should reject misformatted files" do
|
129
|
+
proc {E.parse_string 'mutes=>["0:33", "0:34"]', 'filename'}.should raise_error(SyntaxError)
|
130
|
+
proc {E.parse_string '"mutes"=>["0:33", "0:34"]', 'filename'}.should_not raise_error
|
131
|
+
end
|
132
|
+
|
133
|
+
it "should sort exactly overlapping segments" do
|
134
|
+
proc { go({"mutes"=>{105=>145}, "blank_outs"=>{105=>145}})}.should raise_error(SyntaxError)
|
135
|
+
proc { go({"mutes"=>{105=>145}, "blank_outs"=>{110=>130}})}.should raise_error(SyntaxError)
|
136
|
+
proc { go({"mutes"=>{105=>145}, "blank_outs"=>{110=>150}})}.should raise_error(SyntaxError)
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should add to both ends" do
|
140
|
+
go({"mutes"=>{105=>145}}, 1).should == [[105.0, 146.0, :mute]]
|
141
|
+
go({"mutes"=>{105=>145}}, 1,1).should == [[104.0, 146.0, :mute]]
|
142
|
+
end
|
143
|
+
|
144
|
+
def go *args
|
145
|
+
EdlParser.convert_incoming_to_split_sectors *args
|
146
|
+
end
|
147
|
+
|
148
|
+
it "should raise for end before beginning" do
|
149
|
+
proc{ go({"mutes"=>{105=>104.9}})}.should raise_error(SyntaxError)
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should raise on poor overlap" do
|
153
|
+
proc{go({ "mutes"=>{5=>10, 6=>7}}, 0, 0, [])}.should raise_error(/overlap/i)
|
154
|
+
end
|
155
|
+
|
156
|
+
it "should take the greater of the end and beginning on combined splits and greater of the blank versus mute" do
|
157
|
+
# so if I have a very long mute with a mute in the middle, it should turn into a very long mute
|
158
|
+
go({ "mutes"=>{5=>10, 103=>107}}, 0, 0, []).should == [[5, 10, :mute], [103, 107, :mute]]
|
159
|
+
|
160
|
+
# and with blanks to the mix...
|
161
|
+
go({ "mutes"=>{5=>10}, "blank_outs" => {103=>110}}, 0, 0, []).should == [[5, 10, :mute], [103, 110, :blank]]
|
162
|
+
end
|
163
|
+
|
164
|
+
def translate x
|
165
|
+
EdlParser.translate_string_to_seconds x
|
166
|
+
end
|
167
|
+
|
168
|
+
def english y
|
169
|
+
EdlParser.translate_time_to_human_readable y
|
170
|
+
end
|
171
|
+
|
172
|
+
it "should translate strings to ints well" do
|
173
|
+
translate("00.09").should == 0.09
|
174
|
+
translate("1.1").should == 1.1
|
175
|
+
translate("01").should == 1
|
176
|
+
translate("1:01").should == 61
|
177
|
+
translate("1:01:01.1").should == 60*61+1.1
|
178
|
+
translate("1:01:01").should == 60*61+1
|
179
|
+
end
|
180
|
+
|
181
|
+
it "should translate subtitle type timestamps" do
|
182
|
+
translate("00:00:34,451").should == 34.451
|
183
|
+
end
|
184
|
+
|
185
|
+
it "should disallow malformed" do
|
186
|
+
proc {translate("00:00:34,45a")}.should raise_exception
|
187
|
+
end
|
188
|
+
|
189
|
+
it "should translate ints to english timestamps well" do
|
190
|
+
english(60).should == "01:00.00"
|
191
|
+
english(60.1).should == "01:00.10"
|
192
|
+
english(3600).should == "1:00:00.00"
|
193
|
+
english(3599).should == "59:59.00"
|
194
|
+
english(3660).should == "1:01:00.00"
|
195
|
+
english(3660 + 0.1).should == "1:01:00.10"
|
196
|
+
end
|
197
|
+
|
198
|
+
it "should auto-select a (nested) EDL if it matches a DVD's id" do
|
199
|
+
FileUtils.mkdir_p 'files/edls/a/b/c'
|
200
|
+
File.write('files/edls/a/b/c/yo.txt', %!"disk_unique_id" => "deadbeef|8b27d001"!)
|
201
|
+
EdlParser.single_edit_list_matches_dvd("deadbeef|8b27d001").should_not be nil
|
202
|
+
end
|
203
|
+
|
204
|
+
it "should not auto-select if you pass it nil" do
|
205
|
+
File.write('files/edls/yo', %!"disk_unique_id" => "deadbeef|8b27d001"!)
|
206
|
+
EdlParser.single_edit_list_matches_dvd(nil).should be nil
|
207
|
+
end
|
208
|
+
|
209
|
+
EdlParser::EDL_DIR.gsub!(/^.*$/, 'files/edls')
|
210
|
+
|
211
|
+
it "should not select a file if poorly formed" do
|
212
|
+
EdlParser.stub!(:parse_file) {
|
213
|
+
eval("a----")
|
214
|
+
}
|
215
|
+
EdlParser.single_edit_list_matches_dvd('fake md5') # doesn't choke
|
216
|
+
end
|
217
|
+
|
218
|
+
it "should return false if two EDL's match a DVD title" do
|
219
|
+
begin
|
220
|
+
EdlParser.single_edit_list_matches_dvd("abcdef1234").should be nil
|
221
|
+
File.binwrite('files/edls/a.txt', "\"disk_unique_id\" => \"abcdef1234\"")
|
222
|
+
EdlParser.single_edit_list_matches_dvd("abcdef1234").should == "files/edls/a.txt"
|
223
|
+
File.binwrite('files/edls//b.txt', "\"disk_unique_id\" => \"abcdef1234\"")
|
224
|
+
EdlParser.single_edit_list_matches_dvd("abcdef1234").should be nil
|
225
|
+
ensure
|
226
|
+
FileUtils.rm_rf 'files/edls/a.txt'
|
227
|
+
FileUtils.rm_rf 'files/edls/b.txt'
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
|
232
|
+
it "should merge two files if one specifies another" do
|
233
|
+
begin
|
234
|
+
File.binwrite('files/edls/a.txt', %!"take_from_relative_file" => "b.txt"!)
|
235
|
+
File.binwrite('files/edls/b.txt', %!!) # empty to start out with ...nothing up my sleeve...
|
236
|
+
EdlParser.parse_file('files/edls/a.txt').should == {"take_from_relative_file" => "b.txt", "mutes" => [], "blank_outs" => []}
|
237
|
+
File.binwrite('files/edls/b.txt', %!"blank_outs" => ["00:01", "00:03", "violence"], "yo" => "33"!)
|
238
|
+
EdlParser.parse_file('files/edls/a.txt').should == {"take_from_relative_file" => "b.txt", "mutes" => [], "blank_outs" => [["00:01", "00:03", "violence"]], "yo" => "33"}
|
239
|
+
ensure
|
240
|
+
FileUtils.rm_rf 'files/edls/a.txt'
|
241
|
+
FileUtils.rm_rf 'files/edls/b.txt'
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
before do
|
246
|
+
FileUtils.mkdir_p 'files/edls'
|
247
|
+
end
|
248
|
+
after do
|
249
|
+
FileUtils.rm_rf 'files/edls'
|
250
|
+
end
|
251
|
+
|
252
|
+
it "should download from imdb if specified and merge" do
|
253
|
+
File.binwrite('files/edls/a.txt', %!"imdb_id" => "tt1727587"!)
|
254
|
+
EdlParser.parse_file('files/edls/a.txt').should == {"blank_outs" => [["0:00:56.00", "0:00:57.00"], ["0:01:05.00", "0:01:14.50"]], "mutes" => [], "imdb_id" => "tt1727587"}
|
255
|
+
end
|
256
|
+
|
257
|
+
it "should be able to convert from 29.97 DVD time to DVDNAV time" do
|
258
|
+
|
259
|
+
#"dvd_title_track_start_offset" => "0.06",
|
260
|
+
#"dvd_nav_packet_offset" => [0.866667, 0.944217],
|
261
|
+
|
262
|
+
start = [[1.0, 2.0, :blank], [3600, 3601, :mute]]
|
263
|
+
endy = EdlParser.convert_to_dvd_nav_times start, 'dvd_start_offset', 0.06, [0.866667, 0.944217], 29.97
|
264
|
+
# it should be slightly higher than 1, and slightly less than 3600
|
265
|
+
endy.should == [[1.07655099900099900000, 2.07555199800199830000, :blank], [3596.48114640359600000000, 3597.48014740259760000000, :mute]]
|
266
|
+
end
|
267
|
+
|
268
|
+
it "should parse out bad beginning/ending subtitle entries"
|
269
|
+
|
270
|
+
end
|