Alignment works + scrolls to the alerting timer
[kitchenalert] / src / alertsound.cpp
index b11f538..c10f065 100644 (file)
@@ -26,8 +26,6 @@
 
 #include <QDebug>
 #include <QSettings>
-#include <QList>
-
 
 
 
@@ -35,6 +33,8 @@ AlertSound::AlertSound(QObject *parent) :
     QObject(parent)
 {
 
+    //THIS NEEDS TESTING: DOES IT REALLY CHANGE TUNE WHEN RESTARTING THE APPLICATION?
+
     defaultsound_ = "/opt/KitchenAlert/06capemaycloser_modifiedlouder.mp3";
     QString filename;
 
@@ -53,32 +53,11 @@ AlertSound::AlertSound(QObject *parent) :
         filename = settings.value("soundfile",defaultsound_).toString();
     }
     pSound_ = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(filename));
-
-
-    //TESTCODE!!!
-
-    QList<Phonon::AudioOutputDevice> audioOutputDevices =
-                 Phonon::BackendCapabilities::availableAudioOutputDevices();
-
-    foreach (Phonon::AudioOutputDevice device, audioOutputDevices)
-    {
-    qDebug() << device.name() << device.description();
-    }
 }
 
 void AlertSound::play()
 {
-
-    //TESTCODE
-
-    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
-
-    Phonon::Path path = Phonon::createPath(pSound_, audioOutput);
-
-    audioOutput->setVolumeDecibel(0);
-
-    //TESTCODE ENDS
-
+    pSound_->stop(); //Just testing if stopping the previous alert will prevent the jammming of the sound
     pSound_->play();
     qDebug() << "Sound should be played now";
 }
@@ -89,6 +68,8 @@ void AlertSound::stop()
     pSound_->stop();
 }
 
+
+
 void AlertSound::setSound(QString filename)
 {
    QSettings settings("KitchenAlert","KitchenAlert");