Class: MkvToolNix::Types::Info::MkvContainer
- Inherits:
-
Object
- Object
- MkvToolNix::Types::Info::MkvContainer
- Defined in:
- lib/mkvtoolnix/types/info/mkv_container.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
Returns the value of attribute attachments.
-
#audios ⇒ Object
Returns the value of attribute audios.
-
#container_type ⇒ Object
Returns the value of attribute container_type.
-
#date_utc ⇒ Object
Returns the value of attribute date_utc.
-
#duration_in_secs ⇒ Object
Returns the value of attribute duration_in_secs.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#format_version ⇒ Object
Returns the value of attribute format_version.
-
#is_providing_timestamps ⇒ Object
Returns the value of attribute is_providing_timestamps.
-
#is_recognized ⇒ Object
Returns the value of attribute is_recognized.
-
#is_supported ⇒ Object
Returns the value of attribute is_supported.
-
#mux_application ⇒ Object
Returns the value of attribute mux_application.
-
#segment_uid ⇒ Object
Returns the value of attribute segment_uid.
-
#subtitles ⇒ Object
Returns the value of attribute subtitles.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#videos ⇒ Object
Returns the value of attribute videos.
-
#writing_application ⇒ Object
Returns the value of attribute writing_application.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(title:, file_name:, format_version:, type:, is_supported:, is_recognized:, container_type:, date_utc:, duration_in_nano:, is_providing_timestamps:, mux_application:, segment_uid:, writing_application:, attachments:, videos:, audios:, subtitles:) ⇒ MkvContainer
constructor
A new instance of MkvContainer.
Constructor Details
#initialize(title:, file_name:, format_version:, type:, is_supported:, is_recognized:, container_type:, date_utc:, duration_in_nano:, is_providing_timestamps:, mux_application:, segment_uid:, writing_application:, attachments:, videos:, audios:, subtitles:) ⇒ MkvContainer
Returns a new instance of MkvContainer.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 34 def initialize(title:, file_name:, format_version:, type:, is_supported:, is_recognized:, container_type:, date_utc:, duration_in_nano:, is_providing_timestamps:, mux_application:, segment_uid:, writing_application:, attachments:, videos:, audios:, subtitles:) @title = title @file_name = file_name @format_version = format_version @type = type @is_supported = is_supported @is_recognized = is_recognized @container_type = container_type @date_utc = date_utc @duration_in_secs = duration_in_nano.to_f / 1_000_000_000 @is_providing_timestamps = @mux_application = mux_application @segment_uid = segment_uid @writing_application = writing_application @attachments = @videos = videos @audios = audios @subtitles = subtitles end |
Instance Attribute Details
#attachments ⇒ Object
Returns the value of attribute attachments.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def @attachments end |
#audios ⇒ Object
Returns the value of attribute audios.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def audios @audios end |
#container_type ⇒ Object
Returns the value of attribute container_type.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def container_type @container_type end |
#date_utc ⇒ Object
Returns the value of attribute date_utc.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def date_utc @date_utc end |
#duration_in_secs ⇒ Object
Returns the value of attribute duration_in_secs.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def duration_in_secs @duration_in_secs end |
#file_name ⇒ Object
Returns the value of attribute file_name.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def file_name @file_name end |
#format_version ⇒ Object
Returns the value of attribute format_version.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def format_version @format_version end |
#is_providing_timestamps ⇒ Object
Returns the value of attribute is_providing_timestamps.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def @is_providing_timestamps end |
#is_recognized ⇒ Object
Returns the value of attribute is_recognized.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def is_recognized @is_recognized end |
#is_supported ⇒ Object
Returns the value of attribute is_supported.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def is_supported @is_supported end |
#mux_application ⇒ Object
Returns the value of attribute mux_application.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def mux_application @mux_application end |
#segment_uid ⇒ Object
Returns the value of attribute segment_uid.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def segment_uid @segment_uid end |
#subtitles ⇒ Object
Returns the value of attribute subtitles.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def subtitles @subtitles end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def type @type end |
#videos ⇒ Object
Returns the value of attribute videos.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def videos @videos end |
#writing_application ⇒ Object
Returns the value of attribute writing_application.
8 9 10 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 8 def writing_application @writing_application end |
Class Method Details
.create(hash) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mkvtoolnix/types/info/mkv_container.rb', line 12 def self.create(hash) container = hash['container'] props = container['properties'] = hash['attachments'].map { |it| Attachment.create(it) } tracks = hash['tracks'] video_hash = tracks.select { |it| it['type'] == 'video' } videos = video_hash.nil? ? [] : video_hash.map { |it| Video.create(it) } audio_hash = tracks.select { |it| it['type'] == 'audio' } audios = audio_hash.nil? ? [] : audio_hash.map { |it| Audio.create(it) } subtitle_hash = tracks.select { |it| it['type'] == 'subtitles' } subtitles = subtitle_hash.nil? ? [] : subtitle_hash.map { |it| Subtitle.create(it) } new(title: props['title'], file_name: hash['file_name'], format_version: hash['identification_format_version'], type: container['type'], is_supported: container['supported'], is_recognized: container['recognized'], container_type: props['container_type'], date_utc: props['date_utc'], duration_in_nano: props['duration'], is_providing_timestamps: props['is_providing_timestamps'], mux_application: props['muxing_application'], segment_uid: props['segment_uid'], writing_application: props['writing_application'], attachments: , videos: videos, audios: audios, subtitles: subtitles) end |