matterhorn_whymper 0.1.0 → 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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGNkZjc5NjgzYWRlYmE5YzUzMTU0ZTFlNzI1MWYxN2IxNmQyMzNmOQ==
4
+ OTVmYWFiNTFiYTY3ZWFiMDI4YWJlMWYxYzdkZTUxYmM5OTk3NDFhMw==
5
5
  data.tar.gz: !binary |-
6
- NTI4Y2MzMjI0MGFmMDlmZjI3YmMxNGY1MTMyYzk3NjBhNmM2YzU2Ng==
6
+ M2U5MWJhMWExNWFjYWMwZGZhMzExNTQ0MmIxNDIwZDllZDVhNTU5Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWRlNWUwMDUzYzVkZGIwYmM0YTM4MjZkODIxMTQzM2I4MGJkYzZiYThiOGVl
10
- MmVlOWU4NTIyYjkyNmU0MTk3MmUxOTE3OWM5ZTEwYzI4ODBjNDgxYjI0YmY4
11
- NWE0NjNmMjQ4N2IzMTA0NzliY2RlNmVjNGNjMTAxN2YwYmYxOTI=
9
+ NjhhYzBmN2M1YjAwYzgwNjhiMDlmMTM5ZGJmYjczZWU1MjEwNWM4ODQyYjEw
10
+ Y2IwNjUwM2RmMWMxZWU3YjM5ZTE3ODg3YzhmZDA5YjVjMDc0ODZiMzQyNzFh
11
+ MTQ0MWU3YTNhNDcyMmY0MWQ2ZDRlZTc3OWMxNTc4ODQ2OTFlZDI=
12
12
  data.tar.gz: !binary |-
13
- NzdlMWY1YmI4YzQ0N2JhODBiNzM4ZDIwNzcwZjA1OTcwOTQ0OWZhYmVhODQ2
14
- M2RlMmMyZTE0Y2UyYWVlNGRlZGU3MWRlY2ZhNDYyMzI1YTk2YWE4YzczNmE0
15
- OTY2YTViYWNhNjM1MjdmMDM3OGM0NTEwNDM3OWE0OWZjZTJhNzI=
13
+ NzgyYWIyMDQ5ZjEwMDk4Yjc0Y2Y1NDg5ZTJhYmZjZDJhNzJkNDhhNWQzZjA2
14
+ MTlkYjk0NmFhMmMxYjgyYTRiMWJmMzAzOGE5NDM4ZGQ0MDU1YzI2M2YxN2Yx
15
+ MzhjMDE1MGM4ZDdmZTYzMmRlMWEyNGI4MGE2MGE1ZjIyZWU2YmI=
@@ -37,7 +37,7 @@ module Matterhorn
37
37
 
38
38
  def to_xml
39
39
  doc = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |bx|
40
- bx.smil('xmlns' => "http://www.w3.org/ns/SMIL") do
40
+ bx.smil('xmlns' => "http://www.w3.org/ns/SMIL", 'version' => '3.0') do
41
41
  head.to_xml(bx)
42
42
  body.to_xml(bx)
43
43
  end
@@ -70,13 +70,14 @@ module Matterhorn
70
70
 
71
71
  # ------------------------------------------------------------------------------- attributes ---
72
72
 
73
- attr_reader :par_list
73
+ attr_reader :par_list, :seq_list
74
74
 
75
75
 
76
76
  # --------------------------------------------------------------------------- initialization ---
77
77
 
78
78
  def initialize()
79
79
  @par_list = Array.new
80
+ @seq_list = Array.new
80
81
  end
81
82
 
82
83
 
@@ -89,11 +90,21 @@ module Matterhorn
89
90
  end
90
91
 
91
92
 
93
+ def add_seq()
94
+ seq = Smil::Seq.new(nil)
95
+ @seq_list << seq
96
+ seq
97
+ end
98
+
99
+
92
100
  def to_xml(bx)
93
101
  bx.body do
94
102
  @par_list.each do |par|
95
103
  par.to_xml(bx)
96
104
  end
105
+ @seq_list.each do |seq|
106
+ seq.to_xml(bx)
107
+ end
97
108
  end
98
109
  end
99
110
 
@@ -275,6 +286,7 @@ module Matterhorn
275
286
  def initialize(parent)
276
287
  super(parent)
277
288
  @track_list = Array.new
289
+ @scene_list = Array.new
278
290
  end
279
291
 
280
292
 
@@ -295,6 +307,13 @@ module Matterhorn
295
307
  end
296
308
 
297
309
 
310
+ def add_scene(file, clip_begin, clip_end)
311
+ scene = Smil::Scene.new(self, file, clip_begin, clip_end)
312
+ @scene_list << scene
313
+ scene
314
+ end
315
+
316
+
298
317
  def propagate(parent_elem)
299
318
  @rel_begin = start_point - parent_elem.start_point
300
319
  @track_list.each do |track|
@@ -309,6 +328,9 @@ module Matterhorn
309
328
  @track_list.each do |track|
310
329
  track.to_xml(bx)
311
330
  end
331
+ @scene_list.each do |scene|
332
+ scene.to_xml(bx)
333
+ end
312
334
  end
313
335
  end
314
336
 
@@ -317,7 +339,7 @@ module Matterhorn
317
339
 
318
340
 
319
341
 
320
- # ====================================================================================== Track ===
342
+ # ==================================================================== Matterhorn::Smil::Track ===
321
343
 
322
344
  class Smil::Track < Smil::Element
323
345
 
@@ -352,4 +374,37 @@ module Matterhorn
352
374
  end # ------------------------------------------------------------ end Matterhorn::Smil::Track ---
353
375
 
354
376
 
377
+ # ==================================================================== Matterhorn::Smil::Scene ===
378
+
379
+ class Smil::Scene < Smil::Element
380
+
381
+
382
+ # --------------------------------------------------------------------------- initialization ---
383
+
384
+ def initialize(parent, file, clip_begin, clip_end)
385
+ super(parent)
386
+ @src = file
387
+ @clip_begin = clip_begin
388
+ @clip_end = clip_end
389
+ end
390
+
391
+
392
+ # --------------------------------------------------------------------------------- methodes ---
393
+
394
+ def propagate(parent_elem)
395
+ end
396
+
397
+
398
+ def to_xml(bx)
399
+ attributes = Hash.new
400
+ attributes[:src] = @src.to_s
401
+ attributes[:clipBegin] = "#{(@clip_begin * 1000).round.to_s}ms"
402
+ attributes[:clipEnd] = "#{(@clip_end * 1000).round.to_s}ms"
403
+ bx.video(attributes)
404
+ end
405
+
406
+
407
+ end # ------------------------------------------------------------ end Matterhorn::Smil::Scene ---
408
+
409
+
355
410
  end # --------------------------------------------------------------------------- end Matterhorn ---
@@ -5,7 +5,7 @@ module MatterhornWhymper
5
5
 
6
6
  # -------------------------------------------------------------------------- const definitions ---
7
7
 
8
- VERSION = "0.1.0"
8
+ VERSION = "0.2.0"
9
9
 
10
10
 
11
11
  end # -------------------------------------------------------------------- end MatterhornWhymper ---
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matterhorn_whymper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Fritschi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-21 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post