sensible-cinema 0.16.5 → 0.16.7

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,12 @@
1
+ == 0.16.7 ==
2
+
3
+ Accomodate for disks that have scratches in them better.
4
+
5
+ == 0.16.5 ==
6
+
7
+ Enable "preferences merging" of user preferences with an edit decision list to come up with a new edit decision list for them.
8
+ The prototypes are there, though it's not enabled.
9
+
1
10
  == 0.16.0 ==
2
11
 
3
12
  Change the YAML style so that it can have filterable categories (disabled for now, but there are unit tests
@@ -16,6 +25,8 @@ Note that by at least this version, auto DVD title selection as a parameter has
16
25
  Note that by at least this version, it could compute an md5sum of a DVD's IFO files to compute
17
26
  a unique ID for that disk.
18
27
  Note that before this, I was using the volume name to generate filenames.
28
+ Note that several (even more) revisions ago, I used on screen timestamp OCR and thus tracking to be able to
29
+ control output of hulu, youtube, etc. (online displayable programs).
19
30
 
20
31
  == 0.14.8 ==
21
32
 
data/README CHANGED
@@ -32,7 +32,8 @@ Q. How do I watch these on my TV?
32
32
  A. You can burn a DVD with it. First create it on your hard drive. Then use
33
33
  Dvd Flick ()a good one for windows) (here's a screencast of using it within http://rogerdpack.t28.net/sensible-cinema)
34
34
  For OS X : iDVD might work well.
35
- You might be able to "beam" it to your PS3 and play it from there, using PS3 media server (or windows media player), or put it on a flash drive and play it from that.
35
+ You could also drag your laptop over to your TV and hook it in that way.
36
+ If you're interested in being able to "beam" it from your computer to your game console (ex: PS3) ping me--I might have something in mind.
36
37
 
37
38
  == Caveats ==
38
39
 
data/Rakefile CHANGED
@@ -61,7 +61,7 @@ task 'bundle_dependencies' => 'gemspec' do
61
61
 
62
62
  spec = eval File.read('sensible-cinema.gemspec')
63
63
  dependencies = spec.runtime_dependencies
64
- dependencies = dependencies + get_transitive_dependencies(dependencies)
64
+ dependencies = (dependencies + get_transitive_dependencies(dependencies)).uniq
65
65
  Gem.loaded_specs.select{|name, spec| name == 'os'}
66
66
  FileUtils.rm_rf 'vendor/cache'
67
67
  Dir.mkdir 'vendor/cache'
@@ -72,7 +72,7 @@ task 'bundle_dependencies' => 'gemspec' do
72
72
  puts 'downloading in jruby-complete.jar file'
73
73
  # jruby complete .jar file
74
74
  Net::HTTP.start("jruby.org.s3.amazonaws.com") { |http|
75
- resp = http.get("/downloads/1.5.5/jruby-complete-1.5.5.jar")
75
+ resp = http.get("/downloads/1.5.6/jruby-complete-1.5.6.jar")
76
76
  puts 'copying it... '
77
77
  open("jruby-complete-1.5.5.jar", "wb") { |file|
78
78
  file.write(resp.body)
data/TODO CHANGED
@@ -1,32 +1,72 @@
1
1
  == medium ==
2
2
 
3
3
  == probably next up+low prio ==
4
-
4
+
5
+ "non realtime, non edity good" release (family only)
6
+ add some "||'s" to bat files...
7
+ popup "you may now watch": bring it to the front...
8
+
5
9
  == slightly lower than that ==
6
10
 
11
+ note "I first use this to edit my temple movie"
12
+ move the progressbar to the bottom :)
13
+ license the first time they run it (gplv3)
14
+ only pick that filename once per session...
15
+ note "just a linear editor"
16
+ note "just a wrapper"
7
17
  partner for filters (Jon, Karlie if interested...give beta)
8
18
  lotsa filters somehow
9
19
  my dvd's
20
+ friend's dvd's
21
+ partners'...
10
22
  beta release/rinse and repeat with various ppl (once it's releasable...)
11
- can generate mplayer EDL's and play them...hmm...smplayer them?
12
- update license too...
13
23
  a real'ish website
14
- license the first time they run it (gplv3)
15
24
  checkbox for other license or something?
16
- bring that window to the top! (before done dialog...)
17
- assert that at least one drive has a DVD in it...
18
25
  compare computer DVD playback with physical player...
19
- just run previews in smplayer :P
20
- ffmpeg easier
26
+ overlay audio
21
27
 
22
28
  == DVD backlog (unordered, some very low prio) ==
23
29
 
30
+ assert that at least one drive has a DVD in it...maybe loop refuse with message until this?
31
+ cool runnings:
32
+ make a copy me--do they now match?
33
+ get a working copy--do they match?
34
+ md5sum the full rip files...appears necessary...
35
+ is it necessary?
36
+ add button for md5sum
37
+ propaganda-ize
38
+ alternative.to
39
+ blogs that have ever mentioned clearplay
40
+ play a bigger noise when totally done...(dvd flick has one...)
41
+ vnc has a good looking license :)
42
+ unzip instructions?
43
+ prompt for name, auto populate with volume name
44
+ LLC before ever pay anyone
45
+ redo the edit buttons into an ordering of sorts...
46
+ note that this can corrupt your soul!
47
+ plus figure out if mplayer is a fast forward feature...
48
+ several "play now" options...without a navigator of course :)
49
+ one for watch unedited "as grabbing" (create mode)
50
+ visualbasic
51
+ "round conservatively, write no file" way
52
+ mplayer batch (playlist?)
53
+ "round conservatively, yes write file" (+1 you track it)
54
+ can generate mplayer EDL's and play them...hmm...smplayer them?
55
+ update license too...
56
+ get half-way through, start playing back as writing edited full copy
57
+ maybe not all of these tho...
58
+ non parallelize
59
+ can have different volume settings
60
+ can insert other titles mid-stream [?]
61
+ these last two have gotta be lower prio than the rest...
62
+ whichr: return nil
63
+ install smplayer before mencoder [?]
24
64
  smaller .zip
25
65
  bundle 7z [?]
26
66
  remove note about it
27
67
  using, burning, creating "howto's"
28
68
  better
29
- usability test?
69
+ usability test them?
30
70
 
31
71
  using+burning screencast
32
72
  editing screencast
@@ -36,18 +76,17 @@
36
76
  add an option "just save full disk (unedited) to hard drive..."
37
77
  note to people: can edit those to your liking
38
78
 
79
+ imagemagick (ffmpeg) easier install...
39
80
  DRY up dependency installation code
40
81
  install them to cache2 or something...so I can cleanup the deploy code...
41
82
  advertise urug, ruby flow :)
42
83
  "Re-run most recent" disabled when there isn't one [?]
43
- unit test the GUI
44
84
  re-do DVD EDL's that need it :P
45
85
  all dogs go to heaven...finish EDL
