Class: MkvToolNix::Types::Merge::InputFile

Inherits:
Object
  • Object
show all
Defined in:
lib/mkvtoolnix/types/merge/input_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attachmentsObject (readonly)

Returns the value of attribute attachments.



8
9
10
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8

def attachments
  @attachments
end

#audio_tracksObject (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_attachmentsObject (readonly)

Returns the value of attribute no_attachments.



8
9
10
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8

def no_attachments
  @no_attachments
end

#no_audioObject (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_chaptersObject (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_tagsObject (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
  @no_global_tags
end

#no_subtitlesObject (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_tagsObject (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
  @no_track_tags
end

#no_videoObject (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_tracksObject (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_optionsObject (readonly)

Returns the value of attribute track_options.



8
9
10
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8

def track_options
  @track_options
end

#track_tagsObject (readonly)

Returns the value of attribute track_tags.



8
9
10
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 8

def track_tags
  @track_tags
end

#video_tracksObject (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 add_track_options(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 with_attachments(*attachment_ids)
  @attachments = attachment_ids
  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_attachmentsObject



67
68
69
70
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 67

def with_no_attachments
  @no_attachments = true
  self
end

#with_no_audioObject



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_chaptersObject



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_tagsObject



62
63
64
65
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 62

def with_no_global_tags
  @no_global_tags = true
  self
end

#with_no_subtitlesObject



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_tagsObject



57
58
59
60
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 57

def with_no_track_tags
  @no_track_tags = true
  self
end

#with_no_videoObject



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 with_track_options(options)
  @track_options = options
  self
end

#with_track_tags(*track_ids) ⇒ Object



27
28
29
30
# File 'lib/mkvtoolnix/types/merge/input_file.rb', line 27

def with_track_tags(*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