Sha256: 7056c788bf40169a5f6090a029f818182eb6b4bae204cdec538d5fff5c8b6376

Contents?: true

Size: 764 Bytes

Versions: 7

Compression:

Stored size: 764 Bytes

Contents

module QuickTime
  # see ext/track.c for additional methods
  class Track
    # Returns the length of this track in seconds
    # using raw_duration and time_scale.
    def duration
      raw_duration.to_f/time_scale
    end
    
    # The average frame_rate for this track. May not be exact.
    def frame_rate # what about odd frame rates such as 29.97?
      frame_count/duration
    end
    
    # Returns true/false depending on if track is an audio track.
    def audio?
      media_type == :audio
    end
    
    # Returns true/false depending on if track is a video track.
    def video?
      media_type == :video
    end
    
    # Returns true/false depending on if track is a text track.
    def text?
      media_type == :text
    end
    
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
one-k-rmov-0.1.4 lib/quicktime/track.rb
one-k-rmov-0.2.0 lib/quicktime/track.rb
one-k-rmov-0.2.2 lib/quicktime/track.rb
one-k-rmov-0.2.3 lib/quicktime/track.rb
one-k-rmov-0.2.4 lib/quicktime/track.rb
one-k-rmov-0.2.5 lib/quicktime/track.rb
one-k-rmov-0.2.6 lib/quicktime/track.rb