edl 0.0.4 → 0.0.5
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/History.txt +5 -0
- data/SPECS.txt +11 -1
- data/lib/edl.rb +2 -3
- data/lib/edl/event.rb +9 -3
- data/test/test_edl.rb +31 -0
- metadata +1 -1
data/History.txt
CHANGED
data/SPECS.txt
CHANGED
@@ -19,6 +19,16 @@
|
|
19
19
|
* support capture_length as an alias to src_length
|
20
20
|
* delegate src_length to the timewarp if it is there
|
21
21
|
* report reverse? and reversed? based on the timewarp
|
22
|
+
* report speed as 100 percent without a timewarp
|
23
|
+
* consult the timewarp for speed
|
24
|
+
* report false for starts_with_transition? if transision is nil
|
25
|
+
* report zero for incoming_transition_duration if transision is nil
|
26
|
+
* report true for starts_with_transition? if transision is not nil
|
27
|
+
* consult the transition for incoming_transition_duration if it's present
|
28
|
+
* report capture_from_tc as the source start without a timewarp
|
29
|
+
* consult the timewarp for capture_from_tc if a timewarp is there
|
30
|
+
* report capture_to_tc as record length plus transition when no timewarp present
|
31
|
+
* consult the timewarp for capture_to_tc if timewarp is present
|
22
32
|
|
23
33
|
== A Parser should
|
24
34
|
* store the passed framerate
|
@@ -72,4 +82,4 @@
|
|
72
82
|
== A FinalCutPro speedup and reverse with fade at the end should
|
73
83
|
* parse cleanly
|
74
84
|
|
75
|
-
|
85
|
+
59 specifications, 1 empty (161 requirements), 0 failures
|
data/lib/edl.rb
CHANGED
@@ -6,10 +6,9 @@ require File.dirname(__FILE__) + '/edl/event'
|
|
6
6
|
require File.dirname(__FILE__) + '/edl/transition'
|
7
7
|
require File.dirname(__FILE__) + '/edl/timewarp'
|
8
8
|
|
9
|
-
# A simplistic EDL parser
|
10
|
-
# no support for split edits, no support for key effects, no support for audio
|
9
|
+
# A simplistic EDL parser
|
11
10
|
module EDL
|
12
|
-
VERSION = "0.0.
|
11
|
+
VERSION = "0.0.5"
|
13
12
|
DEFAULT_FPS = 25
|
14
13
|
|
15
14
|
# Represents an EDL, is returned from the parser. Traditional operation is functional style, i.e.
|
data/lib/edl/event.rb
CHANGED
@@ -78,9 +78,15 @@ module EDL
|
|
78
78
|
|
79
79
|
# Returns true if the clip starts with a transiton (not a jump cut)
|
80
80
|
def has_transition?
|
81
|
-
|
81
|
+
!!@transition
|
82
82
|
end
|
83
|
-
|
83
|
+
alias_method :starts_with_transition?, :has_transition?
|
84
|
+
|
85
|
+
# The duration of the incoming transition, or 0 if no transition is used
|
86
|
+
def incoming_transition_duration
|
87
|
+
@transition ? @transition.duration : 0
|
88
|
+
end
|
89
|
+
|
84
90
|
# Returns true if the clip ends with a transition (if the next clip starts with a transition)
|
85
91
|
def ends_with_transition?
|
86
92
|
outgoing_transition_duration > 0
|
@@ -128,7 +134,7 @@ module EDL
|
|
128
134
|
def speed
|
129
135
|
@timewarp ? @timewarp.speed : 100
|
130
136
|
end
|
131
|
-
|
137
|
+
|
132
138
|
# Returns true if this event is a generator
|
133
139
|
def generator?
|
134
140
|
black? || (%(AX GEN).include?(reel))
|
data/test/test_edl.rb
CHANGED
@@ -150,6 +150,32 @@ context "An Event should" do
|
|
150
150
|
e.speed.should.equal :something
|
151
151
|
end
|
152
152
|
|
153
|
+
specify "report false for starts_with_transition? if transision is nil" do
|
154
|
+
e = EDL::Event.new
|
155
|
+
e.should.respond_to :starts_with_transition?
|
156
|
+
e.should.not.be.starts_with_transition
|
157
|
+
end
|
158
|
+
|
159
|
+
specify "report zero for incoming_transition_duration if transision is nil" do
|
160
|
+
e = EDL::Event.new
|
161
|
+
e.should.respond_to :incoming_transition_duration
|
162
|
+
e.incoming_transition_duration.should.zero
|
163
|
+
end
|
164
|
+
|
165
|
+
specify "report true for starts_with_transition? if transision is not nil" do
|
166
|
+
e = EDL::Event.new :transition => true
|
167
|
+
e.should.respond_to :starts_with_transition?
|
168
|
+
e.should.starts_with_transition
|
169
|
+
end
|
170
|
+
|
171
|
+
specify "consult the transition for incoming_transition_duration if it's present" do
|
172
|
+
tr = flexmock
|
173
|
+
tr.should_receive(:duration).and_return(:something)
|
174
|
+
|
175
|
+
e = EDL::Event.new(:transition => tr)
|
176
|
+
e.should.respond_to :incoming_transition_duration
|
177
|
+
e.incoming_transition_duration.should.equal :something
|
178
|
+
end
|
153
179
|
|
154
180
|
specify "report capture_from_tc as the source start without a timewarp" do
|
155
181
|
e = EDL::Event.new(:src_start_tc => "1h".tc)
|
@@ -319,6 +345,7 @@ context "A reverse timewarp EDL coming from Avid should" do
|
|
319
345
|
end
|
320
346
|
|
321
347
|
context "A Final Cut Pro originating reverse should" do
|
348
|
+
|
322
349
|
specify "be interpreted properly" do
|
323
350
|
e = EDL::Parser.new.parse(File.open(FCP_REVERSE)).pop
|
324
351
|
|
@@ -332,6 +359,10 @@ context "A Final Cut Pro originating reverse should" do
|
|
332
359
|
e.timewarp.should.not.be nil
|
333
360
|
|
334
361
|
tw = e.timewarp
|
362
|
+
|
363
|
+
tw.speed.should.equal -100.0
|
364
|
+
e.speed.should.equal -100.0
|
365
|
+
|
335
366
|
tw.source_used_from.should.equal "1h".tc
|
336
367
|
tw.source_used_upto.should.equal "1h 40s".tc
|
337
368
|
end
|