Trait reaper_medium::ControlSurface
source · [−]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.
Provided Methods
sourcefn get_type_string(&self) -> Option<&ReaperStr>
fn get_type_string(&self) -> Option<&ReaperStr>
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.
sourcefn get_desc_string(&self) -> Option<&ReaperStr>
fn get_desc_string(&self) -> Option<&ReaperStr>
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.
sourcefn get_config_string(&self) -> Option<&ReaperStr>
fn get_config_string(&self) -> Option<&ReaperStr>
Should return a string of configuration data.
Return None
if this is a control surface behind the scenes.
sourcefn close_no_reset(&self)
fn close_no_reset(&self)
Should close the control surface without sending reset messages.
Prevent reset being sent in the destructor.
sourcefn set_track_list_change(&self)
fn set_track_list_change(&self)
Called when the track list has changed.
This is called for each track once.
sourcefn set_surface_volume(&self, args: SetSurfaceVolumeArgs)
fn set_surface_volume(&self, args: SetSurfaceVolumeArgs)
Called when the volume of a track has changed.
sourcefn set_surface_pan(&self, args: SetSurfacePanArgs)
fn set_surface_pan(&self, args: SetSurfacePanArgs)
Called when the pan of a track has changed.
sourcefn set_surface_mute(&self, args: SetSurfaceMuteArgs)
fn set_surface_mute(&self, args: SetSurfaceMuteArgs)
Called when a track has been muted or unmuted.
sourcefn set_surface_selected(&self, args: SetSurfaceSelectedArgs)
fn set_surface_selected(&self, args: SetSurfaceSelectedArgs)
Called when a track has been selected or unselected.
sourcefn set_surface_solo(&self, args: SetSurfaceSoloArgs)
fn set_surface_solo(&self, args: SetSurfaceSoloArgs)
Called when a track has been soloed or unsoloed.
If it’s the master track, it means “any solo”.
sourcefn set_surface_rec_arm(&self, args: SetSurfaceRecArmArgs)
fn set_surface_rec_arm(&self, args: SetSurfaceRecArmArgs)
Called when a track has been armed or unarmed for recording.
sourcefn set_play_state(&self, args: SetPlayStateArgs)
fn set_play_state(&self, args: SetPlayStateArgs)
Called when the transport state has changed (playing, paused, recording).
sourcefn set_repeat_state(&self, args: SetRepeatStateArgs)
fn set_repeat_state(&self, args: SetRepeatStateArgs)
Called when repeat has been enabled or disabled.
sourcefn set_track_title(&self, args: SetTrackTitleArgs<'_>)
fn set_track_title(&self, args: SetTrackTitleArgs<'_>)
Called when a track name has changed.
sourcefn get_touch_state(&self, args: GetTouchStateArgs) -> bool
fn get_touch_state(&self, args: GetTouchStateArgs) -> bool
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.
sourcefn set_auto_mode(&self, args: SetAutoModeArgs)
fn set_auto_mode(&self, args: SetAutoModeArgs)
Called when the automation mode of the current track has changed.
sourcefn reset_cached_vol_pan_states(&self)
fn reset_cached_vol_pan_states(&self)
Should flush the control states.
sourcefn on_track_selection(&self, args: OnTrackSelectionArgs)
fn on_track_selection(&self, args: OnTrackSelectionArgs)
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
.
sourcefn is_key_down(&self, args: IsKeyDownArgs) -> bool
fn is_key_down(&self, args: IsKeyDownArgs) -> bool
Should return whether the given modifier key is currently pressed on the surface.
sourceunsafe fn extended(&self, args: ExtendedArgs) -> i32
unsafe fn extended(&self, args: ExtendedArgs) -> i32
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.
sourcefn ext_set_input_monitor(&self, args: ExtSetInputMonitorArgs) -> i32
fn ext_set_input_monitor(&self, args: ExtSetInputMonitorArgs) -> i32
Called when the input monitoring mode of a track has has changed.
sourcefn ext_set_fx_param(&self, args: ExtSetFxParamArgs) -> i32
fn ext_set_fx_param(&self, args: ExtSetFxParamArgs) -> i32
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.
sourcefn ext_set_fx_param_rec_fx(&self, args: ExtSetFxParamArgs) -> i32
fn ext_set_fx_param_rec_fx(&self, args: ExtSetFxParamArgs) -> i32
Called when a parameter of an FX in the input FX chain has changed its value.
Only called for REAPER >= 5.95.
sourcefn ext_set_fx_enabled(&self, args: ExtSetFxEnabledArgs) -> i32
fn ext_set_fx_enabled(&self, args: ExtSetFxEnabledArgs) -> i32
Called when a an FX has been enabled or disabled.
sourcefn ext_set_send_volume(&self, args: ExtSetSendVolumeArgs) -> i32
fn ext_set_send_volume(&self, args: ExtSetSendVolumeArgs) -> i32
Called when the volume of a track send has changed.
sourcefn ext_set_send_pan(&self, args: ExtSetSendPanArgs) -> i32
fn ext_set_send_pan(&self, args: ExtSetSendPanArgs) -> i32
Called when the pan of a track send has changed.
sourcefn ext_set_recv_volume(&self, args: ExtSetRecvVolumeArgs) -> i32
fn ext_set_recv_volume(&self, args: ExtSetRecvVolumeArgs) -> i32
Called when the volume of a track receive has changed.
sourcefn ext_set_recv_pan(&self, args: ExtSetRecvPanArgs) -> i32
fn ext_set_recv_pan(&self, args: ExtSetRecvPanArgs) -> i32
Called when the pan of a track receive has changed.
sourcefn ext_set_pan_ex(&self, args: ExtSetPanExArgs) -> i32
fn ext_set_pan_ex(&self, args: ExtSetPanExArgs) -> i32
Called when the pan of a track has changed.
If a control surface supports this, it should ignore set_surface_pan
.
sourcefn ext_set_focused_fx(&self, args: ExtSetFocusedFxArgs) -> i32
fn ext_set_focused_fx(&self, args: ExtSetFocusedFxArgs) -> i32
Called when a certain FX has gained focus.
sourcefn ext_set_last_touched_fx(&self, args: ExtSetLastTouchedFxArgs) -> i32
fn ext_set_last_touched_fx(&self, args: ExtSetLastTouchedFxArgs) -> i32
Called when a certain FX has been touched.
sourcefn ext_set_fx_open(&self, args: ExtSetFxOpenArgs) -> i32
fn ext_set_fx_open(&self, args: ExtSetFxOpenArgs) -> i32
Called when the user interface of a certain FX has been opened.
sourcefn ext_set_fx_change(&self, args: ExtSetFxChangeArgs) -> i32
fn ext_set_fx_change(&self, args: ExtSetFxChangeArgs) -> i32
Called when an FX has been added, removed or when it changed its position in the chain.
sourcefn ext_set_bpm_and_play_rate(&self, args: ExtSetBpmAndPlayRateArgs) -> i32
fn ext_set_bpm_and_play_rate(&self, args: ExtSetBpmAndPlayRateArgs) -> i32
Called when the master tempo or play rate has changed.
sourcefn ext_track_fx_preset_changed(&self, args: ExtTrackFxPresetChangedArgs) -> i32
fn ext_track_fx_preset_changed(&self, args: ExtTrackFxPresetChangedArgs) -> i32
Called when a preset of a track FX has been selected.
Since REAPER v6.12+dev0617
sourcefn ext_supports_extended_touch(&self, _: ExtSupportsExtendedTouchArgs) -> i32
fn ext_supports_extended_touch(&self, _: ExtSupportsExtendedTouchArgs) -> i32
Should return 1
if get_touch_state()
wants to deal with parameters other than
volume and pan (at the moment this is width only).
sourcefn ext_reset(&self, _: ExtResetArgs) -> i32
fn ext_reset(&self, _: ExtResetArgs) -> i32
Clear all surface state and reset (harder reset than set_track_list_change
).
sourcefn ext_set_project_marker_change(&self, _: ExtSetProjectMarkerChangeArgs) -> i32
fn ext_set_project_marker_change(&self, _: ExtSetProjectMarkerChangeArgs) -> i32
Called whenever project markers are changed.