Ocean
Ocean::Media::SoundMedium Class Referenceabstract

This class is the base class for all sound mediums. More...

Inheritance diagram for Ocean::Media::SoundMedium:

Data Structures

class  SortableSoundType
 Class allowing the sorting of several sound media types according their popularity. More...
 
class  SoundType
 Definition of a sound type composed by the sound frequency and channels. More...
 

Public Types

typedef float SoundFrequency
 Definition of a sound frequency defined in Hz. More...
 
- 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 Member Functions

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...
 
virtual float soundVolume () const =0
 Returns the volume of the sound in db. More...
 
virtual bool soundMute () const =0
 Returns whether the sound medium is in a mute state. 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 setSoundVolume (const float volume)=0
 Sets the volume of the sound in db. More...
 
virtual bool setSoundMute (const bool mute)=0
 Sets or unsets the sound medium to a mute state. 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...
 
- 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...
 
virtual bool isStarted () const =0
 Returns whether the medium is started currently. More...
 
bool isExclusive () const
 Returns whether this medium can be use exclusively. More...
 
virtual bool start ()=0
 Starts the medium. More...
 
virtual bool pause ()=0
 Pauses the medium. More...
 
virtual bool stop ()=0
 Stops the medium. More...
 
virtual Timestamp startTimestamp () const =0
 Returns the start timestamp. More...
 
virtual Timestamp pauseTimestamp () const =0
 Returns the pause timestamp. More...
 
virtual Timestamp stopTimestamp () const =0
 Returns the stop timestamp. More...
 
virtual MediumRef clone () const
 Clones this medium and returns a new independent instance of this medium. More...
 

Protected Member Functions

 SoundMedium (const std::string &url)
 Creates a new sound 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 Attributes

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...
 
- 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...
 

Additional Inherited Members

- 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...
 

Detailed Description

This class is the base class for all sound mediums.

Member Typedef Documentation

◆ SoundFrequency

Definition of a sound frequency defined in Hz.

Constructor & Destructor Documentation

◆ SoundMedium()

Ocean::Media::SoundMedium::SoundMedium ( const std::string &  url)
explicitprotected

Creates a new sound medium by a given url.

Parameters
urlUrl of the sound medium

Member Function Documentation

◆ hasSound()

bool Ocean::Media::SoundMedium::hasSound ( ) const
inline

Returns whether the object holds a sound.

Returns
True, if so

◆ preferredSoundBitsPerSample()

unsigned int Ocean::Media::SoundMedium::preferredSoundBitsPerSample ( ) const
inline

Returns the preferred bits per sound sample.

Returns
Preferred bits per sound sample

◆ preferredSoundChannels()

unsigned int Ocean::Media::SoundMedium::preferredSoundChannels ( ) const
inline

Returns the preferred number of sound channels.

Returns
Preferred sound channels

◆ preferredSoundFrequency()

SoundMedium::SoundFrequency Ocean::Media::SoundMedium::preferredSoundFrequency ( ) const
inline

Returns the preferred sound frequency in Hz.

Returns
Preferred sound frequency

◆ setPreferredSoundBitsPerSample()

virtual bool Ocean::Media::SoundMedium::setPreferredSoundBitsPerSample ( const unsigned int  bits)
virtual

Sets the preferred bits per sound sample.

Parameters
bitsPreferred bits per sound sample
Returns
True, if succeeded

◆ setPreferredSoundChannels()

virtual bool Ocean::Media::SoundMedium::setPreferredSoundChannels ( const unsigned int  channels)
virtual

Sets the preferred number of sound channels.

Parameters
channelsPreferred sound channels
Returns
True, if succeeded

◆ setPreferredSoundFrequency()

virtual bool Ocean::Media::SoundMedium::setPreferredSoundFrequency ( const SoundFrequency  frequency)
virtual

Sets the preferred sound frequency in Hz.

Parameters
frequencyPreferred sound frequency
Returns
True, if succeeded

◆ setSoundMute()

virtual bool Ocean::Media::SoundMedium::setSoundMute ( const bool  mute)
pure virtual

◆ setSoundVolume()

virtual bool Ocean::Media::SoundMedium::setSoundVolume ( const float  volume)
pure virtual

◆ soundBitsPerSample()

unsigned int Ocean::Media::SoundMedium::soundBitsPerSample ( ) const
inline

Returns the number of bits per sample.

Returns
Number of bits per sample

◆ soundChannels()

unsigned int Ocean::Media::SoundMedium::soundChannels ( ) const
inline

Returns the number of sound channels.

Returns
Number of channels

◆ soundFrequency()

SoundMedium::SoundFrequency Ocean::Media::SoundMedium::soundFrequency ( ) const
inline

Returns the frequency of the sound in Hz.

Returns
Sound frequency in Hz

◆ soundMute()

◆ soundVolume()

Field Documentation

◆ mediumPreferredSoundType

SoundType Ocean::Media::SoundMedium::mediumPreferredSoundType
protected

Preferred sound type.

◆ mediumSoundTimestamp

Timestamp Ocean::Media::SoundMedium::mediumSoundTimestamp
protected

Timestamp of the recent sound frame.

◆ mediumSoundType

SoundType Ocean::Media::SoundMedium::mediumSoundType
protected

Actual sound type.

◆ mediumSoundTypeTimestamp

Timestamp Ocean::Media::SoundMedium::mediumSoundTypeTimestamp
protected

Timestamp of the recent sound frame type.


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