pub trait ControlSurface: Debug {
Show 39 methods fn get_type_string(&self) -> Option<&ReaperStr> { ... } fn get_desc_string(&self) -> Option<&ReaperStr> { ... } fn get_config_string(&self) -> Option<&ReaperStr> { ... } fn close_no_reset(&self) { ... } fn run(&mut self) { ... } fn set_track_list_change(&self) { ... } fn set_surface_volume(&self, args: SetSurfaceVolumeArgs) { ... } fn set_surface_pan(&self, args: SetSurfacePanArgs) { ... } fn set_surface_mute(&self, args: SetSurfaceMuteArgs) { ... } fn set_surface_selected(&self, args: SetSurfaceSelectedArgs) { ... } fn set_surface_solo(&self, args: SetSurfaceSoloArgs) { ... } fn set_surface_rec_arm(&self, args: SetSurfaceRecArmArgs) { ... } fn set_play_state(&self, args: SetPlayStateArgs) { ... } fn set_repeat_state(&self, args: SetRepeatStateArgs) { ... } fn set_track_title(&self, args: SetTrackTitleArgs<'_>) { ... } fn get_touch_state(&self, args: GetTouchStateArgs) -> bool { ... } fn set_auto_mode(&self, args: SetAutoModeArgs) { ... } fn reset_cached_vol_pan_states(&self) { ... } fn on_track_selection(&self, args: OnTrackSelectionArgs) { ... } fn is_key_down(&self, args: IsKeyDownArgs) -> bool { ... } unsafe fn extended(&self, args: ExtendedArgs) -> i32 { ... } fn ext_set_input_monitor(&self, args: ExtSetInputMonitorArgs) -> i32 { ... } fn ext_set_fx_param(&self, args: ExtSetFxParamArgs) -> i32 { ... } fn ext_set_fx_param_rec_fx(&self, args: ExtSetFxParamArgs) -> i32 { ... } fn ext_set_fx_enabled(&self, args: ExtSetFxEnabledArgs) -> i32 { ... } fn ext_set_send_volume(&self, args: ExtSetSendVolumeArgs) -> i32 { ... } fn ext_set_send_pan(&self, args: ExtSetSendPanArgs) -> i32 { ... } fn ext_set_recv_volume(&self, args: ExtSetRecvVolumeArgs) -> i32 { ... } fn ext_set_recv_pan(&self, args: ExtSetRecvPanArgs) -> i32 { ... } fn ext_set_pan_ex(&self, args: ExtSetPanExArgs) -> i32 { ... } fn ext_set_focused_fx(&self, args: ExtSetFocusedFxArgs) -> i32 { ... } fn ext_set_last_touched_fx(&self, args: ExtSetLastTouchedFxArgs) -> i32 { ... } fn ext_set_fx_open(&self, args: ExtSetFxOpenArgs) -> i32 { ... } fn ext_set_fx_change(&self, args: ExtSetFxChangeArgs) -> i32 { ... } fn ext_set_bpm_and_play_rate(&self, args: ExtSetBpmAndPlayRateArgs) -> i32 { ... } fn ext_track_fx_preset_changed(
        &self,
        args: ExtTrackFxPresetChangedArgs
    ) -> i32 { ... } fn ext_supports_extended_touch(&self, _: ExtSupportsExtendedTouchArgs) -> i32 { ... } fn ext_reset(&self, _: ExtResetArgs) -> i32 { ... } fn ext_set_project_marker_change(
        &self,
        _: ExtSetProjectMarkerChangeArgs
    ) -> i32 { ... }
}
Expand description

Consumers need to implement this trait in order to get notified about various REAPER events.

All callbacks are invoked in the main thread.

See plugin_register_add_csurf_inst.

Provided Methods

Should return the control surface type.

Must be a simple unique string with only A-Z, 0-9, no spaces or other characters.

Return None if this is a control surface behind the scenes.

Should return the control surface description.

Should be a human readable description, can include instance-specific information.

Return None if this is a control surface behind the scenes.

Should return a string of configuration data.

Return None if this is a control surface behind the scenes.

Should close the control surface without sending reset messages.

Prevent reset being sent in the destructor.

Called on each main loop cycle.

Called about 30 times per second.

Called when the track list has changed.

This is called for each track once.

Called when the volume of a track has changed.

Called when the pan of a track has changed.

Called when a track has been muted or unmuted.

Called when a track has been selected or unselected.

Called when a track has been soloed or unsoloed.

If it’s the master track, it means “any solo”.

Called when a track has been armed or unarmed for recording.

Called when the transport state has changed (playing, paused, recording).

Called when repeat has been enabled or disabled.

Called when a track name has changed.

This is regularly queried by REAPER for touch automation mode in order to determine whether the parameter on the given track should still write automation or not.

The main use case are touch-sensitive motor faders.

Called when the automation mode of the current track has changed.

Should flush the control states.

Called after multiple tracks have been selected (seems to be batched).

Doesn’t seem to be called though when using crate::Reaper::set_track_selected.

Should return whether the given modifier key is currently pressed on the surface.

Generic method which is called for many kinds of events. Prefer implementing the type-safe ext_ methods instead!

reaper-rs calls this method only if you didn’t process the event already in one of the ext_ methods. The meaning of the return value depends on the particular event type (args.call). In any case, returning 0 means that the event has not been handled.

Safety

Implementing this is unsafe because you need to deal with raw pointers.

Called when the input monitoring mode of a track has has changed.

Called when a parameter of an FX in the normal FX chain has changed its value.

For REAPER < 5.95 this is also called for an FX in the input FX chain. In this case there’s no way to know whether the given FX index refers to the normal or input FX chain.

Called when a parameter of an FX in the input FX chain has changed its value.

Only called for REAPER >= 5.95.

Called when a an FX has been enabled or disabled.

Called when the volume of a track send has changed.

Called when the pan of a track send has changed.

Called when the volume of a track receive has changed.

Called when the pan of a track receive has changed.

Called when the pan of a track has changed.

If a control surface supports this, it should ignore set_surface_pan.

Called when a certain FX has gained focus.

Called when a certain FX has been touched.

Called when the user interface of a certain FX has been opened.

Called when an FX has been added, removed or when it changed its position in the chain.

Called when the master tempo or play rate has changed.

Called when a preset of a track FX has been selected.

Since REAPER v6.12+dev0617

Should return 1 if get_touch_state() wants to deal with parameters other than volume and pan (at the moment this is width only).

Clear all surface state and reset (harder reset than set_track_list_change).

Called whenever project markers are changed.

Implementors