lib/quicktime/movie.rb in rmov-0.1.2 vs lib/quicktime/movie.rb in rmov-0.1.3

- old
+ new

@@ -1,6 +1,6 @@ -module Quicktime +module QuickTime # see ext/movie.c for additional methods class Movie # Opens a movie at filepath. def self.open(filepath) new.load_from_file(filepath) @@ -42,16 +42,42 @@ # Returns an array of video tracks in this movie. def video_tracks tracks.select { |t| t.video? } end + # Returns an array of text tracks in this movie. + def text_tracks + tracks.select { |t| t.text? } + end + # Returns an Exporter instance for this movie. def exporter Exporter.new(self) end # Convenience method for exporting the movie. See Exporter::export. def export(*args, &block) exporter.export(*args, &block) + end + + # Creates a new video track with given width/height on movie and returns it. + def new_video_track(width, height) + track = new_track(width, height) + track.new_video_media + track + end + + # Creates a new audio track with given width/height on movie and returns it. + def new_audio_track(width, height) + track = new_track(width, height) + track.new_audio_media + track + end + + # Creates a new text track with given width/height on movie and returns it. + def new_text_track(width, height) + track = new_track(width, height) + track.new_text_media + track end end end