46
86
  warn when labels exist and don't match...
47
87
  kill old mencoder instances more often...
48
88
  auto-download imagemagick, too
49
- check all the various options to see if there's a "cross platform way to split files accurately" besides my hacky kludge.
50
- popup "you may now watch": bring it to the front...
89
+ check all the many options to see if there's a "cross platform way to split files accurately" besides my hacky kludge.
51
90
  can rip from a DVD-like folder (?)
52
91
  ripping "redoes" a large last section, for combining. Can I avoid this?
53
92
  plus I do some copy, some ac3?
@@ -63,24 +102,24 @@
63
102
  in general, fine tune burning with various things...
64
103
 
65
104
  make sure can work with very large DVD's...
66
- can use a fast temp drive, save through to other :P
67
- only prompt if have two...
105
+ can use a fast temp drive, save through it to another :P
106
+ (when they have two...)
68
107
  can have collaborators re-selling EDL's
69
108
  good license for their stuff like "public domain" or what not :P Can't be a hypocrite now, can I?
70
- a real website
109
+ a real website that looks good
71
110
  k9 might preserve/shrink well...hmm...auto calculation may be possible...hmm...
72
111
  better .exe icon...
73
- ensure file exists after we created it...and has a reasonable size, before declaring success
74
- 148 cars_widescreen_2006_edited.ps
75
112
  blu-ray support somehow (real-time? rip?)
76
113
  use DVD navigator ?
77
114
  http://msdn.microsoft.com/en-us/library/dd388584(v=VS.85).aspx
78
115
  with an avi file sink?
79
116
  double buffering hard drive/incoming copying from DVD might speed things, if your HD is fast.
80
- make the progress bar map "better" to the size of the various sections...
81
- detect occurrence of these type errors (DVD read failure): dvdnav warning: cannot get next block (Error reading from DVD.) somehow (file size...)
82
- per movie, several EDL's, one includes profanity, one just violence, one paranoid, etc.
83
- when there are several, it lets you just choose between the ones that are valid (?)
117
+ might not work for all modes tho...
118
+ make the progress bar map "better" to the actual time that each section should take...
119
+
120
+ "show" what drive they have in there--like an auto-detect, and if it has EDL's available for it or not.
121
+ Note to people: make several EDL's per movie.
122
+ Note to people: clean your disks!
84
123
 
85
124
  burnable to DVD/CD/multi DVD automagically... (auto-burn insert your new disk!)
86
125
  can *re-use* original navigation stuffs, less the profanity (is that possible? VobBlanker help, perhaps?)
@@ -92,7 +131,9 @@ burnable to DVD/CD/multi DVD automagically... (auto-burn insert your new disk!)
92
131
  try to compile transcode in cygwin (yipes)
93
132
  legal shtuff (LICENSE)
94
133
 
