Banuba SDK
Loading...
Searching...
No Matches
bnb::interfaces::effect_manager Class Referenceabstract

Public Member Functions

virtual void add_error_listener (const std::shared_ptr< error_listener > &error_listener)=0
 Add callback to receive errors messages from Effect Player.
 
virtual void remove_error_listener (const std::shared_ptr< error_listener > &error_listener)=0
 Remove callback to receive errors messages from Effect Player.
 
virtual void add_hint_listener (const std::shared_ptr< hint_listener > &hint_listener)=0
 Add callback to receive user-visible messages from effects.
 
virtual void remove_hint_listener (const std::shared_ptr< hint_listener > &hint_listener)=0
 Remove callback to receive user-visible messages from effects.
 
virtual void add_effect_event_listener (const std::shared_ptr< effect_event_listener > &effect_event_listener)=0
 Add callback to receive events from effect.
 
virtual void remove_effect_event_listener (const std::shared_ptr< effect_event_listener > &effect_event_listener)=0
 Remove callback to receive events from effect.
 
virtual void add_effect_activated_listener (const std::shared_ptr< effect_activated_listener > &effect_activated_listener)=0
 Add callback to receive notifications on effect change.
 
virtual void remove_effect_activated_listener (const std::shared_ptr< effect_activated_listener > &effect_activated_listener)=0
 Remove callback to receive notifications on effect change.
 
virtual std::shared_ptr< effectcreate_effect (const std::string &work_dir) const =0
 Create empty effect.
 
virtual void set_current_effect (const std::shared_ptr< effect > &effect)=0
 Set current effect.
 
virtual std::shared_ptr< effectload (const std::string &url)=0
 Load and activate effect sync.
 
virtual std::shared_ptr< effectload_async (const std::string &url)=0
 Load effect async, activate in the draw() call when it will be ready.
 
virtual std::shared_ptr< reload_resultreload_config (const std::string &config)=0
 Reload current effect config from the string provided.
 
virtual void unload (const std::shared_ptr< effect > &effect)=0
 Unload effect from cache.
 
virtual std::shared_ptr< effectcurrent () const =0
 Get active effect Thread-safe.
 
virtual void update (bool sync)=0
 Update effect loading state.
 
virtual::bnb::interfaces::size effect_size () const =0
 Get current effect size Thread-safe.
 
virtual::bnb::interfaces::size surface_size () const =0
 Get current surface size Thread-safe.
 
virtual float effect_volume () const =0
 Get effect audio volume.
 
virtual void set_effect_volume (float volume)=0
 Set effect audio volume.
 
virtual void set_effect_size (int32_t fx_width, int32_t fx_height)=0
 Changes effect player render size, should be called on render thread.
 
virtual void set_render_surface (const surface_data &data)=0
 set different render surfaces.
 
virtual void disable_surface_presentation ()=0
 disable surface presentation.
 

Static Public Member Functions

static effect_info get_effect_info (const std::string &url)
 Get effect info.
 

Detailed Description

Definition at line 27 of file effect_manager.hpp.

Constructor & Destructor Documentation

◆ ~effect_manager()

virtual bnb::interfaces::effect_manager::~effect_manager ( )
inlinevirtual

Definition at line 29 of file effect_manager.hpp.

29{}

Member Function Documentation

◆ add_effect_activated_listener()

virtual void bnb::interfaces::effect_manager::add_effect_activated_listener ( const std::shared_ptr< effect_activated_listener > & effect_activated_listener)
pure virtual

Add callback to receive notifications on effect change.

Thread-safe. May be called from any thread

◆ add_effect_event_listener()

virtual void bnb::interfaces::effect_manager::add_effect_event_listener ( const std::shared_ptr< effect_event_listener > & effect_event_listener)
pure virtual

Add callback to receive events from effect.

Thread-safe. May be called from any thread

◆ add_error_listener()

virtual void bnb::interfaces::effect_manager::add_error_listener ( const std::shared_ptr< error_listener > & error_listener)
pure virtual

Add callback to receive errors messages from Effect Player.

Thread-safe. May be called from any thread

◆ add_hint_listener()

virtual void bnb::interfaces::effect_manager::add_hint_listener ( const std::shared_ptr< hint_listener > & hint_listener)
pure virtual

Add callback to receive user-visible messages from effects.

You should display them on UI. Thread-safe. May be called from any thread

