sensible-cinema 0.21.5 → 0.21.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/LICENSE.TXT +13 -11
  2. data/README +59 -45
  3. data/Rakefile +27 -17
  4. data/TODO +272 -210
  5. data/VERSION +1 -1
  6. data/_DO_NOT_RUN_IT_FROM_HERE_DOWNLOAD_THE_RELEASE_ZIP_INSTEAD +0 -0
  7. data/bin/{sensible-cinema.rb → sensible-cinema} +40 -24
  8. data/bin/sensible-cinema-cli +7 -1
  9. data/business_ideas.txt +13 -0
  10. data/{ChangeLog → change_log_with_feature_list.txt} +97 -3
  11. data/development.txt +4 -0
  12. data/{experimental_readme.txt → experimental_ocr_readme.txt} +1 -1
  13. data/go.bat +2 -1
  14. data/go_ocr_tracker.bat +1 -0
  15. data/gocreatemode.bat +1 -0
  16. data/how_to_create_your_own_delete_lists.txt +11 -12
  17. data/legal/md5s.txt +50 -0
  18. data/legal/transcript_mute_vlc.txt +117 -0
  19. data/legal2 +1 -0
  20. data/lib/auto_convert.rb +3 -0
  21. data/lib/blanker.rb +22 -11
  22. data/lib/count_down_timer_jruby_swing.rb +40 -0
  23. data/lib/edl_converter.rb +34 -0
  24. data/lib/mouse.rb +61 -14
  25. data/lib/muter.rb +19 -5
  26. data/lib/profanity_finder.rb +84 -0
  27. data/{todo_if_need_speed → ocr.todo_if_need_speed} +0 -0
  28. data/propaganda +73 -0
  29. data/sensible-cinema.gemspec +45 -23
  30. data/spec/common.rb +1 -1
  31. data/spec/mouse.spec.rb +16 -1
  32. data/spec/notes +251 -8
  33. data/spec/screen_tracker.spec.rb +6 -4
  34. data/template_bats/RUN SENSIBLE CINEMA CLICK HERE.bat +19 -0
  35. data/template_bats/advanced--create or edit sensible cinema delete list files.bat +1 -0
  36. data/todo.build_library.txt +11 -0
  37. data/todo.inventionzy.txt +56 -0
  38. data/todo.open_edl_list_org.txt +148 -0
  39. data/todo.subtitle +35 -0
  40. data/www/index.html +46 -16
  41. data/zamples/edit_decision_lists/{netflix/example_file_copy_me.txt → dvds/example_delete_list.txt} +0 -0
  42. data/zamples/edit_decision_lists/dvds/example_delete_list_that_has_no_cuts_in_it.txt +10 -0
  43. data/zamples/edit_decision_lists/youtube/demo_mutes.txt +12 -0
  44. data/zamples/edit_decision_lists/youtube/nuki_song_youtube.txt +13 -0
  45. data/zamples/players/youtube/normal_in_youtube.com.chrome.txt +1 -0
  46. metadata +414 -311
  47. data/RUN SENSIBLE CINEMA CLICK HERE.bat +0 -7
  48. data/create or edit sensible cinema delete list files.bat +0 -7
  49. data/ext/mkrf_conf.rb +0 -27
  50. data/goc.bat +0 -1
  51. data/goe.bat +0 -1
  52. data/zamples/edit_decision_lists/old_not_yet_updated/youtube/nuki_song_youtube.txt +0 -9
data/legal2 ADDED
@@ -0,0 +1 @@
1
+ http://en.wikipedia.org/wiki/DVD_Decrypter mentions fair use a bit, though in context of a different program.
@@ -0,0 +1,3 @@
1
+ seconds = 1000
2
+ p 'converted value is', seconds* 29.97/30
3
+ p 'another converted value is', seconds* 30/29.97
data/lib/blanker.rb CHANGED
@@ -15,6 +15,7 @@ This file is part of Sensible Cinema.
15
15
  You should have received a copy of the GNU General Public License
16
16
  along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
17
17
  =end
18
+
18
19
  if RUBY_PLATFORM !~ /java/