95
- == random non-DVD 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). ==
134
+ @smplayer: right click on DVD...
135
+
136
+ == random non-DVD (or don't care when) 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). ==
96
137
 
97
138
  the ac3 thing
98
139
  ask VLC "fuzzy menus on the happiest baby dvd expected?"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.16.5
1
+ 0.16.7
@@ -3,7 +3,7 @@
3
3
  puts 'Loading Sensible Cinema...'
4
4
 
5
5
  require File.dirname(__FILE__) + "/../lib/add_any_bundled_gems_to_load_path.rb"
6
- require 'sane'
6
+ require 'sane' # failure here means you haven't bundled your dependencies...[rake task]
7
7
 
8
8
  require_relative '../lib/mencoder_wrapper'
9
9
  require_relative '../lib/storage'
@@ -15,237 +15,266 @@ require_relative '../lib/drive_info'
15
15
  require 'whichr'
16
16
 
17
17
  ENV['PATH'] = ENV['PATH'] + ';' + File.expand_path(File.dirname(__FILE__)) + '/../vendor/cache/mencoder'.to_filename
18
+ ENV['PATH'] = ENV['PATH'] + ";d:\\Program Files\\SMPlayer;c:\\Program Files\\SMPlayer"
18
19
 
19
20
  module SensibleSwing
20
- class MainWindow < JFrame
21
- Storage = Storage.new("sc")
22
- def initialize
23
- super "Sensible-Cinema"
24
- setDefaultCloseOperation JFrame::EXIT_ON_CLOSE
25
- panel = JPanel.new
26
- panel.set_layout nil
27
- add panel # why can't I just slap these down?
28
-
29
- jlabel = JLabel.new 'Welcome to Sensible Cinema!'
30
- happy = Font.new("Tahoma", Font::PLAIN, 11)
31
- jlabel.setFont(happy)
32
- jlabel.set_bounds(44,44,160,14)
33
- panel.add jlabel
21
+ class MainWindow < JFrame
22
+
23
+ def new_jbutton title, only_on_create_mode
24
+ button = JButton.new title
25
+ button.set_bounds(44, @starting_button_y, @button_width, 23)
26
+ @starting_button_y += 30
27
+ if only_on_create_mode
28
+ if ARGV.index("--create-mode")
29
+ @panel.add button
30
+ @buttons << button
31
+ end
32
+ else
33
+ @panel.add button
34
+ @buttons << button
35
+ end
36
+ button
37
+ end
38
+
39
+ Storage = Storage.new("sc")
34
40
 
35
- button_width = 270
41
+ alias system_blocking system
36
42
 
37
- c = JButton.new( "Create edited copy of DVD on Your Hard Drive" )
38
- c.on_clicked {
39
- do_copy_dvd_to_hard_drive false
40
- }
41
- c.set_bounds(44,120,button_width,23)
42
- panel.add c
43
+ def system_non_blocking command
44
+ Thread.new { system_blocking command }
45
+ end
43
46
 
44
- b = JButton.new("Watch DVD from hard drive unedited") # LODO watch in realtime option--then rippers and watchers can combine
45
- b.on_clicked {
46
- ENV['PATH'] = ENV['PATH'] + ";d:\\Program Files\\SMPlayer;c:\\Program Files\\SMPlayer"
47
- path = RubyWhich.new.which('smplayer')
48
- if(path.length == 0)
49
- JOptionPane.showMessageDialog(self, "It appears that you need to install a dependency: SMPlayer.\n
50
- Click ok to be directed to its download website.
51
- Also note that if it ever hangs, kill the process, and then use VLC instead
52
- (though VLC only has approximate timings).", "Lacking dependency", JOptionPane::ERROR_MESSAGE)
53
- system("start http://smplayer.sourceforge.net/downloads.php")
54
- else
55
- success_no_run, wrote_to_here_fulli = do_copy_dvd_to_hard_drive false, true
56
- command = "smplayer #{wrote_to_here_fulli}"
57
- on_success = proc {
58
- puts command
59
- Thread.new { system(command) }
60
- }
47
+ # make them choose which one to use
48
+ undef system
49
+
50
+ def initialize
51
+ super "Sensible-Cinema"
52
+ setDefaultCloseOperation JFrame::EXIT_ON_CLOSE
53
+ panel = JPanel.new
54
+ @panel = panel
55
+ @buttons = []
56
+ panel.set_layout nil
57
+ add panel # why can't I just slap these down?
58
+
59
+ jlabel = JLabel.new 'Welcome to Sensible Cinema!'
60
+ happy = Font.new("Tahoma", Font::PLAIN, 11)
61
+ jlabel.setFont(happy)
62
+ jlabel.set_bounds(44,44,160,14)
63
+ panel.add jlabel
64
+ @starting_button_y = 120
65
+ @button_width = 270
66
+
67
+ @progress_bar = JProgressBar.new(0, 100)
68
+ @progress_bar.set_bounds(44,80,@button_width,23)
69
+ @progress_bar.visible = false
70
+ panel.add @progress_bar
71
+
72
+ @create = new_jbutton( "Create edited copy of DVD on Your Hard Drive", false )
73
+ @create.on_clicked {
74
+ do_copy_dvd_to_hard_drive false
75
+ }
76
+
77
+ @watch_unedited = new_jbutton("Watch DVD from hard drive unedited", true) # LODO watch in realtime option--then rippers and watchers can combine
78
+ @watch_unedited.on_clicked {
79
+ path = RubyWhich.new.which('smplayer')
80
+ if(path.length == 0)
81
+ show_blocking_message_dialog("It appears that you need to install a dependency: SMPlayer.\n
82
+ Click ok to be directed to its download website, where you can download and install it.", "Lacking dependency", JOptionPane::ERROR_MESSAGE)
83
+ system_non_blocking("start http://smplayer.sourceforge.net/downloads.php")
84
+ System.exit(1)
85
+ else
86
+ success_no_run, wrote_to_here_fulli = do_copy_dvd_to_hard_drive false, true # LODO pass in a block (currently @after_success_once is run from the other thread--even have a race condition in there!)
87
+ on_success = proc {
88
+ command = "smplayer #{wrote_to_here_fulli}"
89
+ system_non_blocking command
90
+ }
91
+ if success_no_run
92
+ on_success.call
93
+ else
94
+ @after_success_once = on_success # shenanigans to be able to let that thread run...
95
+ end
96
+ end
97
+ }
98
+
99
+ @open_list = new_jbutton("Open/Edit a pre-existing Edit Decision List", false)
100
+ @open_list.on_clicked {
101
+ dialog = FileDialog.new(self, "Pick file to edit")
102
+ dialog.set_directory EDL_DIR
103
+ filename = dialog.go
104
+ open_file_to_edit_it filename if filename
105
+ }
106
+
107
+ @preview_section = new_jbutton( "Preview a certain time frame (edited)", true )
108
+ @preview_section.on_clicked {
109
+ success_no_run, wrote_to_here_fulli = do_copy_dvd_to_hard_drive true
110
+ on_success = proc { |file|
111
+ system_non_blocking("smplayer #{file}")
112
+ }
61
113
  if success_no_run
62
114
  on_success.call
63
115
  else
64
- @after_success_once = on_success # shenanigans to be able to let this thread run...
116
+ @after_success_once = on_success # shenanigans to be able to let that thread run...
65
117
  end
66
- end
67
- }
68
- b.set_bounds(44,150,button_width,23)
69
- panel.add b if ARGV.index("--create-mode") # LODO allow end users to play it from here?
70
-
71
- d = JButton.new( "Preview edited section of current DVD" )
72
- d.on_clicked {
73
- do_copy_dvd_to_hard_drive true
74
- }
75
-
76
- d.set_bounds(44,180,button_width,23)
77
- panel.add d if ARGV.index("--create-mode")
78
-
79
- f = JButton.new("Open/Edit an Edit Decision List")
80
- f.on_clicked {
81
- dialog = FileDialog.new(self, "Pick file to edit")
82
- dialog.set_directory EDL_DIR
83
- filename = dialog.go
84
- open_file_to_edit_it filename if filename
85
- }
86
- f.set_bounds(44,260,button_width,23)
87
- panel.add f if ARGV.index("--create-mode")
88
-
89
- e = JButton.new( "Re-run most recent preview segment" )
90
- e.on_clicked {
91
- repeat_last_copy_dvd_to_hard_drive
92
- }
93
-
94
- e.set_bounds(44,220,button_width,23)
95
- panel.add e if ARGV.index("--create-mode")
96
-
97
- reload = JButton.new( "Get a disk's unique ID" ).on_clicked {
98
- drive, volume, md5 = choose_dvd_drive
99
- # display it, allow them to copy and paste it out
100
- JOptionPane.showInputDialog("#{drive} #{volume} for your copying+pasting pleasure (highlight, then ctrl+c to copy) \n
101
- This is used to identify a disk to match it to its EDL, later.", "\"disk_unique_id\" => \"#{md5}\",")
102
- }
103
-
104
- reload.set_bounds(44,290,button_width,20)
105
- panel.add reload if ARGV.index("--create-mode")
118
+ }
106
119
 
107
- @progress_bar = JProgressBar.new(0, 100)
108
- @progress_bar.set_bounds(44,280,button_width,23)
109
- @progress_bar.visible = false
110
- panel.add @progress_bar
111
-
112
- g = JButton.new("Create New Edit List for current DVD")
113
- g.on_clicked do
114
- drive, volume, md5 = choose_dvd_drive
120
+ @rerun_preview = new_jbutton( "Re-run most recently performed preview", true )
121
+ @rerun_preview.on_clicked {
122
+ repeat_last_copy_dvd_to_hard_drive
123
+ }
124
+
125
+ @create_new_edl_for_current_dvd = new_jbutton("Create new Edit Decision List for current DVD", true)
126
+ @create_new_edl_for_current_dvd.on_clicked do
127
+ drive, volume, md5 = choose_dvd_drive
115
128
  input = <<-EOL
116
- # comments can go after a # on any line.
129
+ # comments can go after a # on any line, for example this one.
117
130
  "mutes" => [
118
- #"00:00:01", "00:00:02",
131
+ "0:00:01.0", "0:00:02.0", "da..",
119
132
  ],
120
133
 
121
134
  "blank_outs" => [
122
- #"01:01:00" , "01:02:00"
135
+ "1:01:00.0" , "1:02:00.0", "violent scene of some sort"
123
136
  ],
124
137
  "disk_unique_id" => "#{md5}",
125
138
  "title" => "#{volume}",
126
- EOL
127
- puts input
128
- filename = volume.gsub(' ', '_') + '.txt'
129
- File.write(filename, input) unless File.exist?(filename) # lodo let them choose name (?)
130
- open_file_to_edit_it filename
131
-
132
- end
133
- g.set_bounds(44,320,button_width,20)
134
- panel.add g if ARGV.index("--create-mode")
135
-
136
- @exit = JButton.new("Exit").on_clicked {
137
- self.close
138
- }
139
- @exit.set_bounds(44,350,button_width,23)
140
- panel.add @exit
141
-
142
- setSize 350,430
143
-
144
- @buttons = [b,c,d,e,reload,@exit]
145
- check_for_dependencies
146
- end
147
-
148
- def download full_url, to_here
149
- require 'open-uri'
150
- writeOut = open(to_here, "wb")
151
- writeOut.write(open(full_url).read)
152
- writeOut.close
153
- end
154
-
155
- def check_for_dependencies
156
- ffmpeg = RubyWhich.new.which('ffmpeg')
157
- if ffmpeg.length == 0
158
- JOptionPane.showMessageDialog(self, "It appears that you need to install a dependency: imagemagick.\n
159
- Click ok to be directed to its download website.\nYou'll probably want to download and install the \"windows-dll.exe\" package.\n
160
- Then restart Sensible-Cinema.", "Lacking dependency", JOptionPane::ERROR_MESSAGE)
161
- system("start http://www.imagemagick.org/script/binary-releases.php#windows")
162
- java.lang.System.exit(1)
139
+ "dvd_title_track" => "1" # most DVD's use title 1 for the main film. Some don't though. The correct number is discoverable by opening the film in VLC and choosing "playback -> title" while watching the main feature. If its not 1, then change this here. And delete this overly verbose comment either way :)
140
+ EOL
141
+ filename = EDL_DIR + "\\" + volume.gsub(' ', '_') + '.txt'
142
+ File.write(filename, input) unless File.exist?(filename) # lodo let them choose name (?)
143
+ open_file_to_edit_it filename
144
+
145
+ end
146
+
147
+ @display_unique = new_jbutton( "Calculate DVD's unique ID", true ).on_clicked {
148
+ drive, volume, md5 = choose_dvd_drive
149
+ # display it, allow them to copy and paste it out
150
+ get_user_input("#{drive} #{volume} for your copying+pasting pleasure (highlight, then ctrl+c to copy) \n
151
+ This is used to identify a disk to match it to its EDL, later.", "\"disk_unique_id\" => \"#{md5}\",")
152
+ }
153
+
154
+ @exit = new_jbutton("Exit", false).on_clicked {
155
+ self.close
156
+ }
157
+
158
+ setSize 350,430
159
+
160
+ check_for_dependencies
163
161
  end
164
- mencoder = RubyWhich.new.which('mencoder')
165
- if mencoder.length == 0
166
- answer = JOptionPane.showConfirmDialog(nil, "Appears that you need to install a dependency: mencoder.
167
- Its license is at: http://www.gnu.org/licenses/gpl-2.0.html.
168
- Also this will download 7z locally (license: http://www.7-zip.org/license.txt).
169
- Click yes if you accept the terms of the several license agreements mentioned. The programs will then be downloaded.
170
- Or click no to cancel and exit.", "Lacking dependency", JOptionPane::YES_NO_OPTION)
171
- if answer == 1
172
- p 'exiting, no mencoder...'
162
+
163
+ def download full_url, to_here
164
+ require 'open-uri'
165
+ writeOut = open(to_here, "wb")
166
+ writeOut.write(open(full_url).read)
167
+ writeOut.close
168
+ end
169
+
170
+ def check_for_dependencies
171
+ ffmpeg = RubyWhich.new.which('ffmpeg')
172
+ if ffmpeg.length == 0
173
+ show_blocking_message_dialog(self, "It appears that you need to install a dependency: imagemagick.\n
174
+ Click ok to be directed to its download website.\nYou'll probably want to download and install the \"windows-dll.exe\" package.\n
175
+ Then restart Sensible-Cinema.", "Lacking dependency", JOptionPane::ERROR_MESSAGE)
176
+ system_non_blocking("start http://www.imagemagick.org/script/binary-releases.php#windows")
173
177
  java.lang.System.exit(1)
174
178
  end
175
- vendor_cache = File.expand_path(File.dirname(__FILE__)) + "/../vendor/cache/"
176
- ENV['PATH'] = ENV['PATH'] + ';' + vendor_cache + '\\..;' + vendor_cache
177
- Dir.chdir(vendor_cache) do
178
- Kernel.print 'downloading unzip utility...'
179
- download("http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip", "7za920.zip")
180
- system("unzip -o 7za920.zip") # -o means "overwrite" without prompting
181
- # now we have 7za.exe
182
- Kernel.print 'downloading mencoder'
183
- download("http://downloads.sourceforge.net/project/mplayer-win32/MPlayer%20and%20MEncoder/revision%2032492/MPlayer-rtm-svn-32492.7z", "mencoder.7z")
184
- system("7za e mencoder.7z -y -omencoder")
185
- Kernel.puts 'done'
179
+ mencoder = RubyWhich.new.which('mencoder')
180
+ if mencoder.length == 0
181
+ answer = JOptionPane.showConfirmDialog(nil, "Appears that you need to install a dependency: mencoder.
182
+ Its license is at: http://www.gnu.org/licenses/gpl-2.0.html.
183
+ Also this will download 7z locally (license: http://www.7-zip.org/license.txt).
184
+ Click yes if you accept the terms of the several license agreements mentioned. The programs will then be downloaded.
185
+ Or click no to cancel and exit.", "Lacking dependency", JOptionPane::YES_NO_OPTION)
186
+ if answer == 1
187
+ p 'exiting, no mencoder...'
188
+ java.lang.System.exit(1)
189
+ end
190
+ vendor_cache = File.expand_path(File.dirname(__FILE__)) + "/../vendor/cache/"
191
+ ENV['PATH'] = ENV['PATH'] + ';' + vendor_cache + '\\..;' + vendor_cache
192
+ Dir.chdir(vendor_cache) do
193
+ Kernel.print 'downloading unzip utility...'
194
+ download("http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip", "7za920.zip")
195
+ system_blocking("unzip -o 7za920.zip") # -o means "overwrite" without prompting
196
+ # now we have 7za.exe
197
+ Kernel.print 'downloading mencoder'
198
+ download("http://downloads.sourceforge.net/project/mplayer-win32/MPlayer%20and%20MEncoder/revision%2032492/MPlayer-rtm-svn-32492.7z", "mencoder.7z")
199
+ system_blocking("7za e mencoder.7z -y -omencoder")
200
+ Kernel.puts 'done'
201
+ end
186
202
  end
187
203
  end
188
- end
189
204
 
190
- def open_file_to_edit_it filename
191
- Thread.new { system("notepad \"#{filename}\"")} # blocks otherwise...
192
- end
205
+ def open_file_to_edit_it filename
206
+ system_non_blocking "notepad \"#{filename}\""
207
+ end
208
+
209
+ def single_edit_list_matches_dvd md5
210
+ return unless md5 # ignore nil searches, where it wasn't set in the .txt file
211
+ matching = Dir[EDL_DIR + '/*.txt'].select{|file|
212
+ EdlParser.parse_file(file)["disk_unique_id"] == md5
213
+ }
214
+ if matching.length == 1
215
+ file = matching[0]
216
+ p "selecting the one matching file #{file} #{md5}"
217
+ file
218
+ else
219
+ nil
220
+ end
221
+ end
222
+
223
+ EDL_DIR = File.expand_path(__dir__ + "/../zamples/edit_decision_lists/dvds").to_filename
193
224
 
194
- def single_edit_list_matches_dvd md5
195
- return unless md5 # ignore nil searches, where it wasn't set in the .txt file
196
- matching = Dir[EDL_DIR + '/*.txt'].select{|file|
197
- EdlParser.parse_file(file)["disk_unique_id"] == md5
198
- }
199
- if matching.length == 1
200
- file = matching[0]
201
- p "selecting the one matching file #{file} #{md5}"
202
- file
203
- else
204
- nil
225
+ def repeat_last_copy_dvd_to_hard_drive
226
+ generate_and_run_bat_file *Storage['last_params']
205
227
  end
206
- end
207
-
208
- EDL_DIR = File.expand_path(__dir__ + "/../zamples/edit_decision_lists/dvds").to_filename
209
-
210
- def repeat_last_copy_dvd_to_hard_drive
211
- generate_and_run_bat_file *Storage['last_params']
212
- end
213
-
214
- def do_copy_dvd_to_hard_drive should_prompt_for_start_and_end_times, want_full_list = false
228
+
229
+ def new_filechooser
230
+ JFileChooser.new
231
+ end
232
+
233
+ def show_blocking_message_dialog(message, title = message.split("\n")[0], style= JOptionPane::INFORMATION_MESSAGE)
234
+ JOptionPane.showMessageDialog(nil, message, title, style)
235
+ end
236
+
237
+ def get_user_input(message, default)
238
+ start_time = JOptionPane.showInputDialog(message, default)
239
+ end
240
+
241
+ def do_copy_dvd_to_hard_drive should_prompt_for_start_and_end_times, want_full_list = false
215
242
  drive, dvd_volume_name, md5sum = choose_dvd_drive
216
- p drive, dvd_volume_name, md5sum
243
+ puts "#{drive}, #{dvd_volume_name}, #{md5sum}"
217
244
  edit_list_path = single_edit_list_matches_dvd(md5sum)
218
245
  if !edit_list_path
219
246
  fc = FileDialog.new(self)
220
- fc.set_title "Please pick a DVD Edit List File"
247
+ fc.set_title "Please pick a DVD Edit Decision List File"
221
248
  fc.set_directory EDL_DIR
222
249
  edit_list_path = fc.go
223
250
  end
251
+ return unless edit_list_path
224
252
  descriptors = EdlParser.parse_file edit_list_path
225
-
253
+
226
254
  dvd_title = descriptors['title'] || dvd_volume_name
227
-
228
- fc = JFileChooser.new
229
- # LODO allow for spaces in the save to filename
230
-
255
+
256
+ fc = new_filechooser
257
+
258
+ # LODO allow for spaces in the save_to filename
259
+
231
260
  if should_prompt_for_start_and_end_times
232
- JOptionPane.showMessageDialog(nil, "Ok, let's preview just a portion of it. \nNote that you'll want to preview a section that wholly includes an edit decision in it\n For example, if it mutes from second 1 to second 10, you'll want to play from 00:00 to 00:12 or what not.\nAlso note that the first time you preview a section of a video, it will take like 20 minutes as it sets up the video for previewing.\nSubsequent previews will be faster, though, as long as you use the same filename.", "Preview!", JOptionPane::INFORMATION_MESSAGE)
233
- start_time = JOptionPane.showInputDialog("At what point in the video would you like to start your preview? (like 01:00 for starting at 1 minute)", Storage['start_time'])
234
- Storage['start_time'] = start_time
235
- end_time = JOptionPane.showInputDialog("At what point in the video would you like to finish your preview? (like 02:00 for ending at the 2 minute mark)", Storage['end_time'])
236
- Storage['end_time'] = end_time
237
- unless start_time and end_time
238
- JOptionPane.showMessageDialog(nil, " Please choose start and end", "Failed", JOptionPane::ERROR_MESSAGE)
239
- return
240
- end
261
+ show_blocking_message_dialog("Ok, let's preview just a portion of it. \nNote that you'll want to preview a section that wholly includes an edit decision in it\n For example, if it mutes from second 1 to second 10, you'll want to play from 00:00 to 00:12 or what not.\nAlso note that the first time you preview a section of a video, it will take like 20 minutes as it sets up the video for previewing.\nSubsequent previews will be faster, though, as long as you use the same filename.", "Preview")
262
+ start_time = get_user_input("At what point in the video would you like to start your preview? (like 01:00 for starting at 1 minute)", Storage['start_time'])
263
+ Storage['start_time'] = start_time
264
+ end_time = get_user_input("At what point in the video would you like to finish your preview? (like 02:00 for ending at the 2 minute mark)", Storage['end_time'])
265
+ Storage['end_time'] = end_time
266
+ unless start_time and end_time
267
+ JOptionPane.showMessageDialog(nil, " Please choose start and end", "Failed", JOptionPane::ERROR_MESSAGE)
268
+ return
269
+ end
241
270
  end
242
-
271
+
243
272
  fc.set_title "Pick where to save #{dvd_title} edited to"
244
-
273
+
245
274
  save_to_file_name = dvd_title + ' edited copy'
246
275
  save_to_file_name += ' single segment' if should_prompt_for_start_and_end_times || want_full_list
247
- save_to_file_name=save_to_file_name.gsub(' ', '_').gsub( /\W/, '') # no punctuation for now...
248
- fc.setFile(DriveInfo.get_drive_with_most_space_with_slash + save_to_file_name)
276
+ save_to_file_name = save_to_file_name.gsub(' ', '_').gsub( /\W/, '') # no punctuation for now...
277
+ fc.set_file(get_drive_with_most_space_with_slash + save_to_file_name)
249
278
  save_to = fc.go
250
279
  dvd_title_track = descriptors["dvd_title_track"]
251
280
  # how does save_to map to fulli?
@@ -260,32 +289,41 @@ EOL
260
289
  end
261
290
  end
262
291
  generate_and_run_bat_file save_to, edit_list_path, descriptors, drive, dvd_title, start_time, end_time, dvd_title_track
263
- [false, fulli]
292
+ [false, fulli] # false means it's running in a background thread :P
293
+ end
294
+
295
+ def get_drive_with_most_space_with_slash
296
+ DriveInfo.get_drive_with_most_space_with_slash
264
297
  end
265
-
266
- def generate_and_run_bat_file save_to, edit_list_path, descriptors, drive, dvd_title, start_time, end_time, dvd_title_track
298
+
299
+ def get_mencoder_commands descriptors, drive, save_to, start_time, end_time, dvd_title_track
300
+ MencoderWrapper.get_bat_commands descriptors, drive, save_to, start_time, end_time, dvd_title_track
301
+ end
302
+
303
+ def generate_and_run_bat_file save_to, edit_list_path, descriptors, drive, dvd_title, start_time, end_time, dvd_title_track
267
304
  Storage['last_params'] = [save_to, edit_list_path, descriptors, drive, dvd_title, start_time, end_time, dvd_title_track]
268
- bat_file = MencoderWrapper.get_bat_commands descriptors, drive, save_to, start_time, end_time, dvd_title_track
305
+ commands = get_mencoder_commands descriptors, drive, save_to, start_time, end_time, dvd_title_track
269
306
  temp_dir = Dir.tmpdir
270
307
  temp_file = temp_dir + '/vlc.temp.bat'
271
- File.write(temp_file, bat_file)
272
- puts 'commands located for debugging purposes at: ' + bat_file
273
- popup = ModeLessDialog.new( "Copying to #{save_to}.\n" +
274
- "Running #{File.basename edit_list_path} against #{drive} (#{dvd_title}).\n" +
275
- "This could take quite awhile, and will prompt you when it is done.\n" +
276
- "You can close this window and continue working while it runs.\n" +
277
- "NB that the created file will be playable with SMplayer or VLC player.",
278
- "OK")
279
-
308
+ File.write(temp_file, commands)
309
+ popup = ModeLessDialog.new( "Copying to #{save_to}.\n" +
310
+ "Running #{File.basename edit_list_path} against #{drive} (#{dvd_title}).\n" +
311
+ "This could take quite awhile, and will prompt you when it is done.\n" +
312
+ "You can close this window and continue working while it runs.\n" +
313
+ "NB that the created file will be playable only with smplayer or VLC player.",
314
+ "OK")
315
+
280
316
  # allow our popups to still be serviced while it is running
281
- Thread.new {
282
- run_create_commands bat_file, save_to
317
+ @background_thread = Thread.new {
318
+ run_create_commands commands, save_to
283
319
  popup.dispose
284
320
  }
285
321
  # LODO warn if they will overwrite a file in the end...
286
322
  end
287
-
288
- def run_create_commands batch_commands, save_to
323
+
324
+ attr_accessor :background_thread, :after_success_once
325
+
326
+ def run_create_commands batch_commands, save_to
289
327
  @buttons.each{|b| b.set_enabled false}
290
328
  success = true
291
329
  lines = batch_commands.lines.to_a
@@ -294,7 +332,7 @@ EOL
294
332
  @progress_bar.set_value(10) # start at 10% always, so they can see something.
295
333
  lines.each_with_index{|l, idx|
296
334
  if success
297
- success = system(l) unless ARGV.find{|a| a == '--test'} # this might not actually cancel out early for some reason...
335
+ success = system_blocking(l) unless ARGV.find{|a| a == '--test'} # this might not actually cancel out early for some reason...
298
336
  if l =~ /@rem /
299
337
  success = true # these fail fof some reason?
300
338
  else
@@ -305,76 +343,75 @@ EOL
305
343
  }
306
344
  @progress_bar.visible=false
307
345
  @buttons.each{|b| b.set_enabled true}
308
- if true#success
346
+ if success
347
+ saved_to = save_to + '.avi' # LODO pass this out?
309
348
  if @after_success_once
310
- procy = @after_success_once
311
- @after_success_once = nil
312
- procy.call
349
+ @after_success_once.call saved_to
313
350
  else
314
- saved_to = save_to + '.avi' # LODO pass this out?
315
- JOptionPane.showMessageDialog(nil, " Done--you may now watch file #{saved_to} in SMPlayer or VLC player", "Done!", JOptionPane::INFORMATION_MESSAGE)
351
+ show_blocking_message_dialog(" Done--you may now watch file #{saved_to} in SMPlayer or VLC player")
316
352
  show_file = "explorer /e,/select,\"#{File.expand_path(saved_to).to_filename}\""
317
- system show_file
353
+ system_non_blocking show_file
318
354
  #self.close # ?
319
355
  end
320
356
  else
321
- JOptionPane.showMessageDialog(nil, " Failed--please examine screen output and report back!", "Failed", JOptionPane::ERROR_MESSAGE)
357
+ show_blocking_message_dialog("Failed--please examine screen output and report back!", "Failed", JOptionPane::ERROR_MESSAGE)
322
358
  end
323
- end
324
-
325
- # returns e:\, volume, md5sum
326
- def choose_dvd_drive
327
- opticals = DriveInfo.get_dvd_drives_as_win32ole
328
- names = opticals.map{|d| d.Name + "\\" + " (" + (d.VolumeName || 'please insert DVD before proceeding if you want to use this drive') + ")"}
329
-
330
- if opticals.length != 1
331
- dialog = GetDisk.new(self, names)
332
- dialog.setSize 200,125
333
- dialog.show
334
- selected_idx = dialog.selected_idx
335
- else
336
- selected_idx = 0
337
- p 'selecting user\'s only disk drive ' + names[0]
359
+ @after_success_once = nil
338
360
  end
339
-
340
- if selected_idx
341
- disk = opticals[selected_idx]
342
- prefix = names[selected_idx][0..2]
343
- return prefix, opticals[selected_idx].VolumeName, DriveInfo.md5sum_disk(prefix)
344
- else
345
- puts 'did not select a drive...exiting'
346
- java.lang.System.exit 1
361
+
362
+ # returns e:\, volume, md5sum
363
+ def choose_dvd_drive
364
+ opticals = DriveInfo.get_dvd_drives_as_win32ole
365
+ names = opticals.map{|d| d.Name + "\\" + " (" + (d.VolumeName || 'Insert DVD to use') + ")"}
366
+
367
+ if opticals.length != 1
368
+ dialog = GetDisk.new(self, names)
369
+ dialog.setSize 200,125
370
+ dialog.show
371
+ selected_idx = dialog.selected_idx
372
+ else
373
+ selected_idx = 0
374
+ p 'selecting user\'s only disk drive ' + names[0]
375
+ end
376
+
377
+ if selected_idx
378
+ disk = opticals[selected_idx]
379
+ prefix = names[selected_idx][0..2]
380
+ return prefix, opticals[selected_idx].VolumeName, DriveInfo.md5sum_disk(prefix)
381
+ else
382
+ puts 'did not select a drive...exiting'
383
+ java.lang.System.exit 1
384
+ end
347
385
  end
386
+
348
387
  end
349
388
 
350
- end
351
-
352
- class GetDisk < JDialog
353
- attr_reader :selected_idx
354
- def initialize parent, options_array
355
- super parent, true
356
-
357
- box = JComboBox.new
358
- box.add_action_listener do |e|
359
- idx = box.get_selected_index
360
- if idx != 0
361
- # don't count choosing the first as a real entry
362
- @selected_idx = box.get_selected_index - 1
363
- dispose
364
- end
365
- end
366
-
367
- box.add_item "Click to select DVD drive" # put something in index 0
368
- options_array.each{|drive|
369
- box.add_item drive
370
- }
371
- add box
372
- pack
389
+ class GetDisk < JDialog
390
+ attr_reader :selected_idx
391
+ def initialize parent, options_array
392
+ super parent, true
393
+
394
+ box = JComboBox.new
395
+ box.add_action_listener do |e|
396
+ idx = box.get_selected_index
397
+ if idx != 0
398
+ # don't count choosing the first as a real entry
399
+ @selected_idx = box.get_selected_index - 1
400
+ dispose
401
+ end
402
+ end
403
+
404
+ box.add_item "Click to select DVD drive" # put something in index 0
405
+ options_array.each{|drive|
406
+ box.add_item drive
407
+ }
408
+ add box
409
+ pack
373
410
  end
374
- end
411
+ end
375
412
  end
376
413
 
377
414
  if $0 == __FILE__
378
415
  SensibleSwing::MainWindow.new.set_visible true
379
416
  puts 'Please use the Sensible Cinema GUI window popup...'
380
- end
417
+ end
@@ -53,7 +53,7 @@ class MencoderWrapper
53
53
  out += "call mencoder #{partials.join(' ')} -o #{to_here_final_file}.avi -ovc copy -oac copy\n"
54
54
  # LODO only do this if they want to watch it on their computer, with something other than smplayer, or want to make it smaller, as it takes *forever* longer
55
55
  # LODO the "insta play" mode, or the "faster rip" mode (related...)
56
- # out += "call mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 #{partials.join(' ')} -o #{to_here_final_file}\n"
56
+ out += "@rem call mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 #{partials.join(' ')} -o #{to_here_final_file}\n"
57
57
 
58
58
  out += "@rem del #{@big_temp}\n" # LODO
59
59
  out += "del " + partials.join(' ') + "\n"# LODO
@@ -18,18 +18,23 @@ module SensibleSwing
18
18
 
19
19
  def on_clicked &block
20
20
  raise unless block
21
+ @block = block
21
22
  add_action_listener do |e|
22
23
  begin
23
- block.call
24
- rescue Exception => e
25
- puts 'got fatal exception', e
26
- puts e.backtrace.join("\n")
27
- System.exit(1) # LODO no exit
28
- end
24
+ block.call
25
+ rescue Exception => e
26
+ puts 'got fatal exception', e
27
+ puts e.backtrace.join("\n")
28
+ System.exit(1) # LODO no exit
29
+ end
29
30
  end
30
31
  self
31
32
  end
32
33
 
34
+ def simulate_click
35
+ @block.call
36
+ end
37
+
33
38
  end
34
39
 
35
40
  class JFrame
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sensible-cinema}
8
- s.version = "0.16.5"
8
+ s.version = "0.16.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roger Pack"]
12
- s.date = %q{2010-12-04}
12
+ s.date = %q{2010-12-06}
13
13
  s.email = %q{rogerdpack@gmail.com}
14
14
  s.executables = ["sensible-cinema", "sensible-cinema-cli"]
15
15
  s.extensions = ["ext/mkrf_conf.rb"]
@@ -23,11 +23,13 @@ Gem::Specification.new do |s|
23
23
  "ChangeLog",
24
24
  "LICENSE",
25
25
  "README",
26
+ "RUN SENSIBLE CINEMA CLICK HERE.bat",
26
27
  "Rakefile",
27
28
  "TODO",
28
29
  "VERSION",
29
30
  "bin/sensible-cinema",
30
31
  "bin/sensible-cinema-cli",
32
+ "edit sensible cinema decision list files.bat",
31
33
  "experimental_readme.txt",
32
34
  "ext/mkrf_conf.rb",
33
35
  "gplv3.txt",
@@ -50,8 +52,6 @@ Gem::Specification.new do |s|
50
52
  "lib/swing_helpers.rb",
51
53
  "lib/vlc_programmer.rb",
52
54
  "never_do",
53
- "run_sensible_cinema.bat",
54
- "run_sensible_cinema_in_create_mode.bat",
55
55
  "sensible-cinema.gemspec",
56
56
  "spec/blanker.spec.rb",
57
57
  "spec/common.rb",
@@ -121,6 +121,7 @@ Gem::Specification.new do |s|
121
121
  "vendor/gocr049.exe",
122
122
  "vendor/unzip.exe",
123
123
  "zamples/edit_decision_lists/category descriptions.txt",
124
+ "zamples/edit_decision_lists/dvds/COOL_RUNNINGS.txt",
124
125
  "zamples/edit_decision_lists/dvds/bob the builder pets in a pickle.txt",
125
126
  "zamples/edit_decision_lists/dvds/bobs_big_plan.txt",
126
127
  "zamples/edit_decision_lists/dvds/happiest baby on the block.txt",
@@ -3,16 +3,21 @@ load '../bin/sensible-cinema'
3
3
 
4
4
  module SensibleSwing
5
5
  describe MainWindow do
6
-
6
+
7
+ it "should be able to start up" do
8
+ MainWindow.new.dispose# shouldn't crash :)
9
+ end
10
+
7
11
  it "should auto-select a EDL if it matches a DVD's title" do
8
- MainWindow.new.single_edit_list_matches_dvd("d41d8cd98f00b204e9800998ecf8427e").should_not be nil
12
+ MainWindow.new.single_edit_list_matches_dvd("19d121ae8dc40cdd70b57ab7e8c74f76").should_not be nil
9
13
  end
10
-
14
+
11
15
  it "should not auto-select if you pass it nil" do
12
16
  MainWindow.new.single_edit_list_matches_dvd(nil).should be nil
13
17
  end
14
-
18
+
15
19
  it "should prompt if two EDL's match a DVD title" do
20
+ old_edl = MainWindow::EDL_DIR
16
21
  MainWindow.const_set(:EDL_DIR, 'temp')
17
22
  FileUtils.rm_rf 'temp'
18
23
  Dir.mkdir 'temp'
@@ -22,11 +27,127 @@ module SensibleSwing
22
27
  File.binwrite('b.txt', "\"disk_unique_id\" => \"abcdef1234\"")
23
28
  end
24
29
  MainWindow.new.single_edit_list_matches_dvd("abcdef1234").should be nil
30
+ MainWindow.const_set(:EDL_DIR, old_edl)
25
31
  end
26
-
32
+
27
33
  it "should modify path to have mencder available, and ffmpeg, and download them on the fly" do
28
34
  ENV['PATH'].should include("mencoder")
29
35
  end
30
-
36
+
37
+ before do
38
+ @subject = MainWindow.new
39
+ @subject.stub!(:choose_dvd_drive) {
40
+ ["drive", "volume", "19d121ae8dc40cdd70b57ab7e8c74f76"] # happiest baby on the block
41
+ }
42
+ @subject.stub!(:get_mencoder_commands) { |*args|
43
+ args[-4].should match(/abc/)
44
+ @args = args
45
+ 'sleep 0.1'
46
+ }
47
+ @subject.stub!(:new_filechooser) {
48
+ FakeFileChooser.new
49
+ }
50
+ @subject.stub!(:get_drive_with_most_space_with_slash) {
51
+ "e:\\"
52
+ }
53
+ @subject.stub!(:show_blocking_message_dialog) {}
54
+ @subject.stub!(:get_user_input) {'01:00'}
55
+ @subject.stub!(:system_non_blocking) { |command|
56
+ @command = command
57
+ Thread.new {} # fake out the return...
58
+ }
59
+ @subject.stub!(:open_file_to_edit_it) {}
60
+ end
61
+
62
+ class FakeFileChooser
63
+ def set_title x
64
+ end
65
+ def set_file y
66
+ end
67
+ def go
68
+ 'abc'
69
+ end
70
+ end
71
+
72
+ it "should be able to do a normal copy to hard drive, edited" do
73
+ @subject.do_copy_dvd_to_hard_drive(false).should == [false, "abc.fulli.tmp.avi"]
74
+ end
75
+
76
+ it "should call through to explorer for the full thing" do
77
+ @subject.do_copy_dvd_to_hard_drive(false)
78
+ @subject.background_thread.join
79
+ @args[-2].should == nil
80
+ @command.should match /explorer/
81
+ @command.should_not match /fulli/
82
+ end
83
+
84
+ it "should be able to return the full list if it already exists" do
85
+ FileUtils.touch "abc.fulli.tmp.avi.done"
86
+ @subject.do_copy_dvd_to_hard_drive(false,true).should == [true, "abc.fulli.tmp.avi"]
87
+ FileUtils.rm "abc.fulli.tmp.avi.done"
88
+ end
89
+
90
+ it "should call explorer for the we can't reach this path of opening a partial without telling it what to do with it" do
91
+ @subject.do_copy_dvd_to_hard_drive(true).should == [false, "abc.fulli.tmp.avi"]
92
+ @subject.background_thread.join
93
+ @args[-1].should == 1
94
+ @args[-2].should == "01:00"
95
+ @command.should match /explorer/
96
+ @command.should_not match /fulli/
97
+ end
98
+
99
+ def prompt_for_start_and_end_times
100
+ @subject.instance_variable_get(:@preview_section).simulate_click
101
+ @args[-1].should == 1
102
+ @args[-2].should == "01:00"
103
+ @subject.background_thread.join
104
+ @command.should match /smplayer/
105
+ end
106
+
107
+ it "should prompt for start and end times" do
108
+ prompt_for_start_and_end_times
109
+ end
110
+
111
+ it "should be able to reprompt for start and end times automagically" do
112
+ prompt_for_start_and_end_times
113
+ old_args = @args
114
+ @args = nil
115
+ @subject.repeat_last_copy_dvd_to_hard_drive.join
116
+ @args.should == old_args
117
+ end
118
+
119
+
120
+ it "if the .done file exists, it should directly call smplayer" do
121
+ FileUtils.touch "abc.fulli.tmp.avi.done"
122
+ @subject.instance_variable_get(:@watch_unedited).simulate_click
123
+ @command.should == "smplayer abc.fulli.tmp.avi"
124
+ FileUtils.rm "abc.fulli.tmp.avi.done"
125
+ end
126
+
127
+ it "if the .done file does not exist, it should call mplayer later" do
128
+ @subject.instance_variable_get(:@watch_unedited).simulate_click
129
+ @subject.after_success_once.should_not == nil
130
+ @command.should == nil # scary timing spec
131
+ @subject.background_thread.join
132
+ # should have cleaned up...
133
+ @subject.after_success_once.should == nil
134
+ @command.should_not == nil
135
+ end
136
+
137
+ it "should create a new file for ya" do
138
+ out = MainWindow::EDL_DIR + "/volume.txt"
139
+ File.exist?( out ).should be_false
140
+ @subject.instance_variable_get(:@create_new_edl_for_current_dvd).simulate_click
141
+ begin
142
+ File.exist?( out ).should be_true
143
+ ensure
144
+ FileUtils.rm_rf out
145
+ end
146
+ end
147
+
148
+ it "should display unique" do
149
+ @subject.instance_variable_get(:@display_unique).simulate_click.should == "01:00"
150
+ end
151
+
31
152
  end
32
- end
153
+ end
@@ -0,0 +1,11 @@
1
+ # comments can go after a # on any line.
2
+ "mutes" => [
3
+ "0:00:01.0", "00:00:02.0", "dang",
4
+ ],
5
+
6
+ "blank_outs" => [
7
+ "1:16:50.0" , "1:17:00.0", "bad ..."
8
+ ],
9
+ "disk_unique_id" => "5a0a43f52e5d5e705fdfaa831b38409b",
10
+ "title" => "COOL_RUNNINGS",
11
+ "dvd_title_track" => "1"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 16
8
- - 5
9
- version: 0.16.5
8
+ - 7
9
+ version: 0.16.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Roger Pack
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-04 00:00:00 -07:00
17
+ date: 2010-12-06 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -161,11 +161,13 @@ files:
161
161
  - ChangeLog
162
162
  - LICENSE
163
163
  - README
164
+ - RUN SENSIBLE CINEMA CLICK HERE.bat
164
165
  - Rakefile
165
166
  - TODO
166
167
  - VERSION
167
168
  - bin/sensible-cinema
168
169
  - bin/sensible-cinema-cli
170
+ - edit sensible cinema decision list files.bat
169
171
  - experimental_readme.txt
170
172
  - ext/mkrf_conf.rb
171
173
  - gplv3.txt
@@ -188,8 +190,6 @@ files:
188
190
  - lib/swing_helpers.rb
189
191
  - lib/vlc_programmer.rb
190
192
  - never_do
191
- - run_sensible_cinema.bat
192
- - run_sensible_cinema_in_create_mode.bat
193
193
  - sensible-cinema.gemspec
194
194
  - spec/blanker.spec.rb
195
195
  - spec/common.rb
@@ -259,6 +259,7 @@ files:
259
259
  - vendor/gocr049.exe
260
260
  - vendor/unzip.exe
261
261
  - zamples/edit_decision_lists/category descriptions.txt
262
+ - zamples/edit_decision_lists/dvds/COOL_RUNNINGS.txt
262
263
  - zamples/edit_decision_lists/dvds/bob the builder pets in a pickle.txt
263
264
  - zamples/edit_decision_lists/dvds/bobs_big_plan.txt
264
265
  - zamples/edit_decision_lists/dvds/happiest baby on the block.txt