stmm-games-doc  0.32.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
stmi::SndMgmtCapability Class Referenceabstract

Sound device manager capability. More...

Inheritance diagram for stmi::SndMgmtCapability:
Inheritance graph
[legend]

Public Member Functions

virtual int32_t getMaxPlaybackDevices () const noexcept=0
 The maximum number of playbacks the device manager supports. More...
 
virtual shared_ptr< PlaybackCapabilitygetDefaultPlayback () const noexcept=0
 The default playback capability of the device manager. More...
 
virtual bool supportsSpatialSounds () const noexcept=0
 Whether the capabilities of the devices of the device manager support sound positioning. More...
 
- Public Member Functions inherited from stmi::DeviceManagerCapability
shared_ptr< DevicegetDevice () const noexcept override
 Returns null. More...
 
virtual shared_ptr< DeviceManagergetDeviceManager () const noexcept=0
 Returns the device manager owning this capability, if any. More...
 
- Public Member Functions inherited from stmi::Capability
virtual ~Capability () noexcept=default
 
int32_t getId () const noexcept
 The capability id. More...
 
const ClassgetCapabilityClass () const noexcept
 Get the registered class of the capability instance. More...
 

Static Public Member Functions

static const Capability::ClassgetClass () noexcept
 
- Static Public Member Functions inherited from stmi::Capability
static bool isCapabilityClassIdRegistered (const std::string &sCapabilityClassId) noexcept
 Tells whether the given capability class id is registered. More...
 
static Class getCapabilityClassIdClass (const std::string &sCapabilityClassId) noexcept
 Gets the class with given class id. More...
 

Static Public Attributes

static const char *const s_sClassId
 

Protected Member Functions

 SndMgmtCapability () noexcept
 
- Protected Member Functions inherited from stmi::DeviceManagerCapability
 DeviceManagerCapability (const Class &oClass) noexcept
 
- Protected Member Functions inherited from stmi::Capability
 Capability (const Class &oClass) noexcept
 Constructor to be called from subclasses. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from stmi::Capability
static bool isCapabilityTypeRegistered (const std::type_info &oCapabilityType) noexcept
 Tells whether a capability type was registered. More...
 
static const std::type_info & getCapabilityClassIdType (const std::string &sCapabilityClassId, bool &bRegistered) noexcept
 Gets the type of the registered capability subclass associated with class id. More...
 
static std::string getCapabilityTypeClassId (const std::type_info &oType) noexcept
 Gets the class id of the given type. More...
 

Detailed Description

Sound device manager capability.

Gives information about capabilities of playback devices.

Constructor & Destructor Documentation

◆ SndMgmtCapability()

stmi::SndMgmtCapability::SndMgmtCapability ( )
protectednoexcept

Member Function Documentation

◆ getClass()

static const Capability::Class& stmi::SndMgmtCapability::getClass ( )
inlinestaticnoexcept

◆ getDefaultPlayback()

virtual shared_ptr<PlaybackCapability> stmi::SndMgmtCapability::getDefaultPlayback ( ) const
pure virtualnoexcept

The default playback capability of the device manager.

Returns
The default playback or null if unknown or there are no playback devices.

◆ getMaxPlaybackDevices()

virtual int32_t stmi::SndMgmtCapability::getMaxPlaybackDevices ( ) const
pure virtualnoexcept

The maximum number of playbacks the device manager supports.

This is usually 1 or std::numeric_limits<int32_t>::max(), but returning 1000 to mean infinite is also valid.

Example: this is used by the stmm-games library to determine whether to allow per player playback capability assignment.

Returns
The maximum number of devices with PlaybackCapability.

◆ supportsSpatialSounds()

virtual bool stmi::SndMgmtCapability::supportsSpatialSounds ( ) const
pure virtualnoexcept

Whether the capabilities of the devices of the device manager support sound positioning.

If this method returns false the position parameters of PlaybackCapability::playSound(), PlaybackCapability::setSoundPos(), PlaybackCapability::setListenerPos() are ignored.

Returns
Whether sound space is supported.

Member Data Documentation

◆ s_sClassId

const char* const stmi::SndMgmtCapability::s_sClassId
static