pub enum RegistrationObject<'a> {
Show 15 variants Api(Cow<'a, ReaperStr>, *mut c_void), ApiDef(Cow<'a, ReaperStr>, *const c_char), ApiVararg(Cow<'a, ReaperStr>, ApiVararg), HookCommand(HookCommand), HookCommand2(HookCommand2), HookPostCommand(HookPostCommand), HookPostCommand2(HookPostCommand2), Timer(TimerFunction), ToggleAction(ToggleAction), CommandId(*const c_char), Gaccel(NonNull<gaccel_register_t>), BackAccelerator(NonNull<accelerator_register_t>), FrontAccelerator(NonNull<accelerator_register_t>), CsurfInst(NonNull<IReaperControlSurface>), Custom(Cow<'a, ReaperStr>, *mut c_void),
}
Expand description

A thing that you can register at REAPER.

Variants

Api(Cow<'a, ReaperStr>, *mut c_void)

A function that you want to expose to other extensions or plug-ins.

Extract from reaper_plugin_functions.h:

if you have a function called myfunction(..) that you want to expose to other extensions or
plug-ins, use register("API_myfunction",funcaddress), and "-API_myfunction" to remove.
Other extensions then use GetFunc("myfunction") to get the function pointer.
REAPER will also export the function address to ReaScript, so your extension could supply
a Python module that provides a wrapper called RPR_myfunction(..).

ApiDef(Cow<'a, ReaperStr>, *const c_char)

A function definition that describes a function registered via Api.

Extract from reaper_plugin_functions.h:

register("APIdef_myfunction",defstring) will include your function declaration and help
in the auto-generated REAPER API header and ReaScript documentation.
defstring is four null-separated fields: return type, argument types, argument names, and
help. Example: double myfunction(char* str, int flag) would have
defstring="double\0char*,int\0str,flag\0help text for myfunction"

ApiVararg(Cow<'a, ReaperStr>, ApiVararg)

A var-arg function for exposing a function to ReaScript.

HookCommand(HookCommand)

A hook command.

Extract from reaper_plugin_functions.h:

another thing you can register is "hookcommand", which you pass a callback:
 NON_API: bool runCommand(int command, int flag);
          register("hookcommand",runCommand);
which returns TRUE to eat (process) the command.
flag is usually 0 but can sometimes have useful info depending on the message.
note: it's OK to call Main_OnCommand() within your runCommand, however you MUST check for
recursion if doing so! > in fact, any use of this hook should benefit from a simple
reentrancy test...

HookCommand2(HookCommand2)

A hook command that supports MIDI CC/mousewheel actions.

Extract from reaper_plugin_functions.h:

you can also register "hookcommand2", which you pass a callback:
 NON_API: bool onAction(KbdSectionInfo *sec, int command, int val, int valhw, int relmode,
HWND hwnd);           register("hookcommand2",onAction);
which returns TRUE to eat (process) the command.
val/valhw are used for actions learned with MIDI/OSC.
val = [0..127] and valhw = -1 for MIDI CC,
valhw >=0 for MIDI pitch or OSC with value = (valhw|val<<7)/16383.0,
relmode absolute(0) or 1/2/3 for relative adjust modes

HookPostCommand(HookPostCommand)

A hook post command.

Extract from reaper_plugin_functions.h:

to get notified when an action of the main section is performed,
you can register "hookpostcommand", which you pass a callback:
 NON_API: void postCommand(int command, int flag);
          register("hookpostcommand",postCommand);

HookPostCommand2(HookPostCommand2)

A hook post command 2.

Timer(TimerFunction)

A timer.

ToggleAction(ToggleAction)

A toggle action.

Extract from reaper_plugin.h:

register("toggleaction", toggleactioncallback) lets you register a callback function
that is called to check if an action registered by an extension has an on/off state.

callback function:
  int toggleactioncallback(int command_id);

return:
  -1=action does not belong to this extension, or does not toggle
  0=action belongs to this extension and is currently set to "off"
  1=action belongs to this extension and is currently set to "on"

CommandId(*const c_char)

A command ID for the given command name.

Extract from reaper_plugin_functions.h:

you can also register command IDs for actions,
register with "command_id", parameter is a unique string with only A-Z, 0-9,
returns command ID (or 0 if not supported/out of actions)

Gaccel(NonNull<gaccel_register_t>)

An action description and shortcut.

Extract from reaper_plugin.h:

gaccel_register_t allows you to register ("gaccel") an action into the main keyboard
section action list, and at the same time a default binding for it (accel.cmd is the
command ID, desc is the description, and accel's other parameters are the key to bind.

BackAccelerator(NonNull<accelerator_register_t>)

A record which lets you get a place in the keyboard processing queue.

FrontAccelerator(NonNull<accelerator_register_t>)

A record which lets you get the first place in the keyboard processing queue.

CsurfInst(NonNull<IReaperControlSurface>)

A hidden control surface (useful for being notified by REAPER about events).

Extract from reaper_plugin.h:

note you can also add a control surface behind the scenes with "csurf_inst"
(IReaperControlSurface*)instance

Custom(Cow<'a, ReaperStr>, *mut c_void)

If a variant is missing in this enum, you can use this custom one as a resort.

Use custom() to create this variant.

Implementations

Convenience function for creating an Api registration object.

Convenience function for creating an ApiDef registration object.

Convenience function for creating an ApiVararg registration object.

Convenience function for creating a Custom registration object.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.