fn callback_wrapper<T: Host>(effect: *mut AEffect, opcode: i32, index: i32,
                             value: isize, ptr: *mut c_void, opt: f32) -> isize {
    unsafe {
        // If the effect pointer is not null and the host pointer is not null, the plugin has
        // already been initialized
        if !effect.is_null() && (*effect).reserved1 != 0 {
            let reserved = (*effect).reserved1 as *const Arc<Mutex<T>>;
            let host = &*reserved;

            let host = &mut *host.lock().unwrap();

            interfaces::host_dispatch(host, effect, opcode, index, value, ptr, opt)
        // In this case, the plugin is still undergoing initialization and so `LOAD_POINTER` is
        // dereferenced
        } else {
            // Used only during the plugin initialization
            let host = LOAD_POINTER as *const Arc<Mutex<T>>;
            let host = &*host;
            let host = &mut *host.lock().unwrap();

            interfaces::host_dispatch(host, effect, opcode, index, value, ptr, opt)
        }
    }
}
/// Function passed to plugin to handle dispatching host opcodes.
Function passed to plugin to handle dispatching host opcodes.
Function passed to plugin to handle dispatching host opcodes .
fn callback_wrapper<T: Host>(effect: *mut AEffect, opcode: i32, index: i32,
                             value: isize, ptr: *mut c_void, opt: f32) -> isize {
    unsafe {
        // If the effect pointer is not null and the host pointer is not null, the plugin has
        // already been initialized
        if !effect.is_null() && (*effect).reserved1 != 0 {
            let reserved = (*effect).reserved1 as *const Arc<Mutex<T>>;
            let host = &*reserved;
            let host = &mut *host.lock().unwrap();
            interfaces::host_dispatch(host, effect, opcode, index, value, ptr, opt)
        // In this case, the plugin is still undergoing initialization and so `LOAD_POINTER` is
        // dereferenced
        } else {
            // Used only during the plugin initialization
            let host = LOAD_POINTER as *const Arc<Mutex<T>>;
            let host = &*host;
            let host = &mut *host.lock().unwrap();
            interfaces::host_dispatch(host, effect, opcode, index, value, ptr, opt)
        }
    }
}
fn callback_wrapper < T : Host > ( effect : * mut AEffect , opcode : i32 , index : i32 , value : isize , ptr : * mut c_void , opt : f32 ) -> isize { unsafe { // If the effect pointer is not null and the host pointer is not null, the plugin has // already been initialized if ! effect . is_null ( ) && ( * effect ) . reserved1 != 0 { let reserved = ( * effect ) . reserved1 as * const Arc < Mutex < T > > ; let host = & * reserved ; let host = & mut * host . lock ( ) . unwrap ( ) ; interfaces :: host_dispatch ( host , effect , opcode , index , value , ptr , opt ) // In this case, the plugin is still undergoing initialization and so `LOAD_POINTER` is // dereferenced } else { // Used only during the plugin initialization let host = LOAD_POINTER as * const Arc < Mutex < T > > ; let host = & * host ; let host = & mut * host . lock ( ) . unwrap ( ) ; interfaces :: host_dispatch ( host , effect , opcode , index , value , ptr , opt ) } } }
Function passed to plugin to handle dispatching host opcodes.
Function passed to plugin to handle dispatching host opcodes .
effect
*mut AEffect
opcode
i32
index
i32
value
isize
ptr
*mut c_void
opt
f32
effect
*mut AEffect
opcode
i32
index
i32
value
isize
ptr
*mut c_void
opt
f32