blip  0.1
Vibrator Class Reference

A class representing a vibration (haptic feedback) device. More...

#include <Vibrator.hpp>

Public Member Functions

 ~Vibrator ()
 Destructor. More...
 
void setVibrating (bool on)
 Turn the vibration function on or off. More...
 
bool isVibrating ()
 Test if the vibration function is currently on. More...
 
void setFrequency (uint_t milliHertz)
 Set the vibration frequency. More...
 
uint_t getFrequency ()
 Get the vibration frequency. More...
 
bool supportsFrequency () const
 Test if the device supports changing the vibration frequency. More...
 
uint_t getMinFrequency () const
 Get the minimum frequency supported by the device. More...
 
uint_t getMaxFrequency () const
 Get the maximum frequency supported by the device. More...
 
void setIntensity (uint_t perMille)
 Set the vibration intensity. More...
 
uint_t getIntensity ()
 Get the vibration intensity. More...
 
bool supportsIntensity () const
 Test if the device supports changing the vibration intensity. More...
 
uint_t getMinIntensity () const
 Get the minimum intensity supported by the device. More...
 
uint_t getMaxIntensity () const
 Get the maximum intensity supported by the device. More...
 

Detailed Description

A class representing a vibration (haptic feedback) device.

Instances of this class may be obtained from an AudioEngine.

NOTE: As of Android platform version 9, the OpenSL implementation is missing vibrator functionality.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ ~Vibrator()

~Vibrator ( )

Destructor.

Member Function Documentation

◆ getFrequency()

uint_t getFrequency ( )

Get the vibration frequency.

Returns
The current frequency, in millihertz.
Exceptions
AudioExceptionIf an error occurs.

◆ getIntensity()

uint_t getIntensity ( )

Get the vibration intensity.

Returns
The intensity, in per mille (tenths of 1%).
Exceptions
AudioExceptionIf an error occurs.

◆ getMaxFrequency()

uint_t getMaxFrequency ( ) const
inline

Get the maximum frequency supported by the device.

Returns
The maximum frequency, in millihertz.

◆ getMaxIntensity()

uint_t getMaxIntensity ( ) const
inline

Get the maximum intensity supported by the device.

Returns
The maximum intensity, in per mille (tenths of 1%).

◆ getMinFrequency()

uint_t getMinFrequency ( ) const
inline

Get the minimum frequency supported by the device.

Returns
The minimum frequency, in millihertz.

◆ getMinIntensity()

uint_t getMinIntensity ( ) const
inline

Get the minimum intensity supported by the device.

Returns
The minimum intensity, in per mille (tenths of 1%).

◆ isVibrating()

bool isVibrating ( )

Test if the vibration function is currently on.

Returns
true if vibratuion is on, false otherwise.
Exceptions
AudioExceptionIf an error occurs.

◆ setFrequency()

void setFrequency ( uint_t  milliHertz)

Set the vibration frequency.

Parameters
milliHertzThe new frequency, in millihertz.
Exceptions
AudioExceptionIf an error occurs.

◆ setIntensity()

void setIntensity ( uint_t  perMille)

Set the vibration intensity.

Parameters
perMilleThe new intensity, in per mille (tenths of 1%).
Exceptions
AudioExceptionIf an error occurs.

◆ setVibrating()

void setVibrating ( bool  on)

Turn the vibration function on or off.

Parameters
onA flag indicating whether to turn vibration on or off.
Exceptions
AudioExceptionIf an error occurs.

◆ supportsFrequency()

bool supportsFrequency ( ) const
inline

Test if the device supports changing the vibration frequency.

◆ supportsIntensity()

bool supportsIntensity ( ) const
inline

Test if the device supports changing the vibration intensity.


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