From b4c4cefb706f9c43a54fecb18cb8ee50f0f0e19a Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 11 Nov 2019 23:38:09 +0800 Subject: New UI hook "main.seek". Fix SysExc. message sending. API documentation update. Simple visualization no longer have notes stuck after seeking. System exclusive messages longer than 256 bytes are now sent correctly. --- core/qmpmidioutfluid.cpp | 4 ++-- core/qmpmidioutfluid.hpp | 2 +- core/qmpmidioutrtmidi.cpp | 2 +- core/qmpmidioutrtmidi.hpp | 2 +- core/qmpmidiplay.cpp | 2 +- core/qmpmidiread.cpp | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/qmpmidioutfluid.cpp b/core/qmpmidioutfluid.cpp index e9bc6b1..4fcdd21 100644 --- a/core/qmpmidioutfluid.cpp +++ b/core/qmpmidioutfluid.cpp @@ -69,10 +69,10 @@ void qmpMidiOutFluid::basicMessage(uint8_t type,uint8_t p1,uint8_t p2) break; } } -void qmpMidiOutFluid::extendedMessage(uint8_t length,const char *data) +void qmpMidiOutFluid::extendedMessage(uint32_t length,const char *data) { int rlen=0; - fluid_synth_sysex(synth,data,length,nullptr,&rlen,nullptr,0); + fluid_synth_sysex(synth,data,int(length),nullptr,&rlen,nullptr,0); } void qmpMidiOutFluid::rpnMessage(uint8_t ch,uint16_t type,uint16_t val) { diff --git a/core/qmpmidioutfluid.hpp b/core/qmpmidioutfluid.hpp index d6a62c9..6cd2058 100644 --- a/core/qmpmidioutfluid.hpp +++ b/core/qmpmidioutfluid.hpp @@ -33,7 +33,7 @@ class qmpMidiOutFluid:public qmpMidiOutDevice,public IFluidSettings void deviceDeinit(); void deviceDeinit(bool freshsettings); void basicMessage(uint8_t type,uint8_t p1,uint8_t p2); - void extendedMessage(uint8_t length,const char *data); + void extendedMessage(uint32_t length,const char *data); void rpnMessage(uint8_t ch,uint16_t type,uint16_t val); void nrpnMessage(uint8_t ch,uint16_t type,uint16_t val); void panic(uint8_t ch); diff --git a/core/qmpmidioutrtmidi.cpp b/core/qmpmidioutrtmidi.cpp index 03b184d..6dc9ca6 100644 --- a/core/qmpmidioutrtmidi.cpp +++ b/core/qmpmidioutrtmidi.cpp @@ -201,7 +201,7 @@ void qmpMidiOutRtMidi::basicMessage(uint8_t type,uint8_t p1,uint8_t p2) msg.push_back(p2); outport->sendMessage(&msg); } -void qmpMidiOutRtMidi::extendedMessage(uint8_t length,const char *data) +void qmpMidiOutRtMidi::extendedMessage(uint32_t length,const char *data) { if(!outport||!outport->isPortOpen())return; std::vectormsg(data,data+length); diff --git a/core/qmpmidioutrtmidi.hpp b/core/qmpmidioutrtmidi.hpp index 8bb829c..2c9195c 100644 --- a/core/qmpmidioutrtmidi.hpp +++ b/core/qmpmidioutrtmidi.hpp @@ -31,7 +31,7 @@ public: void deviceInit(); void deviceDeinit(); void basicMessage(uint8_t type,uint8_t p1,uint8_t p2); - void extendedMessage(uint8_t length,const char *data); + void extendedMessage(uint32_t length,const char *data); void rpnMessage(uint8_t ch,uint16_t type,uint16_t val); void nrpnMessage(uint8_t ch,uint16_t type,uint16_t val); void panic(uint8_t ch); diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index 2992e06..89fdf84 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -93,7 +93,7 @@ bool CMidiPlayer::processEvent(const SEvent *e) if(((e->type&0x0F)==0x00||(e->type&0x0F)==07)&&sendSysEx) for(auto& i:mididev) if(i.refcnt) - i.dev->extendedMessage(e->p1,e->str.c_str()); + i.dev->extendedMessage(uint32_t(e->str.length()),e->str.c_str()); return false; } return false; diff --git a/core/qmpmidiread.cpp b/core/qmpmidiread.cpp index 48a149d..697a5bd 100644 --- a/core/qmpmidiread.cpp +++ b/core/qmpmidiread.cpp @@ -147,7 +147,7 @@ int CSMFReader::read_event()//returns 0 if End of Track encountered str=new char[len+8]; if((type&0x0F)==0x00) { - str[0]=0xF0;++len; + str[0]=char(0xF0);++len; size_t sz=fread(str+1,1,len-1,f); if(szappendEvent(SEvent(curid,curt,type,len,0,str)); + curTrack->appendEvent(SEvent(curid,curt,type,0,0,std::string(str,len))); if(!strcmp(str,GM1SysX))ret->std=1; if(!strcmp(str,GM2SysX))ret->std=2; if(!strcmp(str,GSSysEx))ret->std=3; -- cgit v1.2.3