audiofox 1.1.0

Cross platform audio capture made easy!
Documentation
// SPDX-License-Identifier: GPL-2.0-or-later WITH Classpath-exception-2.0
// Audiofox, the audio capturer!
// Copyright (c) 2026 foxberries

/// Macro for filtering for successful responses from a [`mpsc::channel`](std::sync::mpsc::channel).
macro_rules! receive {
    ($receiver:expr, $pattern:pat => $success:expr) => {{
        match $receiver.recv()? {
            $pattern => Ok($success),
            Response::Error(err) => Err(err),
            response => Err(anyhow::anyhow!(
                "Expected {}, got {:?}",
                stringify!($pattern),
                response
            )),
        }
    }};
}

/// Macro for sending commands to and filtering for successful responses from a 
/// [`mpsc::channel`](std::sync::mpsc::channel).
macro_rules! roundtrip {
    ($sender:expr, $receiver:expr, $command:expr, $pattern:pat => $success:expr) => {{
        send!($sender, $command)?;
        receive!($receiver, $pattern => $success)
    }};
}