[][src]Struct fpsdk::host::Host

pub struct Host { /* fields omitted */ }

Plugin host.

Implementations

impl Host[src]

pub fn new(host_ptr: *mut c_void) -> Self[src]

Initializer.

pub fn on_message<T: Message>(&mut self, tag: Tag, message: T) -> T::Return[src]

Send message to host.

See plugin::message.

pub fn on_parameter(&mut self, tag: Tag, index: usize, value: ValuePtr)[src]

Notify the host that a parameter value has changed.

In order to make your parameters recordable in FL Studio, you have to call this function whenever a parameter is changed from within your plugin (probably because the user turned a wheel or something).

  • tag - plugin's tag.
  • index - the parameter index
  • value - the new parameter value.

pub fn on_controller(&mut self, tag: Tag, index: usize, value: u16)[src]

Notify the host that an internal controller has changed.

Check out this post for more info about an internal controller implemenation.

pub fn on_hint(&mut self, tag: Tag, text: String)[src]

Let the host show a hint, as specified by the parameters.

  • tag - the plugin's tag.
  • text - the text to show as a hint.

There is one extra feature of parameter hints. It is possible to tell FL Studio to show little icons next to the hint, that have a special meaning. For the moment there are three of those. Note that these have to be inserted at the BEGINNING of the string.

  • "^a" - shows a little icon that informs the user that the parameter that the hint is about can be linked to a MIDI controller.
  • "^b" - informs the user that the parameter is recordable.
  • "^c" - shows a little smiley. No real use, just for fun.
  • "^d" - shows a mouse with the right button clicked, to denote a control that has a popup menu.
  • "^e" - shows an unhappy smiley, to use when something went wrong.
  • "^f" - shows a left-pointing arrow.
  • "^g" - shows a double right-pointing arrow, for fast forward.
  • "^h" - is an exclamation mark, for a warning to the user.
  • "^i" - is an hourglass.
  • "^j" - shows a double left-pointing arrow, for fast reverse.

pub fn midi_out(&mut self, tag: Tag, message: MidiMessage)[src]

Send a MIDI out message immediately.

To be able to use this method, you should enable MIDI out for the plugin (see InfoBuilder::midi_out) and send plugin::message::ActivateMidi to the host.

pub fn midi_out_del(&mut self, tag: Tag, message: MidiMessage)[src]

Send a delayed MIDI out message. This message will actually be sent when the MIDI tick has reached the current mixer tick.

To be able to use this method, you should enable MIDI out for the plugin (see InfoBuilder::midi_out).

pub fn loop_out(&mut self, tag: Tag, message: ValuePtr)[src]

MAY NOT WORK

Ask for a message to be dispatched to itself when the current mixing tick will be played (to synchronize stuff).

See Plugin::loop_in.

The message is guaranteed to be dispatched, however it could be sent immediately if it couldn't be buffered (it's only buffered when playing).

pub fn loop_kill(&mut self, tag: Tag, message: ValuePtr)[src]

Remove the buffered message scheduled by Host::loop_out, so that it will never be dispatched.

pub fn lock_mix(&mut self)[src]

This is a function for thread synchronization. When this is called, no more voices shall be created and there will be no more rendering until Host::unlock_mix has been called.

pub fn unlock_mix(&mut self)[src]

Unlocks the mix thread if it was previously locked with Host::lock_mix.

pub fn lock_plugin(&mut self, tag: Tag)[src]

Warning: this function is not very performant, so avoid using it if possible.

This is an alternative to Host::lock_mix. It won't freeze the audio. This function can only be called from the GUI thread!

pub fn unlock_plugin(&mut self, tag: Tag)[src]

Warning: this function is not very performant, so avoid using it if possible.

Unlocks the mix thread if it was previously locked with Host::lock_plugin.

pub fn suspend_out(&mut self)[src]

This is a function for thread synchronization. When this is called, no more voices shall be created and there will be no more rendering until Host::resume_out has been called. Unlike Host::lock_mix, this function also stops all sound.

pub fn resume_out(&mut self)[src]

Unlocks the mixer thread if it was previously locked with Host::suspend_out.

pub fn buffer(
    &mut self,
    tag: Tag,
    kind: Buffer,
    length: usize
) -> Option<&mut [[f32; 2]]>
[src]

Get one of the buffers.

  • kind the kind of the buffer you want to get (see host::Buffer).
  • length is the buffer length (use the length of the output buffer passed to the render function).

The buffers are valid only during Plugin::render (i.e. it's supposed to be used inside this method only).

pub fn voice_handler(&self) -> Arc<Mutex<Voicer>>[src]

Get Voicer

pub fn out_voice_handler(&self) -> Arc<Mutex<OutVoicer>>[src]

Get OutVoicer.

Trait Implementations

impl Debug for Host[src]

Auto Trait Implementations

impl RefUnwindSafe for Host

impl Send for Host

impl Sync for Host

impl Unpin for Host

impl UnwindSafe for Host

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.