vlc-client 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile +1 -1
- data/lib/vlc-client/client/media_controls.rb +23 -0
- data/lib/vlc-client/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: 9147dc5e6a15d08a05df809ff663b6742745c74d
|
4
|
+
data.tar.gz: c17e805e48164003a0e41799bc76fbb0929932e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32ae8d3654604c60d1fada63aae4c5d6700227cfbace78a6e4b41157804267ec9f3d890de13973fc126f2ac4dd2d85b8b91aaf18d523d26c0055a863d2259449
|
7
|
+
data.tar.gz: 51fa0cc8e26e35f876158bde6e8b2a25f216cfa915c566f74652fbfdd3961ee53c642bfb1301104dba7e9e311b156d9a2fecbdce302ab6e7b2e1098d6d37d6b4
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -3,6 +3,14 @@ require 'uri'
|
|
3
3
|
module VLC
|
4
4
|
class Client
|
5
5
|
module MediaControls
|
6
|
+
# Expressions for parsing VLC's "status" command
|
7
|
+
# @api private
|
8
|
+
STATUS_MAPPING = {
|
9
|
+
file: /\( new input: file:\/\/(.*) \)/,
|
10
|
+
volume: /\( audio volume: (\d+) \)/,
|
11
|
+
state: /\( state (.*) \)/ ,
|
12
|
+
}.freeze
|
13
|
+
|
6
14
|
# Plays media or resumes playback
|
7
15
|
#
|
8
16
|
# @overload play(media)
|
@@ -105,6 +113,21 @@ module VLC
|
|
105
113
|
def volume=(level)
|
106
114
|
volume(level)
|
107
115
|
end
|
116
|
+
|
117
|
+
# @return [Hash{Symbol => String}] the mapping of status strings
|
118
|
+
# @example
|
119
|
+
# status = vlc.status
|
120
|
+
# status[:file] # => "/path/to/file/playing.mp3"
|
121
|
+
# status[:volume] # => "256"
|
122
|
+
# status[:state] # => "playing"
|
123
|
+
def status
|
124
|
+
connection.write("status")
|
125
|
+
raw_status = 3.times.collect { connection.read }
|
126
|
+
|
127
|
+
STATUS_MAPPING.keys.zip(raw_status).map do |k, s|
|
128
|
+
[k, STATUS_MAPPING[k].match(s)[1]]
|
129
|
+
end.to_h
|
130
|
+
end
|
108
131
|
end
|
109
132
|
end
|
110
133
|
end
|
data/lib/vlc-client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vlc-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Guinada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: vlc-client allows to control VLC media player over TCP
|
14
14
|
email:
|