From 2b46ba471830d4e6e22be5afc720adc2489efcfe Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 8 Apr 2016 23:49:24 +0800 Subject: the Awakening of the Evil. --- ChangeLog | 7 +++ core/qmpmidiplay.cpp | 13 +++++- core/qmpmidiplay.hpp | 12 ++++++ debian/changelog | 13 ++++++ debian/control | 8 +++- img/ledoff.png | Bin 0 -> 385 bytes img/ledoff.svg | 64 ++++++++++++++++++++++++++++ img/ledon.png | Bin 0 -> 558 bytes img/ledon.svg | 64 ++++++++++++++++++++++++++++ qmidiplayer-desktop/qmidiplayer-desktop.pro | 12 ++++-- qmidiplayer-desktop/qmpchannelswindow.cpp | 58 ++++++++++++++++--------- qmidiplayer-desktop/qmpchannelswindow.hpp | 13 ++++++ qmidiplayer-desktop/qmpchannelswindow.ui | 9 +++- qmidiplayer-desktop/qmphelpwindow.hpp | 2 +- qmidiplayer-desktop/qmpmainwindow.cpp | 22 +++++++--- qmidiplayer-desktop/qmpsettingswindow.cpp | 16 ++++--- qmidiplayer-desktop/resources.qrc | 2 + qmidiplayer-lite/qmidiplayer-lite.pro | 11 ++++- 18 files changed, 285 insertions(+), 41 deletions(-) create mode 100644 img/ledoff.png create mode 100644 img/ledoff.svg create mode 100644 img/ledon.png create mode 100644 img/ledon.svg diff --git a/ChangeLog b/ChangeLog index c92da4f..d737748 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-04-08 0.7.1 beta +Add MIDI activity indicator. +Substract time taken by sending midi data from sleep time. +Fix no soundfont loaded after rendering a file. +Modify default settings for Windows, solving the timing +problem for me. + 2016-04-07 0.7.1 beta MIDI mapper: first steps. diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index e65a2a1..4ee812f 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -55,10 +55,12 @@ void CMidiPlayer::processEvent(const SEvent *e) case 0x90://Note on if((mute>>(e->type&0x0F))&1)break;//muted if(solo&&!((solo>>(e->type&0x0F))&1))break; + if(noteOnCB)noteOnCB->callBack(noteOnCBUserData); if(mappedoutput[e->type&0x0F]) mapper->noteOn(mappedoutput[e->type&0x0F]-1,e->type*0x0F,e->p1,e->p2); else fluid_synth_noteon(synth,e->type&0x0F,e->p1,e->p2); + chstate[e->type&0x0F]=1; break; case 0xB0://CC if(e->p1==100)rpnid=e->p2; @@ -182,15 +184,20 @@ void CMidiPlayer::playEvents() for(uint32_t ct=midiFile->getEvent(0)->time;tceptrgetEventCount();) { while(tcpaused)std::this_thread::sleep_for(std::chrono::milliseconds(100)); + using namespace std::chrono; + high_resolution_clock::time_point b=high_resolution_clock::now(); while(!tcstop&&midiFile&&tceptrgetEventCount()&&ct==midiFile->getEvent(tceptr)->time) processEvent(midiFile->getEvent(tceptr++)); if(tcstop||!midiFile||tceptr>=midiFile->getEventCount())break; + high_resolution_clock::time_point a=high_resolution_clock::now(); + auto sendtime=a-b; if(resumed)resumed=false; else + if(sendtime.count()<(midiFile->getEvent(tceptr)->time-ct)*dpt) #if 0 w32usleep((midiFile->getEvent(tceptr)->time-ct)*(dpt/1000)); #else - std::this_thread::sleep_for(std::chrono::nanoseconds(midiFile->getEvent(tceptr)->time-ct)*dpt); + std::this_thread::sleep_for(std::chrono::nanoseconds((midiFile->getEvent(tceptr)->time-ct)*dpt-sendtime.count())); #endif if(tcstop||!midiFile)break; ct=midiFile->getEvent(tceptr)->time; @@ -251,6 +258,7 @@ CMidiPlayer::CMidiPlayer(bool singleInst) { midiFile=NULL;resumed=false;singleInstance=singleInst; settings=NULL;synth=NULL;adriver=NULL;waitvoice=true; + noteOnCB=NULL;noteOnCBUserData=NULL; memset(mappedoutput,0,sizeof(mappedoutput)); memset(deviceusage,0,sizeof(deviceusage)); mapper=new qmpMidiMapperRtMidi(); @@ -444,3 +452,6 @@ void CMidiPlayer::setChannelOutput(int ch,int devid) if(!deviceusage[origoutput-1])mapper->deviceDeinit(origoutput-1); } } +uint8_t* CMidiPlayer::getChstates(){return chstate;} +void CMidiPlayer::setNoteOnCallBack(CMidiCallBack *cb,void *userdata) +{noteOnCB=cb;noteOnCBUserData=userdata;} diff --git a/core/qmpmidiplay.hpp b/core/qmpmidiplay.hpp index a7e7f88..4592ea0 100644 --- a/core/qmpmidiplay.hpp +++ b/core/qmpmidiplay.hpp @@ -19,6 +19,13 @@ struct SEvent if(s){str=new char[strlen(s)+2];strcpy(str,s);}else str=NULL; } }; +class CMidiCallBack +{ + public: + CMidiCallBack(){} + virtual void callBack(void* data)=0; + virtual ~CMidiCallBack(){} +}; class CMidiFile { private: @@ -72,6 +79,9 @@ class CMidiPlayer uint32_t finished,resumed; qmpMidiMapperRtMidi *mapper; int mappedoutput[16],deviceusage[16],deviceiid[128]; + uint8_t chstate[16]; + CMidiCallBack *noteOnCB; + void* noteOnCBUserData; void setBit(uint16_t &n,uint16_t bn,uint16_t b); void processEvent(const SEvent *e); @@ -139,5 +149,7 @@ class CMidiPlayer qmpMidiMapperRtMidi* getMidiMapper(); void setChannelOutput(int ch,int devid); + uint8_t* getChstates(); + void setNoteOnCallBack(CMidiCallBack *cb,void *userdata); }; #endif diff --git a/debian/changelog b/debian/changelog index a57c578..b19c3e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +qmidiplayer (0.7.1-1) UNRELEASED; urgency=low + + * New upstream release. + + -- chrisoft Wed, 08 Apr 2016 23:48:08 +0800 + + +qmidiplayer (0.7.1-0) UNRELEASED; urgency=low + + * New upstream release. + + -- chrisoft Wed, 07 Apr 2016 23:40:14 +0800 + qmidiplayer (0.7.0-6) UNRELEASED; urgency=low * Package qmidiplayer-lite. diff --git a/debian/control b/debian/control index 44eeaae..d79bb76 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,15 @@ Maintainer: Chris Xiong Section: sound Priority: optional Standards-Version: 3.9.2 -Build-Depends: debhelper (>= 9), qtbase5-dev, qt5-qmake, libfluidsynth-dev, +Build-Depends: debhelper (>= 9), + qtbase5-dev, + qt5-qmake, + libfluidsynth-dev, qml-module-qtquick-controls, qml-module-qtquick-window2, qml-module-qtquick2, - libqt5qml5 + libqt5qml5, + librtmidi-dev Package: qmidiplayer Architecture: any diff --git a/img/ledoff.png b/img/ledoff.png new file mode 100644 index 0000000..4c86677 Binary files /dev/null and b/img/ledoff.png differ diff --git a/img/ledoff.svg b/img/ledoff.svg new file mode 100644 index 0000000..e159382 --- /dev/null +++ b/img/ledoff.svg @@ -0,0 +1,64 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/img/ledon.png b/img/ledon.png new file mode 100644 index 0000000..b06f015 Binary files /dev/null and b/img/ledon.png differ diff --git a/img/ledon.svg b/img/ledon.svg new file mode 100644 index 0000000..c09e9cb --- /dev/null +++ b/img/ledon.svg @@ -0,0 +1,64 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/qmidiplayer-desktop/qmidiplayer-desktop.pro b/qmidiplayer-desktop/qmidiplayer-desktop.pro index 0ac1b97..6ac0670 100644 --- a/qmidiplayer-desktop/qmidiplayer-desktop.pro +++ b/qmidiplayer-desktop/qmidiplayer-desktop.pro @@ -11,6 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = qmidiplayer TEMPLATE = app +CONFIG += c++11 SOURCES += main.cpp\ qmpmainwindow.cpp \ @@ -57,9 +58,14 @@ unix{ BINDIR = $$PREFIX/bin target.path = $$BINDIR INSTALLS += target - QMAKE_CXXFLAGS += -std=c++11 -Wall + QMAKE_CXXFLAGS += -Wall LIBS += -lfluidsynth -lrtmidi } -win32:LIBS += e:/libs/fluidsynth/fluidsynth.lib winmm.lib #You have to change these -win32:INCLUDEPATH += e:/libs/fluidsynth/include #before building... +win32{ + #change these before building... + LIBS += e:/libs/fluidsynth/fluidsynth.lib winmm.lib + LIBS += e:/libs/rtmidi/rtmidi.lib + INCLUDEPATH += e:/libs/fluidsynth/include + INCLUDEPATH += e:/libs/rtmidi +} RESOURCES = resources.qrc diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp index 4d5f6ab..3e43c3d 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.cpp +++ b/qmidiplayer-desktop/qmpchannelswindow.cpp @@ -14,30 +14,38 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : ceditw=new qmpChannelEditor(this); connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); mapper=qmpMainWindow::getInstance()->getPlayer()->getMidiMapper(); + cha=new QPixmap(":/img/ledon.png");chi=new QPixmap(":/img/ledoff.png"); + cb=new qmpCWNoteOnCB(); + qmpMainWindow::getInstance()->getPlayer()->setNoteOnCallBack(cb,NULL); + connect(cb,SIGNAL(onNoteOn()),this,SLOT(updateChannelActivity())); 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->setItem(i,0,new QTableWidgetItem()); + ui->twChannels->item(i,0)->setIcon(*chi); + ui->twChannels->item(i,0)->setFlags(ui->twChannels->item(i,0)->flags()^Qt::ItemIsEditable); 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 QDCComboBox()); - QDCComboBox *cb=(QDCComboBox*)ui->twChannels->cellWidget(i,2); + ui->twChannels->setCellWidget(i,2,new QCheckBox("")); + connect(ui->twChannels->cellWidget(i,2),SIGNAL(stateChanged(int)),this,SLOT(channelMSChanged())); + 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;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))); - ui->twChannels->setCellWidget(i,4,new QDCPushButton("...")); + ui->twChannels->setCellWidget(i,4,new QDCLabel("")); ((QDCLabel*)ui->twChannels->cellWidget(i,4))->setID(i); - connect(ui->twChannels->cellWidget(i,4),SIGNAL(onClick(int)),this,SLOT(showChannelEditorWindow(int))); + connect(ui->twChannels->cellWidget(i,4),SIGNAL(onDoubleClick(int)),this,SLOT(showPresetWindow(int))); + ui->twChannels->setCellWidget(i,5,new QDCPushButton("...")); + ((QDCLabel*)ui->twChannels->cellWidget(i,5))->setID(i); + connect(ui->twChannels->cellWidget(i,5),SIGNAL(onClick(int)),this,SLOT(showChannelEditorWindow(int))); } - ui->twChannels->setColumnWidth(0,32); + ui->twChannels->setColumnWidth(0,24); ui->twChannels->setColumnWidth(1,32); - ui->twChannels->setColumnWidth(2,192); + ui->twChannels->setColumnWidth(2,32); ui->twChannels->setColumnWidth(3,192); - ui->twChannels->setColumnWidth(4,32); + ui->twChannels->setColumnWidth(4,192); + ui->twChannels->setColumnWidth(5,32); } void qmpChannelsWindow::showEvent(QShowEvent *event) @@ -68,12 +76,19 @@ void qmpChannelsWindow::moveEvent(QMoveEvent *event) } } +void qmpChannelsWindow::updateChannelActivity() +{ + for(int i=0;i<16;++i) + ui->twChannels->item(i,0)->setIcon( + qmpMainWindow::getInstance()->getPlayer()->getChstates()[i]?*cha:*chi); +} + void qmpChannelsWindow::channelWindowsUpdate() { if(qmpMainWindow::getInstance()->getPlayer()->isFinished()) { for(int i=0;i<16;++i) - ((QLabel*)ui->twChannels->cellWidget(i,3))->setText(""); + ((QLabel*)ui->twChannels->cellWidget(i,4))->setText(""); return; } for(int i=0;i<16;++i) @@ -82,7 +97,11 @@ void qmpChannelsWindow::channelWindowsUpdate() int b,p; qmpMainWindow::getInstance()->getPlayer()->getChannelPreset(i,&b,&p,nm); sprintf(data,"%d:%d %s",b,p,nm); - ((QLabel*)ui->twChannels->cellWidget(i,3))->setText(data); + ((QLabel*)ui->twChannels->cellWidget(i,4))->setText(data); + ui->twChannels->item(i,0)->setIcon( + qmpMainWindow::getInstance()->getPlayer()->getChstates()[i]?*cha:*chi); + if(qmpMainWindow::getInstance()->getPlayer()->getChstates()[i]) + qmpMainWindow::getInstance()->getPlayer()->getChstates()[i]=0; } } @@ -91,8 +110,8 @@ void qmpChannelsWindow::channelMSChanged() for(int i=0;i<16;++i) { QCheckBox *m,*s; - m=(QCheckBox*)ui->twChannels->cellWidget(i,0); - s=(QCheckBox*)ui->twChannels->cellWidget(i,1); + m=(QCheckBox*)ui->twChannels->cellWidget(i,1); + s=(QCheckBox*)ui->twChannels->cellWidget(i,2); if(m->isChecked()&&s->isChecked())s->setChecked(false); qmpMainWindow::getInstance()->getPlayer()->setMute(i,m->isChecked()); qmpMainWindow::getInstance()->getPlayer()->setSolo(i,s->isChecked()); @@ -101,14 +120,15 @@ void qmpChannelsWindow::channelMSChanged() qmpChannelsWindow::~qmpChannelsWindow() { - delete ui; + delete chi;delete cha; + delete cb;delete ui; } void qmpChannelsWindow::on_pbUnmute_clicked() { for(int i=0;i<16;++i) { - ((QCheckBox*)ui->twChannels->cellWidget(i,0))->setChecked(false); + ((QCheckBox*)ui->twChannels->cellWidget(i,1))->setChecked(false); qmpMainWindow::getInstance()->getPlayer()->setMute(i,false); } } @@ -117,7 +137,7 @@ void qmpChannelsWindow::on_pbUnsolo_clicked() { for(int i=0;i<16;++i) { - ((QCheckBox*)ui->twChannels->cellWidget(i,1))->setChecked(false); + ((QCheckBox*)ui->twChannels->cellWidget(i,2))->setChecked(false); qmpMainWindow::getInstance()->getPlayer()->setSolo(i,false); } } diff --git a/qmidiplayer-desktop/qmpchannelswindow.hpp b/qmidiplayer-desktop/qmpchannelswindow.hpp index 57f293e..80f427a 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.hpp +++ b/qmidiplayer-desktop/qmpchannelswindow.hpp @@ -10,6 +10,7 @@ #include #include "qmppresetselect.hpp" #include "qmpchanneleditor.hpp" +#include "../core/qmpmidiplay.hpp" #include "../core/qmpmidimappers.hpp" namespace Ui { @@ -58,6 +59,15 @@ class QDCComboBox:public QComboBox void indexChangedSlot(int idx){emit(onChange(id,idx));} }; +class qmpCWNoteOnCB:public QObject,public CMidiCallBack +{ + Q_OBJECT + public: + void callBack(void *data){if(data)data=NULL;emit(onNoteOn());} + signals: + void onNoteOn(); +}; + class qmpChannelsWindow:public QDialog { Q_OBJECT @@ -72,6 +82,7 @@ class qmpChannelsWindow:public QDialog void dialogClosing(); public slots: void channelWindowsUpdate(); + void updateChannelActivity(); void channelMSChanged(); void showPresetWindow(int chid); void showChannelEditorWindow(int chid); @@ -84,6 +95,8 @@ class qmpChannelsWindow:public QDialog qmpPresetSelector *pselectw; qmpChannelEditor *ceditw; qmpMidiMapperRtMidi *mapper; + QPixmap *cha,*chi; + qmpCWNoteOnCB *cb; }; #endif // QMPCHANNELSWINDOW_H diff --git a/qmidiplayer-desktop/qmpchannelswindow.ui b/qmidiplayer-desktop/qmpchannelswindow.ui index a8b43cb..2d85ab0 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.ui +++ b/qmidiplayer-desktop/qmpchannelswindow.ui @@ -49,7 +49,7 @@ 16 - 5 + 6 @@ -67,6 +67,11 @@ + + + A + + M @@ -92,7 +97,7 @@ ... - + diff --git a/qmidiplayer-desktop/qmphelpwindow.hpp b/qmidiplayer-desktop/qmphelpwindow.hpp index c2052b2..af1b746 100644 --- a/qmidiplayer-desktop/qmphelpwindow.hpp +++ b/qmidiplayer-desktop/qmphelpwindow.hpp @@ -2,7 +2,7 @@ #define QMPHELPWINDOW_H #include -#define APP_VERSION "0.7.0" +#define APP_VERSION "0.7.1" namespace Ui { class qmpHelpWindow; diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 32d28f2..37ca9f4 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -9,6 +9,7 @@ #ifdef _WIN32 #include #endif +#define UPDATE_INTERVAL 66 qmpMainWindow* qmpMainWindow::ref=NULL; @@ -188,7 +189,7 @@ void qmpMainWindow::updateWidgets() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); } } if(renderTh) @@ -199,7 +200,14 @@ void qmpMainWindow::updateWidgets() ui->centralWidget->setEnabled(true); delete renderTh;renderTh=NULL; player->rendererDeinit(); - if(singleFS){player->fluidPreInitialize();playerSetup();player->fluidInitialize();} + if(singleFS) + { + player->fluidPreInitialize(); + playerSetup(); + player->fluidInitialize(); + for(int i=settingsw->getSFWidget()->count()-1;i>=0;--i) + player->pushSoundFont(settingsw->getSFWidget()->item(i)->text().toStdString().c_str()); + } } } while(!player->isFinished()&&player->getTCeptr()>player->getStamp(ui->hsTimer->value()) @@ -281,7 +289,7 @@ void qmpMainWindow::on_pbPlayPause_clicked() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); stopped=false; } else @@ -405,7 +413,7 @@ void qmpMainWindow::on_pbPrev_clicked() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); } void qmpMainWindow::on_pbNext_clicked() @@ -430,7 +438,7 @@ void qmpMainWindow::on_pbNext_clicked() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); } void qmpMainWindow::selectionChanged() @@ -458,7 +466,7 @@ void qmpMainWindow::selectionChanged() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); } void qmpMainWindow::on_pbEfx_clicked() @@ -495,7 +503,7 @@ void qmpMainWindow::onfnA2() ui->centralWidget->setEnabled(false); for(int i=settingsw->getSFWidget()->count()-1;i>=0;--i) player->pushSoundFont(settingsw->getSFWidget()->item(i)->text().toStdString().c_str()); - player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange();timer->start(100); + player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange();timer->start(UPDATE_INTERVAL); renderTh=new std::thread(&CMidiPlayer::rendererThread,player); } diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp index c2e31a2..2074972 100644 --- a/qmidiplayer-desktop/qmpsettingswindow.cpp +++ b/qmidiplayer-desktop/qmpsettingswindow.cpp @@ -82,7 +82,7 @@ void qmpSettingsWindow::settingsInit() settings->setValue("Audio/Driver",ui->cbAudioDrv->currentText()); #ifdef _WIN32 -#define DefBufSize 8192 +#define DefBufSize 256 #else #define DefBufSize 128 #endif @@ -97,15 +97,21 @@ void qmpSettingsWindow::settingsInit() settings->setValue("Audio/BufSize",ui->cbBufSize->currentText().toInt()); #undef DefBufSize +#ifdef _WIN32 +#define DefBufCnt 8 +#else +#define DefBufCnt 2 +#endif selected=-1; for(int i=0;icbBufCnt->count();++i) - if(ui->cbBufCnt->itemText(i).toInt()==settings->value("Audio/BufCnt",2).toInt()) + if(ui->cbBufCnt->itemText(i).toInt()==settings->value("Audio/BufCnt",DefBufCnt).toInt()) {selected=i;break;} if(~selected)ui->cbBufCnt->setCurrentIndex(selected); - else if(settings->value("Audio/BufCnt",2).toInt()>=2&&settings->value("Audio/BufCnt",2).toInt()<=64) - ui->cbBufCnt->setCurrentText(settings->value("Audio/BufCnt",2).toString()); - else ui->cbBufCnt->setCurrentText("2"); + else if(settings->value("Audio/BufCnt",DefBufCnt).toInt()>=2&&settings->value("Audio/BufCnt",DefBufCnt).toInt()<=64) + ui->cbBufCnt->setCurrentText(settings->value("Audio/BufCnt",DefBufCnt).toString()); + else ui->cbBufCnt->setCurrentText(QString::number(DefBufCnt)); settings->setValue("Audio/BufCnt",ui->cbBufCnt->currentText().toInt()); +#undef DefBufCnt selected=-1; for(int i=0;icbFormat->count();++i) diff --git a/qmidiplayer-desktop/resources.qrc b/qmidiplayer-desktop/resources.qrc index 351d2fa..d34966d 100644 --- a/qmidiplayer-desktop/resources.qrc +++ b/qmidiplayer-desktop/resources.qrc @@ -25,6 +25,8 @@ ../img/stop.png ../img/up.png ../img/visualization.png + ../img/ledon.png + ../img/ledoff.png ../img/mainw.png ../img/chanw.png ../doc/index.html diff --git a/qmidiplayer-lite/qmidiplayer-lite.pro b/qmidiplayer-lite/qmidiplayer-lite.pro index 4307068..7d901f6 100644 --- a/qmidiplayer-lite/qmidiplayer-lite.pro +++ b/qmidiplayer-lite/qmidiplayer-lite.pro @@ -22,5 +22,14 @@ HEADERS += \ ../core/qmpmidiplay.hpp \ qmpcorewrapper.hpp \ ../core/qmpmidimappers.hpp - +unix{ LIBS += -lfluidsynth -lrtmidi +} + +win32{ + #change these before building... + LIBS += e:/libs/fluidsynth/fluidsynth.lib winmm.lib + LIBS += e:/libs/rtmidi/rtmidi.lib + INCLUDEPATH += e:/libs/fluidsynth/include + INCLUDEPATH += e:/libs/rtmidi +} -- cgit v1.2.3