|
Ocean
|
This class is the base class for all sound mediums. More...
#include <SoundMedium.h>
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 | |
| using | SoundFrequency = float |
| Definition of a sound frequency defined in Hz. | |
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. | |
| unsigned int | soundChannels () const |
| Returns the number of sound channels. | |
| SoundFrequency | soundFrequency () const |
| Returns the frequency of the sound in Hz. | |
| unsigned int | soundBitsPerSample () const |
| Returns the number of bits per sample. | |
| virtual float | soundVolume () const =0 |
| Returns the volume of the sound in db. | |
| virtual bool | soundMute () const =0 |
| Returns whether the sound medium is in a mute state. | |
| unsigned int | preferredSoundChannels () const |
| Returns the preferred number of sound channels. | |
| SoundFrequency | preferredSoundFrequency () const |
| Returns the preferred sound frequency in Hz. | |
| unsigned int | preferredSoundBitsPerSample () const |
| Returns the preferred bits per sound sample. | |
| virtual bool | setSoundVolume (const float volume)=0 |
| Sets the volume of the sound in db. | |
| virtual bool | setSoundMute (const bool mute)=0 |
| Sets or unsets the sound medium to a mute state. | |
| virtual bool | setPreferredSoundChannels (const unsigned int channels) |
| Sets the preferred number of sound channels. | |
| virtual bool | setPreferredSoundFrequency (const SoundFrequency frequency) |
| Sets the preferred sound frequency in Hz. | |
| virtual bool | setPreferredSoundBitsPerSample (const unsigned int bits) |
| Sets the preferred bits per sound sample. | |
Public Member Functions inherited from Ocean::Media::Medium | |
| const std::string & | url () const |
| Returns the url of the medium. | |
| bool | isValid () const |
| Returns whether the medium is valid. | |
| const std::string & | library () const |
| Returns the name of the owner library. | |
| Type | type () const |
| Returns the type of the medium. | |
| bool | isType (const Type type) const |
| Returns whether a medium has a given type. | |
| virtual bool | isStarted () const =0 |
| Returns whether the medium is started currently. | |
| bool | isExclusive () const |
| Returns whether this medium can be use exclusively. | |
| virtual bool | start ()=0 |
| Starts the medium. | |
| virtual bool | pause ()=0 |
| Pauses the medium. | |
| virtual bool | stop ()=0 |
| Stops the medium. | |
| virtual Timestamp | startTimestamp () const =0 |
| Returns the start timestamp. | |
| virtual Timestamp | pauseTimestamp () const =0 |
| Returns the pause timestamp. | |
| virtual Timestamp | stopTimestamp () const =0 |
| Returns the stop timestamp. | |
| virtual MediumRef | clone () const |
| Clones this medium and returns a new independent instance of this medium. | |
Protected Member Functions | |
| SoundMedium (const std::string &url) | |
| Creates a new sound medium by a given url. | |
Protected Member Functions inherited from Ocean::Media::Medium | |
| Medium (const Medium &medium)=delete | |
| Disabled copy constructor. | |
| Medium (const std::string &url) | |
| Creates a new medium by a given url. | |
| virtual | ~Medium () |
| Destructs a medium. | |
| Medium & | operator= (const Medium &medium)=delete |
| Disabled copy operator. | |
Protected Attributes | |
| SoundType | mediumSoundType |
| Actual sound type. | |
| SoundType | mediumPreferredSoundType |
| Preferred sound type. | |
| Timestamp | mediumSoundTimestamp |
| Timestamp of the recent sound frame. | |
| Timestamp | mediumSoundTypeTimestamp |
| Timestamp of the recent sound frame type. | |
Protected Attributes inherited from Ocean::Media::Medium | |
| std::string | url_ |
| Url of the medium. | |
| std::string | libraryName_ |
| Name of the owner library. | |
| bool | isValid_ = false |
| Determines whether the medium is valid. | |
| Type | type_ = MEDIUM |
| Type of the medium. | |
| Lock | lock_ |
| Medium lock. | |
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. | |
| static Type | convertType (const std::string &type) |
| Converts a medium type string to a medium type. | |
This class is the base class for all sound mediums.
| using Ocean::Media::SoundMedium::SoundFrequency = float |
Definition of a sound frequency defined in Hz.
|
explicitprotected |
Creates a new sound medium by a given url.
| url | Url of the sound medium |
|
inline |
Returns whether the object holds a sound.
|
inline |
Returns the preferred bits per sound sample.
|
inline |
Returns the preferred number of sound channels.
|
inline |
Returns the preferred sound frequency in Hz.
|
virtual |
Sets the preferred bits per sound sample.
| bits | Preferred bits per sound sample |
|
virtual |
Sets the preferred number of sound channels.
| channels | Preferred sound channels |
|
virtual |
Sets the preferred sound frequency in Hz.
| frequency | Preferred sound frequency |
|
pure virtual |
Sets or unsets the sound medium to a mute state.
| mute | True, to mute the sound |
Implemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::ALiveAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFLiveAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSSoundMedium, Ocean::Media::FFmpeg::FFMMovie, and Ocean::Media::MediaFoundation::MFSoundMedium.
|
pure virtual |
Sets the volume of the sound in db.
The volume must be in range [-100db, 0db]
| volume | New volume in db |
Implemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::ALiveAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFLiveAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSSoundMedium, Ocean::Media::FFmpeg::FFMMovie, and Ocean::Media::MediaFoundation::MFSoundMedium.
|
inline |
Returns the number of bits per sample.
|
inline |
Returns the number of sound channels.
|
inline |
Returns the frequency of the sound in Hz.
|
pure virtual |
Returns whether the sound medium is in a mute state.
Implemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::ALiveAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFLiveAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSSoundMedium, Ocean::Media::FFmpeg::FFMMovie, and Ocean::Media::MediaFoundation::MFSoundMedium.
|
pure virtual |
Returns the volume of the sound in db.
Implemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::ALiveAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFLiveAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSSoundMedium, Ocean::Media::FFmpeg::FFMMovie, and Ocean::Media::MediaFoundation::MFSoundMedium.
|
protected |
Preferred sound type.
|
protected |
Timestamp of the recent sound frame.
|
protected |
Actual sound type.
|
protected |
Timestamp of the recent sound frame type.