19
20
  require_relative 'fake_blanker'
20
21
  else
@@ -45,24 +46,34 @@ else
45
46
  @fr.repaint
46
47
  unblank_full_screen! # and hide it to start
47
48
  end
49
+
50
+ @@use_mouse = true
48
51
 
49
52
  def self.blank_full_screen! seconds
50
- # somewhat hacky work around for doze: http://www.experts-exchange.com/Programming/Languages/Java/Q_22977145.html
51
- @fr.setAlwaysOnTop(false)
52
- @fr.setAlwaysOnTop(true)
53
- @fr.set_location(0,0)
54
- @fr.repaint # early paint, just in case that helps it pop up faster :)
55
- if seconds
56
- @label.set_text " #{seconds} s"
53
+ if @@use_mouse
54
+ Mouse.single_click_left_mouse_button
57
55
  else
58
- @label.set_text " Blank section"
56
+ # somewhat hacky work around for doze: http://www.experts-exchange.com/Programming/Languages/Java/Q_22977145.html
57
+ @fr.setAlwaysOnTop(false)
58
+ @fr.setAlwaysOnTop(true)
59
+ @fr.set_location(0,0)
60
+ @fr.repaint # early paint, just in case that helps it pop up faster :)
61
+ if seconds
62
+ @label.set_text " #{seconds} s"
63
+ else
64
+ @label.set_text " Blank section"
65
+ end
59
66
  end
60
67
  end
61
68
 
62
69
  def self.unblank_full_screen!
63
- # move it off screen...
64
- @fr.set_location(-2100, -2100)
65
- @fr.repaint 0
70
+ if @@use_mouse
71
+ Mouse.single_click_left_mouse_button
72
+ else
73
+ # just move it off screen...lodo
74
+ @fr.set_location(-2100, -2100)
75
+ @fr.repaint 0
76
+ end
66
77
  end
67
78
 
68
79
  def self.shutdown
@@ -0,0 +1,40 @@
1
+ require 'rubygems'
2
+ require 'sane'
3
+ require_relative '../lib/swing_helpers'
4
+
5
+ module SensibleSwing
6
+
7
+ class MainWindow < JFrame
8
+
9
+ def initialize
10
+ super "countdown"
11
+ set_size 150,100
12
+ setDefaultCloseOperation JFrame::EXIT_ON_CLOSE # happiness
13
+ @jlabel = JLabel.new 'Welcome to Sensible Cinema!'
14
+ happy = Font.new("Tahoma", Font::PLAIN, 11)
15
+ @jlabel.setFont(happy)
16
+ @jlabel.set_bounds(44,44,160,14)
17
+ panel = JPanel.new
18
+ @panel = panel
19
+ @buttons = []
20
+ panel.set_layout nil
21
+ add panel # why can't I just slap these down?
22
+ panel.add @jlabel
23
+ @start_time = Time.now
24
+ @jlabel.set_text 'welcome...'
25
+ Thread.new { sleep 1; @jlabel.set_text 'yo3'}
26
+
27
+ @switch_image_timer = javax.swing.Timer.new(1000, nil) # nil means it has no default person to call when the action has occurred...
28
+ @switch_image_timer.add_action_listener do |e|
29
+ seconds_left = (ARGV[0] || '35').to_i*60 - (Time.now - @start_time)
30
+ @jlabel.set_text "%02d:%02d" % [seconds_left/60, seconds_left % 60]
31
+ end
32
+ @switch_image_timer.start
33
+ self.always_on_top=true
34
+ end
35
+
36
+ end
37
+
38
+ MainWindow.new.show
39
+
40
+ end
@@ -0,0 +1,34 @@
1
+ #from: https://gist.github.com/52f5c6386fc67e9e6b6b
2
+ require 'rubygems'
3
+ require 'timecode' # from http://guerilla-di.org/timecode
4
+ require 'json'
5
+
6
+ class MplayerEdl
7
+ attr_reader :edl
8
+
9
+ def initialize(edl)
10
+ @edl = edl
11
+ end
12
+
13
+ def to_s
14
+ out = []
15
+ edl['events'].each do |event|
16
+ out << ("%0.1f\t%0.1f\t%d" % [
17
+ event['source_in'].to_seconds,
18
+ event['source_out'].to_seconds,
19
+ (event['transition'] == 'cut') ? 0 : 1
20
+ ])
21
+ end
22
+ out.join("\n")
23
+ end
24
+ end
25
+
26
+ edl = JSON.load(IO.read("All Dogs Go To Heaven.json"))
27
+ edl['events'].map! do |event|
28
+ event['source_in'] = Timecode.parse(event['source_in'], edl['film_fps'])
29
+ event['source_out'] = Timecode.parse(event['source_out'], edl['film_fps'])
30
+ event
31
+ end
32
+
33
+ m = MplayerEdl.new(edl)
34
+ puts m.to_s
data/lib/mouse.rb CHANGED
@@ -17,6 +17,7 @@ This file is part of Sensible Cinema.
17
17
  =end
