You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
I was writing a VST for a HW synth to convert CCs to SysEx automation and vice-versa (while letting irrelevant msgs through unchanged).
Due to the lifetime on Event/SysExEvent.payload I couldn't just map incoming msgs to outgoing msgs, but had to push those msgs that should be mapped to SysEx to a separate vec, and then send that one afterwards (so I have two calls to send_buffer.send_events, one for the filtered input events and one for the payloads vec mapped to SysExEvents).
But I want to preserve the ordering between the input and output msgs, i.e. not change the order of the param automation.
So this requires being able to return SysExEvents where the payload's lifetime comes from a vec outside of the mapping closure.
But currently it's not possible, I get:
error: cannot infer an appropriate lifetime for lifetime parameter in function call due to conflicting requirements
note: ...so that closure can access payloads
note: first, the lifetime cannot outlive the lifetime '_ as defined on the body at 336:44...
note: but, the lifetime must be valid for the method call at 336:17...
note: ...so that a type/lifetime parameter is in scope
The lifetime that the incoming events have comes from this:
I was writing a VST for a HW synth to convert CCs to SysEx automation and vice-versa (while letting irrelevant msgs through unchanged).
Due to the lifetime on
Event
/SysExEvent.payload
I couldn't justmap
incoming msgs to outgoing msgs, but had to push those msgs that should be mapped to SysEx to a separate vec, and then send that one afterwards (so I have two calls tosend_buffer.send_events
, one for the filtered input events and one for the payloads vec mapped toSysExEvent
s).But I want to preserve the ordering between the input and output msgs, i.e. not change the order of the param automation.
So this requires being able to return
SysExEvent
s where the payload's lifetime comes from a vec outside of themap
ping closure.But currently it's not possible, I get:
The lifetime that the incoming events have comes from this:
vst-rs/src/api.rs
Lines 454 to 457 in d7d5b6f
Any thoughts what the best approach would be, to make this kind of use case more convenient?
The text was updated successfully, but these errors were encountered: