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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fc87b39f837f0e8735889341bfd34e82587d2aa
4
- data.tar.gz: eda3ce1e29b6a63a9d379a747b5bc517235e37e2
3
+ metadata.gz: bacef736a273a0aa8ee2cfaa5b8f736a119cc5dc
4
+ data.tar.gz: b6f29afcd2ba4d9f290dc985a5c70a0521e92b50
5
5
  SHA512:
6
- metadata.gz: 383bf5699e3bf169587ef407d268a326204274abea14c2bec669371d84fa081d3afd93e996feb5a944128bba88dbc9da2cef8d70c38d56fedfd3482cbcb36bb2
7
- data.tar.gz: 1167ade1975fb7e12a3203295a754ce6a48a9ee39c4adf1a922b9a6d4ab98474975260d0cc5f7e1d9f4815edf5f41b9fd453d540a8ba4c27ab12162002759188
6
+ metadata.gz: 10d0bcb65ce15761c715bf71ad63fd4267c07e98f0b95e5f7c23a760c690bddab66155e052a09642a8c78c9bb58cfad6c3d2f63b3e06e45bc2f386be47d94370
7
+ data.tar.gz: c05ab1a5fd433fe57be51d5a43f7ea0e9d435717accd709dad8244a64b9a25bc1e6afb60d9847c765cbabaa6e4af7f0a869ad92fd2c78cb453b7e654cbf6a765
@@ -1,5 +1,5 @@
1
- require 'druzy/protocol/version'
2
- require 'druzy/protocol/device'
1
+ require_relative 'protocol/version'
2
+ require_relative 'protocol/device'
3
3
 
4
4
  module Druzy
5
5
  module Protocol
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module Druzy
2
2
  module Protocol
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
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.3
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-23 00:00:00.000000000 Z
11
+ date: 2016-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: druzy-mvc