druzy-protocol 1.0.2 → 1.0.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9339c6f87ff3e1a1fedb2aaf07de9e11b67cb44
4
- data.tar.gz: 50036287382e2510b81ac20f1605d82e9c090261
3
+ metadata.gz: 6fc87b39f837f0e8735889341bfd34e82587d2aa
4
+ data.tar.gz: eda3ce1e29b6a63a9d379a747b5bc517235e37e2
5
5
  SHA512:
6
- metadata.gz: a3a4cfed54a9d3a50a08ef79f15d229096b9e14dcd662f6b99f9f1d1681ba38f3d7718a22781d749c2382fd4b3365a2cf0dea3fe85e1ed2020660ae16d8720a2
7
- data.tar.gz: 5e473cebedbed6c7d397ee74f1ce818f89da6e85cf28590b01af6ce238445f3524b12563fa442705eb80866a8ee2bc18fbaa4f49b6240b2d5de89bcadeb7bccf
6
+ metadata.gz: 383bf5699e3bf169587ef407d268a326204274abea14c2bec669371d84fa081d3afd93e996feb5a944128bba88dbc9da2cef8d70c38d56fedfd3482cbcb36bb2
7
+ data.tar.gz: 1167ade1975fb7e12a3203295a754ce6a48a9ee39c4adf1a922b9a6d4ab98474975260d0cc5f7e1d9f4815edf5f41b9fd453d540a8ba4c27ab12162002759188
@@ -1,16 +1,20 @@
1
+ require 'druzy/mvc'
2
+
1
3
  module Druzy
2
4
  module Protocol
3
5
 
4
- class Device
6
+ class Device < Druzy::MVC::Model
5
7
  attr_reader :identifier, :protocol, :name, :icon
6
8
 
7
9
  def initialize(identifier,protocol,name,icon)
10
+ super()
8
11
  @identifier=identifier
9
12
  @protocol=protocol
10
13
  @name=name
11
14
  @icon=icon
12
15
  end
13
16
 
17
+ #il faut faire le cas ou o est nil
14
18
  def ==(o)
15
19
  if !o.is_a? Device
16
20
  return false
@@ -21,7 +25,8 @@ module Druzy
21
25
  end
22
26
 
23
27
  class Renderer < Device
24
- attr_accessor :duration, :time_position, :volume, :volume_min, :volume_max, :mute
28
+ attr_accessor :duration, :time_position, :volume, :volume_min, :volume_max, :mute, :current_file
29
+
25
30
  def initialize(identifier, protocol, name, icon, duration=Time.at(0).utc, time_position=Time.at(0).utc,volume=100,volume_min=0,volume_max=100,mute=false)
26
31
  super(identifier,protocol,name,icon)
27
32
  @duration=duration
@@ -30,7 +35,42 @@ module Druzy
30
35
  @volume_min=volume_min
31
36
  @volume_max=volume_max
32
37
  @mute=mute
33
-
38
+ @current_file
39
+ end
40
+
41
+ def duration=(duration)
42
+ @duration, old = duration, @duration
43
+ fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"duration",old,@duration))
44
+ end
45
+
46
+ def time_position=(time_position)
47
+ @time_position, old = time_position, @time_position
48
+ fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"time_position",old,@time_position))
49
+ end
50
+
51
+ def volume=(volume)
52
+ @volume, old = volume, @volume
53
+ fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"volume",old,@volume))
54
+ end
55
+
56
+ def volume_min=(volume_min)
57
+ @volume_min, old = volume_min, @volume_min
58
+ fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"volume_min",old,@volume_min))
59
+ end
60
+
61
+ def volume_max=(volume_max)
62
+ @volume_max, old = volume_max, @volume_max
63
+ fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"volume_max",old,@volume_max))
64
+ end
65
+
66
+ def mute=(mute)
67
+ @mute, old = mute, @mute
68
+ fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"mute",old,@mute))
69
+ end
70
+
71
+ def current_file=(current_file)
72
+ @current_file, old = current_file, @current_file
73
+ fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"current_file",old,@current_file))
34
74
  end
35
75
 
36
76
  def play
@@ -1,5 +1,5 @@
1
1
  module Druzy
2
2
  module Protocol
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: druzy-protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Le Greneur
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-15 00:00:00.000000000 Z
11
+ date: 2016-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: druzy-mvc
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement