ProtoFlux:Play: Difference between revisions

From Resonite Wiki
m fix types
Added flux node and rudimentary explanations.
Line 1: Line 1:
{{#Invoke:ProtoFlux|GenerateUI
{{#Invoke:ProtoFlux|GenerateUI
|Name=Play
|Name=Play And Wait
|Category=Media
|Category=Media
|Inputs=
|Inputs=
[
[
{"Name":"*", "Type":"Call"},
{"Name":"*", "Type":"AsyncCall"},
{"Name":"Target", "Type":"IPlayable"}
{"Name":"Target", "Type":"IPlayable"}
]
]
|Outputs=
|Outputs=
[
[
{"Name":"Next", "Type":"Continuation"}
{"Name":"OnStarted", "Type":"AsyncCall"},
{"Name":"OnPlaybackFinished", "Type":"Continuation"}
]
]
|}}
|}}


Play is a ProtoFlux node that plays the provided Target ([[Type:IPlayable|IPlayable]]) when * ([[Impulses|Call]]) is called.
PlayAndWait is a ProtoFlux node that plays the provided Target ([[Type:IPlayable|IPlayable]]) when * ([[Impulses|IAsyncOperation]]) is called, and then can continue with an [[Impulses|Continuation]].
Play doesn't change the current [[ProtoFlux:Position|Position Output]], it essentially sets [[ProtoFlux:Is Playing|Is Playing Output]] to true.


== Inputs ==
== Inputs ==


=== * ([[Impulses|Call]]) ===
=== * ([[Impulses|IAsyncOperation]]) ===


Impulse this to play the provided Target ([[Type:IPlayable|IPlayable]])
Impulse this to play the provided Target ([[Type:IPlayable|IPlayable]])
Line 28: Line 28:
== Outputs ==
== Outputs ==


=== Next ([[Impulses|Continuation]]) ===
=== OnStarted ([[Impulses|AsyncCall]]) ===
 
An async impulse that impulses when the target starts playing.
 
=== OnPlaybackFinished ([[Impulses|Continuation]]) ===
 
Sends an impulse after the target finishes playback.


Sends an impulse after * ([[Impulses|Call]]) was called and it successfully started playing.


== Examples ==
== Examples ==
<gallery widths=480px heights=480px>
File:ProtoFlux_example_simple_audio_playback.webp|A simple setup that allows control of the playback of an audio clip utilizing this node along with some others.
</gallery>


[[Category:ProtoFlux:Media]]
[[Category:ProtoFlux:Media]]

Revision as of 21:29, 4 May 2024

Play And Wait
*
OnStarted
Target
OnPlaybackFinished
Media

PlayAndWait is a ProtoFlux node that plays the provided Target (IPlayable) when * (IAsyncOperation) is called, and then can continue with an Continuation.

Inputs

* (IAsyncOperation)

Impulse this to play the provided Target (IPlayable)

Target (IPlayable)

The IPlayable to play.

Outputs

OnStarted (AsyncCall)

An async impulse that impulses when the target starts playing.

OnPlaybackFinished (Continuation)

Sends an impulse after the target finishes playback.


Examples