Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request capability to specify additional flags for AudioIn, AudioOut, MidiIn and MidiOut types #187

Open
xkr47 opened this issue Aug 20, 2023 · 0 comments

Comments

@xkr47
Copy link

xkr47 commented Aug 20, 2023

Currently I cannot add the IS_TERMINAL flag to AudioIn — and if I create my own variant and unsafe impl PortSpec for it, I lose all the as_slice() etc helper methods provided.

Could e.g. implement like:

pub struct AudioIn(PortFlags);

impl AudioIn {
    /// # Example
    /// ```
    /// let spec = jack::AudioIn::with_extra_port_flags(jack::PortFlags::IS_TERMINAL);
    /// let audio_out_port = client.register_port("out", spec).unwrap();
    /// ```
    pub fn with_extra_port_flags(flags: PortFlags) -> Self {
        Self(flags)
    }
}

unsafe impl PortSpec for AudioIn {
    fn jack_flags(&self) -> PortFlags {
        PortFlags::IS_INPUT.union(self.0)
    }
}

Since it seemed the examples suggest using AudioIn::default() to construct instances I think this would not be considered API breakage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant