pub trait CustomPcmSource {
Show 24 methods fn duplicate(&mut self) -> Option<OwnedPcmSource>; fn is_available(&mut self) -> bool; fn get_type(&mut self) -> &ReaperStr; fn set_file_name(&mut self, args: SetFileNameArgs<'_>) -> bool; fn get_num_channels(&mut self) -> Option<u32>; fn get_sample_rate(&mut self) -> Option<Hz>; fn get_length(&mut self) -> DurationInSeconds; fn properties_window(&mut self, args: PropertiesWindowArgs) -> i32; fn get_samples(&mut self, args: GetSamplesArgs<'_>); fn get_peak_info(&mut self, args: GetPeakInfoArgs<'_>); fn save_state(&mut self, args: SaveStateArgs<'_>); fn load_state(
        &mut self,
        args: LoadStateArgs<'_>
    ) -> Result<(), Box<dyn Error>>; fn peaks_clear(&mut self, args: PeaksClearArgs); fn peaks_build_begin(&mut self) -> bool; fn peaks_build_run(&mut self) -> bool; fn peaks_build_finish(&mut self); fn set_available(&mut self, args: SetAvailableArgs) { ... } fn get_file_name(&mut self) -> Option<&ReaperStr> { ... } fn get_source(&mut self) -> Option<PcmSource> { ... } fn set_source(&mut self, args: SetSourceArgs) { ... } fn get_length_beats(&mut self) -> Option<DurationInBeats> { ... } fn get_bits_per_sample(&mut self) -> u32 { ... } fn get_preferred_position(&mut self) -> Option<PositionInSeconds> { ... } unsafe fn extended(&mut self, args: ExtendedArgs) -> i32 { ... }
}
Expand description

Consumers can implement this trait in order to provide own PCM source types.

Required Methods

Return true if supported. This will only be called when offline.

Return number of channels.

Return preferred sample rate. If None then it is assumed to be silent (or MIDI).

Length in seconds.

Unstable!!!

Called by the peaks building UI to build peaks for files.

Unstable!!! Return true if building is opened, otherwise it may mean building isn’t necessary.

Unstable!!! Return true if building should continue.

Called when done.

Provided Methods

If called with false, close files etc.

Optional.

Return None if no file name (not purely a file).

Return parent source, if any.

Length in beats if supported.

Return bits/sample, if available. Only used for metadata purposes, since everything returns as doubles anyway.

Return None if not supported.

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.

Implementors