cinesync 0.9.6 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +11 -11
- data/VERSION +1 -1
- data/cinesync.gemspec +43 -8
- data/{Samples → examples}/Export Notes to CSV.rb +0 -0
- data/examples/Start Session.rb +17 -0
- data/lib/cinesync/commands.rb +50 -0
- data/lib/cinesync/event_handler.rb +0 -1
- data/lib/cinesync/frame_annotation.rb +1 -1
- data/lib/cinesync/media_file.rb +7 -2
- data/lib/cinesync/xml.rb +4 -5
- data/lib/cinesync.rb +4 -7
- data/spec/.bacon +0 -0
- data/spec/cinesync_spec.rb +12 -0
- data/spec/event_handler_spec.rb +66 -0
- data/spec/frame_annotation_spec.rb +33 -0
- data/spec/media_file_spec.rb +125 -0
- data/spec/media_locator_spec.rb +68 -0
- data/spec/session_spec.rb +61 -0
- data/spec/small.txt +1 -0
- data/{test/helper.rb → spec/spec_helper.rb} +3 -5
- data/spec/v3 files/corrupt.csc +4 -0
- data/spec/v3 files/v3-Newer v4.csc +4 -0
- data/spec/v3 files/v3-Unsupported.csc +4 -0
- data/spec/v3 files/v3-active first.csc +37 -0
- data/spec/v3 files/v3-active second.csc +37 -0
- data/spec/v3 files/v3-active single.csc +14 -0
- data/spec/v3 files/v3-basic.csc +37 -0
- data/spec/v3 files/v3-groups.csc +728 -0
- data/spec/v3 files/v3-pro.csc +91 -0
- data/spec/v3 files/v3-refmovie.csc +32 -0
- data/spec/v3 files/v3-stereo-anaglyph-off.csc +468 -0
- data/spec/v3 files/v3-stereo-anaglyph.csc +470 -0
- data/spec/v3 files/v3-stereo-interlaced-off.csc +468 -0
- data/spec/v3 files/v3-stereo.csc +95 -0
- data/spec/v3 files/v3-url.csc +15 -0
- data/spec/xml_spec.rb +272 -0
- metadata +46 -11
@@ -0,0 +1,61 @@
|
|
1
|
+
$: << File.expand_path(File.dirname(__FILE__))
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "cineSync session" do
|
5
|
+
before do
|
6
|
+
@obj = CineSync::Session.new
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should have current file version" do
|
10
|
+
@obj.file_version.should == 3
|
11
|
+
@obj.should.be.valid?
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should have standard features by default" do
|
15
|
+
@obj.session_features.should == :standard
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should store user data" do
|
19
|
+
@obj.notes.should.not.be.nil?
|
20
|
+
@obj.notes.should.be.empty?
|
21
|
+
@obj.user_data = "My custom data"
|
22
|
+
@obj.user_data.should == "My custom data"
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should have a groups array" do
|
26
|
+
@obj.groups.should == []
|
27
|
+
@obj.groups << "My group"
|
28
|
+
@obj.groups.should == ["My group"]
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should store notes" do
|
32
|
+
@obj.notes.should.not.be.nil?
|
33
|
+
@obj.notes.should.be.empty?
|
34
|
+
@obj.notes = "asdf"
|
35
|
+
@obj.notes.should == "asdf"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should have an array of media" do
|
39
|
+
@obj.media.should == []
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should set pro features with group movies" do
|
43
|
+
@obj.session_features.should == :standard
|
44
|
+
@obj.media << CineSync::GroupMovie.new(CineSync::AllFilesGroup)
|
45
|
+
@obj.session_features.should == :pro
|
46
|
+
@obj.media.delete_at(0)
|
47
|
+
@obj.session_features.should == :standard
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should include children in validity" do
|
51
|
+
@obj.should.be.valid?
|
52
|
+
mf = CineSync::MediaFile.new
|
53
|
+
mf.should.not.be.valid?
|
54
|
+
@obj.media << mf
|
55
|
+
@obj.should.not.be.valid?
|
56
|
+
mf.name = "asdf"
|
57
|
+
mf.locator.path = "asdf.mov"
|
58
|
+
mf.should.be.valid?
|
59
|
+
@obj.should.be.valid?
|
60
|
+
end
|
61
|
+
end
|
data/spec/small.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
This is a small file to test the short_hash method.
|
@@ -1,10 +1,8 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
3
|
-
require 'shoulda'
|
2
|
+
require 'bacon'
|
4
3
|
|
5
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
4
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
5
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
7
6
|
require 'cinesync'
|
8
7
|
|
9
|
-
|
10
|
-
end
|
8
|
+
Bacon.summary_on_exit
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<session xmlns="http://www.cinesync.com/ns/session/3.0" version="3" sessionFeatures="standard" userData="sessionUserData blah bloo blee">
|
3
|
+
<media active="true" currentFrame="23">
|
4
|
+
<name>024b_fn_079_v01_1-98.mov</name>
|
5
|
+
<locators>
|
6
|
+
<path>/Volumes/Scratch/test_files/movies/024b_fn_079_v01_1-98.mov</path>
|
7
|
+
</locators>
|
8
|
+
<playRange>
|
9
|
+
<inFrame value="40" />
|
10
|
+
<outFrame value="50" />
|
11
|
+
<playOnlyRange value="true" />
|
12
|
+
</playRange>
|
13
|
+
</media>
|
14
|
+
<media currentFrame="65">
|
15
|
+
<name>sample_mpeg4.mp4</name>
|
16
|
+
<locators>
|
17
|
+
<url>http://example.com/test_files/movies/sample_mpeg4.mp4</url>
|
18
|
+
<shortHash>e74db5de61fa5483c541a3a3056f22d158b44ace</shortHash>
|
19
|
+
</locators>
|
20
|
+
<playRange>
|
21
|
+
<inFrame value="62" />
|
22
|
+
<outFrame value="67" />
|
23
|
+
<playOnlyRange value="true" />
|
24
|
+
</playRange>
|
25
|
+
</media>
|
26
|
+
<media userData="myPrivateInfo">
|
27
|
+
<name>Test_MH 2fps.mov</name>
|
28
|
+
<locators>
|
29
|
+
<shortHash>f9f0c5d3e3e340bcc9486abbb01a71089de9b886</shortHash>
|
30
|
+
</locators>
|
31
|
+
<notes>These notes on the last movie.</notes>
|
32
|
+
<annotation frame="1">
|
33
|
+
<notes>This is a note on the first frame of the last movie.</notes>
|
34
|
+
</annotation>
|
35
|
+
</media>
|
36
|
+
<notes>These are my session notes.
newline.</notes>
|
37
|
+
</session>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<session xmlns="http://www.cinesync.com/ns/session/3.0" version="3" sessionFeatures="standard" userData="sessionUserData blah bloo blee">
|
3
|
+
<media>
|
4
|
+
<name>024b_fn_079_v01_1-98.mov</name>
|
5
|
+
<locators>
|
6
|
+
<path>/Volumes/Scratch/test_files/movies/024b_fn_079_v01_1-98.mov</path>
|
7
|
+
</locators>
|
8
|
+
<playRange>
|
9
|
+
<inFrame value="40" />
|
10
|
+
<outFrame value="50" />
|
11
|
+
<playOnlyRange value="true" />
|
12
|
+
</playRange>
|
13
|
+
</media>
|
14
|
+
<media active="true" currentFrame="65">
|
15
|
+
<name>sample_mpeg4.mp4</name>
|
16
|
+
<locators>
|
17
|
+
<url>http://example.com/test_files/movies/sample_mpeg4.mp4</url>
|
18
|
+
<shortHash>e74db5de61fa5483c541a3a3056f22d158b44ace</shortHash>
|
19
|
+
</locators>
|
20
|
+
<playRange>
|
21
|
+
<inFrame value="62" />
|
22
|
+
<outFrame value="67" />
|
23
|
+
<playOnlyRange value="true" />
|
24
|
+
</playRange>
|
25
|
+
</media>
|
26
|
+
<media userData="myPrivateInfo">
|
27
|
+
<name>Test_MH 2fps.mov</name>
|
28
|
+
<locators>
|
29
|
+
<shortHash>f9f0c5d3e3e340bcc9486abbb01a71089de9b886</shortHash>
|
30
|
+
</locators>
|
31
|
+
<notes>These notes on the last movie.</notes>
|
32
|
+
<annotation frame="1">
|
33
|
+
<notes>This is a note on the first frame of the last movie.</notes>
|
34
|
+
</annotation>
|
35
|
+
</media>
|
36
|
+
<notes>These are my session notes.
newline.</notes>
|
37
|
+
</session>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<session xmlns="http://www.cinesync.com/ns/session/3.0" version="3" sessionFeatures="standard" userData="sessionUserData blah bloo blee">
|
3
|
+
<media active="true" currentFrame="23">
|
4
|
+
<name>024b_fn_079_v01_1-98.mov</name>
|
5
|
+
<locators>
|
6
|
+
<path>/Volumes/Scratch/test_files/movies/024b_fn_079_v01_1-98.mov</path>
|
7
|
+
</locators>
|
8
|
+
<playRange>
|
9
|
+
<inFrame value="40" />
|
10
|
+
<outFrame value="50" />
|
11
|
+
<playOnlyRange value="true" />
|
12
|
+
</playRange>
|
13
|
+
</media>
|
14
|
+
</session>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<session xmlns="http://www.cinesync.com/ns/session/3.0" version="3" sessionFeatures="standard" userData="sessionUserData blah bloo blee">
|
3
|
+
<media>
|
4
|
+
<name>024b_fn_079_v01_1-98.mov</name>
|
5
|
+
<locators>
|
6
|
+
<path>/Volumes/Scratch/test_files/movies/024b_fn_079_v01_1-98.mov</path>
|
7
|
+
</locators>
|
8
|
+
<playRange>
|
9
|
+
<inFrame value="40" />
|
10
|
+
<outFrame value="50" />
|
11
|
+
<playOnlyRange value="true" />
|
12
|
+
</playRange>
|
13
|
+
</media>
|
14
|
+
<media active="true" currentFrame="65">
|
15
|
+
<name>sample_mpeg4.mp4</name>
|
16
|
+
<locators>
|
17
|
+
<url>http://example.com/test_files/movies/sample_mpeg4.mp4</url>
|
18
|
+
<shortHash>e74db5de61fa5483c541a3a3056f22d158b44ace</shortHash>
|
19
|
+
</locators>
|
20
|
+
<playRange>
|
21
|
+
<inFrame value="62" />
|
22
|
+
<outFrame value="67" />
|
23
|
+
<playOnlyRange value="true" />
|
24
|
+
</playRange>
|
25
|
+
</media>
|
26
|
+
<media userData="myPrivateInfo">
|
27
|
+
<name>Test_MH 2fps.mov</name>
|
28
|
+
<locators>
|
29
|
+
<shortHash>f9f0c5d3e3e340bcc9486abbb01a71089de9b886</shortHash>
|
30
|
+
</locators>
|
31
|
+
<notes>These notes on the last movie.</notes>
|
32
|
+
<annotation frame="1">
|
33
|
+
<notes>This is a note on the first frame of the last movie.</notes>
|
34
|
+
</annotation>
|
35
|
+
</media>
|
36
|
+
<notes>These are my session notes.
newline.</notes>
|
37
|
+
</session>
|