Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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" Object
property can be used or the helper functions streamVolumeSetVolume
and streamVolumeGetVolume
. 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 using streamVolumeConvertVolume
. Volume sliders should usually
use a cubic volume.
Separate from the volume the stream can also be muted by the "mute" Object
property or
streamVolumeSetMute
and streamVolumeGetMute
.
Elements that provide some kind of stream volume should implement the "volume" and
"mute" Object
properties and handle setting and getting of them properly.
The volume property is defined to be a linear volume factor.
Synopsis
- newtype StreamVolume = StreamVolume (ManagedPtr StreamVolume)
- noStreamVolume :: Maybe StreamVolume
- class (GObject o, IsDescendantOf StreamVolume o) => IsStreamVolume o
- toStreamVolume :: (MonadIO m, IsStreamVolume o) => o -> m StreamVolume
- streamVolumeConvertVolume :: (HasCallStack, MonadIO m) => StreamVolumeFormat -> StreamVolumeFormat -> Double -> m Double
- streamVolumeGetMute :: (HasCallStack, MonadIO m, IsStreamVolume a) => a -> m Bool
- streamVolumeGetVolume :: (HasCallStack, MonadIO m, IsStreamVolume a) => a -> StreamVolumeFormat -> m Double
- streamVolumeSetMute :: (HasCallStack, MonadIO m, IsStreamVolume a) => a -> Bool -> m ()
- streamVolumeSetVolume :: (HasCallStack, MonadIO m, IsStreamVolume a) => a -> StreamVolumeFormat -> Double -> m ()
- constructStreamVolumeMute :: IsStreamVolume o => Bool -> IO (GValueConstruct o)
- getStreamVolumeMute :: (MonadIO m, IsStreamVolume o) => o -> m Bool
- setStreamVolumeMute :: (MonadIO m, IsStreamVolume o) => o -> Bool -> m ()
- constructStreamVolumeVolume :: IsStreamVolume o => Double -> IO (GValueConstruct o)
- getStreamVolumeVolume :: (MonadIO m, IsStreamVolume o) => o -> m Double
- setStreamVolumeVolume :: (MonadIO m, IsStreamVolume o) => o -> Double -> m ()
Exported types
newtype StreamVolume Source #
Memory-managed wrapper type.
Instances
Eq StreamVolume Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume (==) :: StreamVolume -> StreamVolume -> Bool # (/=) :: StreamVolume -> StreamVolume -> Bool # | |
GObject StreamVolume Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume gobjectType :: IO GType # | |
IsGValue StreamVolume Source # | Convert |
Defined in GI.GstAudio.Interfaces.StreamVolume toGValue :: StreamVolume -> IO GValue # fromGValue :: GValue -> IO StreamVolume # | |
HasParentTypes StreamVolume Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume | |
type ParentTypes StreamVolume Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume |
noStreamVolume :: Maybe StreamVolume Source #
A convenience alias for Nothing
:: Maybe
StreamVolume
.
class (GObject o, IsDescendantOf StreamVolume o) => IsStreamVolume o Source #
Type class for types which can be safely cast to StreamVolume
, for instance with toStreamVolume
.
Instances
(GObject o, IsDescendantOf StreamVolume o) => IsStreamVolume o Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume |
toStreamVolume :: (MonadIO m, IsStreamVolume o) => o -> m StreamVolume Source #
Cast to StreamVolume
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
convertVolume
streamVolumeConvertVolume Source #
:: (HasCallStack, MonadIO m) | |
=> StreamVolumeFormat |
|
-> StreamVolumeFormat |
|
-> Double |
|
-> m Double | Returns: the converted volume |
No description available in the introspection data.
getMute
:: (HasCallStack, MonadIO m, IsStreamVolume a) | |
=> a |
|
-> m Bool | Returns: Returns |
No description available in the introspection data.
getVolume
streamVolumeGetVolume Source #
:: (HasCallStack, MonadIO m, IsStreamVolume a) | |
=> a |
|
-> StreamVolumeFormat |
|
-> m Double | Returns: The current stream volume as linear factor |
No description available in the introspection data.
setMute
:: (HasCallStack, MonadIO m, IsStreamVolume a) | |
=> a |
|
-> Bool |
|
-> m () |
No description available in the introspection data.
setVolume
streamVolumeSetVolume Source #
:: (HasCallStack, MonadIO m, IsStreamVolume a) | |
=> a |
|
-> StreamVolumeFormat |
|
-> Double |
|
-> m () |
No description available in the introspection data.
Properties
mute
No description available in the introspection data.
constructStreamVolumeMute :: IsStreamVolume o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “mute
” property. This is rarely needed directly, but it is used by new
.
getStreamVolumeMute :: (MonadIO m, IsStreamVolume o) => o -> m Bool Source #
Get the value of the “mute
” property.
When overloading is enabled, this is equivalent to
get
streamVolume #mute
setStreamVolumeMute :: (MonadIO m, IsStreamVolume o) => o -> Bool -> m () Source #
Set the value of the “mute
” property.
When overloading is enabled, this is equivalent to
set
streamVolume [ #mute:=
value ]
volume
No description available in the introspection data.
constructStreamVolumeVolume :: IsStreamVolume o => Double -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “volume
” property. This is rarely needed directly, but it is used by new
.
getStreamVolumeVolume :: (MonadIO m, IsStreamVolume o) => o -> m Double Source #
Get the value of the “volume
” property.
When overloading is enabled, this is equivalent to
get
streamVolume #volume
setStreamVolumeVolume :: (MonadIO m, IsStreamVolume o) => o -> Double -> m () Source #
Set the value of the “volume
” property.
When overloading is enabled, this is equivalent to
set
streamVolume [ #volume:=
value ]