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 +4 -4
- data/lib/druzy/protocol/device.rb +43 -3
- data/lib/druzy/protocol/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fc87b39f837f0e8735889341bfd34e82587d2aa
|
4
|
+
data.tar.gz: eda3ce1e29b6a63a9d379a747b5bc517235e37e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
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
|