sensible-cinema 0.26.2 → 0.26.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/TODO +92 -73
  2. data/VERSION +1 -1
  3. data/bin/sensible-cinema-cli +3 -1
  4. data/change_log_with_feature_list.txt +23 -1
  5. data/developer_how_to_contribute_to_the_project.txt +2 -0
  6. data/lib/edl_parser.rb +4 -1
  7. data/lib/eight_three.rb +2 -2
  8. data/lib/gui/sensible-cinema-base.rb +14 -5
  9. data/lib/gui/sensible-cinema-create.rb +42 -21
  10. data/lib/gui/sensible-cinema-normal.rb +9 -4
  11. data/lib/muter.rb +1 -1
  12. data/lib/subtitle_profanity_finder.rb +24 -3
  13. data/spec/dragon.srt +1 -1
  14. data/spec/edl_parser.spec.rb +10 -2
  15. data/spec/notes +3 -1
  16. data/spec/subtitle_profanity_finder.spec.rb +61 -11
  17. data/todo.inventionzy.txt +5 -1
  18. data/todo.subtitle +2 -6
  19. data/todo.upconvert +3 -0
  20. data/zamples/edit_decision_lists/dvds/muppet_treasure_island.txt +21 -0
  21. data/zamples/edit_decision_lists/netflix_instant/avatar-last-air-bender-movie.txt +3 -2
  22. data/zamples/edit_decision_lists/netflix_instant/wrinkle-in-time.txt +23 -0
  23. data/zamples/edit_decision_lists/old_not_yet_updated/example_edit_decision_list.txt +14 -40
  24. metadata +4 -13
  25. data/lib/drive_info.rb +0 -81
  26. data/spec/drive_info.spec.rb +0 -61
  27. data/spec/go_line.bat +0 -1
  28. data/vendor/mac_dvdid/bin/dvdid +0 -0
  29. data/vendor/mac_dvdid/include/dvdid/dvdid.h +0 -67
  30. data/vendor/mac_dvdid/include/dvdid/dvdid2.h +0 -131
  31. data/vendor/mac_dvdid/include/dvdid/export.h +0 -32
  32. data/vendor/mac_dvdid/lib/libdvdid.0.dylib +0 -0
  33. data/vendor/mac_dvdid/lib/libdvdid.a +0 -0
  34. data/vendor/mac_dvdid/lib/libdvdid.dylib +0 -0
  35. data/vendor/mac_dvdid/lib/libdvdid.la +0 -41
data/lib/drive_info.rb DELETED
@@ -1,81 +0,0 @@
1
- =begin
2
- Copyright 2010, Roger Pack
3
- This file is part of Sensible Cinema.
4
-
5
- Sensible Cinema is free software: you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation, either version 3 of the License, or
8
- (at your option) any later version.
9
-
10
- Sensible Cinema is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
17
- =end
18
- require 'digest/md5'
19
- require 'rubygems'
20
- require 'sane'
21
- require 'ostruct'
22
- require 'benchmark'
23
- class DriveInfo
24
-
25
- def self.md5sum_disk(dir)
26
- if OS.mac?
27
- command = "#{__DIR__}/../vendor/mac_dvdid/bin/dvdid #{dir}"
28
- else
29
- command = "#{__DIR__}/../vendor/dvdid.exe #{dir}"
30
- end
31
- output = `#{command}` # can take like 2.2s
32
- raise 'dvdid command failed?' + command unless $?.exitstatus == 0
33
- output.strip
34
- end
35
-
36
- def self.get_dvd_drives_as_openstruct
37
- disks = get_all_drives_as_ostructs
38
- disks.select{|d| d.Description =~ /CD-ROM/ && File.exist?(d.Name + "/VIDEO_TS")}
39
- end
40
-
41
- def self.get_drive_with_most_space_with_slash
42
- disks = get_all_drives_as_ostructs
43
- most_space = disks.sort_by{|d| d.FreeSpace}[-1]
44
- most_space.MountPoint + "/"
45
- end
46
-
47
- def self.get_all_drives_as_ostructs # not just DVD drives...
48
- if OS.mac?
49
- require 'plist'
50
- Dir['/Volumes/*'].map{|dir|
51
- parsed = Plist.parse_xml(`diskutil info -plist "#{dir}"`)
52
- d2 = OpenStruct.new
53
- d2.VolumeName = parsed["VolumeName"]
54
- d2.Name = dir # DevNode?
55
- d2.FreeSpace = parsed["FreeSpace"].to_i
56
- d2.Description = parsed['OpticalDeviceType']
57
- d2.MountPoint = parsed['MountPoint']
58
- if d2.MountPoint == '/'
59
- d2.MountPoint = File.expand_path '~' # better ? I guess?
60
- end
61
- d2
62
- }
63
- else
64
- require 'ruby-wmi'
65
- disks = WMI::Win32_LogicalDisk.find(:all)
66
- disks.map{|d| d2 = OpenStruct.new
67
- d2.Description = d.Description
68
- d2.VolumeName = d.VolumeName
69
- d2.Name = d.Name
70
- d2.FreeSpace = d.FreeSpace.to_i
71
- d2.MountPoint = d.Name[0..2] # needed...
72
- d2
73
- }
74
- end
75
- end
76
-
77
- end
78
-
79
- if $0 == __FILE__
80
- p DriveInfo.get_dvd_drives_as_openstruct
81
- end
@@ -1,61 +0,0 @@
1
- =begin
2
- Copyright 2010, Roger Pack
3
- This file is part of Sensible Cinema.
4
-
5
- Sensible Cinema is free software: you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation, either version 3 of the License, or
8
- (at your option) any later version.
9
-
10
- Sensible Cinema is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
17
- =end
18
- require File.expand_path(File.dirname(__FILE__) + '/common')
19
- require_relative '../lib/drive_info'
20
- require 'socket'
21
-
22
- describe 'dvd_drive_info' do
23
- it 'should be able to get an md5sum from a dvd' do
24
- FileUtils.mkdir_p 'VIDEO_TS'
25
- Dir.chdir 'VIDEO_TS' do
26
- File.binwrite("VTS_01_0.IFO", "b")
27
- File.binwrite("VIDEO_TS.IFO", "a")
28
- end
29
- DriveInfo.md5sum_disk("./").should ==
30
- if Socket.gethostname == "PACKR-B1C04F564"
31
- "b715cc2a|5e217436"
32
- elsif OS.windows? # blacky
33
- "ff83793c|dfaedb42"
34
- else # mac
35
- raise 'unknown here...' + DriveInfo.md5sum_disk("./")
36
- end
37
- end
38
-
39
- it "should be able to do it for real disc in the drive" do
40
- DriveInfo.get_dvd_drives_as_openstruct.length.should be > 0
41
- found_one = false
42
- DriveInfo.get_dvd_drives_as_openstruct.each{|d|
43
- if d.VolumeName # mounted ...
44
- DriveInfo.md5sum_disk(d.MountPoint).length.should be > 0
45
- found_one = true
46
- d.FreeSpace.should == 0
47
- end
48
- }
49
- found_one.should be true
50
- end
51
-
52
- it "should return a drive with most space" do
53
- space_drive = DriveInfo.get_drive_with_most_space_with_slash
54
- space_drive[1..-1].should == ":/" if OS.windows? # hope forward slash is ok...
55
- space_drive[0..0].should == "/" if !OS.windows?
56
- require 'fileutils'
57
- FileUtils.touch space_drive + 'touched_file'
58
- FileUtils.rm space_drive + 'touched_file'
59
- end
60
-
61
- end
data/spec/go_line.bat DELETED
@@ -1 +0,0 @@
1
- jd -S rspec sensible_cinema_gui.spec.rb -l %*
Binary file
@@ -1,67 +0,0 @@
1
- /* $Id: dvdid.h 3209 2009-10-14 14:41:34Z chris $ */
2
-
3
- #ifndef DVDID__DVDID_H
4
- #define DVDID__DVDID_H
5
-
6
-
7
- #include <stdint.h>
8
-
9
-
10
- #include "export.h"
11
-
12
-
13
- #ifdef __cplusplus
14
- extern "C" {
15
- #endif
16
-
17
-
18
- enum dvdid_status_e {
19
- DVDID_STATUS_OK = 0,
20
- DVDID_STATUS_MALLOC_ERROR,
21
-
22
- /* Error that should only be returned by dvdid_calculate (but not test of API) */
23
- DVDID_STATUS_PLATFORM_UNSUPPORTED,
24
- DVDID_STATUS_READ_VIDEO_TS_ERROR,
25
- DVDID_STATUS_READ_VMGI_ERROR,
26
- DVDID_STATUS_READ_VTS01I_ERROR,
27
-
28
- DVDID_STATUS_DETECT_MEDIUM_ERROR,
29
- DVDID_STATUS_MEDIUM_UNKNOWN,
30
- DVDID_STATUS_FIXUP_SIZE_ERROR,
31
-
32
- DVDID_STATUS_READ_VCD_ERROR,
33
- DVDID_STATUS_READ_CDI_ERROR,
34
- DVDID_STATUS_READ_EXT_ERROR,
35
- DVDID_STATUS_READ_KARAOKE_ERROR,
36
- DVDID_STATUS_READ_CDDA_ERROR,
37
- DVDID_STATUS_READ_MPEGAV_ERROR,
38
- DVDID_STATUS_READ_SEGMENT_ERROR,
39
- DVDID_STATUS_READ_INFO_VCD_ERROR,
40
- DVDID_STATUS_READ_ENTRIES_VCD_ERROR,
41
-
42
- DVDID_STATUS_READ_SVCD_ERROR,
43
- DVDID_STATUS_READ_MPEG2_ERROR,
44
- DVDID_STATUS_READ_INFO_SVD_ERROR,
45
- DVDID_STATUS_READ_ENTRIES_SVD_ERROR,
46
- DVDID_STATUS_READ_TRACKS_SVD_ERROR,
47
- };
48
-
49
-
50
- typedef enum dvdid_status_e dvdid_status_t;
51
-
52
- /*
53
- If unsucessful, errn will be set to a platform specific error number, or zero if no
54
- such information is available. If errn is NULL, the parameter will be ignored.
55
- */
56
- DVDID_API(dvdid_status_t) dvdid_calculate(uint64_t *discid, const char* path, int *errn);
57
-
58
- /* Get a pointer to a string describing the contents of a dvdid_status_t */
59
- DVDID_API(const char*) dvdid_error_string(dvdid_status_t status);
60
-
61
-
62
- #ifdef __cplusplus
63
- }
64
- #endif
65
-
66
-
67
- #endif
@@ -1,131 +0,0 @@
1
- /* $Id: dvdid2.h 3221 2009-10-14 20:08:09Z chris $ */
2
-
3
- #ifndef DVDID__DVDID2_H
4
- #define DVDID__DVDID2_H
5
-
6
- #include <stdint.h>
7
-
8
-
9
- #include "export.h"
10
-
11
-
12
- #include "dvdid.h"
13
-
14
-
15
- #ifdef __cplusplus
16
- extern "C" {
17
- #endif
18
-
19
-
20
- enum dvdid_medium_e {
21
- DVDID_MEDIUM_DVD = 1,
22
- DVDID_MEDIUM_VCD,
23
- DVDID_MEDIUM_SVCD,
24
- };
25
-
26
- enum dvdid_dir_e {
27
- /* DVD */
28
- DVDID_DIR_VIDEO_TS = 1,
29
- /* VCD */
30
- DVDID_DIR_VCD,
31
- DVDID_DIR_CDI,
32
- DVDID_DIR_EXT,
33
- DVDID_DIR_KARAOKE,
34
- DVDID_DIR_CDDA,
35
- DVDID_DIR_MPEGAV,
36
- DVDID_DIR_SEGMENT,
37
- /* SVCD */
38
- DVDID_DIR_SVCD,
39
- /* DVDID_DIR_CDI, */
40
- /* DVDID_DIR_EXT */
41
- /* DVDID_DIR_KARAOKE, */
42
- /* DVDID_DIR_CDDA, */
43
- DVDID_DIR_MPEG2,
44
- /* DVDID_DIR_SEGMENT, */
45
- };
46
-
47
- enum dvdid_file_e {
48
- /* DVD */
49
- DVDID_FILE_VMGI = 1,
50
- DVDID_FILE_VTS01I,
51
- /* VCD */
52
- DVDID_FILE_INFO_VCD,
53
- DVDID_FILE_ENTRIES_VCD,
54
- /* SVCD */
55
- DVDID_FILE_INFO_SVD,
56
- DVDID_FILE_ENTRIES_SVD,
57
- DVDID_FILE_TRACKS_SVD,
58
- };
59
-
60
-
61
- typedef struct dvdid_hashinfo_s dvdid_hashinfo_t;
62
- typedef struct dvdid_fileinfo_s dvdid_fileinfo_t;
63
-
64
- typedef enum dvdid_medium_e dvdid_medium_t;
65
- typedef enum dvdid_dir_e dvdid_dir_t;
66
- typedef enum dvdid_file_e dvdid_file_t;
67
-
68
-
69
- struct dvdid_fileinfo_s {
70
- /* Creation time as a Win32 FILETIME */
71
- uint64_t creation_time;
72
-
73
- /* Lowest 32bits of file size (explicitly, the
74
- value stoted on the physical medium, which is
75
- not necessarily the value reported by the OS
76
- for (S)VCDs) */
77
- uint32_t size;
78
-
79
- /* Filename, uppercases, in ASCII */
80
- char *name;
81
- };
82
-
83
-
84
- DVDID_API(dvdid_status_t) dvdid_calculate2(uint64_t *discid, const dvdid_hashinfo_t *hi);
85
-
86
- /* Create a hashinfo struct. Returns non-zero on error */
87
- DVDID_API(dvdid_status_t) dvdid_hashinfo_create(dvdid_hashinfo_t **hi);
88
-
89
- /* Set/get the media type. Defaults to DVDID_TYPE_DVD for backwards
90
- compatibility. Set this before adding file info / data. */
91
- DVDID_API(dvdid_status_t) dvdid_hashinfo_set_medium(dvdid_hashinfo_t *hi, dvdid_medium_t medium);
92
- DVDID_API(dvdid_medium_t) dvdid_hashinfo_get_medium(const dvdid_hashinfo_t *hi);
93
-
94
- /* Add a file to the hashinfo struct. The fileinfo will be copied,
95
- and memory allocated as appropriate. Returns non-zero on error, in
96
- which case dvdid_hashinfo_free must be called on the hashinfo struct
97
- as it's not guaranteed to be useable */
98
- DVDID_API(dvdid_status_t) dvdid_hashinfo_add_fileinfo(dvdid_hashinfo_t *hi, dvdid_dir_t dir, const dvdid_fileinfo_t *fi);
99
-
100
- /* Add the data read from various key files on the medium . This buffer
101
- will be copied, so does not need to be valid until dvd_hashinfo_free is
102
- called. Only call this once (per file to be added). */
103
- /* We need at most the first DVDID_HASHINFO_FILEDATE_MAXSIZE bytes of the file */
104
- #define DVDID_HASHINFO_FILEDATA_MAXSIZE 0x10000
105
- DVDID_API(dvdid_status_t) dvdid_hashinfo_add_filedata(dvdid_hashinfo_t *hi, dvdid_file_t file, const uint8_t *buf, size_t size);
106
-
107
- /* Having added the necessary files and data, perform any additional init
108
- work before dvdid_calculate2 gets called */
109
- DVDID_API(dvdid_status_t) dvdid_hashinfo_init(dvdid_hashinfo_t *hi);
110
-
111
- /* Free hashinfo struct one finished with */
112
- DVDID_API(void) dvdid_hashinfo_free(dvdid_hashinfo_t *hi);
113
-
114
-
115
- /* From previous API, calls dvdid_hashinfo_add_file(hi, DVDID_DIR_VIDEO_TS, fi); */
116
- DVDID_API(dvdid_status_t) dvdid_hashinfo_addfile(dvdid_hashinfo_t *hi, const dvdid_fileinfo_t *fi);
117
-
118
- /* From previous API, calls dvdid_hashinfo_add_data(hi, DVDID_FILE_VMGI, buf, size); */
119
- #define DVDID_HASHINFO_VXXI_MAXBUF DVDID_HASHINFO_FILEDATA_MAXSIZE
120
- DVDID_API(dvdid_status_t) dvdid_hashinfo_set_vmgi(dvdid_hashinfo_t *hi, const uint8_t *buf, size_t size);
121
-
122
- /* From previous API, calls dvdid_hashinfo_add_data(hi, DVDID_FILE_VTS01I, buf, size); */
123
- DVDID_API(dvdid_status_t) dvdid_hashinfo_set_vts01i(dvdid_hashinfo_t *hi, const uint8_t *buf, size_t size);
124
-
125
-
126
- #ifdef __cplusplus
127
- }
128
- #endif
129
-
130
-
131
- #endif
@@ -1,32 +0,0 @@
1
- /* $Id: export.h 2781 2009-09-13 11:31:27Z chris $ */
2
- /* File structure and dll export system derived from FLAC */
3
-
4
- #ifndef DVDID__EXPORT_H
5
- #define DVDID__EXPORT_H
6
-
7
- #if defined(DVDID__NO_DLL) || !defined(_MSC_VER)
8
-
9
- #define DVDID_API(type) type
10
- #define DVDID_CALLBACK
11
-
12
- #else
13
-
14
- #ifdef DVDID_API_EXPORTS
15
- /* We use a .def file rather than __declspec(dllexport) */
16
- #define DVDID_API(type) type __stdcall
17
- #else
18
- #define DVDID_API(type) __declspec(dllimport) type __stdcall
19
- #endif
20
-
21
- #define DVDID_CALLBACK __stdcall
22
-
23
- #endif
24
-
25
- /** These #defines will mirror the libtool-based library version number, see
26
- * http://www.gnu.org/software/libtool/manual.html#Libtool-versioning
27
- */
28
- #define DVDID_API_VERSION_CURRENT 0
29
- #define DVDID_API_VERSION_REVISION 0
30
- #define DVDID_API_VERSION_AGE 0
31
-
32
- #endif
Binary file
Binary file
Binary file
@@ -1,41 +0,0 @@
1
- # libdvdid.la - a libtool library file
2
- # Generated by ltmain.sh (GNU libtool) 2.2.6
3
- #
4
- # Please DO NOT delete this file!
5
- # It is necessary for linking the library.
6
-
7
- # The name that we can dlopen(3).
8
- dlname='libdvdid.0.dylib'
9
-
10
- # Names of this library.
11
- library_names='libdvdid.0.dylib libdvdid.dylib'
12
-
13
- # The name of the static archive.
14
- old_library='libdvdid.a'
15
-
16
- # Linker flags that can not go in dependency_libs.
17
- inherited_linker_flags=' '
18
-
19
- # Libraries that this one depends upon.
20
- dependency_libs=''
21
-
22
- # Names of additional weak libraries provided by this library
23
- weak_library_names=''
24
-
25
- # Version information for libdvdid.
26
- current=1
27
- age=1
28
- revision=0
29
-
30
- # Is this an already installed library?
31
- installed=yes
32
-
33
- # Should we warn about portability when linking against -modules?
34
- shouldnotlink=no
35
-
36
- # Files to dlopen/dlpreopen
37
- dlopen=''
38
- dlpreopen=''
39
-
40
- # Directory that this library needs to be installed in:
41
- libdir='/Users/rogerdpack/mac_dvdid/lib'