Ocean
Ocean::Media::Android::AAudio Class Referencefinal

This class implements an Audio class for Android. More...

Inheritance diagram for Ocean::Media::Android::AAudio:

Public Member Functions

MediumRef clone () const override
 Clones this movie medium and returns a new independent instance of this medium. More...
 
bool start () override
 Starts the medium. More...
 
bool pause () override
 Pauses the medium. More...
 
bool stop () override
 Stops the medium. More...
 
bool isStarted () const override
 Returns whether the medium is started currently. More...
 
double duration () const override
 Returns the duration of the finite medium. More...
 
double normalDuration () const override
 Returns the duration without speed consideration. More...
 
double position () const override
 Returns the recent position of the finite medium. More...
 
bool setPosition (const double position) override
 Sets the recent position of the finite medium. More...
 
float speed () const override
 Returns the speed of the finite medium. More...
 
bool setSpeed (const float speed) override
 Sets the speed of the finite medium. More...
 
bool setLoop (const bool value) override
 Sets whether the medium has to be played in a loop. More...
 
float soundVolume () const override
 Returns the volume of the sound in db. More...
 
bool soundMute () const override
 Returns whether the sound medium is in a mute state. More...
 
bool setSoundVolume (const float volume) override
 Sets the volume of the sound in db. More...
 
bool setSoundMute (const bool mute) override
 Sets or un-sets the sound medium to a mute state. More...
 
Timestamp startTimestamp () const override
 Returns the start timestamp. More...
 
Timestamp pauseTimestamp () const override
 Returns the pause timestamp. More...
 
Timestamp stopTimestamp () const override
 Returns the stop timestamp. More...
 
- Public Member Functions inherited from Ocean::Media::Medium
const std::string & url () const
 Returns the url of the medium. More...
 
bool isValid () const
 Returns whether the medium is valid. More...
 
const std::string & library () const
 Returns the name of the owner library. More...
 
Type type () const
 Returns the type of the medium. More...
 
bool isType (const Type type) const
 Returns whether a medium has a given type. More...
 
bool isExclusive () const
 Returns whether this medium can be use exclusively. More...
 
- Public Member Functions inherited from Ocean::Media::FiniteMedium
bool loop () const
 Returns whether the medium is played in a loop. More...
 
virtual bool taskFinished () const
 Returns whether a previous task has been finished. More...
 
- Public Member Functions inherited from Ocean::Media::SoundMedium
bool hasSound () const
 Returns whether the object holds a sound. More...
 
unsigned int soundChannels () const
 Returns the number of sound channels. More...
 
SoundFrequency soundFrequency () const
 Returns the frequency of the sound in Hz. More...
 
unsigned int soundBitsPerSample () const
 Returns the number of bits per sample. More...
 
unsigned int preferredSoundChannels () const
 Returns the preferred number of sound channels. More...
 
SoundFrequency preferredSoundFrequency () const
 Returns the preferred sound frequency in Hz. More...
 
unsigned int preferredSoundBitsPerSample () const
 Returns the preferred bits per sound sample. More...
 
virtual bool setPreferredSoundChannels (const unsigned int channels)
 Sets the preferred number of sound channels. More...
 
virtual bool setPreferredSoundFrequency (const SoundFrequency frequency)
 Sets the preferred sound frequency in Hz. More...
 
virtual bool setPreferredSoundBitsPerSample (const unsigned int bits)
 Sets the preferred bits per sound sample. More...
 

Protected Member Functions

 AAudio (const SLEngineItf &slEngineInterface, const std::string &url)
 Creates a new medium by a given url. More...
 
 ~AAudio () override
 Destructs the live video object. More...
 
bool initialize (const SLEngineItf &slEngineInterface)
 Initializes the audio and all corresponding resources. More...
 
bool release ()
 Releases the audio and all corresponding resources. More...
 
void callbackFunction (SLPlayItf slCaller, SLuint32 slEvent)
 The callback function for position events. More...
 
- Protected Member Functions inherited from Ocean::Media::Android::AMedium
 AMedium (const std::string &url)
 Creates a new medium by a given url. More...
 
- Protected Member Functions inherited from Ocean::Media::Medium
 Medium (const Medium &medium)=delete
 Disabled copy constructor. More...
 
 Medium (const std::string &url)
 Creates a new medium by a given url. More...
 
