summaryrefslogtreecommitdiff
path: root/qmpchannelswindow.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 /qmpchannelswindow.cpp
parent8dc90ae27c24aec1851215f2cc28ee24eff01ea5 (diff)
downloadQMidiPlayer-b1be9e45b5abdf0a03181b9cee8dc208a762fe57.tar.xz
Complete Darkness. (WTF)
Diffstat (limited to 'qmpchannelswindow.cpp')
-rw-r--r--qmpchannelswindow.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/qmpchannelswindow.cpp b/qmpchannelswindow.cpp
index 635918e..ce05468 100644
--- a/qmpchannelswindow.cpp
+++ b/qmpchannelswindow.cpp
@@ -11,6 +11,7 @@ qmpchannelswindow::qmpchannelswindow(QWidget *parent) :
{
ui->setupUi(this);
pselectw=new qmppresetselect(this);
+ ceditw=new qmpchanneleditor(this);
connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed()));
for(int i=0;i<16;++i)
{
@@ -25,7 +26,9 @@ qmpchannelswindow::qmpchannelswindow(QWidget *parent) :
ui->twChannels->setCellWidget(i,3,new QDCLabel(""));
((QDCLabel*)ui->twChannels->cellWidget(i,3))->setID(i);
connect(ui->twChannels->cellWidget(i,3),SIGNAL(onDoubleClick(int)),this,SLOT(showPresetWindow(int)));
- ui->twChannels->setCellWidget(i,4,new QPushButton("..."));
+ ui->twChannels->setCellWidget(i,4,new QDCPushButton("..."));
+ ((QDCLabel*)ui->twChannels->cellWidget(i,4))->setID(i);
+ connect(ui->twChannels->cellWidget(i,4),SIGNAL(onClick(int)),this,SLOT(showChannelEditorWindow(int)));
}
ui->twChannels->setColumnWidth(0,32);
ui->twChannels->setColumnWidth(1,32);
@@ -47,7 +50,7 @@ void qmpchannelswindow::channelWindowsUpdate()
{
char data[128],nm[24];
int b,p;
- ((qmpMainWindow*)this->parent())->getPlayer()->getChannelPreset(i,&b,&p,nm);
+ qmpMainWindow::getInstance()->getPlayer()->getChannelPreset(i,&b,&p,nm);
sprintf(data,"%d:%d %s",b,p,nm);
((QLabel*)ui->twChannels->cellWidget(i,3))->setText(data);
}
@@ -61,8 +64,8 @@ void qmpchannelswindow::channelMSChanged()
m=(QCheckBox*)ui->twChannels->cellWidget(i,0);
s=(QCheckBox*)ui->twChannels->cellWidget(i,1);
if(m->isChecked()&&s->isChecked())s->setChecked(false);
- ((qmpMainWindow*)this->parent())->getPlayer()->setMute(i,m->isChecked());
- ((qmpMainWindow*)this->parent())->getPlayer()->setSolo(i,s->isChecked());
+ qmpMainWindow::getInstance()->getPlayer()->setMute(i,m->isChecked());
+ qmpMainWindow::getInstance()->getPlayer()->setSolo(i,s->isChecked());
}
}
@@ -76,7 +79,7 @@ void qmpchannelswindow::on_pbUnmute_clicked()
for(int i=0;i<16;++i)
{
((QCheckBox*)ui->twChannels->cellWidget(i,0))->setChecked(false);
- ((qmpMainWindow*)this->parent())->getPlayer()->setMute(i,false);
+ qmpMainWindow::getInstance()->getPlayer()->setMute(i,false);
}
}
@@ -85,7 +88,7 @@ void qmpchannelswindow::on_pbUnsolo_clicked()
for(int i=0;i<16;++i)
{
((QCheckBox*)ui->twChannels->cellWidget(i,1))->setChecked(false);
- ((qmpMainWindow*)this->parent())->getPlayer()->setSolo(i,false);
+ qmpMainWindow::getInstance()->getPlayer()->setSolo(i,false);
}
}
@@ -94,3 +97,9 @@ void qmpchannelswindow::showPresetWindow(int chid)
pselectw->show();
pselectw->setupWindow(chid);
}
+
+void qmpchannelswindow::showChannelEditorWindow(int chid)
+{
+ ceditw->show();
+ ceditw->setupWindow(chid);
+}