diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-04-10 23:39:45 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-04-10 23:39:45 +0800 |
commit | 841eb920676d6c8ac6440c8929e7422e95a9c4c5 (patch) | |
tree | c28dd11fb908682e69d5eb6dc953d1e5bf66b5a7 /qmidiplayer-desktop/qmpchannelswindow.cpp | |
parent | e0e4f9f84bb8eed6cde71ff4d67286c2e26e4693 (diff) | |
download | QMidiPlayer-841eb920676d6c8ac6440c8929e7422e95a9c4c5.tar.xz |
The Last Judgement.
Diffstat (limited to 'qmidiplayer-desktop/qmpchannelswindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpchannelswindow.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp index 17c0893..0c33043 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.cpp +++ b/qmidiplayer-desktop/qmpchannelswindow.cpp @@ -20,6 +20,18 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : qmpMainWindow::getInstance()->getPlayer()->setNoteOnCallBack(cb,NULL); connect(cb,SIGNAL(onNoteOn()),this,SLOT(updateChannelActivity())); int devc=mapper->enumDevices(); + //We setup default output here... + //Pretty strange... + for(int i=0;i<devc;++i) + { + qmpSettingsWindow::getDefaultOutWidget()->addItem(mapper->deviceName(i).c_str()); + if(!QString(mapper->deviceName(i).c_str()).compare(qmpSettingsWindow::getSettingsIntf()-> + value("Midi/DefaultOutput","Internal FluidSynth").toString())) + qmpSettingsWindow::getDefaultOutWidget()->setCurrentIndex(i+1); + } + qmpSettingsWindow::getSettingsIntf()->setValue("Midi/DefaultOutput", + qmpSettingsWindow::getDefaultOutWidget()->currentText()); + qmpSettingsWindow::getSettingsIntf(); for(int i=0;i<16;++i) { ui->twChannels->setItem(i,0,new QTableWidgetItem()); @@ -32,7 +44,19 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : ui->twChannels->setCellWidget(i,3,new QDCComboBox()); QDCComboBox *cb=(QDCComboBox*)ui->twChannels->cellWidget(i,3); cb->addItem("Internal FluidSynth");cb->setID(i); - for(int j=0;j<devc;++j)cb->addItem(mapper->deviceName(j).c_str()); + for(int j=0;j<devc;++j) + { + cb->addItem(mapper->deviceName(j).c_str()); + if(!qmpSettingsWindow::getSettingsIntf()-> + value("Midi/DefaultOutput","Internal FluidSynth").toString().compare( + QString(mapper->deviceName(j).c_str()))) + { + cb->setCurrentIndex(j+1); + changeMidiMapping(i,j+1); + } + } + if(qmpSettingsWindow::getSettingsIntf()->value("Midi/DisableMapping",0).toInt()) + cb->setEnabled(false); connect(cb,SIGNAL(onChange(int,int)),this,SLOT(changeMidiMapping(int,int))); ui->twChannels->setCellWidget(i,4,new QDCLabel("")); ((QDCLabel*)ui->twChannels->cellWidget(i,4))->setID(i); |