Package com.banuba.sdk.effect_player
Interface EffectManager
- All Known Implementing Classes:
EffectManager.CppProxy
public interface EffectManager
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEffectActivatedListener
(EffectActivatedListener effectActivatedListener) Add callback to receive notifications on effect change.void
addEffectEventListener
(EffectEventListener effectEventListener) Add callback to receive events from effect.void
addErrorListener
(ErrorListener errorListener) Add callback to receive errors messages from Effect Player.void
addHintListener
(HintListener hintListener) Add callback to receive user-visible messages from effects.createEffect
(String workDir) Create empty effect.current()
Get active effect Thread-safe.void
disable surface presentation.Get current effect size Thread-safe.float
Get effect audio volume.static EffectInfo
getEffectInfo
(String url) Get effect info.Load and activate effect sync.Load effect async, activate in the draw() call when it will be ready.reloadConfig
(String config) Reload current effect config from the string provided.void
removeEffectActivatedListener
(EffectActivatedListener effectActivatedListener) Remove callback to receive notifications on effect change.void
removeEffectEventListener
(EffectEventListener effectEventListener) Remove callback to receive events from effect.void
removeErrorListener
(ErrorListener errorListener) Remove callback to receive errors messages from Effect Player.void
removeHintListener
(HintListener hintListener) Remove callback to receive user-visible messages from effects.void
setCurrentEffect
(Effect effect) Set current effect.void
setEffectSize
(int fxWidth, int fxHeight) Changes effect player render size, should be called on render thread.void
setEffectVolume
(float volume) Set effect audio volume.void
setRenderSurface
(SurfaceData data) set different render surfaces.Get current surface size Thread-safe.void
Unload effect from cache.void
update
(boolean sync) Update effect loading state
-
Method Details
-
addErrorListener
Add callback to receive errors messages from Effect Player. Thread-safe. May be called from any thread -
removeErrorListener
Remove callback to receive errors messages from Effect Player. Thread-safe. May be called from any thread -
addHintListener
Add callback to receive user-visible messages from effects. You should display them on UI. Thread-safe. May be called from any thread -
removeHintListener
Remove callback to receive user-visible messages from effects. Thread-safe. May be called from any thread -
addEffectEventListener
Add callback to receive events from effect. Thread-safe. May be called from any thread -
removeEffectEventListener
Remove callback to receive events from effect. Thread-safe. May be called from any thread -
addEffectActivatedListener
Add callback to receive notifications on effect change. Thread-safe. May be called from any thread -
removeEffectActivatedListener
Remove callback to receive notifications on effect change. Thread-safe. May be called from any thread -
createEffect
Create empty effect. If working directory path is empty string then effect assumed as an in-memory effect. -
setCurrentEffect
Set current effect. Thread-safe. May be called from any thread -
load
Load and activate effect sync. MUST be called from the render thread. -
loadAsync
Load effect async, activate in the draw() call when it will be ready. Thread-safe. May be called from any thread. -
reloadConfig
Reload current effect config from the string provided. If this reload is possible without effect recreation, this method will return `hot_reload == true`, otherwise `current` effect will be replaced and the method will return `hot_reload == false`. Thread-safe. May be called from any thread. -
unload
Unload effect from cache. if no currently loading effect - works the same way as load(""); launches empty effect loading. MUST be called from the render thread -
current
Get active effect Thread-safe. May be called from any thread -
update
void update(boolean sync) Update effect loading state- Parameters:
sync
- syncronize effect manager, block until effect loaded MUST be called from the render thread
-
effectSize
Get current effect size Thread-safe. May be called from any thread -
surfaceSize
Get current surface size Thread-safe. May be called from any thread -
effectVolume
float effectVolume()Get effect audio volume. Thread-safe. May be called from any thread- Returns:
- A volume in range `[0, 1]`, where `1` means maximum volume.
-
setEffectVolume
void setEffectVolume(float volume) Set effect audio volume. Thread-safe. May be called from any thread- Parameters:
volume
- A value in range `[0, 1]`, where `1` means maximum volume.
-
setEffectSize
void setEffectSize(int fxWidth, int fxHeight) Changes effect player render size, should be called on render thread. MUST be called from the render thread -
setRenderSurface
set different render surfaces. Can be treated as void* -
disableSurfacePresentation
void disableSurfacePresentation()disable surface presentation. Needed for offscreen rendering -
getEffectInfo
Get effect info. May be called before loading effect "render type" and "recognizer features" fields won't be filled Thread-safe. May be called from any thread
-