sensible-cinema 0.34.0 → 0.35.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/.gitmodules +1 -1
  2. data/README.TXT +19 -20
  3. data/Rakefile +191 -195
  4. data/TODO +122 -149
  5. data/VERSION +1 -1
  6. data/bin/sensible-cinema +52 -52
  7. data/change_log_with_feature_list.txt +532 -481
  8. data/documentation/troubleshooting.txt +3 -9
  9. data/go.bat +2 -2
  10. data/go.sh +1 -0
  11. data/goc.bat +1 -1
  12. data/goc.sh +1 -0
  13. data/lib/check_installed_mac.rb +2 -10
  14. data/lib/edl_parser.rb +40 -16
  15. data/lib/gui/base.rb +85 -27
  16. data/lib/gui/create-file.rb +3 -2
  17. data/lib/gui/create.rb +118 -101
  18. data/lib/gui/dependencies.rb +110 -76
  19. data/lib/gui/normal.rb +32 -81
  20. data/lib/mplayer_edl.rb +7 -1
  21. data/lib/subtitle_profanity_finder.rb +10 -5
  22. data/notes_for_potential_developers.txt +18 -25
  23. data/spec/bad_beginning.srt +3778 -0
  24. data/spec/edl_parser.spec.rb +4 -0
  25. data/spec/notes +327 -167
  26. data/spec/youtube_edl.spec.rb +28 -0
  27. data/template_bats/RUN SENSIBLE CINEMA CLICK HERE WINDOWS.bat +2 -2
  28. data/todo.inventionzy.txt +3 -1
  29. data/vendor/mplayer_patches/how_to_doze.bat +6 -0
  30. data/vendor/mplayer_patches/port_dir/PortIndex.quick +1 -1
  31. data/vendor/mplayer_patches/port_dir/how_to +16 -9
  32. data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/Portfile +10 -25
  33. data/vendor/mplayer_patches/port_dir/multimedia/rdp-projects/Portfile +2 -2
  34. data/vendor/mplayer_patches/{configure_from_betterlogic → port_dir_is_for_mac} +0 -0
  35. data/www/content_editor.html +9 -5
  36. data/zamples/edit_decision_lists/dvds/big_buck_bunny_dvd.txt +7 -4
  37. data/zamples/edit_decision_lists/dvds/court_jester.txt +0 -1
  38. data/zamples/edit_decision_lists/dvds/edls_being_edited/father_goose.txt +41 -0
  39. data/zamples/edit_decision_lists/dvds/edls_being_edited/harry_potter_and_the_goblet_of_fire.txt +45 -0
  40. data/zamples/edit_decision_lists/dvds/edls_being_edited/national_treasure.txt +6 -3
  41. data/zamples/edit_decision_lists/dvds/edls_being_edited/percy_jackson_lightening_thief.txt +40 -0
  42. data/zamples/edit_decision_lists/dvds/edls_being_edited/percy_jackson_lightening_thief_mute_scary.txt +23 -0
  43. data/zamples/edit_decision_lists/dvds/edls_being_edited/puss_in_boots.txt +33 -0
  44. data/zamples/edit_decision_lists/dvds/edls_being_edited/ratatouille.txt +5 -5
  45. data/zamples/edit_decision_lists/dvds/edls_being_edited/rio.txt +24 -0
  46. data/zamples/edit_decision_lists/dvds/sintel_open_source_blender_ntsc_dvd.txt +0 -1
  47. metadata +17 -15
  48. data/lib/count_down_timer_jruby_swing.rb +0 -55
  49. data/vendor/mplayer_patches/apply.bat +0 -12
  50. data/vendor/mplayer_patches/libdvdnav/2905259c3b45529b3d8dedba572b6e4f67a2d8f4.diff +0 -19
  51. data/vendor/mplayer_patches/libdvdnav/83f1c9256f500285e46f1e44bcc74ffce90159db.diff +0 -16
  52. data/vendor/mplayer_patches/libdvdnav/eb91fb74680d30322461a1b9e425918ad4e2b2df.diff +0 -21
  53. data/vendor/mplayer_patches/libdvdnav/jump_to_time.diff +0 -654
  54. data/vendor/mplayer_patches/libdvdnav/non_strict.diff +0 -13
  55. data/vendor/mplayer_patches/mplayer_edl.diff +0 -354
  56. data/vendor/mplayer_patches/updated_lib_too +0 -0
