40 class QuickTimeMetaData; |
36 class QuickTimeMetaData; |
41 class AudioGraph; |
37 class AudioGraph; |
42 class MediaObjectAudioNode; |
38 class MediaObjectAudioNode; |
43 |
39 |
44 class MediaObject : public MediaNode, |
40 class MediaObject : public MediaNode, |
45 public Phonon::MediaObjectInterface |
41 public Phonon::MediaObjectInterface, public Phonon::AddonInterface |
46 #ifndef QT_NO_PHONON_MEDIACONTROLLER |
|
47 , public Phonon::AddonInterface |
|
48 #endif |
|
49 { |
42 { |
50 Q_OBJECT |
43 Q_OBJECT |
51 Q_INTERFACES(Phonon::MediaObjectInterface Phonon::AddonInterface) |
44 Q_INTERFACES(Phonon::MediaObjectInterface Phonon::AddonInterface) |
52 |
45 |
53 public: |
46 public: |
97 void setVolumeOnMovie(float volume); |
90 void setVolumeOnMovie(float volume); |
98 bool setAudioDeviceOnMovie(int id); |
91 bool setAudioDeviceOnMovie(int id); |
99 |
92 |
100 int videoOutputCount(); |
93 int videoOutputCount(); |
101 |
94 |
102 #if QT_ALLOW_QUICKTIME |
|
103 void displayLinkEvent(); |
|
104 #endif |
|
105 |
|
106 signals: |
95 signals: |
107 void stateChanged(Phonon::State,Phonon::State); |
96 void stateChanged(Phonon::State,Phonon::State); |
108 void tick(qint64); |
97 void tick(qint64); |
109 void seekableChanged(bool); |
98 void seekableChanged(bool); |
110 void hasVideoChanged(bool); |
99 void hasVideoChanged(bool); |
113 void aboutToFinish(); |
102 void aboutToFinish(); |
114 void prefinishMarkReached(qint32); |
103 void prefinishMarkReached(qint32); |
115 void totalTimeChanged(qint64); |
104 void totalTimeChanged(qint64); |
116 void metaDataChanged(QMultiMap<QString,QString>); |
105 void metaDataChanged(QMultiMap<QString,QString>); |
117 void currentSourceChanged(const MediaSource &newSource); |
106 void currentSourceChanged(const MediaSource &newSource); |
118 |
|
119 // Add-on interface: |
|
120 void availableSubtitlesChanged(); |
|
121 void availableAudioChannelsChanged(); |
|
122 void titleChanged(int); |
|
123 void availableTitlesChanged(int); |
|
124 void chapterChanged(int); |
|
125 void availableChaptersChanged(int); |
|
126 void angleChanged(int); |
|
127 void availableAnglesChanged(int); |
|
128 |
107 |
129 protected: |
108 protected: |
130 void mediaNodeEvent(const MediaNodeEvent *event); |
109 void mediaNodeEvent(const MediaNodeEvent *event); |
131 bool event(QEvent *event); |
110 bool event(QEvent *event); |
132 |
111 |
137 QuickTimeVideoPlayer *m_videoPlayer; |
116 QuickTimeVideoPlayer *m_videoPlayer; |
138 QuickTimeAudioPlayer *m_audioPlayer; |
117 QuickTimeAudioPlayer *m_audioPlayer; |
139 QuickTimeVideoPlayer *m_nextVideoPlayer; |
118 QuickTimeVideoPlayer *m_nextVideoPlayer; |
140 QuickTimeAudioPlayer *m_nextAudioPlayer; |
119 QuickTimeAudioPlayer *m_nextAudioPlayer; |
141 MediaObjectAudioNode *m_mediaObjectAudioNode; |
120 MediaObjectAudioNode *m_mediaObjectAudioNode; |
142 |
121 QuickTimeMetaData *m_metaData; |
143 #if QT_ALLOW_QUICKTIME |
|
144 CVDisplayLinkRef m_displayLink; |
|
145 QMutex m_displayLinkMutex; |
|
146 bool m_pendingDisplayLinkEvent; |
|
147 void startDisplayLink(); |
|
148 void stopDisplayLink(); |
|
149 #endif |
|
150 |
122 |
151 qint32 m_tickInterval; |
123 qint32 m_tickInterval; |
152 qint32 m_transitionTime; |
124 qint32 m_transitionTime; |
153 quint32 m_prefinishMark; |
125 quint32 m_prefinishMark; |
154 quint32 m_currentTime; |
126 quint32 m_currentTime; |
155 float m_percentageLoaded; |
127 float m_percentageLoaded; |
156 |
128 |
157 int m_tickTimer; |
129 int m_tickTimer; |
158 int m_videoTimer; |
130 int m_bufferTimer; |
159 int m_audioTimer; |
|
160 int m_rapidTimer; |
131 int m_rapidTimer; |
161 |
132 |
162 bool m_waitNextSwap; |
133 bool m_waitNextSwap; |
163 int m_swapTimeLeft; |
134 int m_swapTimeLeft; |
164 QTime m_swapTime; |
135 QTime m_swapTime; |
165 bool m_autoplayTitles; |
|
166 |
136 |
167 void synchAudioVideo(); |
137 void synchAudioVideo(); |
168 void updateCurrentTime(); |
138 void updateCurrentTime(); |
169 void swapCurrentWithNext(qint32 transitionTime); |
139 void swapCurrentWithNext(qint32 transitionTime); |
170 bool setState(Phonon::State state); |
140 bool setState(Phonon::State state); |
171 void pause_internal(); |
141 void pause_internal(); |
172 void play_internal(); |
142 void play_internal(); |
173 void setupAudioSystem(); |
143 void setupAudioSystem(); |
174 void restartAudioVideoTimers(); |
144 void updateTimer(int &timer, int interval); |
|
145 void bufferAudioVideo(); |
175 void updateRapidly(); |
146 void updateRapidly(); |
176 void updateCrossFade(); |
147 void updateCrossFade(); |
177 void updateAudioBuffers(); |
148 void updateAudioBuffers(); |
178 void updateLipSynch(int allowedOffset); |
149 void updateLipSynch(int allowedOffset); |
179 void updateVideoFrames(); |
150 void updateVideoFrames(); |
181 void setMute(bool mute); |
152 void setMute(bool mute); |
182 void inspectAudioGraphRecursive(AudioConnection *connection, int &effectCount, int &outputCount); |
153 void inspectAudioGraphRecursive(AudioConnection *connection, int &effectCount, int &outputCount); |
183 void inspectVideoGraphRecursive(MediaNode *node, int &effectCount, int &outputCount); |
154 void inspectVideoGraphRecursive(MediaNode *node, int &effectCount, int &outputCount); |
184 void inspectGraph(); |
155 void inspectGraph(); |
185 bool isCrossFading(); |
156 bool isCrossFading(); |
186 void setCurrentTrack(int track); |
|
187 |
157 |
188 QString m_errorString; |
158 QString m_errorString; |
189 Phonon::ErrorType m_errorType; |
159 Phonon::ErrorType m_errorType; |
190 bool checkForError(); |
160 bool checkForError(); |
191 |
161 |