//! Standalone entry point for the Cagire plugin.

use cagire_plugins::CagirePlugin;
use nih_plug::prelude::*;

fn main() {
    let mut args: Vec<String> = std::env::args().collect();
    // Default to 44100 Hz — nih-plug defaults to 48000 which causes CoreAudio
    // to deliver mismatched buffer sizes, crashing the standalone wrapper.
    if !args.iter().any(|a| a == "--sample-rate" || a == "-r") {
        args.extend(["--sample-rate".into(), "44100".into()]);
    }
    nih_export_standalone_with_args::<CagirePlugin, _>(args);
}
