summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/utils.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <gareth.stockwell@sosco.com>2009-08-25 07:46:08 (GMT)
committerGareth Stockwell <gareth.stockwell@sosco.com>2009-08-25 07:46:08 (GMT)
commitca8f0c669142d27091873c108ffe21b4285e3087 (patch)
tree74bee27be06d17007b9e589c6bc3aaf668aab69a /src/3rdparty/phonon/mmf/utils.cpp
parentd4efe766d35aa8150f67f67cd16cfc00ba4f9723 (diff)
downloadQt-ca8f0c669142d27091873c108ffe21b4285e3087.zip
Qt-ca8f0c669142d27091873c108ffe21b4285e3087.tar.gz
Qt-ca8f0c669142d27091873c108ffe21b4285e3087.tar.bz2
Implemented Backend::availableMimeTypes
Diffstat (limited to 'src/3rdparty/phonon/mmf/utils.cpp')
-rw-r--r--src/3rdparty/phonon/mmf/utils.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp
index ada4800..2655962 100644
--- a/src/3rdparty/phonon/mmf/utils.cpp
+++ b/src/3rdparty/phonon/mmf/utils.cpp
@@ -44,3 +44,24 @@ QHBufC MMF::Utils::symbianFilename(const QString& qtFilename)
return result;
}
+
+
+static const TInt KMimePrefixLength = 6; // either "audio/" or "video/"
+_LIT(KMimePrefixAudio, "audio/");
+_LIT(KMimePrefixVideo, "video/");
+
+MMF::MediaType MMF::Utils::mimeTypeToMediaType(const TDesC& mimeType)
+{
+ MediaType result = MediaTypeUnknown;
+
+ if(mimeType.Left(KMimePrefixLength).Compare(KMimePrefixAudio) == 0)
+ {
+ result = MediaTypeAudio;
+ }
+ else if(mimeType.Left(KMimePrefixLength).Compare(KMimePrefixVideo) == 0)
+ {
+ result = MediaTypeVideo;
+ }
+
+ return result;
+}