summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Whiting <jpwhiting@kde.org>2015-09-28 21:24:13 (GMT)
committerJeremy Whiting <jpwhiting@kde.org>2015-09-28 21:24:13 (GMT)
commit13f7a3e35d6d05296f067c84e887317fb4f95bdd (patch)
treed700549161572145a1ab080666374ae915bf8572
parent8f89fbe888c7e00089738877360a160a7bca9017 (diff)
Add call to stateChanged to set initial disc state in phonon interface.
Use "phonon" in test rather than "alsa" to use the phonon interface.
-rw-r--r--src/phonon_interface.cpp5
-rw-r--r--tests/testkcd.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/phonon_interface.cpp b/src/phonon_interface.cpp
index 440b416..45f21db 100644
--- a/src/phonon_interface.cpp
+++ b/src/phonon_interface.cpp
@@ -100,6 +100,7 @@ KPhononCompactDiscPrivate::~KPhononCompactDiscPrivate()
bool KPhononCompactDiscPrivate::createInterface()
{
+ qDebug() << "createInterface called";
Solid::Device opticalDevice(m_udi);
Solid::OpticalDrive *opticalDrive = opticalDevice.as<Solid::OpticalDrive>();
@@ -125,12 +126,14 @@ ProducerWidget *KPhononCompactDiscPrivate::producer()
if(!m_producerWidget) {
Solid::Device opticalDevice(m_udi);
Solid::OpticalDrive *opticalDrive = opticalDevice.as<Solid::OpticalDrive>();
+ qDebug() << "producer called, opticalDrive is " << opticalDrive;
if(opticalDrive) {
Solid::OpticalDisc *opticalDisc = opticalDevice.as<Solid::OpticalDisc>();
qDebug() << "opticalDisc " << opticalDisc;
//if(opticalDisc && (opticalDisc->availableContent() == Solid::OpticalDisc::Audio)) {
m_producerWidget = new ProducerWidget(this, m_udi);
+ stateChanged(m_producerWidget->m_media->state(), Phonon::StoppedState);
//}
}
}
@@ -302,6 +305,7 @@ void KPhononCompactDiscPrivate::tick(qint64 t)
void KPhononCompactDiscPrivate::stateChanged(Phonon::State newstate, Phonon::State)
{
+ qDebug() << "stateChanged with state " << newstate;
KCompactDisc::DiscStatus status;
Q_Q(KCompactDisc);
@@ -321,6 +325,7 @@ void KPhononCompactDiscPrivate::stateChanged(Phonon::State newstate, Phonon::Sta
default:
if(m_tracks == 0) {
m_tracks = m_producerWidget->m_mediaController->availableTitles();
+ qDebug() << "Got " << m_tracks << " tracks from media controller";
if(m_tracks > 0) {
qDebug() << "New disc with " << m_tracks << " tracks";
diff --git a/tests/testkcd.cpp b/tests/testkcd.cpp
index a0d73ab..991791e 100644
--- a/tests/testkcd.cpp
+++ b/tests/testkcd.cpp
@@ -27,7 +27,7 @@ class TestKCD : public QObject
void doTest()
{
qDebug() << "Starting test";
- mKcd->setDevice(mKcd->defaultCdromDeviceName(), 50, true, "alsa");
+ mKcd->setDevice(mKcd->defaultCdromDeviceName(), 50, true, "phonon");
qDebug() << "";
qDebug() << "We have" << mKcd->audioSystems().size() << "audo systems available:";