src/3rdparty/phonon/qt7/quicktimemetadata.h
changeset 0 1918ee327afb
child 30 5dc02b23752f
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /*  This file is part of the KDE project.
       
     2 
       
     3     Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 
       
     5     This library is free software: you can redistribute it and/or modify
       
     6     it under the terms of the GNU Lesser General Public License as published by
       
     7     the Free Software Foundation, either version 2.1 or 3 of the License.
       
     8 
       
     9     This library is distributed in the hope that it will be useful,
       
    10     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12     GNU Lesser General Public License for more details.
       
    13 
       
    14     You should have received a copy of the GNU Lesser General Public License
       
    15     along with this library.  If not, see <http://www.gnu.org/licenses/>.
       
    16 */
       
    17 
       
    18 #ifndef Phonon_QT7_QUICKTIMEMETADATA_H
       
    19 #define Phonon_QT7_QUICKTIMEMETADATA_H
       
    20 
       
    21 #include "backendheader.h"
       
    22 #include <phonon/mediasource.h>
       
    23 #include <Carbon/Carbon.h>
       
    24 #include <QtCore/QString>
       
    25 
       
    26 #ifdef QUICKTIME_C_API_AVAILABLE
       
    27     #include <QuickTime/QuickTime.h>
       
    28     #undef check // avoid name clash;
       
    29 #endif
       
    30 
       
    31 QT_BEGIN_NAMESPACE
       
    32 
       
    33 namespace Phonon
       
    34 {
       
    35 namespace QT7
       
    36 {
       
    37     class QuickTimeVideoPlayer;
       
    38     class QuickTimeMetaData
       
    39     {
       
    40         public:
       
    41             QuickTimeMetaData(QuickTimeVideoPlayer *videoPlayer);
       
    42             void update();
       
    43             QMultiMap<QString, QString> metaData();
       
    44 
       
    45         private:
       
    46             QMultiMap<QString, QString> m_metaData;
       
    47             bool m_movieChanged;
       
    48             QuickTimeVideoPlayer *m_videoPlayer;
       
    49             void readMetaData();
       
    50             void guessMetaDataForCD();
       
    51             void readMetaDataFromMovie();
       
    52 
       
    53 #ifdef QUICKTIME_C_API_AVAILABLE
       
    54             QString stripCopyRightSymbol(const QString &key);
       
    55             QString convertQuickTimeKeyToUserKey(const QString &key);
       
    56             OSStatus readMetaValue(QTMetaDataRef, QTMetaDataItem, QTPropertyClass, QTPropertyID, QTPropertyValuePtr *, ByteCount *);
       
    57             UInt32 getMetaType(QTMetaDataRef metaDataRef, QTMetaDataItem item);
       
    58             QString getMetaValue(QTMetaDataRef metaDataRef, QTMetaDataItem item, SInt32 id);
       
    59             void readFormattedData(QTMetaDataRef metaDataRef, OSType format, QMultiMap<QString, QString> &result);
       
    60 #endif // QUICKTIME_C_API_AVAILABLE
       
    61     };
       
    62 
       
    63 }} // namespace Phonon::QT7
       
    64 
       
    65 QT_END_NAMESPACE
       
    66 
       
    67 #endif // Phonon_QT7_QUICKTIMEMETADATA_H