diff options
author | James McDonnell <jmcdonnell@blackberry.com> | 2017-03-27 14:59:06 -0400 |
---|---|---|
committer | James McDonnell <jmcdonnell@blackberry.com> | 2017-09-06 14:07:11 +0000 |
commit | fec653b6f4402e70ee6d11f8beba070ece0b3d8d (patch) | |
tree | 4c64b85f6d818400beb869c884956607c506d1d9 /src/plugins/qnx/mediaplayer | |
parent | a523f9e117c5d402b83c4cdbf54d99004095616d (diff) |
Add custom audio role API to QMediaPlayer
Allows use of audio roles beyond those known to Qt.
[ChangeLog][QMediaPlayer] Added customAudioRole string property to
enable use of audio roles beyond those available via the audioRole
enum property.
Change-Id: Id7ed5d7bc1af0c15910e699f25c97cfed2d48243
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins/qnx/mediaplayer')
-rw-r--r-- | src/plugins/qnx/mediaplayer/mmrendererutil.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/qnx/mediaplayer/mmrendererutil.cpp b/src/plugins/qnx/mediaplayer/mmrendererutil.cpp index 7a9f6393b..d8af4a746 100644 --- a/src/plugins/qnx/mediaplayer/mmrendererutil.cpp +++ b/src/plugins/qnx/mediaplayer/mmrendererutil.cpp @@ -92,7 +92,7 @@ static const unsigned int numMmErrors = sizeof(mmErrors) / sizeof(MmError); static QBasicMutex roleMapMutex; static bool roleMapInitialized = false; -static QString roleMap[QAudio::GameRole + 1]; +static QString roleMap[QAudio::CustomRole + 1]; template <typename T, size_t N> constexpr size_t countof(T (&)[N]) @@ -166,9 +166,15 @@ static void loadRoleMap() loadRoleMapping(AccessibilityRole); loadRoleMapping(SonificationRole); loadRoleMapping(GameRole); + loadRoleMapping(CustomRole); } #undef loadRoleMapping #pragma GCC diagnostic pop + + if (!roleMap[QAudio::CustomRole].isEmpty()) { + qWarning("CustomRole mapping ignored"); + roleMap[QAudio::CustomRole].clear(); + } } roleMapInitialized = true; |