MediaPlayer

One QMediaPlayer in one role: audio for Singularity's sound graph, or video.

Declared in src/libs/libsing/media/MediaPlayer.hpp
Inherits QObject
Group singularity

Detailed description

No role has a QAudioOutput. The audio role sends its decoded audio into one source of SingAudioGraph, and its volume is the gain of that graph slot. The video role feeds a video sink, and it turns off the audio track when the media has loaded, so Qt decodes no audio from the video file.

setAudioGraph() connects the audio role to a graph source. prepare() loads a media URL, and play(), setPause() and stop() control playback.

Property documentation

volume property

volume : int

This property holds the playback volume, from 0 to 100.

The audio role sets the gain of its graph slot to the volume divided by 100. The player keeps the value when it has no graph, and applies it when setAudioGraph() connects one. The default is 100.

Access functions:

  • int volume() const
  • void setVolume(int volume)

Notifier signal:

  • void volumeChanged(int volume)
In this section