From 4da5d9a1f93b275913019aa84fd74d06e35f6553 Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Thu, 25 Nov 2010 02:43:43 +0000 Subject: Fixed crash in FluidSynthGui::channelItemClicked(): Use item->row() for the channel. --- muse2/synti/fluidsynth/fluidsynthgui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'muse2/synti') diff --git a/muse2/synti/fluidsynth/fluidsynthgui.cpp b/muse2/synti/fluidsynth/fluidsynthgui.cpp index bb82fa92..d591ecb9 100644 --- a/muse2/synti/fluidsynth/fluidsynthgui.cpp +++ b/muse2/synti/fluidsynth/fluidsynthgui.cpp @@ -472,6 +472,7 @@ QString FluidSynthGui::getSoundFontName(int id) void FluidSynthGui::channelItemClicked(QTableWidgetItem* item) { int col = item->column(); + int row = item->row(); if (col == FS_SF_ID_COL) { QMenu* popup = new QMenu(this); @@ -522,7 +523,8 @@ void FluidSynthGui::channelItemClicked(QTableWidgetItem* item) sfid = getSoundFontId(act->text()); fontname = getSoundFontName(sfid); } - byte channel = atoi(item->text().latin1()) - 1; + //byte channel = atoi(item->text().latin1()) - 1; + byte channel = row; sendChannelChange(sfid, channel); item->setText(fontname); } @@ -539,7 +541,8 @@ void FluidSynthGui::channelItemClicked(QTableWidgetItem* item) yes->setData(1); QAction * no = popup->addAction("No"); no->setData(0); - byte channel = atoi(item->text().latin1()) - 1; + //byte channel = atoi(item->text().latin1()) - 1; + byte channel = row; QAction * act2 = popup->exec(ppt, 0); if (act2) { -- cgit v1.2.3