qtmobility/plugins/multimedia/directshow/player/directshowmetadatacontrol.cpp
changeset 5 453da2cfceef
parent 4 90517678cc4f
child 11 06b8e2af4411
equal deleted inserted replaced
4:90517678cc4f 5:453da2cfceef
    52 #ifndef QT_NO_WMSDK
    52 #ifndef QT_NO_WMSDK
    53 namespace
    53 namespace
    54 {
    54 {
    55     struct QWMMetaDataKeyLookup
    55     struct QWMMetaDataKeyLookup
    56     {
    56     {
    57         QtMedia::MetaData key;
    57         QtMediaServices::MetaData key;
    58         const wchar_t *token;
    58         const wchar_t *token;
    59     };
    59     };
    60 }
    60 }
    61 
    61 
    62 static const QWMMetaDataKeyLookup qt_wmMetaDataKeys[] =
    62 static const QWMMetaDataKeyLookup qt_wmMetaDataKeys[] =
    63 {
    63 {
    64     { QtMedia::Title, L"Title" },
    64     { QtMediaServices::Title, L"Title" },
    65     { QtMedia::SubTitle, L"WM/SubTitle" },
    65     { QtMediaServices::SubTitle, L"WM/SubTitle" },
    66     { QtMedia::Author, L"Author" },
    66     { QtMediaServices::Author, L"Author" },
    67     { QtMedia::Comment, L"Comment" },
    67     { QtMediaServices::Comment, L"Comment" },
    68     { QtMedia::Description, L"Description" },
    68     { QtMediaServices::Description, L"Description" },
    69     { QtMedia::Category, L"WM/Category" },
    69     { QtMediaServices::Category, L"WM/Category" },
    70     { QtMedia::Genre, L"WM/Genre" },
    70     { QtMediaServices::Genre, L"WM/Genre" },
    71     //{ QtMedia::Date, 0 },
    71     //{ QtMediaServices::Date, 0 },
    72     { QtMedia::Year, L"WM/Year" },
    72     { QtMediaServices::Year, L"WM/Year" },
    73     { QtMedia::UserRating, L"UserRating" },
    73     { QtMediaServices::UserRating, L"UserRating" },
    74     //{ QtMedia::MetaDatawords, 0 },
    74     //{ QtMediaServices::MetaDatawords, 0 },
    75     { QtMedia::Language, L"Language" },
    75     { QtMediaServices::Language, L"Language" },
    76     { QtMedia::Publisher, L"WM/Publisher" },
    76     { QtMediaServices::Publisher, L"WM/Publisher" },
    77     { QtMedia::Copyright, L"Copyright" },
    77     { QtMediaServices::Copyright, L"Copyright" },
    78     { QtMedia::ParentalRating, L"ParentalRating" },
    78     { QtMediaServices::ParentalRating, L"ParentalRating" },
    79     { QtMedia::RatingOrganisation, L"RatingOrganisation" },
    79     { QtMediaServices::RatingOrganisation, L"RatingOrganisation" },
    80 
    80 
    81     // Media
    81     // Media
    82     { QtMedia::Size, L"FileSize" },
    82     { QtMediaServices::Size, L"FileSize" },
    83     { QtMedia::MediaType, L"MediaType" },
    83     { QtMediaServices::MediaType, L"MediaType" },
    84     { QtMedia::Duration, L"Duration" },
    84     { QtMediaServices::Duration, L"Duration" },
    85 
    85 
    86     // Audio
    86     // Audio
    87     { QtMedia::AudioBitRate, L"AudioBitRate" },
    87     { QtMediaServices::AudioBitRate, L"AudioBitRate" },
    88     { QtMedia::AudioCodec, L"AudioCodec" },
    88     { QtMediaServices::AudioCodec, L"AudioCodec" },
    89     { QtMedia::ChannelCount, L"ChannelCount" },
    89     { QtMediaServices::ChannelCount, L"ChannelCount" },
    90     { QtMedia::SampleRate, L"Frequency" },
    90     { QtMediaServices::SampleRate, L"Frequency" },
    91 
    91 
    92     // Music
    92     // Music
    93     { QtMedia::AlbumTitle, L"WM/AlbumTitle" },
    93     { QtMediaServices::AlbumTitle, L"WM/AlbumTitle" },
    94     { QtMedia::AlbumArtist, L"WM/AlbumArtist" },
    94     { QtMediaServices::AlbumArtist, L"WM/AlbumArtist" },
    95     { QtMedia::ContributingArtist, L"Author" },
    95     { QtMediaServices::ContributingArtist, L"Author" },
    96     { QtMedia::Composer, L"WM/Composer" },
    96     { QtMediaServices::Composer, L"WM/Composer" },
    97     { QtMedia::Conductor, L"WM/Conductor" },
    97     { QtMediaServices::Conductor, L"WM/Conductor" },
    98     { QtMedia::Lyrics, L"WM/Lyrics" },
    98     { QtMediaServices::Lyrics, L"WM/Lyrics" },
    99     { QtMedia::Mood, L"WM/Mood" },
    99     { QtMediaServices::Mood, L"WM/Mood" },
   100     { QtMedia::TrackNumber, L"WM/TrackNumber" },
   100     { QtMediaServices::TrackNumber, L"WM/TrackNumber" },
   101     //{ QtMedia::TrackCount, 0 },
   101     //{ QtMediaServices::TrackCount, 0 },
   102     //{ QtMedia::CoverArtUriSmall, 0 },
   102     //{ QtMediaServices::CoverArtUriSmall, 0 },
   103     //{ QtMedia::CoverArtUriLarge, 0 },
   103     //{ QtMediaServices::CoverArtUriLarge, 0 },
   104 
   104 
   105     // Image/Video
   105     // Image/Video
   106     //{ QtMedia::Resolution, 0 },
   106     //{ QtMediaServices::Resolution, 0 },
   107     //{ QtMedia::PixelAspectRatio, 0 },
   107     //{ QtMediaServices::PixelAspectRatio, 0 },
   108 
   108 
   109     // Video
   109     // Video
   110     //{ QtMedia::FrameRate, 0 },
   110     //{ QtMediaServices::FrameRate, 0 },
   111     { QtMedia::VideoBitRate, L"VideoBitRate" },
   111     { QtMediaServices::VideoBitRate, L"VideoBitRate" },
   112     { QtMedia::VideoCodec, L"VideoCodec" },
   112     { QtMediaServices::VideoCodec, L"VideoCodec" },
   113 
   113 
   114     //{ QtMedia::PosterUri, 0 },
   114     //{ QtMediaServices::PosterUri, 0 },
   115 
   115 
   116     // Movie
   116     // Movie
   117     { QtMedia::ChapterNumber, L"ChapterNumber" },
   117     { QtMediaServices::ChapterNumber, L"ChapterNumber" },
   118     { QtMedia::Director, L"WM/Director" },
   118     { QtMediaServices::Director, L"WM/Director" },
   119     { QtMedia::LeadPerformer, L"LeadPerformer" },
   119     { QtMediaServices::LeadPerformer, L"LeadPerformer" },
   120     { QtMedia::Writer, L"WM/Writer" },
   120     { QtMediaServices::Writer, L"WM/Writer" },
   121 
   121 
   122     // Photos
   122     // Photos
   123     { QtMedia::CameraManufacturer, L"CameraManufacturer" },
   123     { QtMediaServices::CameraManufacturer, L"CameraManufacturer" },
   124     { QtMedia::CameraModel, L"CameraModel" },
   124     { QtMediaServices::CameraModel, L"CameraModel" },
   125     { QtMedia::Event, L"Event" },
   125     { QtMediaServices::Event, L"Event" },
   126     { QtMedia::Subject, L"Subject" }
   126     { QtMediaServices::Subject, L"Subject" }
   127 };
   127 };
   128 
   128 
   129 static QVariant getValue(IWMHeaderInfo *header, const wchar_t *key)
   129 static QVariant getValue(IWMHeaderInfo *header, const wchar_t *key)
   130 {
   130 {
   131     WORD streamNumber = 0;
   131     WORD streamNumber = 0;
   252 #else
   252 #else
   253     return m_content;
   253     return m_content;
   254 #endif
   254 #endif
   255 }
   255 }
   256 
   256 
   257 QVariant DirectShowMetaDataControl::metaData(QtMedia::MetaData key) const
   257 QVariant DirectShowMetaDataControl::metaData(QtMediaServices::MetaData key) const
   258 {
   258 {
   259     QVariant value;
   259     QVariant value;
   260 
   260 
   261 #ifndef QT_NO_WMSDK
   261 #ifndef QT_NO_WMSDK
   262     if (m_headerInfo) {
   262     if (m_headerInfo) {
   272     if (m_content) {
   272     if (m_content) {
   273 #endif
   273 #endif
   274         BSTR string = 0;
   274         BSTR string = 0;
   275 
   275 
   276         switch (key) {
   276         switch (key) {
   277         case QtMedia::Author:
   277         case QtMediaServices::Author:
   278             m_content->get_AuthorName(&string);
   278             m_content->get_AuthorName(&string);
   279             break;
   279             break;
   280         case QtMedia::Title:
   280         case QtMediaServices::Title:
   281             m_content->get_Title(&string);
   281             m_content->get_Title(&string);
   282             break;
   282             break;
   283         case QtMedia::ParentalRating:
   283         case QtMediaServices::ParentalRating:
   284             m_content->get_Rating(&string);
   284             m_content->get_Rating(&string);
   285             break;
   285             break;
   286         case QtMedia::Description:
   286         case QtMediaServices::Description:
   287             m_content->get_Description(&string);
   287             m_content->get_Description(&string);
   288             break;
   288             break;
   289         case QtMedia::Copyright:
   289         case QtMediaServices::Copyright:
   290             m_content->get_Copyright(&string);
   290             m_content->get_Copyright(&string);
   291             break;
   291             break;
   292         default:
   292         default:
   293             break;
   293             break;
   294         }
   294         }
   300         }
   300         }
   301     }
   301     }
   302     return value;
   302     return value;
   303 }
   303 }
   304 
   304 
   305 void DirectShowMetaDataControl::setMetaData(QtMedia::MetaData, const QVariant &)
   305 void DirectShowMetaDataControl::setMetaData(QtMediaServices::MetaData, const QVariant &)
   306 {
   306 {
   307 }
   307 }
   308 
   308 
   309 QList<QtMedia::MetaData> DirectShowMetaDataControl::availableMetaData() const
   309 QList<QtMediaServices::MetaData> DirectShowMetaDataControl::availableMetaData() const
   310 {
   310 {
   311     return QList<QtMedia::MetaData>();
   311     return QList<QtMediaServices::MetaData>();
   312 }
   312 }
   313 
   313 
   314 QVariant DirectShowMetaDataControl::extendedMetaData(const QString &) const
   314 QVariant DirectShowMetaDataControl::extendedMetaData(const QString &) const
   315 {
   315 {
   316     return QVariant();
   316     return QVariant();