From 8f8782f43bd838e825f3792b611d27fffa90399b Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Thu, 7 Apr 2016 23:39:02 +0800 Subject: Lunatic Princess. --- qmidiplayer-desktop/qmpchannelswindow.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'qmidiplayer-desktop/qmpchannelswindow.cpp') 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;jaddItem(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); +} -- cgit v1.2.3