phononnamespace.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2005-2008 Matthias Kretz <kretz@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Lesser General Public
00006     License as published by the Free Software Foundation; either
00007     version 2.1 of the License, or (at your option) version 3, or any
00008     later version accepted by the membership of KDE e.V. (or its
00009     successor approved by the membership of KDE e.V.), Nokia Corporation 
00010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
00011     act as a proxy defined in Section 6 of version 3 of the license.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public 
00019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifndef PHONONNAMESPACE_H
00024 #define PHONONNAMESPACE_H
00025 
00026 #include "phonon_export.h"
00027 
00028 #ifdef __QT_SYNCQT__
00029 // Tell syncqt to create a "Global" header here
00030 #pragma qt_class(Phonon::Global)
00031 #endif
00032 
00039 #define PHONON_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
00040 
00044 #define PHONON_VERSION PHONON_VERSION_CHECK(4, 4, 0)
00045 
00049 #define PHONON_VERSION_STR "4.4.0"
00050 
00051 QT_BEGIN_HEADER
00052 QT_BEGIN_NAMESPACE
00053 
00054 class QString;
00055 
00068 namespace Phonon
00069 {
00070     PHONON_EXPORT const char *phononVersion();
00071 
00077     enum DiscType {
00082         NoDisc = -1,
00086         Cd = 0,
00090         Dvd = 1,
00094         Vcd = 2
00095     };
00096 
00101     enum MetaData {
00108         ArtistMetaData,
00112         AlbumMetaData,
00116         TitleMetaData,
00120         DateMetaData,
00124         GenreMetaData,
00129         TracknumberMetaData,
00133         DescriptionMetaData,
00134         MusicBrainzDiscIdMetaData
00135     };
00136 
00142     enum State
00143     {
00150         LoadingState,
00155         StoppedState,
00159         PlayingState,
00164         BufferingState,
00168         PausedState,
00172         ErrorState
00173     };
00174 
00188     enum Category
00189     {
00193         NoCategory = -1,
00198         NotificationCategory = 0,
00203         MusicCategory = 1,
00207         VideoCategory = 2,
00212         CommunicationCategory = 3,
00216         GameCategory = 4,
00220         AccessibilityCategory = 5,
00225         LastCategory = AccessibilityCategory
00226     };
00227 
00233     enum ErrorType {
00238         NoError = 0,
00242         NormalError = 1,
00248         FatalError = 2
00249     };
00250 
00255     PHONON_EXPORT QString categoryToString(Category c);
00256 
00257     // TODO: naming
00258     /*enum MediaStreamType {
00259         Audio = 1,
00260         Video = 2,
00261         StillImage = 4,
00262         Subtitle = 8,
00263         AllMedia = 0xFFFFFFFF
00264     };
00265     Q_DECLARE_FLAGS(MediaStreamTypes, MediaStreamType)*/
00266 } // namespace Phonon
00267 //Q_DECLARE_OPERATORS_FOR_FLAGS(Phonon::MediaStreamTypes)
00268 
00269 QT_END_NAMESPACE
00270 
00271 //X class kdbgstream;
00272 //X #include <kdebug.h>
00273 //X /**
00274 //X  * Implements needed operator to use Phonon::State with kDebug
00275 //X  */
00276 //X inline PHONON_EXPORT kdbgstream &operator<<(kdbgstream  & stream, const Phonon::State state)
00277 //X {
00278 //X     switch(state)
00279 //X     {
00280 //X     case Phonon::ErrorState:
00281 //X         stream << "ErrorState";
00282 //X         break;
00283 //X     case Phonon::LoadingState:
00284 //X         stream << "LoadingState";
00285 //X         break;
00286 //X     case Phonon::StoppedState:
00287 //X         stream << "StoppedState";
00288 //X         break;
00289 //X     case Phonon::PlayingState:
00290 //X         stream << "PlayingState";
00291 //X         break;
00292 //X     case Phonon::BufferingState:
00293 //X         stream << "BufferingState";
00294 //X         break;
00295 //X     case Phonon::PausedState:
00296 //X         stream << "PausedState";
00297 //X         break;
00298 //X     }
00299 //X     return stream;
00300 //X }
00301 
00302 #include <QtCore/QMetaType>
00303 
00304 Q_DECLARE_METATYPE(Phonon::State)
00305 Q_DECLARE_METATYPE(Phonon::ErrorType)
00306 Q_DECLARE_METATYPE(Phonon::Category)
00307 
00308 QT_END_HEADER
00309 
00310 // vim: sw=4 ts=4 tw=80
00311 #endif // PHONONNAMESPACE_H