sensible-cinema 0.14.4 → 0.14.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/ChangeLog +4 -0
  2. data/LICENSE +23 -3
  3. data/README +19 -9
  4. data/Rakefile +66 -3
  5. data/TODO +29 -52
  6. data/VERSION +1 -1
  7. data/bin/sensible-cinema +49 -37
  8. data/bin/sensible-cinema-cli +11 -11
  9. data/lib/ocr.rb +10 -2
  10. data/lib/overlayer.rb +1 -1
  11. data/lib/screen_tracker.rb +7 -13
  12. data/lib/swing_helpers.rb +11 -0
  13. data/lib/vlc_programmer.rb +1 -1
  14. data/run_sensible_cinema.bat +5 -0
  15. data/sensible-cinema.gemspec +130 -147
  16. data/spec/swing_helpers.spec.rb +11 -2
  17. data/spec/vlc_programmer.spec.rb +1 -1
  18. data/todo_if_need_speed +6 -0
  19. data/zamples/{scene_lists → edit_decision_lists}/category descriptions.txt +0 -0
  20. data/zamples/{scene_lists → edit_decision_lists}/dvds/White Christmas.txt +0 -0
  21. data/zamples/{scene_lists → edit_decision_lists}/dvds/all_dogs_go_to_heaven_dvd.txt +1 -1
  22. data/zamples/{scene_lists → edit_decision_lists}/dvds/bobs_big_plan.txt +4 -1
  23. data/zamples/{scene_lists → edit_decision_lists}/dvds/cars_disney.txt +0 -0
  24. data/zamples/{scene_lists → edit_decision_lists}/dvds/happy_feet_dvd.txt +0 -0
  25. data/zamples/{scene_lists → edit_decision_lists}/dvds/labyrinth.txt +0 -0
  26. data/zamples/{scene_lists → edit_decision_lists}/dvds/making marriage work.txt +0 -0
  27. data/zamples/{scene_lists/example_scene_descriptions_list.txt → edit_decision_lists/example_edit_decision_list.txt} +0 -0
  28. data/zamples/{scene_lists → edit_decision_lists}/star_trek_generations_hulu.txt +0 -0
  29. data/zamples/{scene_lists → edit_decision_lists}/youtube/gummy_bear_song_youtube.txt +0 -0
  30. data/zamples/{scene_lists → edit_decision_lists}/youtube/nuki_song_youtube.txt +0 -0
  31. data/zamples/players/how_to_create_more_players.txt +1 -1
  32. metadata +287 -282
  33. data/vendor/imagemagick/CORE_RL_Magick++_.dll +0 -0
  34. data/vendor/imagemagick/CORE_RL_bzlib_.dll +0 -0
  35. data/vendor/imagemagick/CORE_RL_jbig_.dll +0 -0
  36. data/vendor/imagemagick/CORE_RL_jp2_.dll +0 -0
  37. data/vendor/imagemagick/CORE_RL_jpeg_.dll +0 -0
  38. data/vendor/imagemagick/CORE_RL_lcms_.dll +0 -0
  39. data/vendor/imagemagick/CORE_RL_libxml_.dll +0 -0
  40. data/vendor/imagemagick/CORE_RL_magick_.dll +0 -0
  41. data/vendor/imagemagick/CORE_RL_png_.dll +0 -0
  42. data/vendor/imagemagick/CORE_RL_tiff_.dll +0 -0
  43. data/vendor/imagemagick/CORE_RL_ttf_.dll +0 -0
  44. data/vendor/imagemagick/CORE_RL_wand_.dll +0 -0
  45. data/vendor/imagemagick/CORE_RL_xlib_.dll +0 -0
  46. data/vendor/imagemagick/CORE_RL_zlib_.dll +0 -0
  47. data/vendor/imagemagick/X11.dll +0 -0
  48. data/vendor/imagemagick/Xext.dll +0 -0
  49. data/vendor/imagemagick/atl90.dll +0 -0
  50. data/vendor/imagemagick/convert.exe +0 -0
  51. data/vendor/imagemagick/identify.exe +0 -0
  52. data/vendor/imagemagick/mfc90.dll +0 -0
  53. data/vendor/imagemagick/msvcp90.dll +0 -0
  54. data/vendor/imagemagick/msvcr90.dll +0 -0
  55. data/vendor/imagemagick/vcomp90.dll +0 -0
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.14.5 ==
2
+
3
+ Make it distributable more easily.
4
+
1
5
  == 0.14.4 ==
2
6
 
3
7
  Add a progress bar.
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- All files released under the GPLv3 license [1] unless otherwise specified. Ping me if you need this changed.
1
+ All files released under the GPLv3 license [1] unless otherwise specified. Ping me if you want this changed.
2
2
 
