6
6
License as published by the Free Software Foundation; either
7
7
version 2.1 of the License, or (at your option) version 3, or any
8
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
9
successor approved by the membership of KDE e.V.), Nokia Corporation
10
10
(or its successors, if any) and the KDE Free Qt Foundation, which shall
11
11
act as a proxy defined in Section 6 of version 3 of the license.
15
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
16
Lesser General Public License for more details.
18
You should have received a copy of the GNU Lesser General Public
18
You should have received a copy of the GNU Lesser General Public
19
19
License along with this library. If not, see <http://www.gnu.org/licenses/>.
254
254
if (d->mediaSource.type() == MediaSource::Stream) {
255
255
Q_ASSERT(d->mediaSource.stream());
256
256
d->mediaSource.stream()->d_func()->setMediaObjectPrivate(d);
258
258
#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
260
260
INTERFACE_CALL(setSource(d->mediaSource));
453
453
Q_ASSERT(m_backendObject);
454
454
//pDebug() << Q_FUNC_INFO;
456
// Queue the stateChanged connection to prevent issues with Amarok's engine controller.
457
// On error Amarok's engine controller will delete the MediaObject, meaning if
458
// the error state was emitted from the same thread it will destroy the backend's
459
// MediaObject *while* it is doing something.
460
// By queuing the connection the MediaObject can finish whatever it is doing
461
// before Amarok starts doing nasty things to us.
456
462
#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
457
QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SLOT(_k_stateChanged(Phonon::State, Phonon::State)));
463
QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SLOT(_k_stateChanged(Phonon::State, Phonon::State)), Qt::QueuedConnection);
459
QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SIGNAL(stateChanged(Phonon::State, Phonon::State)));
465
QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SIGNAL(stateChanged(Phonon::State, Phonon::State)), Qt::QueuedConnection);
460
466
#endif // QT_NO_PHONON_ABSTRACTMEDIASTREAM
461
467
QObject::connect(m_backendObject, SIGNAL(tick(qint64)), q, SIGNAL(tick(qint64)));
462
468
QObject::connect(m_backendObject, SIGNAL(seekableChanged(bool)), q, SIGNAL(seekableChanged(bool)));
464
470
QObject::connect(m_backendObject, SIGNAL(hasVideoChanged(bool)), q, SIGNAL(hasVideoChanged(bool)));
465
471
#endif //QT_NO_PHONON_VIDEO
466
472
QObject::connect(m_backendObject, SIGNAL(bufferStatus(int)), q, SIGNAL(bufferStatus(int)));
467
QObject::connect(m_backendObject, SIGNAL(finished()), q, SIGNAL(finished()));
473
QObject::connect(m_backendObject, SIGNAL(finished()), q, SIGNAL(finished()), Qt::QueuedConnection);
468
474
QObject::connect(m_backendObject, SIGNAL(aboutToFinish()), q, SLOT(_k_aboutToFinish()));
469
475
QObject::connect(m_backendObject, SIGNAL(prefinishMarkReached(qint32)), q, SIGNAL(prefinishMarkReached(qint32)));
470
476
QObject::connect(m_backendObject, SIGNAL(totalTimeChanged(qint64)), q, SIGNAL(totalTimeChanged(qint64)));
471
477
QObject::connect(m_backendObject, SIGNAL(metaDataChanged(const QMultiMap<QString, QString> &)),
472
478
q, SLOT(_k_metaDataChanged(const QMultiMap<QString, QString> &)));
473
QObject::connect(m_backendObject, SIGNAL(currentSourceChanged(const MediaSource&)),
479
QObject::connect(m_backendObject, SIGNAL(currentSourceChanged(const MediaSource&)),
474
480
q, SLOT(_k_currentSourceChanged(const MediaSource&)));
476
482
// set up attributes