virtual ~Medium ()
 Destructs a medium. More...
 
Mediumoperator= (const Medium &medium)=delete
 Disabled copy operator. More...
 
- Protected Member Functions inherited from Ocean::Media::Audio
 Audio (const std::string &url)
 Creates a new audio by a given url. More...
 
- Protected Member Functions inherited from Ocean::Media::FiniteMedium
 FiniteMedium (const std::string &url)
 Creates a new finite medium by a given url. More...
 
- Protected Member Functions inherited from Ocean::Media::SoundMedium
 SoundMedium (const std::string &url)
 Creates a new sound medium by a given url. More...
 

Static Protected Member Functions

static void staticCallbackFunction (SLPlayItf slCaller, void *context, SLuint32 slEvent)
 The static callback function for position events. More...
 

Protected Attributes

Timestamp startTimestamp_ = Timestamp(false)
 Start timestamp. More...
 
Timestamp pauseTimestamp_ = Timestamp(false)
 Pause timestamp. More...
 
Timestamp stopTimestamp_ = Timestamp(false)
 Stop timestamp. More...
 
SLObjectItf slPlayer_ = nullptr
 The SL player object. More...
 
SLPlayItf slPlayInterface_ = nullptr
 The SL player interface. More...
 
SLObjectItf slOutputMix_ = nullptr
 The SL output mix object. More...
 
SLSeekItf slSeekInterface_ = nullptr
 The SL seek interface. More...
 
SLVolumeItf slVolumeInterface_ = nullptr
 The SL volume interface. More...
 
- Protected Attributes inherited from Ocean::Media::Medium
std::string url_
 Url of the medium. More...
 
std::string libraryName_
 Name of the owner library. More...
 
bool isValid_ = false
 Determines whether the medium is valid. More...
 
Type type_ = MEDIUM
 Type of the medium. More...
 
Lock lock_
 Medium lock. More...
 
- Protected Attributes inherited from Ocean::Media::FiniteMedium
bool loop_ = false
 Determines whether the medium is played in a loop. More...
 
- Protected Attributes inherited from Ocean::Media::SoundMedium
SoundType mediumSoundType
 Actual sound type. More...
 
SoundType mediumPreferredSoundType
 Preferred sound type. More...
 
Timestamp mediumSoundTimestamp
 Timestamp of the recent sound frame. More...
 
Timestamp mediumSoundTypeTimestamp
 Timestamp of the recent sound frame type. More...
 

Friends

class ALibrary
 

Additional Inherited Members

- Public Types inherited from Ocean::Media::Medium
enum  Type : uint32_t {
  MEDIUM = 0u , FRAME_MEDIUM = 1u << 0u , SOUND_MEDIUM = 1u << 1u , FINITE_MEDIUM = 1u << 2u ,
  LIVE_MEDIUM = 1u << 3u , CONFIG_MEDIUM = 1u << 4u , AUDIO = (1u << 5u) | FINITE_MEDIUM | SOUND_MEDIUM , IMAGE = (1u << 6u) | FRAME_MEDIUM ,
  PIXEL_IMAGE = (1u << 7u) | FRAME_MEDIUM , BUFFER_IMAGE = (1u << 8u) | FRAME_MEDIUM , IMAGE_SEQUENCE = (1u << 9u) | FRAME_MEDIUM | FINITE_MEDIUM , LIVE_AUDIO = (1u << 10u) | LIVE_MEDIUM | SOUND_MEDIUM ,
  LIVE_VIDEO = (1u << 11u) | LIVE_MEDIUM | FRAME_MEDIUM , MICROPHONE = (1u << 12u) | LIVE_MEDIUM , MOVIE = (1u << 13u) | FINITE_MEDIUM | FRAME_MEDIUM | SOUND_MEDIUM
}
 Definition of different medium types. More...
 
- Public Types inherited from Ocean::Media::SoundMedium
typedef float SoundFrequency
 Definition of a sound frequency defined in Hz. More...
 
- Static Public Member Functions inherited from Ocean::Media::Android::AMedium
static bool areInterfaceIdsIdentical (const SLInterfaceID &interfaceId0, const SLInterfaceID &interfaceId1)
 Returns whether two interface ids are identical. More...
 
