Class: Timecode::ComputationValues
- Inherits:
-
Object
- Object
- Timecode::ComputationValues
- Defined in:
- lib/timecode.rb
Instance Attribute Summary collapse
-
#drop_count ⇒ Object
readonly
Returns the value of attribute drop_count.
-
#frames_per_10_min ⇒ Object
readonly
Returns the value of attribute frames_per_10_min.
-
#frames_per_hour ⇒ Object
readonly
Returns the value of attribute frames_per_hour.
-
#frames_per_min ⇒ Object
readonly
Returns the value of attribute frames_per_min.
-
#nd_frames_per_min ⇒ Object
readonly
Returns the value of attribute nd_frames_per_min.
Instance Method Summary collapse
-
#initialize(fps, drop_frame) ⇒ ComputationValues
constructor
A new instance of ComputationValues.
Constructor Details
#initialize(fps, drop_frame) ⇒ ComputationValues
Returns a new instance of ComputationValues.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/timecode.rb', line 20 def initialize(fps, drop_frame) rounded_base = fps.round if (drop_frame) # first 2 frame numbers shall be omitted at the start of each minute, # except minutes 0, 10, 20, 30, 40 and 50 @drop_count = 2 if (fps > 59 && fps < 60) @drop_count *= 2 end @frames_per_min = rounded_base * 60 - @drop_count @frames_per_10_min = @frames_per_min * 10 + @drop_count else @frames_per_min = rounded_base * 60 @frames_per_10_min = @frames_per_min * 10 end @frames_per_hour = @frames_per_10_min * 6 @nd_frames_per_min = rounded_base * 60 end |
Instance Attribute Details
#drop_count ⇒ Object (readonly)
Returns the value of attribute drop_count.
18 19 20 |
# File 'lib/timecode.rb', line 18 def drop_count @drop_count end |
#frames_per_10_min ⇒ Object (readonly)
Returns the value of attribute frames_per_10_min.
18 19 20 |
# File 'lib/timecode.rb', line 18 def frames_per_10_min @frames_per_10_min end |
#frames_per_hour ⇒ Object (readonly)
Returns the value of attribute frames_per_hour.
18 19 20 |
# File 'lib/timecode.rb', line 18 def frames_per_hour @frames_per_hour end |
#frames_per_min ⇒ Object (readonly)
Returns the value of attribute frames_per_min.
18 19 20 |
# File 'lib/timecode.rb', line 18 def frames_per_min @frames_per_min end |
#nd_frames_per_min ⇒ Object (readonly)
Returns the value of attribute nd_frames_per_min.
18 19 20 |
# File 'lib/timecode.rb', line 18 def nd_frames_per_min @nd_frames_per_min end |