vlc-client 0.0.1.beta2 → 0.0.1.beta.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,7 +14,7 @@ And then execute:
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
- $ gem install vlc-client
17
+ $ gem install vlc-client --pre
18
18
 
19
19
  ## Usage
20
20
 
@@ -79,6 +79,27 @@ module VLC
79
79
  connection.write("is_playing", false) == "0"
80
80
  end
81
81
 
82
+ # Queries/Sets VLC volume level
83
+ #
84
+ # @overload volume()
85
+ #
86
+ # @return [Integer] the current volume level
87
+ #
88
+ # @overload volume(level)
89
+ #
90
+ # @param [Integer] level the volume level to set
91
+ #
92
+ def volume(level = nil)
93
+ level.nil? ? Integer(connection.write("volume", false)) : connection.write("volume #{Integer(level)}")
94
+ rescue ArgumentError
95
+ level.nil? ? 0 : nil
96
+ end
97
+
98
+ # @see #volume
99
+ def volume=(level)
100
+ volume(level)
101
+ end
102
+
82
103
  private
83
104
  def media_arg(media)
84
105
  case media
@@ -1,3 +1,3 @@
1
1
  module VLC
2
- VERSION = "0.0.1.beta2"
2
+ VERSION = "0.0.1.beta.3"
3
3
  end
@@ -120,6 +120,31 @@ describe VLC::Client::MediaControls do
120
120
  vlc.title.should be_empty
121
121
  end
122
122
 
123
+ it 'reads the volume level' do
124
+ tcp = tcp_mock
125
+
126
+ tcp.should_receive(:puts).once.with('volume')
127
+ tcp.should_receive(:gets).once.and_return('100')
128
+
129
+ vlc.connect
130
+ vlc.play('http://example.org/media.mp3')
131
+ vlc.volume.should eq(100)
132
+ end
133
+
134
+ it 'sets the volume level' do
135
+ tcp = tcp_mock
136
+
137
+ tcp.should_receive(:puts).once.with('volume 150')
138
+ tcp.should_receive(:puts).once.with('volume')
139
+ tcp.should_receive(:gets).once.and_return('150')
140
+
141
+ vlc.connect
142
+ vlc.play('http://example.org/media.mp3')
143
+ vlc.volume = 150
144
+
145
+ vlc.volume.should eq(150)
146
+ end
147
+
123
148
  it 'is aware of track time' do
124
149
  tcp = tcp_mock
125
150
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vlc-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta2
4
+ version: 0.0.1.beta.3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: retryable
16
- requirement: &11273980 !ruby/object:Gem::Requirement
16
+ requirement: &9184240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *11273980
24
+ version_requirements: *9184240
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &11272940 !ruby/object:Gem::Requirement
27
+ requirement: &9183640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *11272940
35
+ version_requirements: *9183640
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &11271820 !ruby/object:Gem::Requirement
38
+ requirement: &9183040 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *11271820
46
+ version_requirements: *9183040
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: simplecov
49
- requirement: &11271200 !ruby/object:Gem::Requirement
49
+ requirement: &9182260 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *11271200
57
+ version_requirements: *9182260
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: pry
60
- requirement: &11269520 !ruby/object:Gem::Requirement
60
+ requirement: &9181580 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *11269520
68
+ version_requirements: *9181580
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
- requirement: &11268560 !ruby/object:Gem::Requirement
71
+ requirement: &9181160 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *11268560
79
+ version_requirements: *9181160
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: maruku
82
- requirement: &11267320 !ruby/object:Gem::Requirement
82
+ requirement: &9180680 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *11267320
90
+ version_requirements: *9180680
91
91
  description: vlc-client allows to control VLC media player over TCP
92
92
  email:
93
93
  - mguinada@gmail.com