View Single Post
Old 04-05-2017, 03:51 AM   #1
ceanganb
Human being with feelings
 
Join Date: May 2009
Location: Brazil
Posts: 323
Default Can't get MIDI metadata C++

Hi. I'm using the following code in C++ to get the sysex messages:

Code:
	auto mehwnd = MIDIEditor_GetActive();
	auto mit = MIDIEditor_GetTake(mehwnd);
	int numOfNotes;
	int numOfCCs;
	int numOfSysex;

	MIDI_CountEvts(mit, &numOfNotes, &numOfCCs, &numOfSysex);
	for (int i = 0; i < numOfSysex; ++i)
	{
		bool selectedOutOptional;
		bool mutedOutOptional;
		double ppqposOutOptional;
		int typeOutOptional;
		char msgOptional[1024];
		int msgOptional_sz;

		int retval = MIDI_GetTextSysexEvt(mit, i,
			&selectedOutOptional, &mutedOutOptional, &ppqposOutOptional,
			&typeOutOptional, msgOptional, &msgOptional_sz);
		ShowConsoleMsg(msgOptional);
I tried char* msgOptional, many different array values, nothing works. All the other data are retrived fine. What am I doing wrong, guys?

Thanks.
__________________
Ceanganb

Last edited by ceanganb; 04-05-2017 at 03:52 AM. Reason: improve title
ceanganb is offline   Reply With Quote