fast_osc 0.0.10 → 0.0.11
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/ext/fast_osc/fast_osc_wrapper.c +11 -3
- data/lib/fast_osc/version.rb +1 -1
- data/test/fast_osc_test.rb +3 -3
- 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: 3615d5a4fa5494a0ad2cfafe7c7bb143d5a277a4
|
4
|
+
data.tar.gz: 38ebafa5000ef23eacf2dfefd99808958483f3ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83a69f85ba11e17f26731b7eec9e439686a44ec757ab631841916de3044fbadea7ca03299588ff4d7f59b4f8f0eb7afe499e55d1b5f5164365b2da7385c76cf7
|
7
|
+
data.tar.gz: 2a00b2f5615da6bdd7c7e5eb69fb06a3e3b44014a78e29c539969789a29a143a040b9f19f2b39976306fd8b6171b81b0f2019faa9311a7b0cde978a5e67a3231
|
@@ -1,7 +1,9 @@
|
|
1
1
|
#include <ruby.h>
|
2
|
+
#include <ruby/encoding.h>
|
2
3
|
#include <rtosc.h>
|
3
4
|
#include <rtosc.c>
|
4
5
|
|
6
|
+
|
5
7
|
// Allocate VALUE variables to hold the modules we'll create. Ruby values
|
6
8
|
// are all of type VALUE. Qnil is the C representation of Ruby's nil.
|
7
9
|
VALUE FastOsc = Qnil;
|
@@ -73,6 +75,8 @@ VALUE method_fast_osc_decode_single_message(VALUE self, VALUE msg) {
|
|
73
75
|
itr = rtosc_itr_begin(data);
|
74
76
|
VALUE output = rb_ary_new();
|
75
77
|
VALUE args_output = rb_ary_new();
|
78
|
+
VALUE string_arg;
|
79
|
+
int enc;
|
76
80
|
|
77
81
|
VALUE path = rb_str_new2(rtosc_path(data));
|
78
82
|
|
@@ -94,7 +98,11 @@ VALUE method_fast_osc_decode_single_message(VALUE self, VALUE msg) {
|
|
94
98
|
rb_ary_push(args_output, rb_float_new(next_val.val.f));
|
95
99
|
break;
|
96
100
|
case 's' :
|
97
|
-
|
101
|
+
string_arg = rb_str_new2(next_val.val.s);
|
102
|
+
enc = rb_enc_find_index("UTF-8");
|
103
|
+
rb_enc_associate_index(string_arg, enc);
|
104
|
+
|
105
|
+
rb_ary_push(args_output, string_arg);
|
98
106
|
break;
|
99
107
|
case 'b' :
|
100
108
|
rb_ary_push(args_output, rb_str_new((const char*)next_val.val.b.data, next_val.val.b.len));
|
@@ -237,7 +245,7 @@ VALUE method_fast_osc_encode_single_message(int argc, VALUE* argv, VALUE self) {
|
|
237
245
|
|
238
246
|
char buffer[max_buffer_size];
|
239
247
|
|
240
|
-
int len;
|
248
|
+
unsigned long int len;
|
241
249
|
if(RSTRING_LEN(tagstring)) {
|
242
250
|
len = rtosc_amessage(buffer, sizeof(buffer), c_address, StringValueCStr(tagstring), output_args);
|
243
251
|
} else {
|
@@ -267,7 +275,7 @@ VALUE method_fast_osc_encode_single_bundle(int argc, VALUE* argv, VALUE self) {
|
|
267
275
|
uint64_t tt = ruby_time_to_osc_timetag(timetag);
|
268
276
|
char output_buffer[bufsize];
|
269
277
|
|
270
|
-
int len = rtosc_bundle(output_buffer, bufsize, tt, no_of_elems, StringValuePtr(message));
|
278
|
+
unsigned long int len = rtosc_bundle(output_buffer, bufsize, tt, no_of_elems, StringValuePtr(message));
|
271
279
|
|
272
280
|
VALUE output = rb_str_new(output_buffer, len);
|
273
281
|
|
data/lib/fast_osc/version.rb
CHANGED
data/test/fast_osc_test.rb
CHANGED
@@ -5,7 +5,7 @@ require 'date'
|
|
5
5
|
class FastOscTest < Minitest::Test
|
6
6
|
def setup
|
7
7
|
@path = "/thisisatest"
|
8
|
-
@args = ["", 1, 2.0, "baz"]
|
8
|
+
@args = ["", 1, 2.0, "baz", "▁▃▅▇"]
|
9
9
|
@timestamp = Date.parse("1st Jan 1990").to_time
|
10
10
|
|
11
11
|
@msg0 = OSC::Message.new(@path).encode
|
@@ -40,8 +40,8 @@ class FastOscTest < Minitest::Test
|
|
40
40
|
def test_that_it_decodes_a_single_message_with_args
|
41
41
|
path, args = FastOsc.decode_single_message(@encoded_msg1)
|
42
42
|
|
43
|
-
|
44
|
-
|
43
|
+
assert_equal path, @path
|
44
|
+
assert_equal args, @args
|
45
45
|
end
|
46
46
|
|
47
47
|
def test_that_it_encodes_a_single_bundle
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_osc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xavier Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|