druzy-protocol 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/druzy/protocol/device.rb +42 -0
- data/lib/druzy/protocol/version.rb +1 -1
- data/lib/druzy/protocol.rb +4 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 539b9e733fb595056bb3f421452ad09b85b5b170
|
4
|
+
data.tar.gz: 59e0261aff526a962e7e3fb7918f67ff1762ef42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7023e03259b8ef4675662c4f0e5a19c3ee4624f5e8737eed6acdb4ea9a098b2b6736d7a02ee3e8bc3ea0874db093efb3b8faa733ea1cac1290a962d22e7d97b
|
7
|
+
data.tar.gz: 263d5c47419794c2cd19762b304cfcdae9861c796d0eb85b4f03df66c8ecd298f417f358df3b9ae5f4145fd551b05456e1727d8fee33c8ecb6f52ce15b84fd17
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Druzy
|
2
|
+
module Protocol
|
3
|
+
|
4
|
+
class Device
|
5
|
+
attr_reader :identifier, :protocol, :name, :icon
|
6
|
+
|
7
|
+
def initialize(identifier,protocol,name,icon)
|
8
|
+
@identifier=identifier
|
9
|
+
@protocol=protocol
|
10
|
+
@name=name
|
11
|
+
@icon=icon
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Renderer < Device
|
16
|
+
attr_accessor :duration, :time_position, :volume, :volume_min, :volume_max, :mute
|
17
|
+
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)
|
18
|
+
super(identifier,protocol,name,icon)
|
19
|
+
@duration=duration
|
20
|
+
@time_position=time_position
|
21
|
+
@volume=volume
|
22
|
+
@volume_min=volume_min
|
23
|
+
@volume_max=volume_max
|
24
|
+
@mute=mute
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
def play
|
29
|
+
end
|
30
|
+
|
31
|
+
def pause
|
32
|
+
end
|
33
|
+
|
34
|
+
def stop
|
35
|
+
end
|
36
|
+
|
37
|
+
def send(file)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
data/lib/druzy/protocol.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'druzy/protocol/version'
|
2
|
+
require 'druzy/protocol/device'
|
2
3
|
|
3
4
|
module Druzy
|
4
5
|
module Protocol
|
@@ -6,9 +7,11 @@ module Druzy
|
|
6
7
|
class Discoverer
|
7
8
|
@@discoverers=[]
|
8
9
|
@@plugin_dir=File.dirname(__FILE__)+'/protocol/plugin/'
|
10
|
+
#@@plugin_dir="/usr/lib/ruby/vendor_ruby/druzy"+"/protocol/plugin/"
|
9
11
|
|
10
12
|
def self.get_discoverers
|
11
13
|
Dir[File.join(@@plugin_dir, '*.rb')].each {|file| require "druzy/protocol/plugin/"+File.basename(file,"*.rb")}
|
14
|
+
return @@discoverers
|
12
15
|
end
|
13
16
|
|
14
17
|
def self.inherited(klass)
|
@@ -28,9 +31,6 @@ module Druzy
|
|
28
31
|
def restart_discoverer
|
29
32
|
end
|
30
33
|
end
|
31
|
-
|
32
|
-
class Device
|
33
|
-
|
34
|
-
end
|
34
|
+
|
35
35
|
end
|
36
36
|
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: 0.0
|
4
|
+
version: 1.0.0
|
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-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -46,6 +46,7 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- lib/druzy/protocol.rb
|
49
|
+
- lib/druzy/protocol/device.rb
|
49
50
|
- lib/druzy/protocol/version.rb
|
50
51
|
homepage: https://github.com/druzy/ruby-druzy-protocol
|
51
52
|
licenses:
|