diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-01-16 16:46:27 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-01-16 16:46:27 +0800 |
commit | ebda8030fdb70a8162c67947dd980b59337f2d05 (patch) | |
tree | 3ef4b43e8ca4f58788888e18d9feaa4cf74f5107 /qmppresetselect.cpp | |
parent | e3a5241953051e97978ac42fa278572ae735abb3 (diff) | |
download | QMidiPlayer-ebda8030fdb70a8162c67947dd980b59337f2d05.tar.xz |
Peaceful Romancer. (WTF)0.6.2-2
Diffstat (limited to 'qmppresetselect.cpp')
-rw-r--r-- | qmppresetselect.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qmppresetselect.cpp b/qmppresetselect.cpp index d4dd38a..c0e6f75 100644 --- a/qmppresetselect.cpp +++ b/qmppresetselect.cpp @@ -17,8 +17,9 @@ qmpPresetSelector::~qmpPresetSelector() void qmpPresetSelector::showEvent(QShowEvent *e) { - e->accept();memset(presets,0,sizeof(presets)); + memset(presets,0,sizeof(presets)); CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer(); + if(!plyr->getSFCount())return e->ignore(); int sfc=plyr->getSFCount(); for(int i=sfc-1;i>=0;--i) { @@ -36,11 +37,13 @@ void qmpPresetSelector::showEvent(QShowEvent *e) for(int j=0;j<128;++j)if(strlen(presets[i][j])){b=1;break;} if(b)ui->lwBankSelect->addItem(QString::number(i)); } + e->accept(); } void qmpPresetSelector::setupWindow(int chid) { CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer(); - ch=chid;int b,p,r;char name[30]; + if(!plyr->getSFCount())return; + ch=chid;int b=0,p=0,r;char name[64]; sprintf(name,"Preset Selection - Channel #%d",ch); setWindowTitle(name); plyr->getChannelPreset(chid,&b,&p,name); |