summaryrefslogtreecommitdiff
path: root/muse2/synti
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/synti')
-rw-r--r--muse2/synti/simpledrums2/simpledrums.cpp22
-rw-r--r--muse2/synti/simpledrums2/simpledrumsgui.cpp2
2 files changed, 22 insertions, 2 deletions
diff --git a/muse2/synti/simpledrums2/simpledrums.cpp b/muse2/synti/simpledrums2/simpledrums.cpp
index 2cc42ba6..d62c5374 100644
--- a/muse2/synti/simpledrums2/simpledrums.cpp
+++ b/muse2/synti/simpledrums2/simpledrums.cpp
@@ -31,6 +31,7 @@
#include "simpledrums.h"
#include <samplerate.h>
+#include <QFileDialog>
const char* SimpleSynth::synth_state_descr[] =
{
@@ -1333,11 +1334,30 @@ bool SimpleSynth::loadSample(int chno, const char* filename)
// Thread stuff:
SS_SampleLoader* loader = new SS_SampleLoader;
loader->channel = ch;
- loader->filename = std::string(filename);
loader->ch_no = chno;
if (SS_DEBUG) {
printf("Loader filename is: %s\n", filename);
}
+
+ if (QFile::exists(filename))
+ {
+ loader->filename = std::string(filename);
+ }
+ 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 sample: %1 - Choose sample").arg(filename),
+ filename,
+ QString("Samples *.wav *.ogg *.flac (*.wav *.WAV *.ogg *.flac);;All files (*)"));
+ loader->filename = newName.toStdString();
+ }
+
+
pthread_t sampleThread;
pthread_attr_t* attributes = (pthread_attr_t*) malloc(sizeof(pthread_attr_t));
pthread_attr_init(attributes);
diff --git a/muse2/synti/simpledrums2/simpledrumsgui.cpp b/muse2/synti/simpledrums2/simpledrumsgui.cpp
index f5e38a86..b68a441e 100644
--- a/muse2/synti/simpledrums2/simpledrumsgui.cpp
+++ b/muse2/synti/simpledrums2/simpledrumsgui.cpp
@@ -808,7 +808,7 @@ void SimpleSynthGui::loadSampleDialogue(int channel)
this,
tr("Load sample dialog"),
lastDir,
- QString("*.wav *.WAV"));
+ QString("Samples *.wav *.ogg *.flac (*.wav *.WAV *.ogg *.flac);;All files (*)"));
if (filename != QString::null) {
QFileInfo fi(filename);