GstAudio.StreamVolume¶
- Implementations:
None
Methods¶
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
None
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
Mute the audio channel without changing the volume |
||
r/w |
Linear volume factor, 1.0=100% |
Signals¶
None
Fields¶
None
Class Details¶
- class GstAudio.StreamVolume¶
- Bases:
- Structure:
This interface is implemented by elements that provide a stream volume. Examples for such elements are #volume and #playbin.
Applications can use this interface to get or set the current stream volume. For this the “volume”
GObject.Objectproperty can be used or the helper functionsGstAudio.StreamVolume.set_volume() andGstAudio.StreamVolume.get_volume(). This volume is always a linear factor, i.e. 0.0 is muted 1.0 is 100%. For showing the volume in a GUI it might make sense to convert it to a different format by usingGstAudio.StreamVolume.convert_volume(). Volume sliders should usually use a cubic volume.Separate from the volume the stream can also be muted by the “mute”
GObject.Objectproperty orGstAudio.StreamVolume.set_mute() andGstAudio.StreamVolume.get_mute().Elements that provide some kind of stream volume should implement the “volume” and “mute”
GObject.Objectproperties and handle setting and getting of them properly. The volume property is defined to be a linear volume factor.- classmethod convert_volume(from_, to, val)[source]¶
- Parameters:
from (
GstAudio.StreamVolumeFormat) –GstAudio.StreamVolumeFormatto convert fromto (
GstAudio.StreamVolumeFormat) –GstAudio.StreamVolumeFormatto convert toval (
float) – Volume in from format that should be converted
- Returns:
the converted volume
- Return type:
- get_volume(format)[source]¶
- Parameters:
format (
GstAudio.StreamVolumeFormat) –GstAudio.StreamVolumeFormatwhich should be returned- Returns:
The current stream volume as linear factor
- Return type:
- set_volume(format, val)[source]¶
- Parameters:
format (
GstAudio.StreamVolumeFormat) –GstAudio.StreamVolumeFormatof valval (
float) – Linear volume factor that should be set
Property Details¶
- GstAudio.StreamVolume.props.mute¶
-
Mute the audio channel without changing the volume