Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
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)
- 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, MonadIO m) => Bool -> m (GValueConstruct o)
- getStreamVolumeMute :: (MonadIO m, IsStreamVolume o) => o -> m Bool
- setStreamVolumeMute :: (MonadIO m, IsStreamVolume o) => o -> Bool -> m ()
- constructStreamVolumeVolume :: (IsStreamVolume o, MonadIO m) => Double -> m (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.
StreamVolume (ManagedPtr StreamVolume) |
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 | |
ManagedPtrNewtype StreamVolume Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume toManagedPtr :: StreamVolume -> ManagedPtr StreamVolume | |
TypedObject StreamVolume Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume | |
HasParentTypes StreamVolume Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume | |
IsGValue (Maybe StreamVolume) Source # | Convert |
Defined in GI.GstAudio.Interfaces.StreamVolume gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe StreamVolume -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe StreamVolume) | |
type ParentTypes StreamVolume Source # | |
Defined in GI.GstAudio.Interfaces.StreamVolume type ParentTypes StreamVolume = '[Object] |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getMute, getProperty, getQdata, getVolume.
Setters
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, MonadIO m) => Bool -> m (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, MonadIO m) => Double -> m (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 ]