mpv 0.0.1 → 0.0.2
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/README.md +5 -2
- data/lib/mpv.rb +1 -1
- data/lib/mpv/server.rb +1 -1
- data/lib/mpv/session.rb +19 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4417184570b34fbc47e80a7fdd12beaaceef5549
|
4
|
+
data.tar.gz: 3c3e132b9f249b4796adfe38b4506c95f8c4adfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9c5dcd380e9b84cbfc251a622c4bd54b5546944e89ec7f6ea55ddd777e42d6af707b693c03d301c13657dc8e4bde8a903c19128b22e3fb038d61973231c5e72
|
7
|
+
data.tar.gz: 2c95ed9002d056bed2102b30413f8a0ad91b70c7d48fd2fa5fc57f691ad2bf9870f50b93c1b9e3663333f941b268efc323d41a5cf17ada67bbde612adfacd0b4
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
ruby-mpv
|
2
2
|
========
|
3
3
|
|
4
|
+
[](https://badge.fury.io/rb/mpv)
|
5
|
+
|
4
6
|
A ruby library for controlling mpv processes.
|
5
7
|
|
6
8
|
### Installation
|
@@ -11,9 +13,10 @@ $ gem install mpv
|
|
11
13
|
|
12
14
|
### Example
|
13
15
|
|
14
|
-
For full documentation, please see the
|
16
|
+
For full documentation, please see the
|
17
|
+
[RubyDocs](http://www.rubydoc.info/gems/mpv/).
|
15
18
|
|
16
|
-
```
|
19
|
+
```ruby
|
17
20
|
# this will be called every time mpv sends an event back over the socket
|
18
21
|
def event(event)
|
19
22
|
puts "look ma! a callback: #{event}"
|
data/lib/mpv.rb
CHANGED
data/lib/mpv/server.rb
CHANGED
@@ -28,7 +28,7 @@ module MPV
|
|
28
28
|
@pid = Process.spawn("mpv", *@args)
|
29
29
|
end
|
30
30
|
|
31
|
-
# @return [Boolean]
|
31
|
+
# @return [Boolean] whether or not the mpv process is running
|
32
32
|
def running?
|
33
33
|
begin
|
34
34
|
!!@pid && Process.waitpid(@pid, Process::WNOHANG).nil?
|
data/lib/mpv/session.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
require "forwardable"
|
2
|
+
|
1
3
|
module MPV
|
2
4
|
# Represents a combined mpv "server" and "client" communicating over
|
3
5
|
# JSON IPC.
|
4
6
|
class Session
|
7
|
+
extend Forwardable
|
8
|
+
|
5
9
|
# @return [String] the path of the socket being used for communication
|
6
10
|
attr_reader :socket_path
|
7
11
|
|
@@ -27,5 +31,20 @@ module MPV
|
|
27
31
|
|
28
32
|
@client = Client.new(@socket_path)
|
29
33
|
end
|
34
|
+
|
35
|
+
# @!method running?
|
36
|
+
# @return (see MPV::Server#running?)
|
37
|
+
# @see MPV::Server#running?
|
38
|
+
def_delegators :@server, :running?
|
39
|
+
|
40
|
+
# @!method callbacks
|
41
|
+
# @return (see MPV::Client#callbacks)
|
42
|
+
# @see MPV::Client#callbacks
|
43
|
+
def_delegators :@client, :callbacks
|
44
|
+
|
45
|
+
# @!method quit!
|
46
|
+
# @return (see MPV::Client#quit!)
|
47
|
+
# @see MPV::Client#quit!
|
48
|
+
def_delegators :@client, :quit!
|
30
49
|
end
|
31
50
|
end
|