aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpchannelswindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-07 23:39:02 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-07 23:39:02 +0800
commit8f8782f43bd838e825f3792b611d27fffa90399b (patch)
tree1fbd96dd7ce061010edacf67f72f0ffb07889edf /qmidiplayer-desktop/qmpchannelswindow.cpp
parent70fd2d85c1bd6fb8732e680e8fda9d36c317c732 (diff)
downloadQMidiPlayer-8f8782f43bd838e825f3792b611d27fffa90399b.tar.xz
Lunatic Princess.
Diffstat (limited to 'qmidiplayer-desktop/qmpchannelswindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpchannelswindow.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp
index a9cf60e..4d5f6ab 100644
--- a/qmidiplayer-desktop/qmpchannelswindow.cpp
+++ b/qmidiplayer-desktop/qmpchannelswindow.cpp
@@ -13,16 +13,19 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) :
pselectw=new qmpPresetSelector(this);
ceditw=new qmpChannelEditor(this);
connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed()));
+ mapper=qmpMainWindow::getInstance()->getPlayer()->getMidiMapper();
+ int devc=mapper->enumDevices();
for(int i=0;i<16;++i)
{
ui->twChannels->setCellWidget(i,0,new QCheckBox(""));
connect(ui->twChannels->cellWidget(i,0),SIGNAL(stateChanged(int)),this,SLOT(channelMSChanged()));
ui->twChannels->setCellWidget(i,1,new QCheckBox(""));
connect(ui->twChannels->cellWidget(i,1),SIGNAL(stateChanged(int)),this,SLOT(channelMSChanged()));
- ui->twChannels->setCellWidget(i,2,new QComboBox());
- QComboBox *cb=(QComboBox*)ui->twChannels->cellWidget(i,2);
- //stub
- cb->addItem("Internal FluidSynth");
+ ui->twChannels->setCellWidget(i,2,new QDCComboBox());
+ QDCComboBox *cb=(QDCComboBox*)ui->twChannels->cellWidget(i,2);
+ cb->addItem("Internal FluidSynth");cb->setID(i);
+ for(int j=0;j<devc;++j)cb->addItem(mapper->deviceName(j).c_str());
+ connect(cb,SIGNAL(onChange(int,int)),this,SLOT(changeMidiMapping(int,int)));
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)));
@@ -130,3 +133,8 @@ void qmpChannelsWindow::showChannelEditorWindow(int chid)
ceditw->show();
ceditw->setupWindow(chid);
}
+
+void qmpChannelsWindow::changeMidiMapping(int chid,int idx)
+{
+ qmpMainWindow::getInstance()->getPlayer()->setChannelOutput(chid,idx);
+}