| 1 |
/* This file is part of the KDE project |
| 2 |
Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org> |
| 3 |
|
| 4 |
This library is free software; you can redistribute it and/or |
| 5 |
modify it under the terms of the GNU Lesser General Public |
| 6 |
License as published by the Free Software Foundation; either |
| 7 |
version 2.1 of the License, or (at your option) version 3, or any |
| 8 |
later version accepted by the membership of KDE e.V. (or its |
| 9 |
successor approved by the membership of KDE e.V.), Nokia Corporation |
| 10 |
(or its successors, if any) and the KDE Free Qt Foundation, which shall |
| 11 |
act as a proxy defined in Section 6 of version 3 of the license. |
| 12 |
|
| 13 |
This library is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
Lesser General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU Lesser General Public |
| 19 |
License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 20 |
|
| 21 |
*/ |
| 22 |
|
| 23 |
#include "phononnamespace.h" |
| 24 |
#include "phononnamespace_p.h" |
| 25 |
#include "phonondefs_p.h" |
| 26 |
|
| 27 |
#include "factory_p.h" |
| 28 |
|
| 29 |
#include <QtCore/QCoreApplication> |
| 30 |
#include <QtCore/QList> |
| 31 |
|
| 32 |
QT_BEGIN_NAMESPACE |
| 33 |
|
| 34 |
namespace Phonon |
| 35 |
{ |
| 36 |
/*! |
| 37 |
Returns the version number of Phonon at run-time as a string (for |
| 38 |
example, "4.0.0"). This may be a different version than the |
| 39 |
version the application was compiled against. |
| 40 |
|
| 41 |
\sa PHONON_VERSION_STR |
| 42 |
*/ |
| 43 |
const char *phononVersion() |
| 44 |
{ |
| 45 |
return PHONON_VERSION_STR; |
| 46 |
} |
| 47 |
|
| 48 |
QString categoryToString(Category c) |
| 49 |
{ |
| 50 |
switch(c) |
| 51 |
{ |
| 52 |
case Phonon::NoCategory: |
| 53 |
break; |
| 54 |
case Phonon::NotificationCategory: |
| 55 |
return QCoreApplication::translate("Phonon::", "Notifications"); |
| 56 |
case Phonon::MusicCategory: |
| 57 |
return QCoreApplication::translate("Phonon::", "Music"); |
| 58 |
case Phonon::VideoCategory: |
| 59 |
return QCoreApplication::translate("Phonon::", "Video"); |
| 60 |
case Phonon::CommunicationCategory: |
| 61 |
return QCoreApplication::translate("Phonon::", "Communication"); |
| 62 |
case Phonon::GameCategory: |
| 63 |
return QCoreApplication::translate("Phonon::", "Games"); |
| 64 |
case Phonon::AccessibilityCategory: |
| 65 |
return QCoreApplication::translate("Phonon::", "Accessibility"); |
| 66 |
} |
| 67 |
return QString(); |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
static int registerPhononMetaTypes() |
| 72 |
{ |
| 73 |
qRegisterMetaType<Phonon::State>(); |
| 74 |
qRegisterMetaType<Phonon::ErrorType>(); |
| 75 |
qRegisterMetaType<Phonon::Category>(); |
| 76 |
|
| 77 |
// need those for QSettings |
| 78 |
qRegisterMetaType<QList<int> >(); |
| 79 |
qRegisterMetaTypeStreamOperators<QList<int> >("QList<int>"); |
| 80 |
|
| 81 |
return 0; // something |
| 82 |
} |
| 83 |
|
| 84 |
#ifdef Q_CONSTRUCTOR_FUNCTION |
| 85 |
Q_CONSTRUCTOR_FUNCTION(registerPhononMetaTypes) |
| 86 |
#else |
| 87 |
static const int _Phonon_registerMetaTypes = registerPhononMetaTypes(); |
| 88 |
#endif |
| 89 |
|
| 90 |
QT_END_NAMESPACE |
| 91 |
|
| 92 |
// vim: sw=4 ts=4 |