/// Compiles Csound input files (such as an orchestra and score, or CSD) as directed by the supplied command-line arguments , but does not perform them.
/// This function cannot be called during performance, and before a repeated call, csoundReset() needs to be called.
/// # Arguments
/// * `args` A slice containing the arguments  to be passed to csound
/// # Returns
/// A error message in case of failure
Compiles Csound input files (such as an orchestra and score, or CSD) as directed by the supplied command-line arguments , but does not perform them.
This function cannot be called during performance, and before a repeated call, csoundReset() needs to be called.
Compiles Csound input files ( such as an orchestra and score or CSD ) as directed by the supplied command - line arguments but does not perform them . This function cannot be called during performance and before a repeated call csoundReset () needs to be called .
pub fn compile<T>(&self, args: &[T]) -> Result<(), String>
    where
        T: AsRef<str> + std::fmt::Debug,
    {
        if args.is_empty() {
            return Err("Not enough arguments".into());
        }
        let arguments: Vec<CString> = args
            .iter()
            .map(|arg| CString::new(arg.as_ref()))
            .filter_map(Result::ok)
            .collect();
        let mut args_raw: Vec<*const c_char> = arguments.iter().map(|arg| arg.as_ptr()).collect();
        let argv: *mut *const c_char = args_raw.as_mut_ptr();
        unsafe {
            match csound_sys::csoundCompile(self.engine.csound, args_raw.len() as c_int, argv) {
                CSOUND_STATUS::CSOUND_SUCCESS => Ok(()),
                _ => Err(format!("Can't compile csound arguments: {:?}", args)),
            }
        }
    }
pub fn compile < T > ( & self , args : & [ T ] ) -> Result < ( ) , String > where T : AsRef < str > + std :: fmt :: Debug , { if args . is_empty ( ) { return Err ( " " . into ( ) ) ; } let arguments : Vec < CString > = args . iter ( ) . map ( | arg | CString :: new ( arg . as_ref ( ) ) ) . filter_map ( Result :: ok ) . collect ( ) ; let mut args_raw : Vec < * const c_char > = arguments . iter ( ) . map ( | arg | arg . as_ptr ( ) ) . collect ( ) ; let argv : * mut * const c_char = args_raw . as_mut_ptr ( ) ; unsafe { match csound_sys :: csoundCompile ( self . engine . csound , args_raw . len ( ) as c_int , argv ) { CSOUND_STATUS :: CSOUND_SUCCESS => Ok ( ( ) ) , _ => Err ( format ! ( " " args ) ) , } } }
Compiles Csound input files (such as an orchestra and score, or CSD) as directed by the supplied command-line arguments , but does not perform them.
Compiles Csound input files ( such as an orchestra and score or CSD ) as directed by the supplied command - line arguments but does not perform them .
A error message in case of failure
A error message in case of failure
&self
args
&[T]