use std::path::PathBuf;
use crate::io::IoArgs;
pub fn get_output_path(
io_args: &IoArgs,
index: usize,
item_output: Option<&str>,
is_batch_mode: bool,
) -> PathBuf {
if let Some(output) = item_output {
if let Some(ref dir) = io_args.output_dir {
return dir.join(output);
}
return PathBuf::from(output);
}
if is_batch_mode {
let dir = io_args
.output_dir
.as_deref()
.unwrap_or_else(|| std::path::Path::new("."));
return dir.join(format!("output_{}.wav", index));
}
io_args.output.clone()
}