◆ create_effect()

virtual std::shared_ptr< effect > bnb::interfaces::effect_manager::create_effect ( const std::string & work_dir) const
pure virtual

Create empty effect.

If working directory path is empty string then effect assumed as an in-memory effect.

◆ current()

virtual std::shared_ptr< effect > bnb::interfaces::effect_manager::current ( ) const
pure virtual

Get active effect Thread-safe.

May be called from any thread

◆ disable_surface_presentation()

virtual void bnb::interfaces::effect_manager::disable_surface_presentation ( )
pure virtual

disable surface presentation.

Needed for offscreen rendering

◆ effect_size()

virtual::bnb::interfaces::size bnb::interfaces::effect_manager::effect_size ( ) const
pure virtual

Get current effect size Thread-safe.

May be called from any thread

◆ effect_volume()

virtual float bnb::interfaces::effect_manager::effect_volume ( ) const
pure virtual

Get effect audio volume.

Thread-safe. May be called from any thread

Returns
A volume in range [0, 1], where 1 means maximum volume.

◆ get_effect_info()

static effect_info bnb::interfaces::effect_manager::get_effect_info ( const std::string & url)
static

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

◆ load()

virtual std::shared_ptr< effect > bnb::interfaces::effect_manager::load ( const std::string & url)
pure virtual

Load and activate effect sync.

MUST be called from the render thread.

◆ load_async()

virtual std::shared_ptr< effect > bnb::interfaces::effect_manager::load_async ( const std::string & url)
pure virtual

Load effect async, activate in the draw() call when it will be ready.

Thread-safe. May be called from any thread.

◆ reload_config()

virtual std::shared_ptr< reload_result > bnb::interfaces::effect_manager::reload_config ( const std::string & config)
pure virtual

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.

◆ remove_effect_activated_listener()

virtual void bnb::interfaces::effect_manager::remove_effect_activated_listener ( const std::shared_ptr< effect_activated_listener > & effect_activated_listener)
pure virtual

Remove callback to receive notifications on effect change.

Thread-safe. May be called from any thread

◆ remove_effect_event_listener()

virtual void bnb::interfaces::effect_manager::remove_effect_event_listener ( const std::shared_ptr< effect_event_listener > & effect_event_listener)
pure virtual

Remove callback to receive events from effect.

Thread-safe. May be called from any thread

◆ remove_error_listener()

virtual void bnb::interfaces::effect_manager::remove_error_listener ( const std::shared_ptr< error_listener > & error_listener)
pure virtual

Remove callback to receive errors messages from Effect Player.

Thread-safe. May be called from any thread

◆ remove_hint_listener()

virtual void bnb::interfaces::effect_manager::remove_hint_listener ( const std::shared_ptr< hint_listener > & hint_listener)
pure virtual

Remove callback to receive user-visible messages from effects.

Thread-safe. May be called from any thread

◆ set_current_effect()

virtual void bnb::interfaces::effect_manager::set_current_effect ( const std::shared_ptr< effect > & effect)
pure virtual

Set current effect.

Thread-safe. May be called from any thread

◆ set_effect_size()

virtual void bnb::interfaces::effect_manager::set_effect_size ( int32_t fx_width,
int32_t fx_height )
pure virtual

Changes effect player render size, should be called on render thread.

MUST be called from the render thread

◆ set_effect_volume()

virtual void bnb::interfaces::effect_manager::set_effect_volume ( float volume)
pure virtual

Set effect audio volume.

Thread-safe. May be called from any thread

Parameters
volumeA value in range [0, 1], where 1 means maximum volume.

◆ set_render_surface()

virtual void bnb::interfaces::effect_manager::set_render_surface ( const surface_data & data)
pure virtual

set different render surfaces.

Can be treated as void*

◆ surface_size()

virtual::bnb::interfaces::size bnb::interfaces::effect_manager::surface_size ( ) const
pure virtual

Get current surface size Thread-safe.

May be called from any thread

◆ unload()

virtual void bnb::interfaces::effect_manager::unload ( const std::shared_ptr< effect > & effect)
pure virtual

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

◆ update()

virtual void bnb::interfaces::effect_manager::update ( bool sync)
pure virtual

Update effect loading state.

Parameters
syncsyncronize effect manager, block until effect loaded MUST be called from the render thread

The documentation for this class was generated from the following file: