JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
JPL::PanningService< VBAPTraits > Class Template Reference

#include <JPLSpatial/Services/PanningService.h>

Public Types

template<class Key , class T >
using FlatMapType = FlatMapWithAllocator< Key, T, std::pmr::polymorphic_allocator >
 
using Vec3Type = typename VBAPTraits::Vec3Type
 
using PannerTraits = VBAPTraits
 
using PannerType = VBAPanner2D< PannerTraits >
 
using SourceLayout = typename PannerType::SourceLayoutType
 
using PanData = typename PannerType::PanUpdateData
 
using PanDataWithOrientation = typename PannerType::PanUpdateDataWithOrientation
 

Public Member Functions

 PanningService ()=default
 
 PanningService (const PanningService &)=delete
 
PanningServiceoperator= (const PanningService &)=delete
 
JPL_INLINE const PannerTypeCreatePannerFor (ChannelMap targetChannelMap)
 
JPL_INLINE const PannerTypeGetPannerFor (ChannelMap targetChannelMap) const
 
JPL_INLINE PanEffectHandle InitializePanningEffect (const PanEffectInitParameters &initParameters)
 High level API.
 
JPL_INLINE bool ReleasePanningEffect (PanEffectHandle source)
 
JPL_INLINE bool SetPanningEffectParameters (PanEffectHandle effect, const PanEffectParameters &parameters)
 
JPL_INLINE bool SetPanningEffectSpread (PanEffectHandle effect, float spread)
 
JPL_INLINE bool EvaluateDirection (PanEffectHandle source, const Position< Vec3Type > &position, ESpatializationType spatialziationType)
 
JPL_INLINE std::span< const floatGetChannelGainsFor (PanEffectHandle source, ChannelMap targetChannelMap) const
 
JPL_INLINE std::shared_ptr< const SourceLayoutCreatePanningDataFor (SourceLayoutKey layout, PanEffectHandle source={})
 
JPL_INLINE std::shared_ptr< const SourceLayoutGetPanningDataFor (SourceLayoutKey layout) const
 
JPL_INLINE bool CreateChannelGainsFor (ChannelMap targetChannelMap, ChannelMap sourceChannelMap, std::pmr::vector< float > &outChannelGains) const
 
JPL_INLINE bool CreateChannelGainsFor (ChannelMap targetChannelMap, PanEffectHandle source)
 
JPL_INLINE std::shared_ptr< const SourceLayoutGetSourceLayoutFor (PanEffectHandle source) const
 

Member Typedef Documentation

◆ FlatMapType

template<class VBAPTraits >
template<class Key , class T >
using JPL::PanningService< VBAPTraits >::FlatMapType = FlatMapWithAllocator<Key, T, std::pmr::polymorphic_allocator>

◆ PanData

◆ PanDataWithOrientation

◆ PannerTraits

◆ PannerType

◆ SourceLayout

◆ Vec3Type

template<class VBAPTraits >
using JPL::PanningService< VBAPTraits >::Vec3Type = typename VBAPTraits::Vec3Type

Constructor & Destructor Documentation

◆ PanningService() [1/2]

template<class VBAPTraits >
JPL::PanningService< VBAPTraits >::PanningService ( )
default

◆ PanningService() [2/2]

template<class VBAPTraits >
JPL::PanningService< VBAPTraits >::PanningService ( const PanningService< VBAPTraits > &  )
delete

Member Function Documentation

◆ CreateChannelGainsFor() [1/2]

template<class VBAPTraits >
JPL_INLINE bool JPL::PanningService< VBAPTraits >::CreateChannelGainsFor ( ChannelMap  targetChannelMap,
ChannelMap  sourceChannelMap,
std::pmr::vector< float > &  outChannelGains 
) const

◆ CreateChannelGainsFor() [2/2]

template<class VBAPTraits >
JPL_INLINE bool JPL::PanningService< VBAPTraits >::CreateChannelGainsFor ( ChannelMap  targetChannelMap,
PanEffectHandle  source 
)

◆ CreatePannerFor()

template<class VBAPTraits >
JPL_INLINE auto JPL::PanningService< VBAPTraits >::CreatePannerFor ( ChannelMap  targetChannelMap)

Create panner for the target ChannelMap if it doesn't exist yet

Returns
panner for the requrested channel map, or nullptr if target channel map is invalid

◆ CreatePanningDataFor()

template<class VBAPTraits >
JPL_INLINE auto JPL::PanningService< VBAPTraits >::CreatePanningDataFor ( SourceLayoutKey  layout,
PanEffectHandle  source = {} 
)

Low level API Mainly internal functions used by high level API. May be used at user's discression to bypass high level API.

◆ EvaluateDirection()

template<class VBAPTraits >
JPL_INLINE bool JPL::PanningService< VBAPTraits >::EvaluateDirection ( PanEffectHandle  source,
const Position< Vec3Type > &  position,
ESpatializationType  spatialziationType 
)

Process channel gains for the source for all target channel maps initialized for it.

Parameters
positionposition of the source relative to listener
Returns
false if the source hanlde is invalid, true otherwise

◆ GetChannelGainsFor()

template<class VBAPTraits >
JPL_INLINE auto JPL::PanningService< VBAPTraits >::GetChannelGainsFor ( PanEffectHandle  source,
ChannelMap  targetChannelMap 
) const
Returns
channel mix map gains for the source and target channel map, empty span if source targets have never been added to the source. The span contains the gains evaluated at the last call of EvaluateDirection

◆ GetPannerFor()

template<class VBAPTraits >
JPL_INLINE auto JPL::PanningService< VBAPTraits >::GetPannerFor ( ChannelMap  targetChannelMap) const
Returns
panner for the target ChannelMap if it exists, nullptr otherwise

◆ GetPanningDataFor()

template<class VBAPTraits >
JPL_INLINE auto JPL::PanningService< VBAPTraits >::GetPanningDataFor ( SourceLayoutKey  layout) const

◆ GetSourceLayoutFor()

template<class VBAPTraits >
JPL_INLINE auto JPL::PanningService< VBAPTraits >::GetSourceLayoutFor ( PanEffectHandle  source) const

◆ InitializePanningEffect()

template<class VBAPTraits >
JPL_INLINE PanEffectHandle JPL::PanningService< VBAPTraits >::InitializePanningEffect ( const PanEffectInitParameters initParameters)

High level API.

Initialize panning effect with a source channel map and optional target channel maps. This can also be called to assign different target channel maps to the source.

Returns
handle for the panning effect interface, which may be invalid if failed to initialize data, e.g. if the source channel map is not valid.

◆ operator=()

◆ ReleasePanningEffect()

template<class VBAPTraits >
JPL_INLINE bool JPL::PanningService< VBAPTraits >::ReleasePanningEffect ( PanEffectHandle  source)

Release any data associated with the source handle.

Returns
true if anything was cleared, false if no data was associated with the handle

◆ SetPanningEffectParameters()

template<class VBAPTraits >
JPL_INLINE bool JPL::PanningService< VBAPTraits >::SetPanningEffectParameters ( PanEffectHandle  effect,
const PanEffectParameters parameters 
)

Set parameters for the panning effect to be used when EvaluateDirection is called

Returns
true if effect handle is valid and the parameters were set, false otherwise

◆ SetPanningEffectSpread()

template<class VBAPTraits >
JPL_INLINE bool JPL::PanningService< VBAPTraits >::SetPanningEffectSpread ( PanEffectHandle  effect,
float  spread 
)

Set spread parameter for the panning effect to be used when EvaluateDirection is called

Returns
true if effect handle is valid and the spead value was set, false otherwise

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