aboutsummaryrefslogtreecommitdiff
path: root/qmpmidiplay.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-01-14 21:47:06 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-01-14 21:47:06 +0800
commit1e1036e705b20ea407bbb922e40c0f44147b3691 (patch)
treefe0d5560c3c44be62de50b8e433b81da0a135f70 /qmpmidiplay.cpp
parentfab7ae34311b9bbb001c98baafa4b1a99aa3c18f (diff)
downloadQMidiPlayer-1e1036e705b20ea407bbb922e40c0f44147b3691.tar.xz
Innocent Treasure. (WTF)
Diffstat (limited to 'qmpmidiplay.cpp')
-rw-r--r--qmpmidiplay.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qmpmidiplay.cpp b/qmpmidiplay.cpp
index 70fe91b..be5a60d 100644
--- a/qmpmidiplay.cpp
+++ b/qmpmidiplay.cpp
@@ -183,12 +183,14 @@ void CMidiPlayer::playerPanic()
for(int i=0;i<16;++i)fluid_synth_all_notes_off(synth,i);
//for(int i=0;i<16;++i)for(int j=0;j<128;++j)fluid_synth_noteoff(synth,i,j);
}
-void CMidiPlayer::playerLoadFile(const char* fn)
+bool CMidiPlayer::playerLoadFile(const char* fn)
{
midiFile=new CMidiFile(fn);
+ if(!midiFile->isValid())return false;
divs=midiFile->getDivision();
fileTimer1Pass();
fileTimer2Pass();
+ return true;
}
void CMidiPlayer::playerInit()
{