summaryrefslogtreecommitdiff
path: root/muse2/synti/fluidsynth
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2012-12-18 16:19:29 +0000
committerRobert Jonsson <spamatica@gmail.com>2012-12-18 16:19:29 +0000
commita227872303382ecb2020e4408525f0b25f41e88d (patch)
tree99b9971aeec5ea71427829f24f83f9aacbeeb3db /muse2/synti/fluidsynth
parenta2ae7e06099f1ceb38d752909e3c17055fbc59ca (diff)
fluidsynth and simpledrums search project folder for missing sounds
Diffstat (limited to 'muse2/synti/fluidsynth')
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp
index d3561fb9..eddedc87 100644
--- a/muse2/synti/fluidsynth/fluidsynti.cpp
+++ b/muse2/synti/fluidsynth/fluidsynti.cpp
@@ -616,15 +616,21 @@ bool FluidSynth::pushSoundfont (const char* filename, int extid)
else
{
- // TODO: Strings should be translated, this does
- // however require the class to be derived from qobject
- // tried in vain to make the call in the gui object
- // could'nt get it to work due to symbol missing in .so ...
- QString newName = QFileDialog::getOpenFileName(0,
- QString("Can't find soundfont: %1 - Choose soundfont").arg(filename),
- filename,
- QString("Soundfonts (*.sf2);;All files (*)"));
- helper->filename = newName.toStdString();
+ //printf("current path: %s \nmuseProject %s\nfilename %s\n",QDir::currentPath().toLatin1().data(), MusEGlobal::museProject.toLatin1().data(), filename);
+ QFileInfo fi(filename);
+ if (QFile::exists(fi.fileName()))
+ helper->filename = QDir::currentPath().toStdString() + "/" + fi.fileName().toStdString();
+ else {
+ // TODO: Strings should be translated, this does
+ // however require the class to be derived from qobject
+ // tried in vain to make the call in the gui object
+ // could'nt get it to work due to symbol missing in .so ...
+ QString newName = QFileDialog::getOpenFileName(0,
+ QString("Can't find soundfont: %1 - Choose soundfont").arg(filename),
+ filename,
+ QString("Soundfonts (*.sf2);;All files (*)"));
+ helper->filename = newName.toStdString();
+ }
}
if (pthread_create(&fontThread, attributes, ::fontLoadThread, (void*) helper))