Stores properties describing a connected media source.
Synopsis:
#include <qplayer/types.h>
class MediaSource {
public:
enum Type {
HDD,
USB,
IPOD,
DLNA,
BLUETOOTH,
MTP,
UNKNOWN
};
enum Status {
NOT_READY,
READY,
FIRST_PASS,
SECOND_PASS,
THIRD_PASS
};
enum Capability {
PLAY = (0x00000001),
PAUSE = (0x00000002),
NEXT = (0x00000004),
PREVIOUS = (0x00000008),
SEEK = (0x00000010),
SET_PLAYBACK_RATE = (0x00000020),
SHUFFLE = (0x00000040),
REPEAT_ALL = (0x00000080),
REPEAT_ONE = (0x00000100),
REPEAT_NONE = (0x00000200),
STOP = (0x00000400),
JUMP = (0x00000800),
GET_POSITION = (0x00001000),
METADATA = (0x00010000),
SEARCH = (0x00020000),
BROWSE = (0x00040000),
EXTENDED_METADATA = (0x00080000)
};
int id;
QString uid;
QString name;
QString viewName;
Type type;
Status status;
uint64_t capabilities;
};
Data:
- int id
- Unique ID of the media source.
- QString uid
- Unique ID of the hardware device.
- QString name
- Media source name.
- QString viewName
- Name of the view configured for the media source.
The view can be changed in the mm-player configuration to suit the HMI's needs.
- Type type
- Hardware type. Can be one of:
- HDD
- Local drive.
- USB
- USB storage device.
- IPOD
- iPod.
- DLNA
- DLNA device.
- BLUETOOTH
- Bluetooth device.
- MTP
- Device with MTP files (e.g., Android, Win7/8 phone).
- UNKNOWN
- Customized media source.
- Status status
- Media source status. Can be one of:
- NOT_READY
- The media source isn't ready because the device is connected but hasn't been synchronized.
- READY
- The media source is ready, meaning it's connected and synchronized and its status can be read.
- FIRST_PASS
- The file information from the media source has been synchronized.
- SECOND_PASS
- The media metadata from the media source has been synchronized.
- THIRD_PASS
- The playlist entry information for the media source has been synchronized.
- uint64_t capabilities
- A flag field indicating the supported browsing and playback operations. Supported flags include:
- PLAY
- Playback is supported.
- PAUSE
- Playback can be paused.
- NEXT
- You can skip to the next track.
- PREVIOUS
- You can skip to the previous track.
- SEEK
- You can seek to a specific playback position.
- SET_PLAYBACK_RATE
- Playback speed can be adjusted.
- SHUFFLE
- Playback can be shuffled (i.e., randomized)
- REPEAT_ALL
- You can repeat all tracks in the same order.
- REPEAT_ONE
- You can repeat one track continuously.
- REPEAT_NONE
- You can disable repeating.
- STOP
- Playback can be stopped.
- JUMP
- You can jump to another track within the active tracksession.
- GET_POSITION
- You can retrieve the current playback position.
- METADATA
- You can retrieve metadata from media nodes.
- SEARCH
- You can retrieve media nodes with metadata properties matching a search string.
- BROWSE
- You can browse a media node within a media source.
- EXTENDED_METADATA
- You can retrieve extended metadata (i.e., nonstandard properties) from media nodes.
Library:
libqplayer
Description:
Stores properties describing a connected media source.
This class defines enumerations that specify the possible values for a media source's hardware type and connection status
as well as the flags that represent various media operations. When examining the fields that store these settings in a MediaSource object,
your code can compare the field values to specific enumeration constants, making it more readable.