@@ -1,47 +1,50 @@
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
-
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 and agree to abide by the implications noted in 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
+ eval("OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE") if full_url =~ /https/
29
+ keep_going_bg_thread = true
30
+ print 'downloading'
31
+ Thread.new { while keep_going_bg_thread; print '.'; sleep 1; end}
32
+ writeOut = open(to_here, "wb")
33
+ writeOut.write(open(full_url).read)
34
+ writeOut.close
35
+ keep_going_bg_thread = false
36
+ puts 'done!'
37
+ end
38
+
39
+ def self.download_to_string full_url
40
+ require 'tempfile'
41
+ to = Tempfile.new 'abc'
42
+ download(full_url, to.path)
43
+ out = File.binread(to.path)
44
+ to.delete
45
+ out
46
+ end
47
+
45
48
 
46
49
  def download_7zip
47
50
  Dir.mkdir('./vendor/cache') unless File.directory? 'vendor/cache' # development may not have it created yet... [?]
@@ -78,29 +81,27 @@ module SensibleSwing
78
81
  true
79
82
  end
80
83
  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
84
+ end
85
+
86
+ def check_for_file_manipulation_dependencies
87
+ 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...
88
+ 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."
89
+ 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"
90
+ old = File.binread 'vendor/cache/mencoder/mplayer.exe'
91
+ old.gsub! "V:%6.1f", "V:%6.2f" # better precision! though I don't use that for playing anymore :)
92
+ File.binwrite('vendor/cache/mencoder/mplayer.exe', old)
93
+ end
92
94
  end
93
95
 
94
- def check_for_various_dependencies
95
-
96
+ def check_for_various_dependencies
96
97
  if OS.doze? && !check_for_exe('vendor/cache/mplayer_edl/mplayer.exe', nil)
97
98
  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
99
  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
100
+ puts 'downloading mplayer edl [12 MB]'
101
+ MainWindow.download('http://sourceforge.net/projects/mplayer-edl/files/0.4/mplayer.exe', 'vendor/cache/mplayer_edl/mplayer.exe')
102
+ config_dir = File.expand_path('~/mplayer')
103
+ FileUtils.mkdir(config_dir) unless File.directory?(config_dir)
104
+ FileUtils.cp('vendor/subfont.ttf', config_dir) # TODO mac
104
105
  end
105
106
 
106
107
  # runtime dependencies, at least as of today...
@@ -114,22 +115,23 @@ module SensibleSwing
114
115
  else
115
116
  path = RubyWhich.new.which('smplayer')
116
117
  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"
118
+ # this one has its own installer...
119
+ 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."
120
+ save_to_dir = SwingHelpers.new_existing_dir_chooser_and_go 'pick dir to save smplayer exe installer to:'
121
+ save_to_file = "#{save_to_dir}/smplayer-0.6.9-win32.exe"
122
+ puts "downloading smplayer.exe [14MB] to #{save_to_file}"
123
+ MainWindow.download "http://sourceforge.net/projects/smplayer/files/SMPlayer/0.6.9/smplayer-0.6.9-win32.exe", save_to_file
124
+ show_blocking_message_dialog "Run this file to install it (ok to reveal): smplayer-0.6.9-win32.exe"
124
125
  show_in_explorer save_to_file
125
126
  sleep 2
126
- show_blocking_message_dialog "hit ok after smplayer is installed:"
127
+ show_blocking_message_dialog "hit ok after smplayer is installed:"
127
128
  end
128
129
  end
129
130
  end
130
-
131
+
131
132
  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
+ force_accept_file_style_license
134
+ message = "Do you certify you own the DVD this came of and have it in your possession, if necessary in your legal jurisdiction?"
133
135
  title = "Verify ownership"
134
136
  returned = JOptionPane.show_select_buttons_prompt(message, {:yes => "no", :no => "yes"})
135
137
  assert_confirmed_dialog returned, nil
@@ -157,8 +159,8 @@ module SensibleSwing
157
159
  if license_url_should_also_be_embedded_by_you_in_message
158
160
  SwingHelpers.open_url_to_view_it_non_blocking license_url_should_also_be_embedded_by_you_in_message
159
161
  puts "Please restart after reading license agreement, to be able to then accept it."
160
- else
161
- puts 'dialog assertion failed'
162
+ else
163
+ puts 'dialog assertion failed'
162
164
  end
163
165
  System.exit 0
164
166
  elsif returned == :cancel
@@ -172,6 +174,38 @@ module SensibleSwing
172
174
  else
173
175
  raise 'unknown?'
174
176
  end
