eeeeeta / sqa-jack

JACK bindings for Rust
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

rust-jack #1

Closed wmedrano closed 7 years ago

wmedrano commented 7 years ago

I notice that you are wrapping jack-sys.

Is there any way rust-jack can meet your needs instead?

eeeeeta commented 7 years ago

@wmedrano I suppose it could. However, the APIs of rust-jack and sqa-jack do differ, although the functionality is obviously identical - for example, you do a whole lot of futzing around with PortSpecs and such to differentiate port types and owners (in particular, why does a Port have a ptr to its owning client?), whereas sqa-jack's definition of a JackPort is literally:

#[derive(Copy, Clone, Debug)]
pub struct JackPort {
    ptr: *mut jack_port_t,
}

Personally, I think the rust-jack API introduces a bit of unnecessary complexity. Alright, it's probably better to have type safety wrt not trying to get the buffer of someone else's port. Maybe I'm just putting too much burden on the user to not mess up ;P But some of the type shenanigans I find a bit ridiculous: why do you need AudioInPort when a simple ProcessScope::get_buf(&AudioInSpec) would suffice? sqa-jack's bindings, on the other hand, are a plainer and lighter abstraction over what the JACK API offers.

Yes, it's possible for me to use rust-jack. I'm not going to, though, because although it seems like a very nice set of bindings, I can't be bothered to port my code to your API (because I'm lazy, c.f. the featureset of your bindings vs. mine) and I disagree with some of your design decisions. Thanks for your concern in trying to stop me reimplementing a whole bunch of stuff for nothing, though :)