summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
Diffstat (limited to 'muse2')
-rw-r--r--muse2/ChangeLog2
-rw-r--r--muse2/synti/simpledrums2/simpledrums.cpp22
-rw-r--r--muse2/synti/simpledrums2/simpledrumsgui.cpp2
3 files changed, 24 insertions, 2 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index 3b9168b0..ffb4d1ea 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,5 @@
+14.12.2012:
+ - Made simpledrums ask to load another sample if a sample wasn't found during loading (rj)
12.12.2012:
- Fixed some vst controls stuck. (Tim)
- Added vst master timebase (sequencers should work now). WIP Not quite finished. (Tim)
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);