pbcore 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +674 -0
  7. data/README.md +37 -0
  8. data/Rakefile +6 -0
  9. data/bin/console +11 -0
  10. data/bin/setup +8 -0
  11. data/lib/pbcore.rb +28 -0
  12. data/lib/pbcore/annotation.rb +12 -0
  13. data/lib/pbcore/asset_date.rb +12 -0
  14. data/lib/pbcore/asset_type.rb +11 -0
  15. data/lib/pbcore/attributes.rb +6 -0
  16. data/lib/pbcore/attributes/common.rb +13 -0
  17. data/lib/pbcore/attributes/time_interval.rb +12 -0
  18. data/lib/pbcore/audience_level.rb +11 -0
  19. data/lib/pbcore/audience_rating.rb +11 -0
  20. data/lib/pbcore/contributor.rb +19 -0
  21. data/lib/pbcore/contributor/contributor.rb +12 -0
  22. data/lib/pbcore/contributor/role.rb +12 -0
  23. data/lib/pbcore/coverage.rb +20 -0
  24. data/lib/pbcore/coverage/coverage.rb +11 -0
  25. data/lib/pbcore/coverage/type.rb +11 -0
  26. data/lib/pbcore/creator.rb +19 -0
  27. data/lib/pbcore/creator/creator.rb +16 -0
  28. data/lib/pbcore/creator/role.rb +11 -0
  29. data/lib/pbcore/description.rb +13 -0
  30. data/lib/pbcore/description_document.rb +60 -0
  31. data/lib/pbcore/element.rb +199 -0
  32. data/lib/pbcore/errors.rb +55 -0
  33. data/lib/pbcore/extension.rb +19 -0
  34. data/lib/pbcore/extension/embedded.rb +15 -0
  35. data/lib/pbcore/extension/wrap.rb +26 -0
  36. data/lib/pbcore/extension/wrap/authority_used.rb +11 -0
  37. data/lib/pbcore/extension/wrap/element.rb +11 -0
  38. data/lib/pbcore/extension/wrap/value.rb +11 -0
  39. data/lib/pbcore/factories.rb +6 -0
  40. data/lib/pbcore/genre.rb +11 -0
  41. data/lib/pbcore/identifier.rb +11 -0
  42. data/lib/pbcore/instantiation.rb +87 -0
  43. data/lib/pbcore/instantiation/alternative_modes.rb +11 -0
  44. data/lib/pbcore/instantiation/annotation.rb +12 -0
  45. data/lib/pbcore/instantiation/channel_configuration.rb +11 -0
  46. data/lib/pbcore/instantiation/colors.rb +11 -0
  47. data/lib/pbcore/instantiation/data_rate.rb +13 -0
  48. data/lib/pbcore/instantiation/date.rb +13 -0
  49. data/lib/pbcore/instantiation/digital.rb +11 -0
  50. data/lib/pbcore/instantiation/dimensions.rb +13 -0
  51. data/lib/pbcore/instantiation/duration.rb +11 -0
  52. data/lib/pbcore/instantiation/essence_track.rb +59 -0
  53. data/lib/pbcore/instantiation/essence_track/annotation.rb +11 -0
  54. data/lib/pbcore/instantiation/essence_track/aspect_ratio.rb +11 -0
  55. data/lib/pbcore/instantiation/essence_track/bit_depth.rb +11 -0
  56. data/lib/pbcore/instantiation/essence_track/data_rate.rb +11 -0
  57. data/lib/pbcore/instantiation/essence_track/duration.rb +9 -0
  58. data/lib/pbcore/instantiation/essence_track/encoding.rb +9 -0
  59. data/lib/pbcore/instantiation/essence_track/frame_rate.rb +11 -0
  60. data/lib/pbcore/instantiation/essence_track/frame_size.rb +11 -0
  61. data/lib/pbcore/instantiation/essence_track/identifier.rb +9 -0
  62. data/lib/pbcore/instantiation/essence_track/language.rb +9 -0
  63. data/lib/pbcore/instantiation/essence_track/playback_speed.rb +11 -0
  64. data/lib/pbcore/instantiation/essence_track/sampling_rate.rb +11 -0
  65. data/lib/pbcore/instantiation/essence_track/standard.rb +9 -0
  66. data/lib/pbcore/instantiation/essence_track/time_start.rb +9 -0
  67. data/lib/pbcore/instantiation/essence_track/type.rb +9 -0
  68. data/lib/pbcore/instantiation/extension.rb +22 -0
  69. data/lib/pbcore/instantiation/file_size.rb +13 -0
  70. data/lib/pbcore/instantiation/generations.rb +11 -0
  71. data/lib/pbcore/instantiation/identifier.rb +11 -0
  72. data/lib/pbcore/instantiation/language.rb +11 -0
  73. data/lib/pbcore/instantiation/location.rb +11 -0
  74. data/lib/pbcore/instantiation/media_type.rb +11 -0
  75. data/lib/pbcore/instantiation/physical.rb +11 -0
  76. data/lib/pbcore/instantiation/relation.rb +19 -0
  77. data/lib/pbcore/instantiation/relation/identifier.rb +9 -0
  78. data/lib/pbcore/instantiation/relation/type.rb +9 -0
  79. data/lib/pbcore/instantiation/rights.rb +22 -0
  80. data/lib/pbcore/instantiation/rights/link.rb +11 -0
  81. data/lib/pbcore/instantiation/rights/summary.rb +11 -0
  82. data/lib/pbcore/instantiation/standard.rb +13 -0
  83. data/lib/pbcore/instantiation/time_start.rb +11 -0
  84. data/lib/pbcore/instantiation/tracks.rb +11 -0
  85. data/lib/pbcore/instantiation_document.rb +97 -0
  86. data/lib/pbcore/publisher.rb +19 -0
  87. data/lib/pbcore/publisher/publisher.rb +17 -0
  88. data/lib/pbcore/publisher/role.rb +11 -0
  89. data/lib/pbcore/relation.rb +19 -0
  90. data/lib/pbcore/relation/identifier.rb +11 -0
  91. data/lib/pbcore/relation/type.rb +11 -0
  92. data/lib/pbcore/rights_summary.rb +22 -0
  93. data/lib/pbcore/rights_summary/link.rb +11 -0
  94. data/lib/pbcore/rights_summary/summary.rb +11 -0
  95. data/lib/pbcore/subject.rb +15 -0
  96. data/lib/pbcore/title.rb +15 -0
  97. data/lib/pbcore/version.rb +3 -0
  98. data/lib/pbcore/vocab.rb +15 -0
  99. data/pbcore.gemspec +40 -0
  100. metadata +297 -0
