mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
OP-279 Checked in a fix for sound issue on Windows: should now be OK on both Windows and Linux. Someone either send me a mac, or test on their own to confirm it's ok on that platform too!
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2477 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
9758026d5a
commit
30d8fcd2b0
@ -404,11 +404,14 @@ void SoundNotifyPlugin::stateChanged(Phonon::State newstate, Phonon::State oldst
|
||||
qDebug() << "New State: " << newstate;
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
// This is a hack to force Linux to wait until the end of the
|
||||
// wav file before moving to the next in the queue
|
||||
// wav file before moving to the next in the queue.
|
||||
// I wish I did not have to go through a #define, but I did not
|
||||
// manage to make this work on both platforms any other way!
|
||||
if (phonon.mo->totalTime()>0)
|
||||
phonon.mo->setTransitionTime(phonon.mo->totalTime());
|
||||
|
||||
#endif
|
||||
if((newstate == Phonon::PausedState) ||
|
||||
(newstate == Phonon::StoppedState))
|
||||
{
|
||||
|
@ -101,28 +101,28 @@ QString NotifyPluginConfiguration::parseNotifyMessage()
|
||||
// generate queue of sound files to play
|
||||
notifyMessageList.clear();
|
||||
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+ getCurrentLanguage()+"/"+getSound1()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + getCurrentLanguage()+"/"+getSound1()+".wav"));
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound1()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound1()+".wav"));
|
||||
else
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "default/"+getSound2()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "default/"+getSound1()+".wav"));
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound1()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound1()+".wav"));
|
||||
|
||||
if(getSound2()!="")
|
||||
{
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + getCurrentLanguage()+"/"+getSound2()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + getCurrentLanguage()+"/"+getSound2()+".wav"));
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound2()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound2()+".wav"));
|
||||
else
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "default/"+getSound2()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "default/"+getSound2()+".wav"));
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound2()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound2()+".wav"));
|
||||
}
|
||||
|
||||
if(getSound3()!="")
|
||||
{
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+getCurrentLanguage()+"/"+getSound3()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath()+getCurrentLanguage()+"/"+getSound3()+".wav"));
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+ "/" + getCurrentLanguage()+"/"+getSound3()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath()+ "/" + getCurrentLanguage()+"/"+getSound3()+".wav"));
|
||||
else
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"default/"+getSound3()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath()+"default/"+getSound3()+".wav"));
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+getSound3()+".wav")))
|
||||
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+getSound3()+".wav"));
|
||||
}
|
||||
|
||||
switch(str1.at(0).toAscii())
|
||||
@ -204,12 +204,12 @@ QString NotifyPluginConfiguration::parseNotifyMessage()
|
||||
}
|
||||
foreach(QString fileName,numberFiles) {
|
||||
fileName+=".wav";
|
||||
QString filePath = getSoundCollectionPath()+ QDir::toNativeSeparators(getCurrentLanguage()+"/"+fileName);
|
||||
QString filePath = QDir::toNativeSeparators(getSoundCollectionPath()+"/"+ getCurrentLanguage()+"/"+fileName);
|
||||
if(QFile::exists(filePath))
|
||||
notifyMessageList.insert(position++,getSoundCollectionPath()+ QDir::toNativeSeparators(getCurrentLanguage()+"/"+fileName));
|
||||
notifyMessageList.insert(position++,QDir::toNativeSeparators(getSoundCollectionPath()+ "/"+getCurrentLanguage()+"/"+fileName));
|
||||
else {
|
||||
if(QFile::exists(getSoundCollectionPath()+QDir::toNativeSeparators("default/"+fileName)))
|
||||
notifyMessageList.insert(position++,getSoundCollectionPath()+QDir::toNativeSeparators("default/"+fileName));
|
||||
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+fileName)))
|
||||
notifyMessageList.insert(position++,QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+fileName));
|
||||
else {
|
||||
notifyMessageList.clear();
|
||||
break; // if no some of *.wav files, then don't play number!
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
QString getObjectField() const { return objectField; }
|
||||
void setObjectField(QString text) { objectField = text; }
|
||||
|
||||
QString getSoundCollectionPath() const { return soundCollectionPath; }
|
||||
QString getSoundCollectionPath() const { return soundCollectionPath; }
|
||||
void setSoundCollectionPath(QString text) { soundCollectionPath = text; }
|
||||
|
||||
QString getCurrentLanguage() const { return currentLanguage; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user