aboutsummaryrefslogtreecommitdiff
path: root/qmppresetselect.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-12-30 23:45:12 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-12-30 23:45:12 +0800
commitb1be9e45b5abdf0a03181b9cee8dc208a762fe57 (patch)
tree1af8db6a9776af748c1d14e330a30ce61e162bea /qmppresetselect.cpp
parent8dc90ae27c24aec1851215f2cc28ee24eff01ea5 (diff)
downloadQMidiPlayer-b1be9e45b5abdf0a03181b9cee8dc208a762fe57.tar.xz
Complete Darkness. (WTF)
Diffstat (limited to 'qmppresetselect.cpp')
-rw-r--r--qmppresetselect.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/qmppresetselect.cpp b/qmppresetselect.cpp
index f96c99e..22b54ca 100644
--- a/qmppresetselect.cpp
+++ b/qmppresetselect.cpp
@@ -18,7 +18,7 @@ qmppresetselect::~qmppresetselect()
void qmppresetselect::showEvent(QShowEvent *e)
{
e->accept();memset(presets,0,sizeof(presets));
- CMidiPlayer *plyr=((qmpMainWindow*)(this->parent()->parent()))->getPlayer();
+ CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer();
int sfc=plyr->getSFCount();
for(int i=0;i<sfc;++i)
{
@@ -39,8 +39,10 @@ void qmppresetselect::showEvent(QShowEvent *e)
}
void qmppresetselect::setupWindow(int chid)
{
- CMidiPlayer *plyr=((qmpMainWindow*)(this->parent()->parent()))->getPlayer();
+ CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer();
ch=chid;int b,p,r;char name[30];
+ sprintf(name,"Preset Selection - Channel #%d",ch);
+ setWindowTitle(name);
plyr->getChannelPreset(chid,&b,&p,name);
for(int i=0;i<ui->lwBankSelect->count();++i)
{
@@ -66,7 +68,7 @@ void qmppresetselect::on_pbCancel_clicked()
void qmppresetselect::on_pbOk_clicked()
{
- CMidiPlayer *plyr=((qmpMainWindow*)(this->parent()->parent()))->getPlayer();
+ CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer();
int b,p;sscanf(ui->lwBankSelect->currentItem()->text().toStdString().c_str(),"%d",&b);
sscanf(ui->lwPresetSelect->currentItem()->text().toStdString().c_str(),"%d",&p);
plyr->setChannelPreset(ch,b,p);