pub unsafe fn plugin_register_add(
        &mut self,
        object: RegistrationObject,
    ) -> ReaperFunctionResult<i32> {
        let reg = object.into_raw();
        let key_ptr = reg.key.as_ptr();
        let value = reg.value;
        self.plugin_registrations.insert(reg);
        let result = self.reaper.low().plugin_register(key_ptr, value);
        if result == 0 {
            return Err(ReaperFunctionError::new("couldn't register thing"));
        }
        Ok(result)
    }
/// This is the primary function for plug-ins to register things.
///
/// *Things* can be keyboard shortcuts, project importers etc. Typically you register things
/// when the plug-in is loaded.
///
/// It is not recommended to use this function directly because it's unsafe. Consider using
/// the safe convenience functions instead. They all start with `plugin_register_add_`.
///
/// The meaning of the return value depends very much on the actual thing being registered. In
/// most cases it just returns 1. In any case, if it's not 0, *reaper-rs* translates this into
/// an error.
///
/// Also see [`plugin_register_remove()`].
///
/// # Errors
///
/// Returns an error if the registration failed.
///
/// # Safety
///
/// REAPER can crash if you pass an invalid pointer or if it dangles during the time it
/// is registered. So you must ensure that the registered thing lives long enough and
/// has a stable address in memory. Additionally, mutation of the thing while it is registered
/// can lead to subtle bugs.
///
/// [`plugin_register_remove()`]: #method.plugin_register_remove
This is the primary function for plug-ins to register things.
Things* can be keyboard shortcuts, project importers etc. Typically you register things
when the plug-in is loaded.

It is not recommended to use this function directly because it's unsafe. Consider using
the safe convenience functions instead. They all start with `plugin_register_add_`.

The meaning of the return value depends very much on the actual thing being registered. In
most cases it just returns 1. In any case, if it's not 0, *reaper-rs* translates this into
an error.


This is the primary function for plug - ins to register things . Things * can be keyboard shortcuts project importers etc . Typically you register things when the plug - in is loaded . It is not recommended to use this function directly because it ' s unsafe . Consider using the safe convenience functions instead . They all start with ` plugin_register_add_ ` . The meaning of the return value depends very much on the actual thing being registered . In most cases it just returns 1 . In any case if it ' s not 0 * reaper - rs * translates this into an error .
pub unsafe fn plugin_register_add(
        &mut self,
        object: RegistrationObject,
    ) -> ReaperFunctionResult<i32> {
        let reg = object.into_raw();
        let key_ptr = reg.key.as_ptr();
        let value = reg.value;
        self.plugin_registrations.insert(reg);
        let result = self.reaper.low().plugin_register(key_ptr, value);
        if result == 0 {
            return Err(ReaperFunctionError::new("couldn't register thing"));
        }
        Ok(result)
    }
pub unsafe fn plugin_register_add ( & mut self , object : RegistrationObject , ) -> ReaperFunctionResult < i32 > { let reg = object . into_raw ( ) ; let key_ptr = reg . key . as_ptr ( ) ; let value = reg . value ; self . plugin_registrations . insert ( reg ) ; let result = self . reaper . low ( ) . plugin_register ( key_ptr , value ) ; if result == 0 { return Err ( ReaperFunctionError :: new ( " " ) ) ; } Ok ( result ) }
This is the primary function for plug-ins to register things.
This is the primary function for plug - ins to register things .
&mut self
object
RegistrationObject
&mut self
object
RegistrationObject
errors
Returns an error if the registration failed.
Returns an error if the registration failed .
safety
REAPER can crash if you pass an invalid pointer or if it dangles during the time it
is registered. So you must ensure that the registered thing lives long enough and
has a stable address in memory. Additionally, mutation of the thing while it is registered
can lead to subtle bugs.

[`plugin_register_remove()`]: #method.plugin_register_remove
REAPER can crash if you pass an invalid pointer or if it dangles during the time it is registered . So you must ensure that the registered thing lives long enough and has a stable address in memory . Additionally mutation of the thing while it is registered can lead to subtle bugs . [ ` plugin_register_remove () ` ] : #method . plugin_register_remove