QObject(parent)
{
- defaultsound_ = "/opt/KitchenAlert/06capemaycloser_modifiedlouder.mp3";
+ //THIS NEEDS TESTING: DOES IT REALLY CHANGE TUNE WHEN RESTARTING THE APPLICATION?
+
+ defaultsound_ = "/home/opt/KitchenAlert/Doorbell-old-tring-modified-multiplied-low-quality.mp3";
QString filename;
QSettings settings("KitchenAlert","KitchenAlert");
// settings.clear(); //REMOVE THIS AFTER TESTING!!!!!!
bool useDefaultSound = settings.value("UseDefaultSound",true).toBool();
- qDebug() << "In AlertSound constructor UseDefaultSound is " << useDefaultSound;
+// qDebug() << "In AlertSound constructor UseDefaultSound is " << useDefaultSound;
if (useDefaultSound == true)
{
filename = defaultsound_;
pSound_ = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(filename));
}
+AlertSound::~AlertSound()
+{
+
+ if (pSound_ != NULL)
+ {
+ delete pSound_;
+ }
+}
+
void AlertSound::play()
{
- pSound_->stop(); //Just testing if stopping the previous alert will prevent the jammming of the sound
+ pSound_->stop(); //Just testing if stopping the previous alert will prevent the jammming of the sound (only partially, but since it helped some, keeping it even if the problem was solved otherwise)
pSound_->play();
qDebug() << "Sound should be played now";
}
{
pSound_->stop();
+ qDebug() << pSound_->state();
+ qDebug() << "Sound stopped by AlertSound.";
}