static std::string toAString (const SLInterfaceID &interfaceId)
 Returns the hex string of an interface id,. More...
 
- Static Public Member Functions inherited from Ocean::Media::Medium
static std::string convertType (const Type type)
 Converts a medium type to a unique string. More...
 
static Type convertType (const std::string &type)
 Converts a medium type string to a medium type. More...
 
- Static Public Attributes inherited from Ocean::Media::Android::AMedium
static constexpr SLInterfaceID_ slEffectTypeNoiseSuppressorId_ = {0x58b4b260, 0x8e06, 0x11e0, 0xaa8e, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}
 Definition of the interface for Noise Suppressor (NS). More...
 
static constexpr SLInterfaceID_ slEffectTypeAcousticEchoCancelerId_ = {0x7b491460, 0x8d4d, 0x11e0, 0xbd61, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}
 Definition of the interface for Acoustic Echo Canceler (AEC). More...
 
- Static Public Attributes inherited from Ocean::Media::FiniteMedium
static constexpr float AS_FAST_AS_POSSIBLE = 0.0f
 Definition of a speed value allowing to deliver the media content as fast as possible. More...
 

Detailed Description

This class implements an Audio class for Android.

Constructor & Destructor Documentation

◆ AAudio()

Ocean::Media::Android::AAudio::AAudio ( const SLEngineItf &  slEngineInterface,
const std::string &  url 
)
explicitprotected

Creates a new medium by a given url.

Parameters
slEngineInterfaceThe interface of the SL engine, must be valid
urlUrl of the medium

◆ ~AAudio()

Ocean::Media::Android::AAudio::~AAudio ( )
overrideprotected

Destructs the live video object.

Member Function Documentation

◆ callbackFunction()

void Ocean::Media::Android::AAudio::callbackFunction ( SLPlayItf  slCaller,
SLuint32  slEvent 
)
protected

The callback function for position events.

Parameters
slCallerThe caller of the function
slEventThe actual event

◆ clone()

MediumRef Ocean::Media::Android::AAudio::clone ( ) const
overridevirtual

Clones this movie medium and returns a new independent instance of this medium.

See also
Medium::clone()

Reimplemented from Ocean::Media::Medium.

◆ duration()

double Ocean::Media::Android::AAudio::duration ( ) const
overridevirtual

Returns the duration of the finite medium.

See also
FiniteMedium::duration().

Implements Ocean::Media::FiniteMedium.

◆ initialize()

bool Ocean::Media::Android::AAudio::initialize ( const SLEngineItf &  slEngineInterface)
protected

Initializes the audio and all corresponding resources.

Parameters
slEngineInterfaceThe interface of the SL engine, must be valid
Returns
True, if succeeded

◆ isStarted()

bool Ocean::Media::Android::AAudio::isStarted ( ) const
overridevirtual

Returns whether the medium is started currently.

See also
Medium::isStarted().

Implements Ocean::Media::Medium.

◆ normalDuration()

double Ocean::Media::Android::AAudio::normalDuration ( ) const
overridevirtual

Returns the duration without speed consideration.

See also
FiniteMedium::normalDuration().

Implements Ocean::Media::FiniteMedium.

◆ pause()

bool Ocean::Media::Android::AAudio::pause ( )
overridevirtual

Pauses the medium.

See also
Medium::pause():

Implements Ocean::Media::Medium.

◆ pauseTimestamp()

Timestamp Ocean::Media::Android::AAudio::pauseTimestamp ( ) const
overridevirtual

Returns the pause timestamp.

See also
FiniteMedium::pauseTimestamp().

Implements Ocean::Media::Medium.

◆ position()

double Ocean::Media::Android::AAudio::position ( ) const
overridevirtual

Returns the recent position of the finite medium.

See also
FiniteMedium::position().

Implements Ocean::Media::FiniteMedium.

◆ release()

bool Ocean::Media::Android::AAudio::release ( )
protected

Releases the audio and all corresponding resources.

Returns
True, if succeeded

◆ setLoop()

bool Ocean::Media::Android::AAudio::setLoop ( const bool  value)
overridevirtual

Sets whether the medium has to be played in a loop.

See also
FiniteMedium::setLoop().

Reimplemented from Ocean::Media::FiniteMedium.

◆ setPosition()

