druzy-protocol 1.0.3 → 1.0.4
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.rb +2 -2
- data/lib/druzy/protocol/device.rb +44 -7
- data/lib/druzy/protocol/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bacef736a273a0aa8ee2cfaa5b8f736a119cc5dc
|
4
|
+
data.tar.gz: b6f29afcd2ba4d9f290dc985a5c70a0521e92b50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10d0bcb65ce15761c715bf71ad63fd4267c07e98f0b95e5f7c23a760c690bddab66155e052a09642a8c78c9bb58cfad6c3d2f63b3e06e45bc2f386be47d94370
|
7
|
+
data.tar.gz: c05ab1a5fd433fe57be51d5a43f7ea0e9d435717accd709dad8244a64b9a25bc1e6afb60d9847c765cbabaa6e4af7f0a869ad92fd2c78cb453b7e654cbf6a765
|
data/lib/druzy/protocol.rb
CHANGED
@@ -29,13 +29,35 @@ module Druzy
|
|
29
29
|
|
30
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)
|
31
31
|
super(identifier,protocol,name,icon)
|
32
|
-
@duration=duration
|
33
|
-
@time_position=time_position
|
34
|
-
@volume=volume
|
35
|
-
@volume_min=volume_min
|
36
|
-
@volume_max=volume_max
|
37
|
-
@mute=mute
|
38
|
-
@current_file
|
32
|
+
@duration = duration
|
33
|
+
@time_position = time_position
|
34
|
+
@volume = volume
|
35
|
+
@volume_min = volume_min
|
36
|
+
@volume_max = volume_max
|
37
|
+
@mute = mute
|
38
|
+
@current_file = nil
|
39
|
+
@play = false
|
40
|
+
@pause = false
|
41
|
+
@stop = true
|
42
|
+
|
43
|
+
add_property_change_listener(Druzy::MVC::PropertyChangeListener.new do |event|
|
44
|
+
if event.property_name == "play"
|
45
|
+
if event.new_value == true
|
46
|
+
stop = false
|
47
|
+
pause = false
|
48
|
+
end
|
49
|
+
elsif event.property_name == "pause"
|
50
|
+
if event.new_value == true
|
51
|
+
pause = false
|
52
|
+
stop = false
|
53
|
+
end
|
54
|
+
elsif event.property_name == "stop"
|
55
|
+
if event.new_value == true
|
56
|
+
play = false
|
57
|
+
pause = false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end)
|
39
61
|
end
|
40
62
|
|
41
63
|
def duration=(duration)
|
@@ -73,6 +95,21 @@ module Druzy
|
|
73
95
|
fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"current_file",old,@current_file))
|
74
96
|
end
|
75
97
|
|
98
|
+
def play=(play)
|
99
|
+
@play, old = play, @play
|
100
|
+
fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"play",old,@play))
|
101
|
+
end
|
102
|
+
|
103
|
+
def pause=(pause)
|
104
|
+
@pause, old = pause, @pause
|
105
|
+
fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"pause",old,@pause))
|
106
|
+
end
|
107
|
+
|
108
|
+
def stop=(stop)
|
109
|
+
@stop, old = stop, @stop
|
110
|
+
fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"stop",old,@stop))
|
111
|
+
end
|
112
|
+
|
76
113
|
def play
|
77
114
|
end
|
78
115
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.4
|
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-07-
|
11
|
+
date: 2016-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: druzy-mvc
|