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 | #ifndef MEDIAOBJECT_P_H |
24 | #define MEDIAOBJECT_P_H |
25 | |
26 | #include "mediaobject.h" |
27 | #include "medianode_p.h" |
28 | #include <QtCore/QString> |
29 | #include "medianodedestructionhandler_p.h" |
30 | #include "mediasource.h" |
31 | #include <QtCore/QQueue> |
32 | |
33 | QT_BEGIN_NAMESPACE |
34 | |
35 | namespace Phonon |
36 | { |
37 | class KioFallback; |
38 | class KioFallbackImpl; |
39 | class FrontendInterfacePrivate; |
40 | |
41 | class MediaObjectPrivate : public MediaNodePrivate, private MediaNodeDestructionHandler |
42 | { |
43 | friend class KioFallbackImpl; |
44 | friend class AbstractMediaStream; |
45 | friend class AbstractMediaStreamPrivate; |
46 | Q_DECLARE_PUBLIC(MediaObject) |
47 | public: |
48 | virtual QObject *qObject() { return q_func(); } |
49 | QList<FrontendInterfacePrivate *> interfaceList; |
50 | protected: |
51 | virtual bool aboutToDeleteBackendObject(); |
52 | virtual void createBackendObject(); |
53 | virtual void phononObjectDestroyed(MediaNodePrivate *); |
54 | PHONON_EXPORT void setupBackendObject(); |
55 | |
56 | void _k_resumePlay(); |
57 | void _k_resumePause(); |
58 | void _k_metaDataChanged(const QMultiMap<QString, QString> &); |
59 | void _k_aboutToFinish(); |
60 | void _k_currentSourceChanged(const MediaSource &); |
61 | #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM |
62 | void streamError(Phonon::ErrorType, const QString &); |
63 | PHONON_EXPORT void _k_stateChanged(Phonon::State, Phonon::State); |
64 | #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM |
65 | |
66 | MediaObjectPrivate() |
67 | : currentTime(0), |
68 | tickInterval(0), |
69 | metaData(), |
70 | errorString(), |
71 | prefinishMark(0), |
72 | transitionTime(0), // gapless playback |
73 | #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM |
74 | kiofallback(0), |
75 | #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM |
76 | state(Phonon::LoadingState) |
77 | #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM |
78 | , errorType(Phonon::NormalError), |
79 | errorOverride(false), |
80 | ignoreLoadingToBufferingStateChange(false), |
81 | ignoreErrorToLoadingStateChange(false) |
82 | #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM |
83 | { |
84 | } |
85 | |
86 | qint64 currentTime; |
87 | qint32 tickInterval; |
88 | QMultiMap<QString, QString> metaData; |
89 | QString errorString; |
90 | qint32 prefinishMark; |
91 | qint32 transitionTime; |
92 | #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM |
93 | AbstractMediaStream *kiofallback; |
94 | #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM |
95 | State state |
96 | #ifdef QT_NO_PHONON_ABSTRACTMEDIASTREAM |
97 | ; |
98 | #else |
99 | : 8; |
100 | ErrorType errorType : 4; |
101 | bool errorOverride : 1; |
102 | bool ignoreLoadingToBufferingStateChange : 1; |
103 | bool ignoreErrorToLoadingStateChange : 1; |
104 | #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM |
105 | MediaSource mediaSource; |
106 | QQueue<MediaSource> sourceQueue; |
107 | }; |
108 | } |
109 | |
110 | QT_END_NAMESPACE |
111 | |
112 | #endif // MEDIAOBJECT_P_H |
113 | // vim: sw=4 ts=4 tw=80 |
114 | |