18
18
  require 'rubygems'
19
19
  require 'ffi'
20
+ require 'java'
20
21
 
21
22
  module Mouse
22
23
  extend FFI::Library
@@ -28,6 +29,9 @@ module Mouse
28
29
  MOUSEEVENTF_MOVE = 1
29
30
  INPUT_MOUSE = 0
30
31
  MOUSEEVENTF_ABSOLUTE = 0x8000
32
+ MOUSEEVENTF_LEFTDOWN = 0x0002
33
+ MOUSEEVENTF_LEFTUP = 0x0004
34
+
31
35
 
32
36
  class MouseInput < FFI::Struct
33
37
  layout :dx, :long,
@@ -37,9 +41,11 @@ module Mouse
37
41
  :time, :ulong,
38
42
  :extra, :ulong
39
43
  end
44
+
40
45
  class InputEvent < FFI::Union
41
46
  layout :mi, MouseInput
42
47
  end
48
+
43
49
  class Input < FFI::Struct
44
50
  layout :type, :ulong,
45
51
  :evt, InputEvent
@@ -47,6 +53,10 @@ module Mouse
47
53
 
48
54
  # UINT SendInput(UINT nInputs, LPINPUT pInputs, int cbSize);
49
55
  attach_function :SendInput, [ :uint, :pointer, :int ], :uint
56
+
57
+ # poller...
58
+ attach_function :GetAsyncKeyState, [:int], :uint
59
+
50
60
  class << self
51
61
 
52
62
  def jitter_forever_in_own_thread
@@ -56,44 +66,81 @@ module Mouse
56
66
 
57
67
  in_evt = myinput[:evt][:mi]
58
68
 
59
- in_evt[:mouse_data] = 0
60
- in_evt[:flags] = Mouse::MOUSEEVENTF_MOVE # | Mouse::MOUSEEVENTF_ABSOLUTE
69
+ in_evt[:mouse_data] = 0 # null it out
70
+ in_evt[:flags] = Mouse::MOUSEEVENTF_MOVE
61
71
  in_evt[:time] = 0
62
72
  in_evt[:extra] = 0
63
73
  in_evt[:dx] = 0
64
- in_evt[:dy] = 8 # just enough for VLC full screen...
74
+ in_evt[:dy] = 8 # just enough for VLC when full screened...
65
75
 
66
- old_x = get_mouse.x
67
- old_y = get_mouse.y
76
+ old_x = get_mouse_location.x
77
+ old_y = get_mouse_location.y
68
78
  Thread.new {
69
79
  loop {
70
- cur_x = get_mouse.x
71
- cur_y = get_mouse.y
80
+ cur_x = get_mouse_location.x
81
+ cur_y = get_mouse_location.y
72
82
  if(cur_x == old_x && cur_y == old_y)
73
83
  @total_movements += 1
74
84
  in_evt[:dy] *= -1
75
- Mouse.SendInput(1, myinput, Mouse::Input.size)
85
+ SendInput(1, myinput, Mouse::Input.size)
76
86
  in_evt[:dy] *= -1
77
87
  sleep 0.05
78
- Mouse.SendInput(1, myinput, Mouse::Input.size)
79
- old_x = get_mouse.x
80
- old_y = get_mouse.y
88
+ SendInput(1, myinput, Mouse::Input.size)
89
+ old_x = get_mouse_location.x
90
+ old_y = get_mouse_location.y
81
91
  sleep 0.75
82
92
  else
83
- old_x = get_mouse.x
84
- old_y = get_mouse.y
93
+ old_x = get_mouse_location.x
94
+ old_y = get_mouse_location.y
85
95
  sleep 3
86
96
  end
87
97
  }
88
98
  }
