[][src]Trait reaper_medium::MediumReaperControlSurface

pub trait MediumReaperControlSurface: RefUnwindSafe + Debug {
    fn get_type_string(&self) -> Option<Cow<'static, CStr>> { ... }
fn get_desc_string(&self) -> Option<Cow<'static, CStr>> { ... }
fn get_config_string(&self) -> Option<Cow<'static, CStr>> { ... }
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_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 { ... } }

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

fn get_type_string(&self) -> Option<Cow<'static, CStr>>

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.

fn get_desc_string(&self) -> Option<Cow<'static, CStr>>

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.

fn get_config_string(&self) -> Option<Cow<'static, CStr>>

Should return a string of configuration data.

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

fn close_no_reset(&self)

Should close the control surface without sending reset messages.

Prevent reset being sent in the destructor.

fn run(&mut self)

Called on each main loop cycle.

Called about 30 times per second.

fn set_track_list_change(&self)

Called when the track list has changed.

This is called for each track once.

fn set_surface_volume(&self, _args: SetSurfaceVolumeArgs)

Called when the volume of a track has changed.

fn set_surface_pan(&self, _args: SetSurfacePanArgs)

Called when the pan of a track has changed.

fn set_surface_mute(&self, _args: SetSurfaceMuteArgs)

Called when a track has been muted or unmuted.

fn set_surface_selected(&self, _args: SetSurfaceSelectedArgs)

Called when a track has been selected or unselected.

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".

fn set_surface_rec_arm(&self, _args: SetSurfaceRecArmArgs)

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

fn set_play_state(&self, _args: SetPlayStateArgs)

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

fn set_repeat_state(&self, _args: SetRepeatStateArgs)

Called when repeat has been enabled or disabled.

fn set_track_title(&self, _args: SetTrackTitleArgs)

Called when a track name has changed.

fn get_touch_state(&self, _args: GetTouchStateArgs) -> bool

fn set_auto_mode(&self, _args: SetAutoModeArgs)

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

fn reset_cached_vol_pan_states(&self)

Should flush the control states.

fn on_track_selection(&self, _args: OnTrackSelectionArgs)

Called when a track has been selected.

fn is_key_down(&self, _args: IsKeyDownArgs) -> bool

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

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.

fn ext_set_input_monitor(&self, _args: ExtSetInputMonitorArgs) -> i32

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

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.

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.

fn ext_set_fx_enabled(&self, _args: ExtSetFxEnabledArgs) -> i32

Called when a an FX has been enabled or disabled.

fn ext_set_send_volume(&self, _args: ExtSetSendVolumeArgs) -> i32

Called when the volume of a track send has changed.

fn ext_set_send_pan(&self, _args: ExtSetSendPanArgs) -> i32

Called when the pan of a track send has changed.

fn ext_set_focused_fx(&self, _args: ExtSetFocusedFxArgs) -> i32

Called when a certain FX has gained focus.

fn ext_set_last_touched_fx(&self, _args: ExtSetLastTouchedFxArgs) -> i32

Called when a certain FX has been touched.

fn ext_set_fx_open(&self, _args: ExtSetFxOpenArgs) -> i32

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

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.

fn ext_set_bpm_and_play_rate(&self, _args: ExtSetBpmAndPlayRateArgs) -> i32

Called when the master tempo or play rate has changed.

Loading content...

Implementors

Loading content...