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 |
Provides a base class for CD digital audio (CDDA) sources, which handles things like seeking, querying, discid calculation, tags, and buffer timestamping.
Using GstAudioCdSrc-based elements in applications
GstAudioCdSrc registers two Format
s of its own, namely
the "track" format and the "sector" format. Applications will usually
only find the "track" format interesting. You can retrieve that Format
for use in seek events or queries with gst_format_get_by_nick("track").
In order to query the number of tracks, for example, an application would
set the CDDA source element to READY or PAUSED state and then query the
the number of tracks via elementQueryDuration
using the track
format acquired above. Applications can query the currently playing track
in the same way.
Alternatively, applications may retrieve the currently playing track and the total number of tracks from the taglist that will posted on the bus whenever the CD is opened or the currently playing track changes. The taglist will contain GST_TAG_TRACK_NUMBER and GST_TAG_TRACK_COUNT tags.
Applications playing back CD audio using playbin and cdda://n URIs should issue a seek command in track format to change between tracks, rather than setting a new cdda://n+1 URI on playbin (as setting a new URI on playbin involves closing and re-opening the CD device, which is much much slower).
Tags and meta-information
CDDA sources will automatically emit a number of tags, details about which
can be found in the libgsttag documentation. Those tags are:
TAG_CDDA_CDDB_DISCID
, TAG_CDDA_CDDB_DISCID_FULL
,
TAG_CDDA_MUSICBRAINZ_DISCID
, TAG_CDDA_MUSICBRAINZ_DISCID_FULL
,
among others.
Tracks and Table of Contents (TOC)
Applications will be informed of the available tracks via a TOC message
on the pipeline's Bus
. The Toc
will contain a TocEntry
for
each track, with information about each track. The duration for each
track can be retrieved via the TAG_DURATION
tag from each entry's
tag list, or calculated via tocEntryGetStartStopTimes
.
The track entries in the TOC will be sorted by track number.
Synopsis
- newtype AudioCdSrc = AudioCdSrc (ManagedPtr AudioCdSrc)
- class (GObject o, IsDescendantOf AudioCdSrc o) => IsAudioCdSrc o
- toAudioCdSrc :: (MonadIO m, IsAudioCdSrc o) => o -> m AudioCdSrc
- audioCdSrcAddTrack :: (HasCallStack, MonadIO m, IsAudioCdSrc a) => a -> AudioCdSrcTrack -> m Bool
- clearAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> m ()
- constructAudioCdSrcDevice :: (IsAudioCdSrc o, MonadIO m) => Text -> m (GValueConstruct o)
- getAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> m (Maybe Text)
- setAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> Text -> m ()
- constructAudioCdSrcMode :: (IsAudioCdSrc o, MonadIO m) => AudioCdSrcMode -> m (GValueConstruct o)
- getAudioCdSrcMode :: (MonadIO m, IsAudioCdSrc o) => o -> m AudioCdSrcMode
- setAudioCdSrcMode :: (MonadIO m, IsAudioCdSrc o) => o -> AudioCdSrcMode -> m ()
- constructAudioCdSrcTrack :: (IsAudioCdSrc o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getAudioCdSrcTrack :: (MonadIO m, IsAudioCdSrc o) => o -> m Word32
- setAudioCdSrcTrack :: (MonadIO m, IsAudioCdSrc o) => o -> Word32 -> m ()
Exported types
newtype AudioCdSrc Source #
Memory-managed wrapper type.
AudioCdSrc (ManagedPtr AudioCdSrc) |
Instances
Eq AudioCdSrc Source # | |
Defined in GI.GstAudio.Objects.AudioCdSrc (==) :: AudioCdSrc -> AudioCdSrc -> Bool (/=) :: AudioCdSrc -> AudioCdSrc -> Bool | |
GObject AudioCdSrc Source # | |
Defined in GI.GstAudio.Objects.AudioCdSrc | |
ManagedPtrNewtype AudioCdSrc Source # | |
Defined in GI.GstAudio.Objects.AudioCdSrc toManagedPtr :: AudioCdSrc -> ManagedPtr AudioCdSrc | |
TypedObject AudioCdSrc Source # | |
Defined in GI.GstAudio.Objects.AudioCdSrc glibType :: IO GType | |
IsGValue AudioCdSrc Source # | Convert |
Defined in GI.GstAudio.Objects.AudioCdSrc toGValue :: AudioCdSrc -> IO GValue fromGValue :: GValue -> IO AudioCdSrc | |
HasParentTypes AudioCdSrc Source # | |
Defined in GI.GstAudio.Objects.AudioCdSrc | |
type ParentTypes AudioCdSrc Source # | |
Defined in GI.GstAudio.Objects.AudioCdSrc type ParentTypes AudioCdSrc = '[PushSrc, BaseSrc, Element, Object, Object, URIHandler] |
class (GObject o, IsDescendantOf AudioCdSrc o) => IsAudioCdSrc o Source #
Type class for types which can be safely cast to AudioCdSrc
, for instance with toAudioCdSrc
.
Instances
(GObject o, IsDescendantOf AudioCdSrc o) => IsAudioCdSrc o Source # | |
Defined in GI.GstAudio.Objects.AudioCdSrc |
toAudioCdSrc :: (MonadIO m, IsAudioCdSrc o) => o -> m AudioCdSrc Source #
Cast to AudioCdSrc
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
addTrack
:: (HasCallStack, MonadIO m, IsAudioCdSrc a) | |
=> a |
|
-> AudioCdSrcTrack |
|
-> m Bool | Returns: FALSE on error, otherwise TRUE. |
CDDA sources use this function from their start vfunc to announce the
available data and audio tracks to the base source class. The caller
should allocate track
on the stack, the base source will do a shallow
copy of the structure (and take ownership of the taglist if there is one).
Properties
device
No description available in the introspection data.
clearAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> m () Source #
Set the value of the “device
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#device
constructAudioCdSrcDevice :: (IsAudioCdSrc o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “device
” property. This is rarely needed directly, but it is used by new
.
getAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> m (Maybe Text) Source #
Get the value of the “device
” property.
When overloading is enabled, this is equivalent to
get
audioCdSrc #device
setAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> Text -> m () Source #
Set the value of the “device
” property.
When overloading is enabled, this is equivalent to
set
audioCdSrc [ #device:=
value ]
mode
No description available in the introspection data.
constructAudioCdSrcMode :: (IsAudioCdSrc o, MonadIO m) => AudioCdSrcMode -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “mode
” property. This is rarely needed directly, but it is used by new
.
getAudioCdSrcMode :: (MonadIO m, IsAudioCdSrc o) => o -> m AudioCdSrcMode Source #
Get the value of the “mode
” property.
When overloading is enabled, this is equivalent to
get
audioCdSrc #mode
setAudioCdSrcMode :: (MonadIO m, IsAudioCdSrc o) => o -> AudioCdSrcMode -> m () Source #
Set the value of the “mode
” property.
When overloading is enabled, this is equivalent to
set
audioCdSrc [ #mode:=
value ]
track
No description available in the introspection data.
constructAudioCdSrcTrack :: (IsAudioCdSrc o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “track
” property. This is rarely needed directly, but it is used by new
.
getAudioCdSrcTrack :: (MonadIO m, IsAudioCdSrc o) => o -> m Word32 Source #
Get the value of the “track
” property.
When overloading is enabled, this is equivalent to
get
audioCdSrc #track
setAudioCdSrcTrack :: (MonadIO m, IsAudioCdSrc o) => o -> Word32 -> m () Source #
Set the value of the “track
” property.
When overloading is enabled, this is equivalent to
set
audioCdSrc [ #track:=
value ]