aboutsummaryrefslogtreecommitdiff
path: root/osc.lv2/osc.lv2
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-10-02 13:43:36 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-10-02 13:43:36 +0200
commitb44b934d5daf5b924cc9170da1b9e25aa6532241 (patch)
tree5d13e733bf2680dfdf84a18ac2ddbf951d3b78ef /osc.lv2/osc.lv2
parent7202b9bf1922d3d67fd603e3d53e8db44e1bcdc1 (diff)
parent2bb70055135af57ff1e429a042f7e08322f65c1a (diff)
downloadsynthpod-b44b934d5daf5b924cc9170da1b9e25aa6532241.tar.xz
Merge commit '2bb70055135af57ff1e429a042f7e08322f65c1a' into master
Diffstat (limited to 'osc.lv2/osc.lv2')
-rw-r--r--osc.lv2/osc.lv2/reader.h3
-rw-r--r--osc.lv2/osc.lv2/stream.h25
2 files changed, 26 insertions, 2 deletions
diff --git a/osc.lv2/osc.lv2/reader.h b/osc.lv2/osc.lv2/reader.h
index 7a8456b5..ae46dfa9 100644
--- a/osc.lv2/osc.lv2/reader.h
+++ b/osc.lv2/osc.lv2/reader.h
@@ -580,6 +580,9 @@ _lv2_osc_trees_internal(LV2_OSC_Reader *reader, const char *path, const char *fr
LV2_OSC_Arg *arg, const LV2_OSC_Tree *trees, void *data)
{
const char *ptr = strchr(from, '/');
+ const char *pattern = strpbrk(from, "*?[]{}/");
+ const bool has_pattern = pattern && (pattern[0] != '/');
+ (void)has_pattern; //FIXME
const size_t len = ptr
? (size_t)(ptr - from)
diff --git a/osc.lv2/osc.lv2/stream.h b/osc.lv2/osc.lv2/stream.h
index c1339c0d..47d338a7 100644
--- a/osc.lv2/osc.lv2/stream.h
+++ b/osc.lv2/osc.lv2/stream.h
@@ -1374,17 +1374,38 @@ lv2_osc_stream_run(LV2_OSC_Stream *stream)
return ev;
}
+static int
+lv2_osc_stream_get_file_descriptors(LV2_OSC_Stream *stream, int fds [2])
+{
+ if(!fds)
+ {
+ return 1;
+ }
+
+ fds[0] = stream->sock;
+ fds[1] = stream->fd;
+
+ return 0;
+}
+
static LV2_OSC_Enum
lv2_osc_stream_pollin(LV2_OSC_Stream *stream, int timeout_ms)
{
+ int fd [2];
+
+ if(lv2_osc_stream_get_file_descriptors(stream, fd) != 0)
+ {
+ return LV2_OSC_STREAM_ERRNO(LV2_OSC_NONE, EBADF);
+ }
+
struct pollfd fds [2] = {
[0] = {
- .fd = stream->sock,
+ .fd = fd[0],
.events = POLLIN,
.revents = 0
},
[1] = {
- .fd = stream->fd,
+ .fd = fd[1],
.events = POLLIN,
.revents = 0
}