QtIfMedia MediaPlayer Simulation Backend
Requirements
- QtMultimedia
- taglib
Supported interfaces
- org.qt-project.interfaceframework.MediaPlayer/1.0
- org.qt-project.interfaceframework.MediaIndexer/1.0
- org.qt-project.interfaceframework.MediaDiscovery/1.0
- org.qt-project.interfaceframework.FilterAndBrowseModel/1.0
The backend uses QtMultimedia to offer real media playback on various platforms. The indexer will automatically start to index all .mp3
files in the media folder.
For the FilterAndBrowseModel the following contenTypes are supported:
- artist A list of all artists.
- album A list of all albums.
- track A list of all tracks.
The model supports filtering and sorting, as well as navigating through the media library using the following navigation paths:
- Artist -> Album -> Track
- Album -> Track
Note: On systems where taglib
is disabled, indexing of files doesn't work and because of that the media database can't be created.
The MediaDiscoveryModel provides a simulation of USB thumb drives and can be configured using the QTIFMEDIA_SIMULATOR_DEVICEFOLDER
environment variable, which needs to be set to an absolute path. Every sub-folder within that path is recognized as a new USB thumb drive.
Using the FilterAndBrowseModel on the discovered media devices, the file
contentType can be used to navigate through the device's folder structure.
Every new device discovered is automatically indexed and all .mp3
files can be retrieved using the the FilterAndBrowseModel connected to the media player's service object to browse the library.
Configuration
This backend can be configured using QIfConfiguration::serviceSettings. By default it will write its database to the application's cache location. There is also a non persistent mode, where the indexed media database is not saved, but recreated on every start of the app. The backend uses qtifmedia
as its configurationId and accepts the following serviceSettings:
Name | Description |
---|---|
useTemporaryDatabase | The database is written to a temporary location and deleted when the application is stopped. |
database | A path to the media database which should be used. |
customMediaFolder | The local media directory (default: all media locations of the user - see also QStandardPaths) |
customDeviceFolder | The path which will be used by the DiscoveryModel for discovering media devices. (default: /home/<user>/usb-simulation) |
In addition the settings can be also provided by using the following environment variables:
Name | Description |
---|---|
QTIFMEDIA_TEMPORARY_DATABASE | The database is written to a temporary location and deleted when the application is stopped. |
QTIFMEDIA_SIMULATOR_DATABASE | A path to the media database which should be used. |
QTIFMEDIA_SIMULATOR_LOCALMEDIAFOLDER | The local media directory (default: all media locations of the user - see also QStandardPaths) |
QTIFMEDIA_SIMULATOR_DEVICEFOLDER | The path which will be used by the DiscoveryModel for discovering media devices. (default: /home/<user>/usb-simulation) |
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.