175
- end
176
- end
177
+ end
178
+
179
+ def set_individual_preferences
180
+ 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]."
181
+ 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
182
+ LocalStorage['have_zoom_button'] = true
183
+ else
184
+ LocalStorage['have_zoom_button'] = false
185
+ end
186
+ # TODO break these out into create mode prefs versus human [?]
187
+ if JOptionPane.show_select_buttons_prompt("Would you like to enable obscure options, like using keyboard shortcuts to create EDL files on the fly, or creating euphemized .srt files (you probably don't)?") == :yes
188
+ LocalStorage['prompt_obscure_options'] = true
189
+ else
190
+ LocalStorage['prompt_obscure_options'] = false
191
+ end
192
+ true
193
+ end
194
+
195
+ def get_set_preference name, english_name
196
+ old_preference = LocalStorage[name]
197
+ old_class = old_preference.class
198
+
199
+ new_preference = get_user_input("Enter value for #{english_name}", old_preference)
200
+ display_and_raise 'enter something like 0.0' if new_preference.empty?
201
+ if old_class == Float
202
+ new_preference = new_preference.to_f
203
+ elsif old_class == String
204
+ # leave same
205
+ else
206
+ raise 'unknown type?' + old_class.to_s
207
+ end
208
+ LocalStorage[name] = new_preference
209
+ end
210
+ end # MainWindow
177
211
  end
@@ -23,12 +23,8 @@ module SensibleSwing
23
23
 
24
24
  attr_accessor :parent, :upconv_line
25
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
26
  def hard_exit; java::lang::System.exit 0; end
27
+
32
28
  def setup_normal_buttons
33
29
  add_text_line ""
34
30
 
@@ -36,10 +32,10 @@ module SensibleSwing
36
32
  @mplayer_edl.tool_tip = "This will watch your DVD in realtime from your computer while skipping/muting questionable scenes."
37
33
  @mplayer_edl.on_clicked {
38
34
  play_smplayer_edl_non_blocking
39
- sleep 5
40
- puts 'enjoy your movie playing in other window'
35
+ sleep 5
36
+ puts 'enjoy your movie playing in other window'
41
37
  sleep 1
42
- hard_exit # paranoid on usage LOL
38
+ hard_exit if OS.doze? # paranoid on cpu usage LOL LODO mac too? it kills mplayer child processes currently...hmm...
43
39
  }
44
40
 
45
41
  add_callback_for_dvd_edl_present { |disk_available, edl_available|
@@ -59,6 +55,7 @@ module SensibleSwing
59
55
  }
60
56
 
61
57
  @watch_file_edl = new_jbutton( "Watch movie file edited (realtime)" ) do
58
+ force_accept_file_style_license
62
59
  choose_file_and_edl_and_create_sxs_or_play false
63
60
  end
64
61
 
@@ -69,7 +66,8 @@ module SensibleSwing
69
66
  It takes quite awhile maybe 2 hours. Sometimes the progress bar will look paused--it typically continues eventually.
70
67
  EOL
71
68
  @create.on_clicked {
72
- check_for_file_manipulation_dependencies
69
+ force_accept_file_style_license
70
+ check_for_file_manipulation_dependencies
73
71
  do_create_edited_copy_via_file false
74
72
  }
75
73
 
@@ -83,17 +81,27 @@ module SensibleSwing
83
81
  end
84
82
 
85
83
  @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."
84
+ set_individual_preferences
85
+ 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."
86
+ upconvert_window = new_child_window
87
+ upconvert_window.add_change_upconvert_buttons
88
+ end
89
+ @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
90
 
93
- new_jbutton("Create new Edit Decision List") do
94
- window = new_child_window
95
- window.setup_advanced_buttons
96
- end
91
+ new_jbutton("Create new Edit Decision List") do
92
+ window = new_child_window
93
+ window.setup_create_buttons
94
+ end
95
+
96
+ @upload = new_jbutton("Feedback/submissions welcome!") # keeps this one last! :)
97
+ @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!"
98
+ @upload.on_clicked {
99
+ show_blocking_message_dialog "ok, next it will open up the groups page now or optionally an email you could send"
100
+ system_non_blocking("start mailto:sensible-cinema@googlegroups.com")
101
+ system_non_blocking("start http://groups.google.com/group/sensible-cinema")
102
+ }
103
+ increment_button_location
104
+
97
105
 
98
106
  @progress_bar = JProgressBar.new(0, 100)
99
107
  @progress_bar.set_bounds(44,@starting_button_y,@button_width,23)
@@ -101,21 +109,7 @@ module SensibleSwing
101
109
  @panel.add @progress_bar
102
110
  add_text_line ""# spacing
103
111
  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
112
+
119
113
 
120
114
  def add_open_documentation_button
121
115
  @open_help_file = new_jbutton("View Sensible Cinema Documentation") do
@@ -124,16 +118,14 @@ module SensibleSwing
124
118
  end
125
119
 
126
120
  # 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
