Class: WaveFile::SMPTETimecode
- Inherits:
-
Object
- Object
- WaveFile::SMPTETimecode
- Defined in:
- lib/wavefile/smpte_timecode.rb
Overview
Public: Represents an SMPTE timecode: en.wikipedia.org/wiki/SMPTE_timecode
If a *.wav file has a "smpl" chunk, then Reader#sampler_info#smpte_offset
will return an instance of this class.
Instance Attribute Summary collapse
-
#frames ⇒ Object
readonly
Returns the value of attribute frames.
-
#hours ⇒ Object
readonly
Returns the value of attribute hours.
-
#minutes ⇒ Object
readonly
Returns the value of attribute minutes.
-
#seconds ⇒ Object
readonly
Returns the value of attribute seconds.
Instance Method Summary collapse
-
#initialize(hours: required("hours"), minutes: required("minutes"), seconds: required("seconds"), frames: required("frames")) ⇒ SMPTETimecode
constructor
Public: Constructs a new SMPTETimecode instance.
Constructor Details
#initialize(hours: required("hours"), minutes: required("minutes"), seconds: required("seconds"), frames: required("frames")) ⇒ SMPTETimecode
Public: Constructs a new SMPTETimecode instance.
Raises InvalidSMPTETimecodeError if the given arguments can’t be written to a *.wav file.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/wavefile/smpte_timecode.rb', line 21 def initialize(hours: required("hours"), minutes: required("minutes"), seconds: required("seconds"), frames: required("frames")) validate_8_bit_signed_integer_field(hours, "hours") validate_8_bit_unsigned_integer_field(minutes, "minutes") validate_8_bit_unsigned_integer_field(seconds, "seconds") validate_8_bit_unsigned_integer_field(frames, "frames") @hours = hours @minutes = minutes @seconds = seconds @frames = frames end |
Instance Attribute Details
#frames ⇒ Object (readonly)
Returns the value of attribute frames.
39 40 41 |
# File 'lib/wavefile/smpte_timecode.rb', line 39 def frames @frames end |
#hours ⇒ Object (readonly)
Returns the value of attribute hours.
36 37 38 |
# File 'lib/wavefile/smpte_timecode.rb', line 36 def hours @hours end |
#minutes ⇒ Object (readonly)
Returns the value of attribute minutes.
37 38 39 |
# File 'lib/wavefile/smpte_timecode.rb', line 37 def minutes @minutes end |
#seconds ⇒ Object (readonly)
Returns the value of attribute seconds.
38 39 40 |
# File 'lib/wavefile/smpte_timecode.rb', line 38 def seconds @seconds end |