aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidiplay.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-10-18 11:40:51 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-10-18 11:40:51 +0800
commitd985112164bd2bfeca0c895abb523d45f0e065bb (patch)
tree3a44ae92001c2a8cac89eb46fe74248249d6e0ea /core/qmpmidiplay.cpp
parent48dd5f9fb11f0a2e69291271d9140ebcec640117 (diff)
downloadQMidiPlayer-d985112164bd2bfeca0c895abb523d45f0e065bb.tar.xz
API changes and crash fixes.
Details in the changelog.
Diffstat (limited to 'core/qmpmidiplay.cpp')
-rw-r--r--core/qmpmidiplay.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp
index 55b3959..15e1331 100644
--- a/core/qmpmidiplay.cpp
+++ b/core/qmpmidiplay.cpp
@@ -276,7 +276,7 @@ bool CMidiPlayer::playerLoadFile(const char* fn)
{
notes=0;if(midiFile)delete midiFile;
midiFile=midiReaders->readFile(fn);
- if(!midiFile->valid)return false;
+ if(!midiFile||!midiFile->valid)return false;
divs=midiFile->divs;maxtk=ecnt=0;
for(CMidiTrack& i:midiFile->tracks)
{
@@ -481,7 +481,7 @@ void CMidiPlayer::setChannelOutput(int ch,int outid)
}
}
uint8_t* CMidiPlayer::getChstates(){return chstate;}
-int CMidiPlayer::setEventHandlerCB(IMidiCallBack *cb,void *userdata)
+int CMidiPlayer::setEventHandlerCB(ICallBack *cb,void *userdata)
{
for(int i=0;i<16;++i)
{
@@ -496,7 +496,7 @@ int CMidiPlayer::setEventHandlerCB(IMidiCallBack *cb,void *userdata)
}
void CMidiPlayer::unsetEventHandlerCB(int id)
{eventHandlerCB[id]=NULL;eventHandlerCBuserdata[id]=NULL;}
-int CMidiPlayer::setEventReaderCB(IMidiCallBack *cb,void *userdata)
+int CMidiPlayer::setEventReaderCB(ICallBack *cb,void *userdata)
{
for(int i=0;i<16;++i)
{
@@ -511,7 +511,7 @@ int CMidiPlayer::setEventReaderCB(IMidiCallBack *cb,void *userdata)
}
void CMidiPlayer::unsetEventReaderCB(int id)
{eventReaderCB[id]=NULL;eventReaderCBuserdata[id]=NULL;}
-int CMidiPlayer::setFileReadFinishedCB(IMidiCallBack *cb,void *userdata)
+int CMidiPlayer::setFileReadFinishedCB(ICallBack *cb,void *userdata)
{
for(int i=0;i<16;++i)
{
@@ -526,7 +526,7 @@ int CMidiPlayer::setFileReadFinishedCB(IMidiCallBack *cb,void *userdata)
}
void CMidiPlayer::unsetFileReadFinishedCB(int id)
{fileReadFinishCB[id]=NULL;fileReadFinishCBuserdata[id]=NULL;}
-void CMidiPlayer::registerReader(IMidiFileReader *reader,std::string name)
+void CMidiPlayer::registerReader(qmpFileReader *reader,std::string name)
{midiReaders->registerReader(reader,name);}
void CMidiPlayer::unregisterReader(std::string name)
{midiReaders->unregisterReader(name);}