121
+ def choose_file_and_edl_and_create_sxs_or_play just_create_xbmc_dot_edl_file_instead_of_play
128
122
  filename_mpg = new_existing_file_selector_and_select_file( "Pick moviefile (like moviename.mpg or video_ts/anything.ext)")
129
123
  edl_filename = new_existing_file_selector_and_select_file( "Pick an EDL file to use with it", EdlParser::EDL_DIR)
130
124
  assert_ownership_dialog
131
- if just_create_dot_edl_file_instead_of_play
125
+ if just_create_xbmc_dot_edl_file_instead_of_play
132
126
  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 = []
127
+ # XBMC can use english timestamps
128
+ 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
137
129
  output_file = filename_mpg.gsub(/\.[^\.]+$/, '') + '.edl' # sanitize...
138
130
  File.write(output_file, edl_contents)
139
131
  raise unless File.exist?(output_file) # sanity
@@ -143,47 +135,6 @@ module SensibleSwing
143
135
  end
144
136
  end
145
137
 
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
138
 
188
139
  end
189
140
  end
@@ -19,7 +19,8 @@ This file is part of Sensible Cinema.
19
19
  require_relative 'edl_parser'
20
20
 
21
21
  class MplayerEdl
22
- def self.convert_to_edl specs, add_this_many_to_end = 0, add_this_many_to_beginning = 0, splits = [], extra_time_to_all = 0.0
22
+
23
+ def self.convert_to_edl specs, add_this_many_to_end = 0, add_this_many_to_beginning = 0, splits = [], extra_time_to_all = 0.0, use_english_timestamps = false
23
24
 
24
25
  # simple re-map to EDL style output
25
26
  combined = EdlParser.convert_incoming_to_split_sectors specs, add_this_many_to_end, add_this_many_to_beginning, splits
@@ -29,8 +30,13 @@ class MplayerEdl
29
30
  for start, endy, type in combined
30
31
  start += extra_time_to_all
31
32
  endy += extra_time_to_all
33
+ if use_english_timestamps
34
+ start = EdlParser.translate_time_to_human_readable start
35
+ endy = EdlParser.translate_time_to_human_readable endy
36
+ end
32
37
  out += "#{start} #{endy} #{map[type]}\n"
33
38
  end
34
39
  out
35
40
  end
41
+
36
42
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # warning: somewhat scary/explicit down there!
3
- # see also todo.subtitle file, though what's here is mostly pretty well functional
3
+ # see also todo.subtitle file, though what's here is mostly pretty well functional/complete
4
4
  #
5
5
  begin
6
6
  require 'sane'
@@ -35,11 +35,15 @@ module SubtitleProfanityFinder
35
35
  out.beginning_time = EdlParser.translate_string_to_seconds ts_begin
36
36
  out.ending_time = EdlParser.translate_string_to_seconds ts_end
37
37
  out.text = text.strip # harmless right?
38
- out.single_line_text = text.strip.gsub(/^[- ,_\.]+/, '').gsub(/[- ,_]+$/, '').gsub(/[\r\n]/, ' ')
38
+ add_single_line_minimized_text_from_multiline out
39
39
  out
40
40
  }
41
41
  end
42
-
42
+
43
+ def self.add_single_line_minimized_text_from_multiline entry
44
+ entry.single_line_text = entry.text.strip.gsub(/^[- ,_\.]+/, '').gsub(/[- ,_]+$/, '').gsub(/[\r\n]/, ' ')
45
+ end
46
+
43
47
  # convert string to regexp, also accomodating for "full word" type profanities
44
48
  def self.convert_to_regexps profanity_hash
45
49
  all_profanity_combinations = []
@@ -138,8 +142,8 @@ module SubtitleProfanityFinder
138
142
  111.chr +
139
143
  100.chr +
140
144
  's' => 'deitys',
141
- 'meu deus' => 'lo..',
142
- 'lord' => 'lo..', 'da' +
145
+ 'meu deus' => 'l...',
146
+ 'lord' => 'l...', 'da' +
143
147
  'mn' => 'da..',
144
148
  'f' +
145
149
  117.chr +
@@ -232,6 +236,7 @@ module SubtitleProfanityFinder
232
236
  text.gsub!(/\[+/, '[')
233
237
  text.gsub!(/\]+/, ']')
234
238
  entry.text = text
239
+ add_single_line_minimized_text_from_multiline entry
235
240
  text = text.gsub(/[\r\n]|\n/, ' ') # flatten up to 3 lines of text to just 1
236
241
  ts_begin_human = EdlParser.translate_time_to_human_readable ts_begin, true
237
242
  ts_end_human = EdlParser.translate_time_to_human_readable ts_end, true