| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GstAudio.Objects.AudioCdSrc
Description
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.
- newtype AudioCdSrc = AudioCdSrc (ManagedPtr AudioCdSrc)
- class GObject o => IsAudioCdSrc o
- toAudioCdSrc :: (MonadIO m, IsAudioCdSrc o) => o -> m AudioCdSrc
- noAudioCdSrc :: Maybe AudioCdSrc
- audioCdSrcAddTrack :: (HasCallStack, MonadIO m, IsAudioCdSrc a) => a -> AudioCdSrcTrack -> m Bool
- clearAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> m ()
- constructAudioCdSrcDevice :: IsAudioCdSrc o => Text -> IO (GValueConstruct o)
- getAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> m (Maybe Text)
- setAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> Text -> m ()
- constructAudioCdSrcMode :: IsAudioCdSrc o => AudioCdSrcMode -> IO (GValueConstruct o)
- getAudioCdSrcMode :: (MonadIO m, IsAudioCdSrc o) => o -> m AudioCdSrcMode
- setAudioCdSrcMode :: (MonadIO m, IsAudioCdSrc o) => o -> AudioCdSrcMode -> m ()
- constructAudioCdSrcTrack :: IsAudioCdSrc o => Word32 -> IO (GValueConstruct o)
- getAudioCdSrcTrack :: (MonadIO m, IsAudioCdSrc o) => o -> m Word32
- setAudioCdSrcTrack :: (MonadIO m, IsAudioCdSrc o) => o -> Word32 -> m ()
Exported types
newtype AudioCdSrc Source #
Constructors
| AudioCdSrc (ManagedPtr AudioCdSrc) |
class GObject o => IsAudioCdSrc o Source #
Instances
toAudioCdSrc :: (MonadIO m, IsAudioCdSrc o) => o -> m AudioCdSrc Source #
Methods
addTrack
Arguments
| :: (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
clearAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> m () Source #
constructAudioCdSrcDevice :: IsAudioCdSrc o => Text -> IO (GValueConstruct o) Source #
getAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> m (Maybe Text) Source #
setAudioCdSrcDevice :: (MonadIO m, IsAudioCdSrc o) => o -> Text -> m () Source #
mode
constructAudioCdSrcMode :: IsAudioCdSrc o => AudioCdSrcMode -> IO (GValueConstruct o) Source #
getAudioCdSrcMode :: (MonadIO m, IsAudioCdSrc o) => o -> m AudioCdSrcMode Source #
setAudioCdSrcMode :: (MonadIO m, IsAudioCdSrc o) => o -> AudioCdSrcMode -> m () Source #
track
constructAudioCdSrcTrack :: IsAudioCdSrc o => Word32 -> IO (GValueConstruct o) Source #
getAudioCdSrcTrack :: (MonadIO m, IsAudioCdSrc o) => o -> m Word32 Source #
setAudioCdSrcTrack :: (MonadIO m, IsAudioCdSrc o) => o -> Word32 -> m () Source #