@@ -0,0 +1,55 @@
1
+ # PBCore Error classes and methods.
2
+ #
3
+ # The classes and methods in this file intend to serve the following purposes:
4
+ #
5
+ # 1) Provide a base class for all PBCore errors, to that host applications can
6
+ # easily rescue from all errors thrown by this gem.
7
+ # 2) Provide specific error classes, with specific error messages, for specific
8
+ # situations. This helps developers of host applications to quickly solve
9
+ # bugs they may encounter when using the gem.
10
+ # 3) Provide module specific module methods that will:
11
+ # a) encapsulate conditional logic for specific situaitons
12
+ # b) raise specific errors
13
+ #
14
+ # New error classes should be created as new error conditions for specific
15
+ # situations arise. The pattern to follow should be:
16
+ #
17
+ # 1) Create a new error class that extends PBCore::Error.
18
+ # 2) The error class should be named in a way that indicates the specific
19
+ # situation.
20
+ # 3) The constructor of the error class should use named arguments, and include
21
+ # all information necessary to provide a detailed error message to
22
+ # developers, ideally with some kind of instruction on how to correct the
23
+ # problem.
24
+ # 3) A module method should be created to encapsulate the logic need to
25
+ # determine if an error should be raised.
26
+ # 4) The module name should beging with "fail_if_" or "fail_unless_", followed
27
+ # by the snake-case name of the specific error class to be raised.
28
+ # 5) The module method should test the condition, and raise the specific
29
+ # error. This implies that the module method must also receive all
30
+ # information necessary to pass along to the constructor of the error
31
+ # class.
32
+
33
+ module PBCore
34
+ class Error < StandardError; end
35
+
36
+ class BaseIsNotPBCoreElement < Error
37
+ def initialize(included_module:, base:)
38
+ super("#{included_module} should only be included in PBCore::Element, but was included in #{base} (ancestors are: #{base.ancestors.join(', ')})")
39
+ end
40
+ end
41
+
42
+ def self.fail_if_base_is_not_pbcore_element(included_module:, base:)
43
+ raise BaseIsNotPBCoreElement.new(included_module: included_module, base: base) unless base.ancestors.include? PBCore::Element
44
+ end
45
+
46
+ class ElementMissingBuildXMLBlock < Error
47
+ def initialize(element_class:)
48
+ super("Element class #{element_class} does not have a block for building xml. Create one by passing a block to #{element_class}.build_xml")
49
+ end
50
+ end
51
+
52
+ def self.fail_if_missing_build_xml_block(element_class:)
53
+ raise ElementMissingBuildXMLBlock.new(element_class: element_class) unless element_class.build_block
54
+ end
55
+ end
@@ -0,0 +1,19 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Extension < Element
5
+ autoload :Wrap, 'pbcore/extension/wrap'
6
+ autoload :Embedded, 'pbcore/extension/embedded'
7
+
8
+ element :pbcoreExtension, as: :value
9
+ element :extensionWrap, as: :wrap, class: PBCore::Extension::Wrap
10
+ element :extensionEmbedded, as: :embedded, class: PBCore::Extension::Embedded
11
+
12
+ build_xml do |xml|
13
+ xml.pbcoreExtension(xml_attributes.compact) do |xml|
14
+ wrap.build(xml) if wrap
15
+ embedded.build(xml) if embedded
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ # NOTE: This class doesn't actually work like you might expect it to.
2
+ # The <extensionEmbedded> element is supposed to contain XML from a different
3
+ # (non-PBCore) schema. However, currently the SAXMachine parser will proceed
4
+ # to parse the embedded XML rather than capture it and provide an accessor to
5
+ # it, which is what we want to happen.
6
+ require 'pbcore/element'
7
+
8
+ module PBCore
9
+ class Extension::Embedded < Element
10
+ element :extensionEmbedded, as: :value
11
+ build_xml do |xml|
12
+ xml.extensionEmbedded(value, xml_attributes.compact)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Extension::Wrap < Element
5
+ autoload :AuthorityUsed, 'pbcore/extension/wrap/authority_used'
6
+ autoload :Element, 'pbcore/extension/wrap/element'
7
+ autoload :Value, 'pbcore/extension/wrap/value'
8
+
9
+ element :extensionWrap, as: :value
10
+ # We set the accessors here to be extension_element and extension_value
11
+ # rather than just `extension` and `value` as the naming convention would
12
+ # suggest, because both `value` and `element` have special meaning for
13
+ # SAXMachine and we want to avoid conflict and confusion.
14
+ element :extensionElement, as: :extension_element, class: PBCore::Extension::Wrap::Element
15
+ element :extensionValue, as: :extension_value, class: PBCore::Extension::Wrap::Value
16
+ element :extensionAuthorityUsed, as: :authority_used, class: PBCore::Extension::Wrap::AuthorityUsed
17
+
18
+ build_xml do |xml|
19
+ xml.extensionWrap(xml_attributes.compact) do |xml|
20
+ extension_element.build(xml) if extension_element
21
+ extension_value.build(xml) if extension_value
22
+ authority_used.build(xml) if authority_used
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Extension::Wrap::AuthorityUsed < Element
5
+ element :extensionAuthorityUsed, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.extensionAuthorityUsed(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Extension::Wrap::Element < Element
5
+ element :extensionElement, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.extensionElement(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Extension::Wrap::Value < Element
5
+ element :extensionValue, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.extensionValue(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ require 'factory_bot'
2
+
3
+ GEM_ROOT = File.dirname(File.dirname(File.dirname(__FILE__)))
4
+
5
+ require File.join(GEM_ROOT, 'spec', 'support', 'date_time_helpers')
6
+ Dir.glob(File.join(GEM_ROOT, 'spec', 'factories', '**', '*.rb')).each { |file| require(file) }
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Genre < Element
5
+ element :pbcoreGenre, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.pbcoreGenre(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Identifier < Element
5
+ element :pbcoreIdentifier, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.pbcoreIdentifier(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,87 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation < Element
5
+ autoload :Identifier, 'pbcore/instantiation/identifier'
6
+ autoload :Date, 'pbcore/instantiation/date'
7
+ autoload :Dimensions, 'pbcore/instantiation/dimensions'
8
+ autoload :Physical, 'pbcore/instantiation/physical'
9
+ autoload :Digital, 'pbcore/instantiation/digital'
10
+ autoload :Standard, 'pbcore/instantiation/standard'
11
+ autoload :Location, 'pbcore/instantiation/location'
12
+ autoload :MediaType, 'pbcore/instantiation/media_type'
13
+ autoload :Generations, 'pbcore/instantiation/generations'
14
+ autoload :TimeStart, 'pbcore/instantiation/time_start'
15
+ autoload :FileSize, 'pbcore/instantiation/file_size'
16
+ autoload :Duration, 'pbcore/instantiation/duration'
17
+ autoload :DataRate, 'pbcore/instantiation/data_rate'
18
+ autoload :Colors, 'pbcore/instantiation/colors'
19
+ autoload :Tracks, 'pbcore/instantiation/tracks'
20
+ autoload :ChannelConfiguration, 'pbcore/instantiation/channel_configuration'
21
+ autoload :Language, 'pbcore/instantiation/language'
22
+ autoload :AlternativeModes, 'pbcore/instantiation/alternative_modes'
23
+ autoload :EssenceTrack, 'pbcore/instantiation/essence_track'
24
+ autoload :Extension, 'pbcore/instantiation/extension'
25
+ autoload :Relation, 'pbcore/instantiation/relation'
26
+ autoload :Rights, 'pbcore/instantiation/rights'
27
+ autoload :Annotation, 'pbcore/instantiation/annotation'
28
+
29
+ element :pbcoreInstantiation, as: :value
30
+ elements :instantiationIdentifier, as: :identifiers, class: PBCore::Instantiation::Identifier
31
+ elements :instantiationDate, as: :dates, class: PBCore::Instantiation::Date
32
+ elements :instantiationDimensions, as: :dimensions, class: PBCore::Instantiation::Dimensions
33
+ element :instantiationPhysical, as: :physical, class: PBCore::Instantiation::Physical
34
+ element :instantiationDigital, as: :digital, class: PBCore::Instantiation::Digital
35
+ element :instantiationStandard, as: :standard, class: PBCore::Instantiation::Standard
36
+ element :instantiationLocation, as: :location, class: PBCore::Instantiation::Location
37
+ element :instantiationMediaType, as: :media_type, class: PBCore::Instantiation::MediaType
38
+ elements :instantiationGenerations, as: :generations, class: PBCore::Instantiation::Generations
39
+ elements :instantiationTimeStart, as: :time_starts, class: PBCore::Instantiation::TimeStart
40
+ element :instantiationFileSize, as: :file_size, class: PBCore::Instantiation::FileSize
41
+ element :instantiationDuration, as: :duration, class: PBCore::Instantiation::Duration
42
+ element :instantiationDataRate, as: :data_rate, class: PBCore::Instantiation::DataRate
43
+ element :instantiationColors, as: :colors, class: PBCore::Instantiation::Colors
44
+ element :instantiationTracks, as: :tracks, class: PBCore::Instantiation::Tracks
45
+ element :instantiationChannelConfiguration, as: :channel_configuration, class: PBCore::Instantiation::ChannelConfiguration
46
+ elements :instantiationLanguage, as: :languages, class: PBCore::Instantiation::Language
47
+ element :instantiationAlternativeModes, as: :alternative_modes, class: PBCore::Instantiation::AlternativeModes
48
+ elements :instantiationEssenceTrack, as: :essence_tracks, class: PBCore::Instantiation::EssenceTrack
49
+ elements :instantiationExtension, as: :extensions, class: PBCore::Instantiation::Extension
50
+ elements :instantiationRelation, as: :relations, class: PBCore::Instantiation::Relation
51
+ elements :instantiationRights, as: :rights, class: PBCore::Instantiation::Rights
52
+ elements :instantiationAnnotation, as: :annotations, class: PBCore::Instantiation::Annotation
53
+
54
+ include PBCore::Attributes::TimeInterval
55
+
56
+ build_xml do |xml|
57
+ xml.pbcoreInstantiation(xml_attributes.compact) do |xml|
58
+ identifiers.each { |identifier| identifier.build(xml) }
59
+ dates.each { |date| date.build(xml) }
60
+ dimensions.each { |dimensions_element| dimensions_element.build(xml) }
61
+ physical.build(xml) if physical
62
+ digital.build(xml) if digital
63
+ standard.build(xml) if standard
64
+ location.build(xml) if location
65
+ media_type.build(xml) if media_type
66
+ generations.each { |generations_element| generations_element.build(xml) }
67
+ file_size.build(xml) if file_size
68
+ time_starts.each { |time_start| time_start.build(xml) }
69
+ duration.build(xml) if duration
70
+ data_rate.build(xml) if data_rate
71
+ colors.build(xml) if colors
72
+ tracks.build(xml) if tracks
73
+ channel_configuration.build(xml) if channel_configuration
74
+ languages.each { |language| language.build(xml) }
75
+ alternative_modes.build(xml) if alternative_modes
76
+ essence_tracks.each { |essence_track| essence_track.build(xml) }
77
+ # TODO: no instrelation?!!
78
+
79
+ # ??? this seems to render correctly according to pbcore.org, but doesnt pass schema validation
80
+ rights.each { |right| right.build(xml) }
81
+ annotations.each { |annotation| annotation.build(xml) }
82
+ # TODO: no instpart?!?
83
+ extensions.each { |extension| extension.build(xml) }
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::AlternativeModes < Element
5
+ element :instantiationAlternativeModes, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.instantiationAlternativeModes(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::Annotation < Element
5
+ element :instantiationAnnotation, as: :value
6
+ attribute :annotationType, as: :type
7
+
8
+ build_xml do |xml|
9
+ xml.instantiationAnnotation(value, xml_attributes.compact)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::ChannelConfiguration < Element
5
+ element :instantiationChannelConfiguration, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.instantiationChannelConfiguration(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::Colors < Element
5
+ element :instantiationColors, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.instantiationColors(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::DataRate < Element
5
+ element :instantiationDataRate, as: :value
6
+
7
+ attribute :unitsOfMeasure, as: :units_of_measure
8
+
9
+ build_xml do |xml|
10
+ xml.instantiationDataRate(value, xml_attributes.compact)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::Date < Element
5
+ element :instantiationDate, as: :value
6
+
7
+ attribute :dateType, as: :type
8
+
9
+ build_xml do |xml|
10
+ xml.instantiationDate(value, xml_attributes.compact)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::Digital < Element
5
+ element :instantiationDigital, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.instantiationDigital(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::Dimensions < Element
5
+ element :instantiationDimensions, as: :value
6
+
7
+ attribute :unitsOfMeasure, as: :units_of_measure
8
+
9
+ build_xml do |xml|
10
+ xml.instantiationDimensions(value, xml_attributes.compact)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::Duration < Element
5
+ element :instantiationDuration, as: :value
6
+
7
+ build_xml do |xml|
8
+ xml.instantiationDuration(value, xml_attributes.compact)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,59 @@
1
+ require 'pbcore/element'
2
+
3
+ module PBCore
4
+ class Instantiation::EssenceTrack < Element
5
+ autoload :Type, 'pbcore/instantiation/essence_track/type'
6
+ autoload :Identifier, 'pbcore/instantiation/essence_track/identifier'
7
+ autoload :Standard, 'pbcore/instantiation/essence_track/standard'
8
+ autoload :Encoding, 'pbcore/instantiation/essence_track/encoding'
9
+ autoload :DataRate, 'pbcore/instantiation/essence_track/data_rate'
10
+ autoload :FrameRate, 'pbcore/instantiation/essence_track/frame_rate'
11
+ autoload :PlaybackSpeed, 'pbcore/instantiation/essence_track/playback_speed'
12
+ autoload :SamplingRate, 'pbcore/instantiation/essence_track/sampling_rate'
13
+ autoload :BitDepth, 'pbcore/instantiation/essence_track/bit_depth'
14
+ autoload :FrameSize, 'pbcore/instantiation/essence_track/frame_size'
15
+ autoload :Duration, 'pbcore/instantiation/essence_track/duration'
16
+ autoload :AspectRatio, 'pbcore/instantiation/essence_track/aspect_ratio'
17
+ autoload :TimeStart, 'pbcore/instantiation/essence_track/time_start'
18
+ autoload :Language, 'pbcore/instantiation/essence_track/language'
19
+ autoload :Annotation, 'pbcore/instantiation/essence_track/annotation'
20
+
21
+ element :instantiationEssenceTrack, as: :value
22
+ element :essenceTrackType, as: :type, class: PBCore::Instantiation::EssenceTrack::Type
23
+ elements :essenceTrackIdentifier, as: :identifiers, class: PBCore::Instantiation::EssenceTrack::Identifier
24
+ element :essenceTrackStandard, as: :standard, class: PBCore::Instantiation::EssenceTrack::Standard
25
+ element :essenceTrackEncoding, as: :encoding, class: PBCore::Instantiation::EssenceTrack::Encoding
26
+ element :essenceTrackDataRate, as: :data_rate, class: PBCore::Instantiation::EssenceTrack::DataRate
27
+ element :essenceTrackFrameRate, as: :frame_rate, class: PBCore::Instantiation::EssenceTrack::FrameRate
28
+ element :essenceTrackPlaybackSpeed, as: :playback_speed, class: PBCore::Instantiation::EssenceTrack::PlaybackSpeed
29
+ element :essenceTrackSamplingRate, as: :sampling_rate, class: PBCore::Instantiation::EssenceTrack::SamplingRate
30
+ element :essenceTrackBitDepth, as: :bit_depth, class: PBCore::Instantiation::EssenceTrack::BitDepth
31
+ element :essenceTrackFrameSize, as: :frame_size, class: PBCore::Instantiation::EssenceTrack::FrameSize
32
+ element :essenceTrackDuration, as: :duration, class: PBCore::Instantiation::EssenceTrack::Duration
33
+ element :essenceTrackAspectRatio, as: :aspect_ratio, class: PBCore::Instantiation::EssenceTrack::AspectRatio
34
+ element :essenceTrackTimeStart, as: :time_start, class: PBCore::Instantiation::EssenceTrack::TimeStart
35
+ elements :essenceTrackLanguage, as: :languages, class: PBCore::Instantiation::EssenceTrack::Language
36
+ elements :essenceTrackAnnotation, as: :annotations, class: PBCore::Instantiation::EssenceTrack::Annotation
37
+
38
+ build_xml do |xml|
39
+ xml.instantiationEssenceTrack(xml_attributes.compact) do |xml|
40
+ type.build(xml) if type
41
+ identifiers.each { |identifier| identifier.build(xml) }
42
+ standard.build(xml) if standard
43
+ encoding.build(xml) if encoding
44
+ data_rate.build(xml) if data_rate
45
+ frame_rate.build(xml) if frame_rate
46
+ playback_speed.build(xml) if playback_speed
47
+ sampling_rate.build(xml) if sampling_rate
48
+ bit_depth.build(xml) if bit_depth
49
+ frame_size.build(xml) if frame_size
50
+ aspect_ratio.build(xml) if aspect_ratio
51
+ time_start.build(xml) if time_start
52
+ duration.build(xml) if duration
53
+ languages.each { |language| language.build(xml) }
54
+ annotations.each { |annotation| annotation.build(xml) }
55
+ # TODO: no essen extension!?!
56
+ end
57
+ end
58
+ end
59
+ end