diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | debian/files | 2 | ||||
-rw-r--r-- | doc/version.html | 3 | ||||
-rw-r--r-- | qmphelpwindow.cpp | 6 | ||||
-rw-r--r-- | qmpmidiplay.cpp | 11 | ||||
-rw-r--r-- | qmpplistwindow.cpp | 5 | ||||
-rw-r--r-- | qmppresetselect.cpp | 7 | ||||
-rw-r--r-- | qmppresetselect.hpp | 4 | ||||
-rw-r--r-- | qmpsettingswindow.cpp | 3 |
11 files changed, 42 insertions, 14 deletions
@@ -1,3 +1,7 @@ +2016-01-16 0.6.2 beta +Stupid RC bug fixes... +Use correct home directory in Windows. + 2016-01-15 0.6.2 beta Fix compatibility with MSVC. Support for MSVC is still experimental. @@ -1,7 +1,7 @@ # QMidiPlayer A cross-platform midi file player based on libfluidsynth and Qt. -Now it's in beta stage. Crashes and hangs may still occur, ~run with gdb attatched if you could~. +Now it's in beta stage. Crashes and hangs may still occur, run with gdb attatched if you could. Features: * Channel mute/solo @@ -11,4 +11,4 @@ Features: * Rendering midi to wave file * Visualization using SMELT (not implemented) -Tested on Debian sid. A few changes are required to make it work correctly on Windows. +Tested on Debian sid and Windows Vista~10. diff --git a/debian/changelog b/debian/changelog index 8c3da68..9edcf8d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +qmidiplayer (0.6.2-2) UNRELEASED; urgency=low + + * Minor crash fixes. + * Also report fluidsynth version in version info. + + -- chrisoft <chirs241097@gmail.com> Sat, 16 Jan 2016 10:59:24 +0800 + qmidiplayer (0.6.2-1) UNRELEASED; urgency=low * Initial release. (Closes: #XXXXXX) diff --git a/debian/files b/debian/files deleted file mode 100644 index c38ebc6..0000000 --- a/debian/files +++ /dev/null @@ -1,2 +0,0 @@ -qmidiplayer-dbg_0.6.2-1_amd64.deb debug extra -qmidiplayer_0.6.2-1_amd64.deb misc optional diff --git a/doc/version.html b/doc/version.html index aac57f0..f756da2 100644 --- a/doc/version.html +++ b/doc/version.html @@ -10,7 +10,8 @@ QMidiPlayer APP_VERSION<br> An MIDI player based on fluidsynth and Qt.<br> Written by Chris Xiong.<br> - Qt version: QT_VERSION_STR + libfluidsynth version: RT_FLUIDSYNTH_VERSION (Built against CT_FLUIDSYNTH_VERSION)<br> + Qt version: RT_QT_VERSION_STR (Built against CT_QT_VERSION_STR)<br> </div><br> <a href="index.html">Return</a> </body> diff --git a/qmphelpwindow.cpp b/qmphelpwindow.cpp index 8b99ab2..10cf083 100644 --- a/qmphelpwindow.cpp +++ b/qmphelpwindow.cpp @@ -1,3 +1,4 @@ +#include <fluidsynth.h> #include "qmphelpwindow.hpp" #include "ui_qmphelpwindow.h" @@ -20,7 +21,10 @@ void qmpHelpWindow::on_textBrowser_sourceChanged(const QUrl &src) if(src.fileName()==QString("version.html")) { QString s=ui->textBrowser->toHtml(); - s.replace("QT_VERSION_STR",QT_VERSION_STR); + s.replace("CT_QT_VERSION_STR",QT_VERSION_STR); + s.replace("RT_QT_VERSION_STR",qVersion()); + s.replace("CT_FLUIDSYNTH_VERSION",FLUIDSYNTH_VERSION); + s.replace("RT_FLUIDSYNTH_VERSION",fluid_version_str()); s.replace("APP_VERSION",APP_VERSION); ui->textBrowser->setHtml(s); } diff --git a/qmpmidiplay.cpp b/qmpmidiplay.cpp index 5bce475..d099384 100644 --- a/qmpmidiplay.cpp +++ b/qmpmidiplay.cpp @@ -10,6 +10,15 @@ void CMidiPlayer::fluidInitialize() fluid_synth_set_chorus(synth,FLUID_CHORUS_DEFAULT_N,FLUID_CHORUS_DEFAULT_LEVEL, FLUID_CHORUS_DEFAULT_SPEED,FLUID_CHORUS_DEFAULT_DEPTH, FLUID_CHORUS_DEFAULT_TYPE); + if(midiFile->getStandard()==4) + fluid_synth_set_channel_type(synth,9,CHANNEL_TYPE_MELODIC); + else if(midiFile->getStandard()==1) + fluid_synth_set_channel_type(synth,9,CHANNEL_TYPE_DRUM); + else + { + fluid_synth_set_channel_type(synth,9,CHANNEL_TYPE_DRUM); + fluid_synth_bank_select(synth,9,128); + } } void CMidiPlayer::fluidDeinitialize() { @@ -147,7 +156,7 @@ void CMidiPlayer::fileTimer2Pass() ccc[i][76]=64;ccc[i][77]=64;ccc[i][78]=64; ccc[0][131]=dpt;ccc[0][132]=0x04021808; ccc[0][133]=0; - } + }if(midiFile->getStandard()!=4)ccc[9][0]=128; for(int i=0;i<16;++i)for(int j=0;j<134;++j) ccstamps[0][i][j]=ccc[i][j]; for(uint32_t eptr=0,ct=midiFile->getEvent(0)->time;eptr<midiFile->getEventCount();) diff --git a/qmpplistwindow.cpp b/qmpplistwindow.cpp index a930a1d..27704d8 100644 --- a/qmpplistwindow.cpp +++ b/qmpplistwindow.cpp @@ -1,6 +1,7 @@ #include <cstdlib> #include <ctime> #include <QFileDialog> +#include <QDir> #include <QDirIterator> #include <QSettings> #include <QUrl> @@ -19,7 +20,7 @@ qmpPlistWindow::qmpPlistWindow(QWidget *parent) : repeat=0;shuffle=0; if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/RestorePlaylist","").toInt()) { - QSettings* plist=new QSettings(QString(getenv("HOME"))+QString("/.config/qmpplist"), + QSettings* plist=new QSettings(QDir::homePath()+QString("/.config/qmpplist"), QSettings::IniFormat); int fc=plist->value("Playlist/FileCount",0).toInt(); ui->lwFiles->clear();for(int i=1;i<=fc;++i) @@ -80,7 +81,7 @@ void qmpPlistWindow::closeEvent(QCloseEvent *event) } if(qmpMainWindow::getInstance()->isFinalizing()&&qmpSettingsWindow::getSettingsIntf()->value("Behavior/RestorePlaylist","").toInt()) { - QSettings* plist=new QSettings(QString(getenv("HOME"))+QString("/.config/qmpplist"), + QSettings* plist=new QSettings(QDir::homePath()+QString("/.config/qmpplist"), QSettings::IniFormat); plist->setValue("Playlist/FileCount",ui->lwFiles->count()); for(int i=0;i<ui->lwFiles->count();++i) diff --git a/qmppresetselect.cpp b/qmppresetselect.cpp index d4dd38a..c0e6f75 100644 --- a/qmppresetselect.cpp +++ b/qmppresetselect.cpp @@ -17,8 +17,9 @@ qmpPresetSelector::~qmpPresetSelector() void qmpPresetSelector::showEvent(QShowEvent *e) { - e->accept();memset(presets,0,sizeof(presets)); + memset(presets,0,sizeof(presets)); CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer(); + if(!plyr->getSFCount())return e->ignore(); int sfc=plyr->getSFCount(); for(int i=sfc-1;i>=0;--i) { @@ -36,11 +37,13 @@ void qmpPresetSelector::showEvent(QShowEvent *e) for(int j=0;j<128;++j)if(strlen(presets[i][j])){b=1;break;} if(b)ui->lwBankSelect->addItem(QString::number(i)); } + e->accept(); } void qmpPresetSelector::setupWindow(int chid) { CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer(); - ch=chid;int b,p,r;char name[30]; + if(!plyr->getSFCount())return; + ch=chid;int b=0,p=0,r;char name[64]; sprintf(name,"Preset Selection - Channel #%d",ch); setWindowTitle(name); plyr->getChannelPreset(chid,&b,&p,name); diff --git a/qmppresetselect.hpp b/qmppresetselect.hpp index 8a185f8..54f5764 100644 --- a/qmppresetselect.hpp +++ b/qmppresetselect.hpp @@ -18,7 +18,7 @@ class qmpPresetSelector:public QDialog void showEvent(QShowEvent* e); void setupWindow(int chid); - private slots: + private slots: void on_pbCancel_clicked(); void on_pbOk_clicked(); @@ -27,7 +27,7 @@ class qmpPresetSelector:public QDialog void on_lwPresetSelect_itemDoubleClicked(); - private: + private: Ui::qmpPresetSelector *ui; char presets[129][128][24]; int ch; diff --git a/qmpsettingswindow.cpp b/qmpsettingswindow.cpp index b55c5b8..465bbc8 100644 --- a/qmpsettingswindow.cpp +++ b/qmpsettingswindow.cpp @@ -1,4 +1,5 @@ #include <QFileDialog> +#include <QDir> #include "qmpsettingswindow.hpp" #include "ui_qmpsettingswindow.h" #include "qmpmainwindow.hpp" @@ -17,7 +18,7 @@ qmpSettingsWindow::qmpSettingsWindow(QWidget *parent) : { ui->setupUi(this); connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); - settings=new QSettings(QString(getenv("HOME"))+QString("/.config/qmprc"),QSettings::IniFormat); + settings=new QSettings(QDir::homePath()+QString("/.config/qmprc"),QSettings::IniFormat); settingsInit(); } |