DragonCdTocReader QML Type

Reads the table of contents of an audio CD asynchronously. More...

Import Statement: import org.kde.dragonmediabackend
In C++: DragonCdTocReader

Signals

Methods

Detailed Description

import org.kde.dragonmediabackend

DragonCdTocReader {
    id: cdReader

    onTocReady: (toc) => {
        discLabel.text = i18n("%1 tracks, %2",
                              toc.tracks.length,
                              toc.discDuration.formatted())
        player.source = toc.tracks[0].url
    }
    onFailed: (message) => errorLabel.text = message
}

DragonPlayer {
    id: player
}

See also DragonCdToc, DragonCdTocReader::tocReady, and DragonCdTocReader::failed.

Signal Documentation

void failed(string errorMessage)

Emitted with the reason errorMessage when the TOC could not be read: no disc, not an Audio CD, an unopenable device, or the library was built without CD support.

Note: The corresponding handler is onFailed.

void tocReady(dragonCdToc toc)

Emitted with the TOC toc of the requested device once it has been read. Spinning up an optical drives might take a couple of seconds.

Handle it with onTocReady: (toc) => ....

Note: The corresponding handler is onTocReady.

Method Documentation

void requestToc(string device)

Reads the TOC of device asynchronously and emits tocReady() or failed(). An empty device selects the default drive.