89
99
 
90
100
  end
101
+
102
+ def single_click_left_mouse_button
103
+ left_mouse_down!
104
+ left_mouse_up!
105
+ p "CLICKED LEFT MOUSE BUTTON"
106
+ end
107
+
108
+ def left_mouse_down!
109
+ change_left_mouse_button MOUSEEVENTF_LEFTDOWN
110
+ end
111
+
112
+ def left_mouse_up!
113
+ change_left_mouse_button MOUSEEVENTF_LEFTUP
114
+ end
91
115
 
92
- def get_mouse
116
+ VK_LBUTTON = 0x01 # mouse left button for GetAsyncKeyState
117
+
118
+ def left_mouse_button_state
119
+ GetAsyncKeyState(VK_LBUTTON) # ignore a first call, which also tells us if it has changed at all since last call
120
+ if GetAsyncKeyState(VK_LBUTTON) == 0 # zero means up
121
+ :up
122
+ else
123
+ :down
124
+ end
125
+ end
126
+
127
+ def get_mouse_location
93
128
  MouseInfo.getPointerInfo.getLocation
94
129
  end
95
130
 
96
131
  attr_accessor :total_movements
132
+
133
+ private
134
+
135
+ def change_left_mouse_button action_type
136
+ myinput = Mouse::Input.new
137
+ myinput[:type] = Mouse::INPUT_MOUSE
138
+ in_evt = myinput[:evt][:mi]
139
+ in_evt[:flags] = action_type
140
+ SendInput(1, myinput, Mouse::Input.size)
141
+ end
142
+
143
+
97
144
  end
98
145
 
99
146
  end
data/lib/muter.rb CHANGED
@@ -17,6 +17,8 @@ This file is part of Sensible Cinema.
17
17
  =end
18
18
  require 'rubygems' # ugh
19
19
  require 'ffi'
20
+ require 'sane'
21
+ require_relative 'mouse'
20
22
 
21
23
  module Muter
22
24
  # from msdn on keybd_event ...
@@ -48,16 +50,28 @@ module Muter
48
50
  keybd_event(VK_VOLUME_DOWN, 0, KEYEVENTF_KEYUP, nil)
49
51
  end
50
52
 
53
+ @@use_mouse = false # ai ai
54
+
51
55
  def mute!
52
- #unmute! # just in case
53
- hit_mute_key
56
+ #unmute! # just in case...somehow this was causing problems...windows 7 perhaps? VLC?
57
+ # anyway we just use a toggle for now...dangerous but works, if barely
58
+ if !@@use_mouse
59
+ hit_mute_key
60
+ else
61
+ Mouse.single_click_left_mouse_button
62
+ end
54
63
  end
55
64
 
56
65
  # TODO better for doze 7...
57
66
  def unmute!
58
- hit_mute_key # Windows XP...
59
- hit_volume_down_key
60
- hit_volume_up_key
67
+ if !@@use_mouse
68
+ hit_mute_key # Windows XP...
69
+ hit_volume_down_key
70
+ hit_volume_up_key
71
+ else
72
+ Mouse.single_click_left_mouse_button
73
+ end
74
+
61
75
  end
62
76
 
63
77
  # allow for Muter.xxx