bool Ocean::Media::Android::AAudio::setPosition ( const double  position)
overridevirtual

Sets the recent position of the finite medium.

See also
FiniteMedium::setPosition().

Reimplemented from Ocean::Media::FiniteMedium.

◆ setSoundMute()

bool Ocean::Media::Android::AAudio::setSoundMute ( const bool  mute)
overridevirtual

Sets or un-sets the sound medium to a mute state.

See also
SoundMedium::setSoundMute().

Implements Ocean::Media::SoundMedium.

◆ setSoundVolume()

bool Ocean::Media::Android::AAudio::setSoundVolume ( const float  volume)
overridevirtual

Sets the volume of the sound in db.

See also
SoundMedium::setSoundVolume().

Implements Ocean::Media::SoundMedium.

◆ setSpeed()

bool Ocean::Media::Android::AAudio::setSpeed ( const float  speed)
overridevirtual

Sets the speed of the finite medium.

See also
FiniteMedium::setSpeed().

Reimplemented from Ocean::Media::FiniteMedium.

◆ soundMute()

bool Ocean::Media::Android::AAudio::soundMute ( ) const
overridevirtual

Returns whether the sound medium is in a mute state.

See also
SoundMedium::soundMute().

Implements Ocean::Media::SoundMedium.

◆ soundVolume()

float Ocean::Media::Android::AAudio::soundVolume ( ) const
overridevirtual

Returns the volume of the sound in db.

See also
SoundMedium::soundVolume().

Implements Ocean::Media::SoundMedium.

◆ speed()

float Ocean::Media::Android::AAudio::speed ( ) const
overridevirtual

Returns the speed of the finite medium.

See also
FiniteMedium::speed().

Implements Ocean::Media::FiniteMedium.

◆ start()

bool Ocean::Media::Android::AAudio::start ( )
overridevirtual

Starts the medium.

See also
Medium::start().

Implements Ocean::Media::Medium.

◆ startTimestamp()

Timestamp Ocean::Media::Android::AAudio::startTimestamp ( ) const
overridevirtual

Returns the start timestamp.

See also
FiniteMedium::startTimestamp().

Implements Ocean::Media::Medium.

◆ staticCallbackFunction()

static void Ocean::Media::Android::AAudio::staticCallbackFunction ( SLPlayItf  slCaller,
void *  context,
SLuint32  slEvent 
)
staticprotected

The static callback function for position events.

Parameters
slCallerThe caller of the function
contextThe callback's context
slEventThe actual event

◆ stop()

bool Ocean::Media::Android::AAudio::stop ( )
overridevirtual

Stops the medium.

See also
Medium::stop().

Implements Ocean::Media::Medium.

◆ stopTimestamp()

Timestamp Ocean::Media::Android::AAudio::stopTimestamp ( ) const
overridevirtual

Returns the stop timestamp.

See also
FiniteMedium::stopTimestamp().

Implements Ocean::Media::Medium.

Friends And Related Function Documentation

◆ ALibrary

friend class ALibrary
friend

Field Documentation

◆ pauseTimestamp_

Timestamp Ocean::Media::Android::AAudio::pauseTimestamp_ = Timestamp(false)
protected

Pause timestamp.

◆ slOutputMix_

SLObjectItf Ocean::Media::Android::AAudio::slOutputMix_ = nullptr
protected

The SL output mix object.

◆ slPlayer_

SLObjectItf Ocean::Media::Android::AAudio::slPlayer_ = nullptr
protected

The SL player object.

◆ slPlayInterface_

SLPlayItf Ocean::Media::Android::AAudio::slPlayInterface_ = nullptr
protected

The SL player interface.

◆ slSeekInterface_

SLSeekItf Ocean::Media::Android::AAudio::slSeekInterface_ = nullptr
protected

The SL seek interface.

◆ slVolumeInterface_

SLVolumeItf Ocean::Media::Android::AAudio::slVolumeInterface_ = nullptr
protected

The SL volume interface.

◆ startTimestamp_

Timestamp Ocean::Media::Android::AAudio::startTimestamp_ = Timestamp(false)
protected

Start timestamp.

◆ stopTimestamp_

Timestamp Ocean::Media::Android::AAudio::stopTimestamp_ = Timestamp(false)
protected

Stop timestamp.


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