summaryrefslogtreecommitdiff
path: root/muse2/synti/fluidsynth
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/synti/fluidsynth')
-rw-r--r--muse2/synti/fluidsynth/fluidsynthgui.cpp19
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.cpp7
2 files changed, 14 insertions, 12 deletions
diff --git a/muse2/synti/fluidsynth/fluidsynthgui.cpp b/muse2/synti/fluidsynth/fluidsynthgui.cpp
index 39344c02..18d5df59 100644
--- a/muse2/synti/fluidsynth/fluidsynthgui.cpp
+++ b/muse2/synti/fluidsynth/fluidsynthgui.cpp
@@ -160,12 +160,13 @@ void FluidSynthGui::pushClicked()
void FluidSynthGui::loadClicked()
{
- QString filename = QFileDialog::getOpenFileName(lastdir, QString("*.[Ss][Ff]2"),
- this,
- "Load Soundfont dialog",
- "Choose soundfont");
+ QString filename = QFileDialog::getOpenFileName(this,
+ tr("Choose soundfont"),
+ lastdir,
+ QString("*.[Ss][Ff]2"));
+
if (filename != QString::null) {
- int lastslash = filename.findRev('/');
+ int lastslash = filename.lastIndexOf('/');
lastdir = filename.left(lastslash);
sendLastdir(lastdir);
@@ -180,10 +181,10 @@ void FluidSynthGui::loadClicked()
void FluidSynthGui::sendLastdir(QString dir)
{
- int l = strlen(dir)+2;
+ int l = dir.length()+2;
byte data[l];
data[0] = FS_LASTDIR_CHANGE;
- memcpy(data+1, dir.toLatin1(), strlen(dir)+1);
+ memcpy(data+1, dir.toLatin1(), dir.length()+1);
sendSysex(data,l);
}
@@ -341,7 +342,7 @@ void FluidSynthGui::processEvent(const MidiPlayEvent& ev)
}
case FS_CHORUS_TYPE: {
ChorusType->blockSignals(true);
- ChorusType->setCurrentItem(val);
+ ChorusType->setCurrentIndex(val);
ChorusType->blockSignals(false);
break;
}
@@ -610,7 +611,7 @@ void FluidSynthGui::popClicked()
void FluidSynthGui::sfItemClicked(QTreeWidgetItem* item, int /*col*/)
{
if (item != 0) {
- currentlySelectedFont = atoi(item->text(FS_ID_COL));
+ currentlySelectedFont = atoi(item->text(FS_ID_COL).toLatin1().constData());
Pop->setEnabled(true);
}
else {
diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp
index c9d5ef4d..0802614b 100644
--- a/muse2/synti/fluidsynth/fluidsynti.cpp
+++ b/muse2/synti/fluidsynth/fluidsynti.cpp
@@ -112,7 +112,7 @@ bool FluidSynth::init(const char* name)
gui = new FluidSynthGui();
gui->show();
- gui->setCaption(name);
+ gui->setWindowTitle(name);
lastdir= "";
currentlyLoadedFonts = 0;
@@ -363,10 +363,11 @@ void FluidSynth::parseInitData(int n, const byte* d)
for (int i=0; i<nr_of_fonts; i++) {
fonts[i].filename = (char*)(chptr);
chptr+=(strlen(fonts[i].filename.c_str())+1);
+ QByteArray ba = projPathPtr->toAscii();
if (QFileInfo(fonts[i].filename.c_str()).isRelative()) {
printf("path is relative, we append full path!\n");
- fonts[i].filename = projPathPtr->ascii() + std::string("/")+ fonts[i].filename;
+ fonts[i].filename = ba.constData() + std::string("/")+ fonts[i].filename;
}
std::cout << "SOUNDFONT FILENAME + PATH " << fonts[i].filename << std::endl;
}
@@ -589,7 +590,7 @@ static void* fontLoadThread(void* t)
//Strip off the filename
QString temp = QString(filename);
- QString name = temp.right(temp.length() - temp.findRev('/',-1) - 1);
+ QString name = temp.right(temp.length() - temp.lastIndexOf('/',-1) - 1);
name = name.left(name.length()-4); //Strip off ".sf2"
font.name = name.toLatin1().constData();
fptr->stack.push_front(font);