237 |
237 |
238 const bool oldPlayerHasVideo = oldPlayer->hasVideo(); |
238 const bool oldPlayerHasVideo = oldPlayer->hasVideo(); |
239 const bool oldPlayerSeekable = oldPlayer->isSeekable(); |
239 const bool oldPlayerSeekable = oldPlayer->isSeekable(); |
240 |
240 |
241 Phonon::ErrorType error = NoError; |
241 Phonon::ErrorType error = NoError; |
|
242 QString errorMessage; |
242 |
243 |
243 // Determine media type |
244 // Determine media type |
244 switch (source.type()) { |
245 switch (source.type()) { |
245 case MediaSource::LocalFile: |
246 case MediaSource::LocalFile: |
246 mediaType = fileMediaType(source.fileName()); |
247 mediaType = fileMediaType(source.fileName()); |
315 if (oldPlayerSeekable != isSeekable()) { |
317 if (oldPlayerSeekable != isSeekable()) { |
316 emit seekableChanged(isSeekable()); |
318 emit seekableChanged(isSeekable()); |
317 } |
319 } |
318 |
320 |
319 connect(m_player.data(), SIGNAL(totalTimeChanged(qint64)), SIGNAL(totalTimeChanged(qint64))); |
321 connect(m_player.data(), SIGNAL(totalTimeChanged(qint64)), SIGNAL(totalTimeChanged(qint64))); |
320 connect(m_player.data(), SIGNAL(stateChanged(Phonon::State, Phonon::State)), SIGNAL(stateChanged(Phonon::State, Phonon::State))); |
322 connect(m_player.data(), SIGNAL(stateChanged(Phonon::State,Phonon::State)), SIGNAL(stateChanged(Phonon::State,Phonon::State))); |
321 connect(m_player.data(), SIGNAL(finished()), SIGNAL(finished())); |
323 connect(m_player.data(), SIGNAL(finished()), SIGNAL(finished())); |
322 connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); |
324 connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); |
323 |
325 connect(m_player.data(), SIGNAL(metaDataChanged(QMultiMap<QString,QString>)), SIGNAL(metaDataChanged(QMultiMap<QString,QString>))); |
324 if (error != NoError ) { |
326 |
325 newPlayer = new DummyPlayer(); |
327 // We need to call setError() after doing the connects, otherwise the |
326 newPlayer->setError(error); |
328 // error won't be received. |
|
329 if (error != NoError) { |
|
330 Q_ASSERT(m_player); |
|
331 m_player->setError(error, errorMessage); |
327 } |
332 } |
328 |
333 |
329 TRACE_EXIT_0(); |
334 TRACE_EXIT_0(); |
330 } |
335 } |
331 |
336 |
351 |
356 |
352 void MMF::MediaObject::setTransitionTime(qint32 time) |
357 void MMF::MediaObject::setTransitionTime(qint32 time) |
353 { |
358 { |
354 m_player->setTransitionTime(time); |
359 m_player->setTransitionTime(time); |
355 } |
360 } |
356 |
|
357 |
|
358 //----------------------------------------------------------------------------- |
|
359 // VolumeObserver |
|
360 //----------------------------------------------------------------------------- |
|
361 |
361 |
362 void MMF::MediaObject::volumeChanged(qreal volume) |
362 void MMF::MediaObject::volumeChanged(qreal volume) |
363 { |
363 { |
364 m_player->volumeChanged(volume); |
364 m_player->volumeChanged(volume); |
365 } |
365 } |