sonic-pi-cli 0.0.4 → 0.0.5
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/lib/sonic_pi.rb +6 -9
- 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: 9baf05899bbbce4df8a843d4751c0c9bfa08a552
|
4
|
+
data.tar.gz: b49222531c954d2751a907aa1aef977f22536cc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4a170127eb3d8f89bd4e543aefb53bcc9c0fe78ffeeec69efb761366aecd6ea833b909bd6e9601b7531fcbec23a98ac7ab9413f93449f4efc8f7216105bc823
|
7
|
+
data.tar.gz: 0f37817499349e424c64408d8abf232657b67b0fc1952c64ab61f72a2af7e15c4321ac67ac48d3b9f514e89a9370d7e77dc372308d2c697b1b6bff5fe51b3730
|
data/lib/sonic_pi.rb
CHANGED
@@ -11,18 +11,17 @@ class SonicPi
|
|
11
11
|
GUI_ID = 'SONIC_PI_CLI'
|
12
12
|
|
13
13
|
def run(command)
|
14
|
-
|
14
|
+
send_command(RUN_COMMAND, command)
|
15
15
|
end
|
16
16
|
|
17
17
|
def stop
|
18
|
-
|
18
|
+
send_command(STOP_COMMAND)
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_connection!
|
22
22
|
begin
|
23
23
|
OSC::Server.new(PORT)
|
24
24
|
abort("ERROR: Sonic Pi is not listening on #{PORT} - is it running?")
|
25
|
-
|
26
25
|
rescue
|
27
26
|
# everything is good
|
28
27
|
end
|
@@ -31,15 +30,13 @@ class SonicPi
|
|
31
30
|
private
|
32
31
|
|
33
32
|
def client
|
34
|
-
client ||= OSC::Client.new(SERVER, PORT)
|
33
|
+
@client ||= OSC::Client.new(SERVER, PORT)
|
35
34
|
end
|
36
35
|
|
37
|
-
def
|
38
|
-
OSC::Message.new(
|
36
|
+
def send_command(call_type, command=nil)
|
37
|
+
prepared_command = OSC::Message.new(call_type, GUI_ID, command)
|
38
|
+
client.send(prepared_command)
|
39
39
|
end
|
40
40
|
|
41
|
-
def stop_command
|
42
|
-
OSC::Message.new(STOP_COMMAND, GUI_ID)
|
43
|
-
end
|
44
41
|
end
|
45
42
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sonic-pi-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Johnstone
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.2.
|
56
|
+
rubygems_version: 2.2.5
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Sonic Pi CLI
|