Class: MkvToolNix::Types::Merge::InputFile
- Inherits:
-
Object
- Object
- MkvToolNix::Types::Merge::InputFile
- Defined in:
- lib/mkvtoolnix/types/merge/input_file.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#audio_tracks ⇒ Object
readonly
Returns the value of attribute audio_tracks.
-
#no_attachments ⇒ Object
readonly
Returns the value of attribute no_attachments.
-
#no_audio ⇒ Object
readonly
Returns the value of attribute no_audio.
-
#no_chapters ⇒ Object
readonly
Returns the value of attribute no_chapters.
-
#no_global_tags ⇒ Object
readonly
Returns the value of attribute no_global_tags.
-
#no_subtitles ⇒ Object
readonly
Returns the value of attribute no_subtitles.
-
#no_track_tags ⇒ Object
readonly
Returns the value of attribute no_track_tags.
-
#no_video ⇒ Object
readonly
Returns the value of attribute no_video.
-
#subtitle_tracks ⇒ Object
readonly
Returns the value of attribute subtitle_tracks.
-
#track_options ⇒ Object
readonly
Returns the value of attribute track_options.
-
#track_tags ⇒ Object
readonly
Returns the value of attribute track_tags.
-
#video_tracks ⇒ Object
readonly
Returns the value of attribute video_tracks.
Instance Method Summary collapse
- #add_to_cmd(cmd) ⇒ Object
- #add_track_options(option) ⇒ Object
- #build_track_option(track_id) ⇒ Object
- #chapter_sync(d = 0, o_div_p = 1.0) ⇒ Object
-
#initialize(file) ⇒ InputFile
constructor
A new instance of InputFile.
- #with_attachments(*attachment_ids) ⇒ Object
- #with_audio_tracks(*track_ids) ⇒ Object
- #with_no_attachments ⇒ Object
- #with_no_audio ⇒ Object
- #with_no_chapters ⇒ Object
- #with_no_global_tags ⇒ Object
- #with_no_subtitles ⇒ Object
- #with_no_track_tags ⇒ Object
- #with_no_video ⇒ Object
- #with_subtitle_tracks(*track_ids) ⇒ Object
- #with_track_options(options) ⇒ Object
- #with_track_tags(*track_ids) ⇒ Object
- #with_video_tracks(*track_ids) ⇒ Object
Constructor Details
#initialize(file) ⇒ InputFile
Returns a new instance of InputFile.
112 113 114 115 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 112 def initialize(file) @file = file @track_options = [] end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def @attachments end |
#audio_tracks ⇒ Object (readonly)
Returns the value of attribute audio_tracks.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def audio_tracks @audio_tracks end |
#no_attachments ⇒ Object (readonly)
Returns the value of attribute no_attachments.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def @no_attachments end |
#no_audio ⇒ Object (readonly)
Returns the value of attribute no_audio.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def no_audio @no_audio end |
#no_chapters ⇒ Object (readonly)
Returns the value of attribute no_chapters.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def no_chapters @no_chapters end |
#no_global_tags ⇒ Object (readonly)
Returns the value of attribute no_global_tags.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def @no_global_tags end |
#no_subtitles ⇒ Object (readonly)
Returns the value of attribute no_subtitles.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def no_subtitles @no_subtitles end |
#no_track_tags ⇒ Object (readonly)
Returns the value of attribute no_track_tags.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def @no_track_tags end |
#no_video ⇒ Object (readonly)
Returns the value of attribute no_video.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def no_video @no_video end |
#subtitle_tracks ⇒ Object (readonly)
Returns the value of attribute subtitle_tracks.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def subtitle_tracks @subtitle_tracks end |
#track_options ⇒ Object (readonly)
Returns the value of attribute track_options.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def @track_options end |
#track_tags ⇒ Object (readonly)
Returns the value of attribute track_tags.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def @track_tags end |
#video_tracks ⇒ Object (readonly)
Returns the value of attribute video_tracks.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8 def video_tracks @video_tracks end |
Instance Method Details
#add_to_cmd(cmd) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 91 def add_to_cmd(cmd) cmd << '--audio-tracks' << @audio_tracks.join(',') unless @audio_tracks.nil? cmd << '--video-tracks' << @video_tracks.join(',') unless @video_tracks.nil? cmd << '--subtitle-tracks' << @subtitle_tracks.join(',') unless @subtitle_tracks.nil? cmd << '--track-tags' << @track_tags.join(',') unless @track_tags.nil? cmd << '--attachments' << @attachments.join(',') unless @attachments.nil? cmd << '--no-audio' unless @no_audio.nil? cmd << '--no-video' unless @no_video.nil? cmd << '--no-subtitles' unless @no_subtitles.nil? cmd << '--no-track-tags' unless @no_track_tags.nil? cmd << '--no-chapters' unless @no_chapters.nil? cmd << '--no-attachments' unless @no_attachments.nil? cmd << '--no-global-tags' unless @no_global_tags.nil? cmd << '--sync' << @chapter_sync unless @chapter_sync.nil? @track_options.each { |option| option.add_to_cmd(cmd) } cmd << @file nil end |
#add_track_options(option) ⇒ Object
72 73 74 75 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 72 def (option) @track_options << option self end |
#build_track_option(track_id) ⇒ Object
87 88 89 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 87 def build_track_option(track_id) InputTrackOption.new(track_id) end |
#chapter_sync(d = 0, o_div_p = 1.0) ⇒ Object
82 83 84 85 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 82 def chapter_sync(d = 0, o_div_p = 1.0) @chapter_sync = "-2:#{d},#{o_div_p}" self end |
#with_attachments(*attachment_ids) ⇒ Object
32 33 34 35 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 32 def (*) @attachments = self end |
#with_audio_tracks(*track_ids) ⇒ Object
12 13 14 15 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 12 def with_audio_tracks(*track_ids) @audio_tracks = track_ids self end |
#with_no_attachments ⇒ Object
67 68 69 70 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 67 def @no_attachments = true self end |
#with_no_audio ⇒ Object
37 38 39 40 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 37 def with_no_audio @no_audio = true self end |
#with_no_chapters ⇒ Object
52 53 54 55 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 52 def with_no_chapters @no_chapters = true self end |
#with_no_global_tags ⇒ Object
62 63 64 65 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 62 def @no_global_tags = true self end |
#with_no_subtitles ⇒ Object
47 48 49 50 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 47 def with_no_subtitles @no_subtitles = true self end |
#with_no_track_tags ⇒ Object
57 58 59 60 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 57 def @no_track_tags = true self end |
#with_no_video ⇒ Object
42 43 44 45 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 42 def with_no_video @no_video = true self end |
#with_subtitle_tracks(*track_ids) ⇒ Object
22 23 24 25 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 22 def with_subtitle_tracks(*track_ids) @subtitle_tracks = track_ids self end |
#with_track_options(options) ⇒ Object
77 78 79 80 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 77 def () @track_options = self end |
#with_track_tags(*track_ids) ⇒ Object
27 28 29 30 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 27 def (*track_ids) @track_tags = track_ids self end |
#with_video_tracks(*track_ids) ⇒ Object
17 18 19 20 |
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 17 def with_video_tracks(*track_ids) @video_tracks = track_ids self end |