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.
48 49 50 51 |
# File 'lib/edl/event.rb', line 48 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
34 35 36 |
# File 'lib/edl/event.rb', line 34 def clip_name @clip_name end |
#comments ⇒ Object
:nodoc:
31 32 33 |
# File 'lib/edl/event.rb', line 31 def comments @comments end |
#line_number ⇒ Object
Where is this event located in the original file
46 47 48 |
# File 'lib/edl/event.rb', line 46 def line_number @line_number end |
#num ⇒ Object
Event number as in the EDL
7 8 9 |
# File 'lib/edl/event.rb', line 7 def num @num end |
#outgoing_transition_duration ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/edl/event.rb', line 43 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
28 29 30 |
# File 'lib/edl/event.rb', line 28 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
24 25 26 |
# File 'lib/edl/event.rb', line 24 def rec_start_tc @rec_start_tc end |
#reel ⇒ Object
Reel name as in the EDL
10 11 12 |
# File 'lib/edl/event.rb', line 10 def reel @reel end |
#src_end_tc ⇒ Object
Source end timecode of the last frame as in the EDL, no timewarps or dissolves included
21 22 23 |
# File 'lib/edl/event.rb', line 21 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
17 18 19 |
# File 'lib/edl/event.rb', line 17 def src_start_tc @src_start_tc end |
#timewarp ⇒ Object
Timewarp metadata (an EDL::Timewarp), or nil if no retime is made
37 38 39 |
# File 'lib/edl/event.rb', line 37 def timewarp @timewarp end |
#track ⇒ Object
Event tracks as in the EDL
13 14 15 |
# File 'lib/edl/event.rb', line 13 def track @track end |
#transition ⇒ Object
Incoming transition metadata (EDL::Transition), or nil if no transition is used
40 41 42 |
# File 'lib/edl/event.rb', line 40 def transition @transition end |
Instance Method Details
#black? ⇒ Boolean Also known as: slug?
Is this a black slug?
106 107 108 |
# File 'lib/edl/event.rb', line 106 def black? reel == 'BL' end |
#capture_from_tc ⇒ Object
Capture from (and including!) this timecode to complete this event including timewarps and transitions
129 130 131 |
# File 'lib/edl/event.rb', line 129 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
134 135 136 |
# File 'lib/edl/event.rb', line 134 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
139 140 141 |
# File 'lib/edl/event.rb', line 139 def capture_to_tc @timewarp ? @timewarp.source_used_upto : (src_end_tc + outgoing_transition_duration) end |
#copy_properties_to(evt) ⇒ Object
77 78 79 80 81 82 |
# File 'lib/edl/event.rb', line 77 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)
96 97 98 |
# File 'lib/edl/event.rb', line 96 def ends_with_transition? outgoing_transition_duration > 0 end |
#generator? ⇒ Boolean
Returns true if this event is a generator
157 158 159 |
# File 'lib/edl/event.rb', line 157 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)
101 102 103 |
# File 'lib/edl/event.rb', line 101 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)
85 86 87 |
# File 'lib/edl/event.rb', line 85 def has_transition? !!@transition end |
#incoming_transition_duration ⇒ Object
The duration of the incoming transition, or 0 if no transition is used
91 92 93 |
# File 'lib/edl/event.rb', line 91 def incoming_transition_duration @transition ? @transition.duration : 0 end |
#inspect ⇒ Object
58 59 60 |
# File 'lib/edl/event.rb', line 58 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)
112 113 114 |
# File 'lib/edl/event.rb', line 112 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)
117 118 119 |
# File 'lib/edl/event.rb', line 117 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?
72 73 74 |
# File 'lib/edl/event.rb', line 72 def reverse? (timewarp && timewarp.reverse?) end |
#speed ⇒ Object
Speed of this clip in percent relative to the source speed. 100 for non-timewarped events
144 145 146 |
# File 'lib/edl/event.rb', line 144 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
122 123 124 |
# File 'lib/edl/event.rb', line 122 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!)
54 55 56 |
# File 'lib/edl/event.rb', line 54 def to_s %w[num reel track src_start_tc src_end_tc rec_start_tc rec_end_tc].map { |a| send(a).to_s }.join(' ') end |