3
- May contain some 3rd party libraries under their own (separate, open source) license.
3
+ May contain some 3rd party libraries under their own (separate, open source) licenses.
4
4
 
5
5
  Note that this software should be legal in the EU,
6
6
  as it is only software and therefore theoretically not subject to patents (see "What about patent licenses?" in [2]).
@@ -16,4 +16,24 @@ http://betterlogic.com/roger/?p=2618
16
16
  Enjoy!
17
17
 
18
18
  [1] http://www.gnu.org/licenses/gpl.html, also gplv3 file.
19
- [2] http://www.videolan.org/support/faq.html
19
+ [2] http://www.videolan.org/support/faq.html
20
+
21
+
22
+ honest about DMCA (we don't distribute the cracker, we don't redistribute, don't perform any acts, etc.)
23
+ if you burn you'll eventually be using a DMCA compatible player :P
24
+ long list of players...we're not alone :)
25
+ the authors of the program might not be liable for damages. We don't feel dishonest about it, as long as
26
+ we own the DVD and have it with us when we watch the edited version.
27
+
28
+
29
+ not more unethical than ripping your DVD collection to hard drive so you can keep your DVD's all in one
30
+ place and don't have to worry about losing them. Then you edit them manually to remove cruft, and watch them
31
+ from there.
32
+
33
+ note that you are watching it using only bits and pieces of the original, similar to said bill. And the
34
+ authors of the program might not be cupable of copyright infringement themselves, since they distribute no infringed materials.
35
+
36
+ Not responsible for your actions. Don't redistribute. "You run the risk on your own"
37
+ "should the courts someday rule..." If DVD next to me...
38
+
39
+ fair use may apply
data/README CHANGED
@@ -1,5 +1,10 @@
1
- Sensible-cinema is a program that allows you to do pre-programmed scene selection (i.e. "mute out"
2
- or "bleep out" scenes) on arbitrary media players like netflix online, vlc (for DVD's), etc.
1
+ Sensible-cinema is a program that allows you to do pre-programmed edit decision lists (i.e. "mute out"
2
+ or "bleep out" scenes) for DVD's.
3
+ An experimental player also works on arbitrary media players like netflix online, vlc, hulu, etc.
4
+
5
+ Note that this README is outdated. Currently just run sensible-cinema in jruby and the GUI will guide you :)
6
+
7
+ == old Readme ==
3
8
 
4
9
  Currently it takes as input a list of "skippable" scenes, and a player description.
5
10
  It then tracks whichever player you are using, and mutes or blanks out the system appropriately,
@@ -39,7 +44,7 @@ Next install the gem by either opening up the command window or hitting windows+
39
44
  It could theoretically be ported to MRI 1.9.2, if anybody wanted to do so.
40
45
  Also if anybody would be interested in porting this to Linux I'd be happy to collaborate.
41
46
 
42
- You can test that it's installed by running it (see above) and selecting the "example_scene_list.yml", and
47
+ You can test that it's installed by running it (see above) and selecting the "example_edit_decision_list.txt", and
43
48
  choosing the hulu player.
44
49
 
45
50
  It will proceed do a few "demo" mutes and blank outs.
@@ -57,7 +62,7 @@ blank_outs:
57
62
 
58
63
  Here's one with more detail
59
64
 
60
- http://github.com/rdp/sensible-cinema/blob/master/zamples/scene_lists/example_scene_list.yml
65
+ http://github.com/rdp/sensible-cinema/blob/master/zamples/edit_decision_lists/example_edit_decision_list.yml
61
66
 
62
67
  Basically your job is to save an appropriate file like that somewhere,
63
68
  then start sensible-cinema and instruct it to use your new file.
@@ -70,9 +75,9 @@ So here is a way to create your scene descriptions file.
70
75
  First create a new file
71
76
 
72
77
  The easiest way to do this is to start sensible-cinema, then instead of choosing an existing file,
73
- "right click" on the existing file "example_scene_list.yml" and choose "Copy"
78
+ "right click" on the existing file "example_edit_decision_list.txt" and choose "Copy"
74
79
  now right click below the list of files and choose "paste"
75
- This will create the file "example_scene_list Copy.yml"
80
+ This will create the file "example_edit_decision_list Copy.txt"
76
81
  Right click on it, choose rename, and give it a better name.
77
82
  Now open it.
78
83
  You can make changes to this file *on the fly* while the player is still playing. It will notice
@@ -131,7 +136,7 @@ A. This enables your player to keep its on-screen time tracker, which in turn al
131
136
  You could specify the scene descriptions list and player list on the command-line, if you don't want to have
132
137
  to pick them each time, like:
133
138
 
134
- C:\> jruby -S sensible-cinema scene_descriptions_list.yml player_description.yml
139
+ C:\> jruby -S sensible-cinema edit_decision_list.yml player_description.yml
135
140
 
136
141
  Also if you specify "test" for the scene descriptions file, it will pause 4s, take a snapshot of the player, then exit.
137
142
  You can also specify -v or -t if you want to enable more verbose (chatty) output.
@@ -158,18 +163,23 @@ The concept isn't too novel. Some examples:
158
163
  Clean Flicks
159
164
  http://en.wikipedia.org/wiki/Linear_video_editing
160
165
  http://imdb.com tends to have reasonably good lists of what occurs in movies (find a movie, click on "parent's guide" on the left). Sometimes it even lists the time signatures for events (ex: "Labyrinth" http://www.imdb.com/title/tt0091369/parentalguide) which you could use to translate into a sensible-cinema compatible list.
161
- Edited "on airplane" style movies.
166
+ Edited "airplane edit" style movies.
167
+ Normal movies versus "directors cut unedited" movies (one is sometimes preferable)
162
168
  http://en.wikipedia.org/wiki/Edit_decision_list (it's a linear editing tool, after all--so see the vast list of those)
163
169
  http://www.oreillynet.com/sysadmin/blog/2005/06/make_your_own_phantom_edit_wit.html (mplayer has had this ability for awhile).
164
170
  http://clearplay.com commercial (tracks DVD's while they play--closed source, costs money, no user contribution possible), and only for DVD's (uses its own DVD-player in its current incantation).
165
171
  http://forum.bsplayer.com/feature-requests-feedback-suggestions/7157-chapter-playlist-scene-cut-3.html
166
- http://www.inmatrix.com/ "scene cut editor" of the zoom player
172
+ http://www.inmatrix.com "scene cut editor" of the zoom player
167
173
  http://wiki.xbmc.org/?title=EDL_(commercial_skipping)_and_SceneMarker_support (XBMC's scene cut support--also contains links to some other editors)
174
+ htp://dvdshrink.info "Re-author" mode: to make "movie-only" backups, compilations, combine "flippers",.... DvdShrink has always had the ability to "crop or cut parts of a title" etc.
175
+ The VCR and the record button, coupled with the pause+rewind button (to edit out unwanted content).
168
176
  http://code.google.com/p/movie-content-editor (written in Python, controls VLC based on captions and scene lists)
169
177
  http://www.imdb.com/swiki/special?ParentalGuideHelp (search for "scene description")
170
178
  http://www.mythtv.org/wiki/Removing_Commercials
171
179
  The remote control with the pause, mute, stop, fast forward, and play buttons, along with previous knowledge of scene locations
172
180
  The scissors and old VHS tapes (Clean Flicks' origin, BTW).
181
+ Windows Movie Maker allows for users to cut and copy scenes of movies to their heart's content.
182
+ http://forum.videolan.org/viewtopic.php?f=7&t=56998 VLC Media Player can do it with playlists for quite awhile
173
183
 
174
184
  == Feedback ==
175
185
 
data/Rakefile CHANGED
@@ -9,12 +9,13 @@ Jeweler::Tasks.new do |s|
9
9
  s.add_dependency 'sane', '>= 0.22.0'
10
10
  s.add_dependency 'rdp-win32screenshot', '>= 0.0.7.3'
11
11
  s.add_dependency 'mini_magick', '>= 3.1' # for ocr...
12
+ s.add_dependency 'whichr', '>= 0.3.6'
12
13
  s.add_dependency 'jruby-win32ole'
13
14
  s.add_dependency 'rdp-ruby-wmi'
14
15
  s.add_dependency 'ffi' # mouse, etc.
15
16
  s.add_development_dependency 'rspec' # prefer rspec 2 I guess...
16
17
  s.add_development_dependency 'jeweler'
17
- s.add_development_dependency 'hitimes' # now jruby compat. yea!
18
+ s.add_development_dependency 'hitimes' # now jruby compat!
18
19
  s.extensions = ["ext/mkrf_conf.rb"]
19
20
  end
20
21
 
@@ -37,7 +38,69 @@ task 'spec' do
37
38
 
38
39
  end
39
40
 
40
- desc 'collect gem deps for distribution zip'
41
+ def get_transitive_dependencies dependencies
42
+ new_dependencies = []
43
+ dependencies.each{|d|
44
+ gem d.name # make sure it's loaded so that it'll be in Gem.loaded_specs
45
+ dependency_spec = Gem.loaded_specs.select{|name, spec| name == d.name}[0][1]
46
+ transitive_deps = dependency_spec.runtime_dependencies
47
+ new_dependencies << transitive_deps
48
+ }
49
+ new_dependencies.flatten
50
+ end
51
+
52
+ desc 'collect binary and gem deps for distribution'
41
53
  task 'bundle_dependencies' => 'gemspec' do
54
+ require 'whichr'
55
+ require 'fileutils'
56
+ require 'net/http'
57
+
42
58
  spec = eval File.read('sensible-cinema.gemspec')
43
- end
59
+ dependencies = spec.runtime_dependencies
60
+ dependencies = dependencies + get_transitive_dependencies(dependencies)
61
+ Gem.loaded_specs.select{|name, spec| name == 'os'}
62
+ FileUtils.rm_rf 'vendor/cache'
63
+ Dir.mkdir 'vendor/cache'
64
+ Dir.chdir 'vendor/cache' do
65
+ dependencies.each{|d|
66
+ system("gem unpack #{d.name}")
67
+ }
68
+ # add imagemagick
69
+ Dir.mkdir 'imagemagick'
70
+ im_dir = RubyWhich.new.which('identify').select{|dir| dir =~ /ImageMagick/}[0]
71
+ # "d:\\installs\\ImageMagick-6.6.2-Q16\\identify.EXE",
72
+ Dir["#{File.dirname im_dir}/*"].each{|file|
73
+ FileUtils.cp(file, 'imagemagick') rescue nil # some fail for some odd reason
74
+ }
75
+
76
+ # jruby complete .jar file
77
+ Net::HTTP.start("jruby.org.s3.amazonaws.com") { |http|
78
+ resp = http.get("/downloads/1.5.5/jruby-complete-1.5.5.jar")
79
+ open("jruby-complete-1.5.5.jar", "wb") { |file|
80
+ file.write(resp.body)
81
+ }
82
+ }
83
+ # create a shunt win32ole file, so that require 'win32ole' will work.
84
+ Dir.mkdir 'lib'
85
+ File.write('lib/win32ole.rb', 'require "jruby-win32ole"')
86
+
87
+ end # chdir
88
+
89
+ end
90
+
91
+ desc 'create distro zippable file'
92
+ task 'create_distro_dir' do
93
+ raise 'need bundle_dependencies first' unless File.directory? 'vendor/cache'
94
+ require 'fileutils'
95
+ spec = eval File.read('sensible-cinema.gemspec')
96
+ require 'ruby-debug'
97
+ #debugger
98
+ dir_out = spec.name + "-" + spec.version.version + '/sensible-cinema'
99
+ FileUtils.rm_rf dir_out + '/..' # in case it exists
100
+ existing = Dir['*']
101
+ FileUtils.mkdir_p dir_out
102
+ FileUtils.cp_r(existing, dir_out)
103
+ # this one belongs in the trunk
104
+ FileUtils.cp("#{dir_out}/run_sensible_cinema.bat", "#{dir_out}/..")
105
+ p 'created ' + dir_out
106
+ end
data/TODO CHANGED
@@ -12,6 +12,7 @@
12
12
  == slightly lower than that ==
13
13
 
14
14
  auto-select EDL
15
+ can even tell them a button "play movie x" or what not, has been detected
15
16
 
16
17
  can parse IMDB (require they put in the URL by hand fer now)
17
18
  add stuffs to imdb hmmm
@@ -29,24 +30,19 @@
29
30
  can lop off sections to save space (?)
30
31
  can burn the extra sections, too?
31
32
  easy editor for this style of edit
32
- split the two projects cleanly (project, distribution)
33
+ split the two projects loosely, then cleanly (project, distribution)
33
34
  partner (Jon, Karlie if interested...give beta)
34
35
  survey/beta release
35
36
  a certified clean list (?)
37
+ better playlist names, like with the DVD title in there :)
36
38
 
37
- == DVD backlog (unordered) ==
39
+ == DVD monetary backlog (unordered) ==
38
40
 
39
41
  some way to choose between x,y,z when auto-select sees several
40
42
  careful phrasing "if you can't afford it..."
41
43
  authorize instead of paypal?
42
- honest about DMCA (we don't distribute the cracker, we don't redistribute, don't perform any acts, etc.)
43
- if you burn you'll eventually be using a DMCA compatible player :P
44
- long list of players...we're not alone :)
45
- one part is probably not against copyright
46
- the authors of the program might not be liable for damages. We don't feel dishonest about it, as long as
47
- we own the DVD and have it with us when we watch the edited version.
48
44
  blu-ray support somehow (real-time? rip?)
49
-
45
+ legal shtuff (LICENSE)
50
46
  some type of one click installer that can setup the registry...
51
47
  auto-assignment of EDL's to media:
52
48
  auto-play option for DVD's (auto-start?)
@@ -55,6 +51,12 @@ auto-assignment of EDL's to media:
55
51
  DVD's (right click on DVD player, play with SC?)
56
52
  a real website (github-y?)
57
53
  instructions on how to do their own (private) or do one and submit it (public), or email their friends :P
54
+ double buffering hard drive/copying might speed things, if your HD is fast.
55
+ personalized copier might be faster than the "type" command.
56
+ merge with preferences
57
+ install VLC from .msi where needed. Pretty low prio...
58
+ For the monetized version: nothing but cut and paste, no merging et al
59
+ mplayer EDL's
58
60
 
59
61
  == random backlog ... note: just plow forward, to "grab" available ideas...except that for now, just what *I* plan on needing for myself (filters for what I need/want). ==
60
62
 
@@ -62,10 +64,9 @@ screencast of things helpful (use, creation...).
62
64
  tune up the levels...
63
65
  prototypes of the experimental stuff (overlay, track time while recording -> map file, specifiable levels, more?)
64
66
 
65
- the overlayer "freeze frames" in vista
66
-
67
- 0:01:01.9 next will be at 0:01:02.0s (r [or q to quit]):
68
- 0:01:04.0 next will be at 0:01:06.5s (blanked) (r [or q to quit]): "warning--unable to track screen time for some reason" # *of course you can't track it now!*
67
+ fix:
68
+ 0:01:01.9 next will be at 0:01:02.0s (r [or q to quit]):
69
+ 0:01:04.0 next will be at 0:01:06.5s (blanked) (r [or q to quit]): "warning--unable to track screen time for some reason" # *of course you can't track it now!*
69
70
 
70
71
  byu.tv descriptor
71
72
  youtube non full screen: work with all browsers
@@ -76,20 +77,10 @@ a netflix player descriptor
76
77
  beep at them when not tracking [?]
77
78
  default on...hmm
78
79
 
79
- note that you are watching it using only bits and pieces of the original, similar to said bill. And the
80
- authors of the program might not be cupable of copyright infringement themselves, since they distribute no infringed materials.
81
-
82
- Not responsible for your actions. Don't redistribute. "You run the risk on your own"
83
- "should the courts someday rule..." If DVD next to me...
84
-
85
- install VLC from .msi where needed. Pretty low prio...
86
-
87
80
  An 'edit preferences' button et al.
88
81
 
89
82
  Just fold if s....
90
83
 
91
- For the monetized version: nothing but cut and paste, no merging et al
92
-
93
84
  a descriptor for some closed source app player...
94
85
 
95
86
  when saving to hard drive, you can "insert" streams where desired (experimental version only)
@@ -123,25 +114,21 @@ advertise on ruby flow
123
114
 
124
115
  DRY up :levels--it's in the ocr spec as well as the others...
125
116
 
126
- unit tests pass with normal ruby
117
+ unit tests run with normal ruby
127
118
 
128
- screen time change only detected... [unexpected] [rid myself of it]
129
-
130
- when polling for bmp changes, just use two lines (if needed speed-wise?)
131
-
132
- super duper VLC
119
+ back off on mouse jerking...only every so often?
120
+ maybe increase timings as you get farther along, to accomodate for drift?
133
121
 
134
- try new GOCR version...
122
+ screen time change only detected... [unexpected] [rid myself of it]
135
123
 
136
- Do I *need* that other window always up or not? (Get rid of it...only do this after have a real window of my own though, that's always up)
124
+ Do I *need* that other window always up or not? (Get rid of it?...only do this after have a real window of my own though, that's always up)
137
125
 
138
126
  preference for beeping at them, et al
139
127
 
140
- itunes video on demand
128
+ itunes video on demand player
141
129
 
142
130
  blockbuster "rent" on demand player
143
131
 
144
-
145
132
  no money making for now...all volunteer...more respectful.
146
133
  or make it so it can work with an editor of some kind...like a "save here" command line snip this tuck that.
147
134
  probably only possible after creating the desktop streamer hmm
@@ -160,25 +147,17 @@ an "online anybody can chat while watching this movie" (or anybody can edit this
160
147
 
161
148
  an online applet web runnable? Why not?
162
149
  click here to watch your favorite film edited on hulu! Just click! [* yea!]
163
- a chrome plugin with imdb/community backing :)
164
150
 
165
- a known list of "compatible" imdb'ers...
166
-
167
151
  code refactors: "screen time change", order should be swapped in bin/x output (just cleanup)
168
152
 
169
- easier installer for windows: release a zip file that they can just click on a .bat file to run it
170
- later: it installs/uninstalls appropo
171
- suggestion: self-extractor
153
+ easier installation for windows: release a zip file that they can just click on a .bat file to run it
154
+ later: .msi?
172
155
 
173
156
  can blank overlay with added text like "and you are one awesome klingon"
174
157
 
175
158
  ability to record it from online/live, then apply edits.
176
159
 
177
- TSR that monitors "oh you're opening a VLC? you're playing the E drive? That's bob's big plan? You're maximized? Full screened? watching x on hulu? y on youtube?"
178
-
179
- add my stuff to imdb...? wiki?
180
-
181
- make youtube work if you have *several* open
160
+ add my stuff to imdb...? make a wiki?
182
161
 
183
162
  user customizable levels...
184
163
  maybe even "I don't like ones that are x, y, z", or "boring level x"
@@ -215,8 +194,6 @@ control location programmatically (using mouse) on the player itself.
215
194
 
216
195
  compare VLC (and other) timings with a real DVD player, and with netflix online, etc.
217
196
 
218
- overlay with an alpha transparent pic (?)
219
-
220
197
  Have a "list of all known movies (url's)" and be able to open (IE et al) to the correct part, and start playing them, and they work...
221
198
  or known parseable imdb's
222
199
 
@@ -224,15 +201,15 @@ does my sweet heart have any suggestions? (make it work well for laymen)
224
201
 
225
202
  web browser plugin?
226
203
 
227
- Programmatically do all of the above, by driving VLC with its real API.
204
+ Programmatically do all of the above, by driving VLC with libvlc (its API).
205
+ So this would be basically tracking VLC using its libvlc callbacks, instead of screen times
206
+ fork the Python project?
228
207
  VLC
229
208
  Allow it to record somehow (recordable)
230
209
  use VLC's web interface? telnet?
231
210
  optimize it with best appropriate iframes (LOL)
232
211
 
233
- integrate with google TV/bravia...maybe...somehow...boxxee? roku?
234
- itunes TV? apple tv?
235
-
236
- OCR the captioning as an auto profanity filter? (or perhaps download subtitles to be able to pre-screen), like the python fella does..
212
+ integrate with google TV...bravia...maybe...somehow...boxxee? roku?
213
+ itunes TV? apple tv? ps3?
237
214
 
238
- --server? optionally higher prio?
215
+ OCR the captioning as an auto profanity filter? (or perhaps download subtitles to be able to pre-screen), like the python fella does.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.14.4
1
+ 0.14.5
data/bin/sensible-cinema CHANGED
@@ -3,11 +3,20 @@
3
3
  puts 'Loading Sensible Cinema...'
4
4
 
5
5
  require 'rubygems'
6
+
7
+ def add_any_bundled_gems
8
+ Dir['vendor/cache/**/lib'].each{|lib_dir|
9
+ $: << lib_dir
10
+ }
11
+ end
12
+
13
+ add_any_bundled_gems
14
+
6
15
  require 'sane' # File.write
7
- require File.dirname(__FILE__) + '/../lib/swing_helpers'
16
+ require 'ruby-wmi'
17
+ require_relative '../lib/swing_helpers'
8
18
  load File.dirname(__FILE__) + '/sensible-cinema-cli'
9
19
  require 'tmpdir'
10
- require 'ruby-wmi'
11
20
 
12
21
  module SensibleSwing
13
22
  class MainWindow < JFrame
@@ -25,7 +34,7 @@ module SensibleSwing
25
34
  jlabel.set_bounds(44,44,136,14)
26
35
  panel.add jlabel
27
36
  b = JButton.new( "Play Hulu, Youtube, or a DVD (Tracking)" ).on_clicked {
28
- Thread.new { go_sc } # needs to be in its own thread becuase it blocks,
37
+ Thread.new { go_sc([]) } # needs to be in its own thread becuase it blocks,
29
38
  # so "this thread" is the uni-swing thread, gets blocked, and the overlayer can't repaint
30
39
  self.close
31
40
  }
@@ -33,7 +42,7 @@ module SensibleSwing
33
42
  b.set_bounds(44,120,button_width,23)
34
43
  panel.add b
35
44
 
36
- c=JButton.new( "Copy edited DVD to Hard Drive" )
45
+ c=JButton.new( "Copy edited copy of DVD to Hard Drive" )
37
46
  c.on_clicked {
38
47
  do_copy_dvd_to_hard_drive true
39
48
  }
@@ -54,26 +63,39 @@ module SensibleSwing
54
63
  @exit.set_bounds(44,320,button_width,23)
55
64
  panel.add @exit
56
65
 
57
- reload = JButton.new( "reload code" ).on_clicked {
58
- eval File.read(__FILE__), nil, __FILE__
59
- p 're-evaled it'
60
- }
61
- reload.set_bounds(44,300,200,23)
62
- panel.add reload if ARGV.find{|a| a == '--test'}
63
- @p = JProgressBar.new(0, 100)
64
- @p.set_value 0
65
- @p.set_bounds(44,280,button_width,23)
66
- panel.add @p
67
- @buttons = [b,c,d,@exit]
68
-
66
+ if ARGV.find{|a| a == '--test'}
67
+ reload = JButton.new( "reload code" ).on_clicked {
68
+ eval File.read(__FILE__), nil, __FILE__
69
+ p 're-evaled the code ...'
70
+ }
71
+ reload.set_bounds(20,300,20,20)
72
+ panel.add reload
73
+ end
74
+
75
+ @progress_bar = JProgressBar.new(0, 100)
76
+ @progress_bar.set_bounds(44,280,button_width,23)
77
+ @progress_bar.visible=false
78
+ panel.add @progress_bar
79
+ @buttons = [b,c,d,@exit]
80
+ end
81
+
82
+ def vlc_currently_installed?
83
+ if !system("vlc --qt-start-minimized vlc://quit")
84
+ JOptionPane.showMessageDialog(nil, "Appears you do not yet have VLC Media Player installed. Click ok to download it.", "VLC Player not found", JOptionPane::ERROR_MESSAGE)
85
+ system("start http://www.videolan.org/")
86
+ false
87
+ else
88
+ true
89
+ end
69
90
  end
70
91
 
71
92
  def do_copy_dvd_to_hard_drive should_save_file
93
+ return unless vlc_currently_installed?
72
94
  drive = choose_dvd_drive
73
95
  fc = JFileChooser.new
74
96
  fc.setFileSelectionMode(nil)
75
97
  fc.set_dialog_title "Please pick a DVD Edit List File"
76
- fc.set_current_directory(JFile.new( __dir__ + "/../zamples/scene_lists/dvds"))
98
+ fc.set_current_directory(JFile.new( __dir__ + "/../zamples/edit_decision_lists/dvds"))
77
99
  edit_list_path = fc.go
78
100
  descriptors = YAML.load_file edit_list_path
79
101
 
@@ -81,7 +103,7 @@ module SensibleSwing
81
103
  fc = JFileChooser.new
82
104
  # LODO allow for spaces in save to file
83
105
  fc.set_dialog_title "Pick where to save the file to"
84
- save_to_file_name = ((descriptors["title"] || "my dvd") + ' edited').gsub(' ', '_').gsub( /\W/, '') # no punctuation for now...
106
+ save_to_file_name = ((descriptors["title"] || "my dvd") + ' edited copy').gsub(' ', '_').gsub( /\W/, '') # no punctuation for now...
85
107
  fc.setSelectedFile(JFile.new(get_drive_with_most_space_with_slash + save_to_file_name))
86
108
  save_to = fc.go
87
109
  else
@@ -100,8 +122,9 @@ module SensibleSwing
100
122
  temp_file = temp_dir + '/' + 'vlc.xspf'
101
123
  File.write(temp_file, bat_file_or_xspf)
102
124
  command = "vlc \"#{temp_file.to_filename}\" vlc://quit"
103
- p 'running', command
104
- system(commands) # blocks the current window while running...
125
+ p 'running playlist: ', command
126
+ system(command) # blocks the current window while running...
127
+ p 'done running playlist'
105
128
  end
106
129
  # TODO warn if they don't have VLC installed, with instructions...
107
130
  # LODO warn if they will overwrite a file in the end
@@ -116,15 +139,15 @@ module SensibleSwing
116
139
  success = true
117
140
  lines = batch_file.lines.to_a
118
141
  total_size = lines.length.to_f
142
+ @progress_bar.visible=true
143
+ @progress_bar.set_value(0)
119
144
  lines.each_with_index{|l, idx|
120
145
  if success
121
- p 'running', l, 'percent', idx/total_size
122
- success = system(l) unless ARGV.find{|a| a == '--test'} # doesn't seem to cancel out early for some reason..
123
- @p.set_value(idx/total_size*100)
124
- sleep 1
146
+ success = system(l) unless ARGV.find{|a| a == '--test'} # this doesn't seem to cancel out early for some reason..
147
+ @progress_bar.set_value(idx/total_size*100)
125
148
  end
126
- }
127
- @p.set_value(0)
149
+ }
150
+ @progress_var.visible=false
128
151
  @buttons.each{|b| b.set_enabled true}
129
152
  popup.dispose
130
153
  if success
@@ -171,7 +194,6 @@ module SensibleSwing
171
194
 
172
195
  end
173
196
 
174
-
175
197
  class GetDisk < JDialog
176
198
  attr_reader :selected
177
199
  def initialize parent, options_array
@@ -198,16 +220,6 @@ module SensibleSwing
198
220
 
199
221
  end
200
222
 
201
- require 'os'
202
- class String
203
- def to_filename
204
- if OS.windows?
205
- self.gsub('/', "\\")
206
- else
207
- self
208
- end
209
- end
210
- end
211
223
 
212
224
  SensibleSwing::MainWindow.new.set_visible true
213
225
 
@@ -25,7 +25,7 @@ def go_sc(args)
25
25
 
26
26
  puts <<-END
27
27
 
28
- syntax: player_description.yml|test scene_descriptions_list.yml [-t -v --clear-cache] (or nothing to prompt for files)
28
+ syntax: [player_description.yml|test] edit_decision_list.txt [-t -v --clear-cache] (or nothing at all--it will prompt)
29
29
  END
30
30
 
31
31
  for file in Dir[__dir__ + '../zamples/mute*/*']
@@ -44,27 +44,27 @@ def go_sc(args)
44
44
  player_description = FileChooser.choose_file(" SELECT COMPUTER PLAYER", __dir__ + "/../zamples/players")
45
45
  end
46
46
 
47
- scene_list = args.shift.to_s
47
+ edit_decision_list = args.shift.to_s
48
48
 
49
- if scene_list == 'test'
49
+ if edit_decision_list == 'test'
50
50
  overlay = nil
51
51
  p 'got test...just doing screen dump'
52
52
  $VERBOSE=true # adds some extra output
53
53
  else
54
- if !File.exist? scene_list
55
- puts 'Select Scene Descriptions file'
56
- scene_list = FileChooser.choose_file(" SELECT SCENE DESCRIPTIONS FILE", __dir__ + "/../zamples/scene_lists")
54
+ if !File.exist? edit_decision_list
55
+ puts 'Select Edit Decision List'
56
+ edit_decision_list = FileChooser.choose_file(" SELECT EDIT DECISION LIST", __dir__ + "/../zamples/edit_decision_lists")
57
57
  end
58
58
 
59
- if !scene_list
59
+ if !edit_decision_list
60
60
  puts "error: have to specify a scene descriptions file\n or specify \"test\" on the command line if you just want to snapshot your player"
61
61
  exit 1
62
62
  end
63
63
 
64
- puts 'Selected scene descriptions file ' + File.basename(scene_list) + "\n\t(full path: #{scene_list})"
64
+ puts 'Selected scene descriptions file ' + File.basename(edit_decision_list) + "\n\t(full path: #{edit_decision_list})"
65
65
  Blanker.startup
66
66
  # todo start it late as it has an annoying startup blip
67
- overlay = OverLayer.new(scene_list)
67
+ overlay = OverLayer.new(edit_decision_list )
68
68
  end
69
69
 
70
70
  if File.exist? player_description.to_s
@@ -88,7 +88,7 @@ def go_sc(args)
88
88
 
89
89
  OCR.unserialize_cache_from_disk # do this every time so we don't delete it if they don't have one...
90
90
 
91
- puts "Opening the curtains... (please play in player now)"
91
+ puts "Opening the curtains... (please play in your other player now)"
92
92
  overlay.start_thread true
93
93
  key_input = KeyboardInput.new overlay
94
94
  key_input.start_thread # status thread
@@ -96,7 +96,7 @@ def go_sc(args)
96
96
  Blanker.shutdown # lodo move this and the 'q' key to within overlayer
97
97
  OCR.serialize_cache_to_disk
98
98
  }
99
- puts 'syntax from command line: ' + player_description + ' ' + scene_list
99
+ puts "syntax from command line: #{player_description} #{edit_decision_list}"
100
100
  key_input.handle_keystrokes_forever # blocking...
101
101
 
102
102
  end
data/lib/ocr.rb CHANGED
@@ -1,5 +1,13 @@
1
- im_path = File.expand_path(File.dirname(__FILE__) + "/../vendor/imagemagick") # convert.exe wants to only be chosen from here...
2
- #ENV['PATH'] = im_path + ';' + ENV['PATH']
1
+ require 'sane' # gem
2
+ require 'whichr' # gem
3
+ require_relative 'swing_helpers' # to_filename lodo not have it there
4
+ im_path = File.expand_path(File.dirname(__FILE__) + "/../vendor/cache/imagemagick") # convert.exe wants to only be chosen from here...
5
+ ENV['PATH'] = im_path.to_filename + ';' + ENV['PATH']
6
+
7
+ if RubyWhich.new.which('identify').length == 0 || RubyWhich.new.which('convert').length == 0
8
+ # for gem users, so I don't have to bundle it :P
9
+ raise 'appears you do not have imagemagick installed (or not in your path) -- please install it! http://www.imagemagick.org/script/binary-releases.php'
10
+ end
3
11
 
4
12
  # helper for OCR'ing single digits that were screen captured
5
13
  module OCR
data/lib/overlayer.rb CHANGED
@@ -106,7 +106,7 @@ class OverLayer
106
106
  start2 = translate_string_to_seconds(start) if start
107
107
  endy2 = translate_string_to_seconds(endy) if endy
108
108
  if start2 == 0 || endy2 == 0 || start == nil || endy == nil
109
- p 'warning--possible error in the scene descriptions file some line not parsed! (NB if you want one to start at time 0 please use 0.0001)', start, endy unless $AM_IN_UNIT_TEST
109
+ p 'warning--possible error in the Edit Decision List file some line not parsed! (NB if you want one to start at time 0 please use 0.0001)', start, endy unless $AM_IN_UNIT_TEST
110
110
  # drop this line into the bitbucket...
111
111
  next
112
112
  end