summaryrefslogtreecommitdiff
path: root/src/til_stream.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-19 22:48:33 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-21 13:33:27 -0800
commit12e2ea7549ba86893104e1b8117a2ceb50d0ebf2 (patch)
treeb6c3669bc3ff2342575b9cd8e287c964b706bffc /src/til_stream.c
parentbc2a41d33785b744181ef2fee7fb05a9525c4900 (diff)
til_{tap,stream}: introduce til_tap_t.inactive
When a driving tap becomes inactive, til_stream_tap() should be able to notice and replace the driver. An example driving tap becoming inactive would be a GNU Rocket track that once had keys in it, but then had them all deleted. This should set the inactive flag so the tap's automation can take over. This gives the user at the Rocket editor the ability to both take over from the tap automation and surrender control back, by populating vs. emptying the respective track.
Diffstat (limited to 'src/til_stream.c')
-rw-r--r--src/til_stream.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/til_stream.c b/src/til_stream.c
index 60c28d4..4109d8f 100644
--- a/src/til_stream.c
+++ b/src/til_stream.c
@@ -163,11 +163,14 @@ int til_stream_tap(til_stream_t *stream, const void *owner, const void *owner_fo
return -1;
}
- /* this looks to be our pipe, but we're not driving */
+ /* this looks to be the pipe, but we're not driving, should we be? */
+ if (pipe->driving_tap->inactive)
+ pipe->driving_tap = tap;
+
*(tap->ptr) = pipe->driving_tap->elems;
pthread_mutex_unlock(&stream->mutex);
- return 1;
+ return (tap != pipe->driving_tap);
}
}
}
© All Rights Reserved