Class: EDL::Event
- Inherits:
-
Object
- Object
- EDL::Event
- Defined in:
- lib/edl/event.rb
Overview
Represents an edit event (or, more specifically, an EDL line denoting a clip being part of an EDL event)
Instance Attribute Summary collapse
-
#clip_name ⇒ Object
Clip name contained in FROM CLIP NAME: comment.
-
#comments ⇒ Object
:nodoc:.
-
#line_number ⇒ Object
Where is this event located in the original file.
-
#num ⇒ Object
Event number as in the EDL.
-
#outgoing_transition_duration ⇒ Object
:nodoc:.
-
#rec_end_tc ⇒ Object
Record end timecode of the event in the master as in the EDL, outgoing transition is not included.
-
#rec_start_tc ⇒ Object
Record start timecode of the event in the master as in the EDL.
-
#reel ⇒ Object
Reel name as in the EDL.
-
#src_end_tc ⇒ Object
Source end timecode of the last frame as in the EDL, no timewarps or dissolves included.
-
#src_start_tc ⇒ Object
Source start timecode of the start frame as in the EDL, no timewarps or dissolves included.
-
#timewarp ⇒ Object
Timewarp metadata (an EDL::Timewarp), or nil if no retime is made.
-
#track ⇒ Object
Event tracks as in the EDL.
-
#transition ⇒ Object
Incoming transition metadata (EDL::Transition), or nil if no transition is used.
Instance Method Summary collapse
-
#black? ⇒ Boolean
(also: #slug?)
Is this a black slug?.
-
#capture_from_tc ⇒ Object
Capture from (and including!) this timecode to complete this event including timewarps and transitions.
-
#capture_to_and_including_tc ⇒ Object
Capture up to AND INCLUDING this timecode to complete this event including timewarps and transitions.
-
#capture_to_tc ⇒ Object
Capture up to BUT NOT INCLUDING this timecode to complete this event including timewarps and transitions.
- #copy_properties_to(evt) ⇒ Object
-
#ends_with_transition? ⇒ Boolean
Returns true if the clip ends with a transition (if the next clip starts with a transition).
-
#generator? ⇒ Boolean
Returns true if this event is a generator.
-
#has_timewarp? ⇒ Boolean
Returns true if the clip has a timewarp (speed ramp, motion memory, you name it).
-
#has_transition? ⇒ Boolean
(also: #starts_with_transition?)
Returns true if the clip starts with a transiton (not a jump cut).
-
#incoming_transition_duration ⇒ Object
The duration of the incoming transition, or 0 if no transition is used.
-
#initialize(opts = {}) {|_self| ... } ⇒ Event
constructor
A new instance of Event.
- #inspect ⇒ Object
-
#rec_length ⇒ Object
Get the record length of the event (how long it occupies in the EDL without an eventual outgoing transition).
-
#rec_length_with_transition ⇒ Object
Get the record length of the event (how long it occupies in the EDL with an eventual outgoing transition).
-
#reverse? ⇒ Boolean
(also: #reversed?)
Is the clip reversed in the edit?.
-
#speed ⇒ Object
Speed of this clip in percent relative to the source speed.
-
#src_length ⇒ Object
(also: #capture_length)
How long does the capture need to be to complete this event including timewarps and transitions.
-
#to_s ⇒ Object
Output a textual description (will not work as an EDL line!).
Constructor Details
#initialize(opts = {}) {|_self| ... } ⇒ Event
Returns a new instance of Event.
46 47 48 49 |
# File 'lib/edl/event.rb', line 46 def initialize(opts = {}) opts.each_pair{|k,v| send("#{k}=", v) } yield(self) if block_given? end |
Instance Attribute Details
#clip_name ⇒ Object
Clip name contained in FROM CLIP NAME: comment
32 33 34 |
# File 'lib/edl/event.rb', line 32 def clip_name @clip_name end |
#comments ⇒ Object
:nodoc:
29 30 31 |
# File 'lib/edl/event.rb', line 29 def comments @comments end |
#line_number ⇒ Object
Where is this event located in the original file
44 45 46 |
# File 'lib/edl/event.rb', line 44 def line_number @line_number end |
#num ⇒ Object
Event number as in the EDL
5 6 7 |
# File 'lib/edl/event.rb', line 5 def num @num end |
#outgoing_transition_duration ⇒ Object
:nodoc:
41 42 43 |
# File 'lib/edl/event.rb', line 41 def outgoing_transition_duration @outgoing_transition_duration end |
#rec_end_tc ⇒ Object
Record end timecode of the event in the master as in the EDL, outgoing transition is not included
26 27 28 |
# File 'lib/edl/event.rb', line 26 def rec_end_tc @rec_end_tc end |
#rec_start_tc ⇒ Object
Record start timecode of the event in the master as in the EDL
22 23 24 |
# File 'lib/edl/event.rb', line 22 def rec_start_tc @rec_start_tc end |
#reel ⇒ Object
Reel name as in the EDL
8 9 10 |
# File 'lib/edl/event.rb', line 8 def reel @reel end |
#src_end_tc ⇒ Object
Source end timecode of the last frame as in the EDL, no timewarps or dissolves included
19 20 21 |
# File 'lib/edl/event.rb', line 19 def src_end_tc @src_end_tc end |
#src_start_tc ⇒ Object
Source start timecode of the start frame as in the EDL, no timewarps or dissolves included
15 16 17 |
# File 'lib/edl/event.rb', line 15 def src_start_tc @src_start_tc end |
#timewarp ⇒ Object
Timewarp metadata (an EDL::Timewarp), or nil if no retime is made
35 36 37 |
# File 'lib/edl/event.rb', line 35 def timewarp @timewarp end |
#track ⇒ Object
Event tracks as in the EDL
11 12 13 |
# File 'lib/edl/event.rb', line 11 def track @track end |
#transition ⇒ Object
Incoming transition metadata (EDL::Transition), or nil if no transition is used
38 39 40 |
# File 'lib/edl/event.rb', line 38 def transition @transition end |
Instance Method Details
#black? ⇒ Boolean Also known as: slug?
Is this a black slug?
104 105 106 |
# File 'lib/edl/event.rb', line 104 def black? reel == 'BL' end |
#capture_from_tc ⇒ Object
Capture from (and including!) this timecode to complete this event including timewarps and transitions
127 128 129 |
# File 'lib/edl/event.rb', line 127 def capture_from_tc @timewarp ? @timewarp.source_used_from : src_start_tc end |
#capture_to_and_including_tc ⇒ Object
Capture up to AND INCLUDING this timecode to complete this event including timewarps and transitions
132 133 134 |
# File 'lib/edl/event.rb', line 132 def capture_to_and_including_tc capture_to_tc - 1 end |
#capture_to_tc ⇒ Object
Capture up to BUT NOT INCLUDING this timecode to complete this event including timewarps and transitions
137 138 139 |
# File 'lib/edl/event.rb', line 137 def capture_to_tc @timewarp ? @timewarp.source_used_upto : (src_end_tc + outgoing_transition_duration) end |
#copy_properties_to(evt) ⇒ Object
75 76 77 78 79 80 |
# File 'lib/edl/event.rb', line 75 def copy_properties_to(evt) %w( num reel track src_start_tc src_end_tc rec_start_tc rec_end_tc).each do | k | evt.send("#{k}=", send(k)) if evt.respond_to?(k) end evt end |
#ends_with_transition? ⇒ Boolean
Returns true if the clip ends with a transition (if the next clip starts with a transition)
94 95 96 |
# File 'lib/edl/event.rb', line 94 def ends_with_transition? outgoing_transition_duration > 0 end |
#generator? ⇒ Boolean
Returns true if this event is a generator
147 148 149 |
# File 'lib/edl/event.rb', line 147 def generator? black? || (%(AX GEN).include?(reel)) end |
#has_timewarp? ⇒ Boolean
Returns true if the clip has a timewarp (speed ramp, motion memory, you name it)
99 100 101 |
# File 'lib/edl/event.rb', line 99 def has_timewarp? !timewarp.nil? end |
#has_transition? ⇒ Boolean Also known as: starts_with_transition?
Returns true if the clip starts with a transiton (not a jump cut)
83 84 85 |
# File 'lib/edl/event.rb', line 83 def has_transition? !!@transition end |
#incoming_transition_duration ⇒ Object
The duration of the incoming transition, or 0 if no transition is used
89 90 91 |
# File 'lib/edl/event.rb', line 89 def incoming_transition_duration @transition ? @transition.duration : 0 end |
#inspect ⇒ Object
56 57 58 |
# File 'lib/edl/event.rb', line 56 def inspect to_s end |
#rec_length ⇒ Object
Get the record length of the event (how long it occupies in the EDL without an eventual outgoing transition)
110 111 112 |
# File 'lib/edl/event.rb', line 110 def rec_length (rec_end_tc.to_i - rec_start_tc.to_i).to_i end |
#rec_length_with_transition ⇒ Object
Get the record length of the event (how long it occupies in the EDL with an eventual outgoing transition)
115 116 117 |
# File 'lib/edl/event.rb', line 115 def rec_length_with_transition rec_length + outgoing_transition_duration.to_i end |
#reverse? ⇒ Boolean Also known as: reversed?
Is the clip reversed in the edit?
70 71 72 |
# File 'lib/edl/event.rb', line 70 def reverse? (timewarp && timewarp.reverse?) end |
#speed ⇒ Object
Speed of this clip in percent relative to the source speed. 100 for non-timewarped events
142 143 144 |
# File 'lib/edl/event.rb', line 142 def speed @timewarp ? @timewarp.speed : 100.0 end |
#src_length ⇒ Object Also known as: capture_length
How long does the capture need to be to complete this event including timewarps and transitions
120 121 122 |
# File 'lib/edl/event.rb', line 120 def src_length @timewarp ? @timewarp.actual_length_of_source : rec_length_with_transition end |
#to_s ⇒ Object
Output a textual description (will not work as an EDL line!)
52 53 54 |
# File 'lib/edl/event.rb', line 52 def to_s %w( num reel track src_start_tc src_end_tc rec_start_tc rec_end_tc).map{|a| self.send(a).to_s}.join(" ") end |