@@ -0,0 +1,84 @@
1
+ #
2
+ # warning: somewhat scary/explicit!
3
+
4
+ # see subtitle_todo file
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+ profanities = {'hell' => 'heck', 'g' +
48
+ 'o' + 'd' => 'g..', 'lord' => 'lo..', 'da' +
49
+ 'mn' => 'da..', 'f' +
50
+ 117.chr +
51
+ 99.chr +
52
+ 107.chr =>
53
+ 'f...',
54
+ 'bi' +
55
+ 'tc' + 104.chr => 'b.....',
56
+ 'bas' +
57
+ 'tard' => 'ba.....',
58
+ ('a'
59
+ + 's'*2) => 'a..'
60
+ }
61
+
62
+ incoming = File.read(ARGV[0])
63
+
64
+ for profanity, sanitized in profanities
65
+ # dunno if we should force words to just start with this or contain it anywhere...
66
+ # what about 'godly' for example?
67
+ # or 'ungodly' ?
68
+ if incoming =~ Regexp.new(profanity, Regexp::IGNORECASE)
69
+ p 'contains', sanitized
70
+ end
71
+ end
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
File without changes
data/propaganda ADDED
@@ -0,0 +1,73 @@
1
+ keywords:
2
+
3
+
4
+ own really long url movie bad scene skipper sensible cinema.t28.net add in there content editor or something lots of google SEO happy words
5
+
6
+ clearplay 18000
7
+ edited movies 4400
8
+ edited dvd 1000
9
+ movie filter 1900
10
+ clean flicks 1600 [flix 1900]
11
+ clean movies 5400
12
+ profanity filter 3600
13
+ clean films 880
14
+ edited films 5400
15
+ clearplay player 1300
16
+ lds movies 2400
17
+ lds videos 2900
18
+ cleanflicks 1300
19
+ family friendly movies 2900
20
+ family videos 135K
21
+ cleanflix 2400
22
+ good clean movies 720
23
+ christian movies 74K "christian friendly" movies?
24
+ family videos 135K
25
+ clean movies 5400
26
+ blu-ray and blue ray have some (once I actually support that LOL)
27
+ coupons
28
+
29
+ some conglom of those ? :P
30
+
31
+
32
+
33
+
34
+
35
+ dvd/movies/films replace?
36
+
37
+ family edited movies 170
38
+ family movies 165K
39
+ clean dvd's 900 [meh]
40
+ edit dvd 14800 [so so]
41
+ good family movie 6600 [meh]
42
+
43
+ adv. to christians (bigger audience?)??
44
+
45
+ NB: no beta testing/propaganda until after the patent discoverable phase <sigh>
46
+ http://en.wikipedia.org/wiki/Re-edited_film
47
+ http://www.google.com/search?q=buy+airplane+movies&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#sclient=psy&hl=en&client=firefox-a&hs=Cls&rls=org.mozilla:en-US%3Aofficial&source=hp&q=buy+airplane+edited+movies&aq=f&aqi=&aql=&oq=&pbx=1&fp=7828c4946c5db268
48
+ more
49
+ http://www.ldsresources.net/hollywood-plan-backfires-and-edited-movie-secrets-are-revealed/
50
+ somehow use clearplay in the title or url, then blog about it, then just using it. maybe newspapers...google adwords...a facebook page, my own facebook lds news groups...melissa's site...link on my blog...facebook "like"
51
+ advertise in LDS newsgroups et al, for beta testers?
52
+ advertise in christian places
53
+ blogs that have ever mentioned clearplay :P
54
+ free google adwords (?)
55
+ advertise ruby flow
56
+ only after new year, new LLC
57
+ http://ldscinema.blogspot.com/
58
+ advertise facebook (at least their page :) [?]
59
+
60
+ advertise on freem4m?
61
+ betterlogic page
62
+ advertise ldsliving once I have patentable stuff done... [?]
63
+
64
+ google free adwords?
65
+
66
+ make money at it?
67
+ ask for donations at download time (or "you set your own purchase price here")
68
+
69
+ http://www.fubarrio.com/2010/01/family-films-and-edited-movies/
70
+ http://www.motleyvision.org/2008/mormon-versions-of-netflix-youtube-and-sort-of-itunes/^M
71
+ lds.net
72
+
73
+ http://www.techenclave.com/applications/possible-skip-certain-violence-parts-movie-175218.html