Ocean
Loading...
Searching...
No Matches
MFSoundMedium.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
*
4
* This source code is licensed under the MIT license found in the
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
#ifndef META_OCEAN_MEDIA_MF_SOUND_MEDIUM_H
9
#define META_OCEAN_MEDIA_MF_SOUND_MEDIUM_H
10
11
#include "
ocean/media/mediafoundation/MediaFoundation.h
"
12
#include "
ocean/media/mediafoundation/MFMedium.h
"
13
14
#include "
ocean/math/Numeric.h
"
15
16
#include "
ocean/media/SoundMedium.h
"
17
18
namespace
Ocean
19
{
20
21
namespace
Media
22
{
23
24
namespace
MediaFoundation
25
{
26
27
/**
28
* This class is the base class for all MediaFoundation sound mediums.
29
* @ingroup mediamf
30
*/
31
class
OCEAN_MEDIA_MF_EXPORT
MFSoundMedium
:
32
public
virtual
MFMedium
,
33
public
virtual
SoundMedium
34
{
35
public
:
36
37
/**
38
* Returns the volume of the sound in db.
39
* @see SoundMedium::soundVolume().
40
*/
41
float
soundVolume
()
const override
;
42
43
/**
44
* Returns whether the sound medium is in a mute state.
45
* @see SoundMedium::soundMute().
46
*/
47
bool
soundMute
()
const override
;
48
49
/**
50
* Sets the volume of the sound in db.
51
* @see SoundMedium::setSoundVolume().
52
*/
53
bool
setSoundVolume
(
const
float
volume)
override
;
54
55
/**
56
* Sets or un-sets the sound medium to a mute state.
57
* @see SoundMedium::setSoundMute().
58
*/
59
bool
setSoundMute
(
const
bool
mute)
override
;
60
61
/**
62
* Extracts the sound format of a given Media Foundation media type.
63
* @param mediaType Media Foundation media type
64
* @param soundType Resulting sound type
65
* @return True, if succeeded
66
*/
67
static
bool
extractSoundFormat
(IMFMediaType* mediaType,
SoundType
& soundType);
68
69
protected
:
70
71
/**
72
* Creates a new sound medium by a given URL.
73
* @param url The URL of the sound medium
74
*/
75
explicit
MFSoundMedium
(
const
std::string& url);
76
77
/**
78
* Destructs a MFSoundMedium object.
79
*/
80
~MFSoundMedium
()
override
;
81
82
/**
83
* Builds the sound topology of this object.
84
* @return True, if succeeded
85
*/
86
virtual
bool
buildSoundTopology
();
87
88
/**
89
* Releases the sound topology of this object.
90
*/
91
virtual
void
releaseSoundTopology
();
92
93
protected
:
94
95
/// The sound volume before mute state.
96
float
nonMuteVolume_ = NumericF::minValue();
97
};
98
99
}
100
101
}
102
103
}
104
105
#endif
// META_OCEAN_MEDIA_MF_SOUND_MEDIUM_H
MFMedium.h
MediaFoundation.h
Numeric.h
SoundMedium.h
Ocean::Media::MediaFoundation::MFMedium
This is the base class for all MediaFoundation mediums.
Definition
MFMedium.h:31
Ocean::Media::MediaFoundation::MFSoundMedium
This class is the base class for all MediaFoundation sound mediums.
Definition
MFSoundMedium.h:34
Ocean::Media::MediaFoundation::MFSoundMedium::setSoundMute
bool setSoundMute(const bool mute) override
Sets or un-sets the sound medium to a mute state.
Ocean::Media::MediaFoundation::MFSoundMedium::buildSoundTopology
virtual bool buildSoundTopology()
Builds the sound topology of this object.
Ocean::Media::MediaFoundation::MFSoundMedium::extractSoundFormat
static bool extractSoundFormat(IMFMediaType *mediaType, SoundType &soundType)
Extracts the sound format of a given Media Foundation media type.
Ocean::Media::MediaFoundation::MFSoundMedium::releaseSoundTopology
virtual void releaseSoundTopology()
Releases the sound topology of this object.
Ocean::Media::MediaFoundation::MFSoundMedium::setSoundVolume
bool setSoundVolume(const float volume) override
Sets the volume of the sound in db.
Ocean::Media::MediaFoundation::MFSoundMedium::~MFSoundMedium
~MFSoundMedium() override
Destructs a MFSoundMedium object.
Ocean::Media::MediaFoundation::MFSoundMedium::soundVolume
float soundVolume() const override
Returns the volume of the sound in db.
Ocean::Media::MediaFoundation::MFSoundMedium::MFSoundMedium
MFSoundMedium(const std::string &url)
Creates a new sound medium by a given URL.
Ocean::Media::MediaFoundation::MFSoundMedium::soundMute
bool soundMute() const override
Returns whether the sound medium is in a mute state.
Ocean::Media::SoundMedium::SoundType
Definition of a sound type composed by the sound frequency and channels.
Definition
SoundMedium.h:50
Ocean::Media::SoundMedium
This class is the base class for all sound mediums.
Definition
SoundMedium.h:38
Ocean
The namespace covering the entire Ocean framework.
Definition
Accessor.h:15
impl
ocean
media
mediafoundation
MFSoundMedium.h
Generated on Sun Mar 9 2025 06:03:31 for Ocean by
1.9.8