MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / getPortName

Method getPortName

TheForceEngine/TFE_Audio/RtMidi.cpp:3714–3732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3712}
3713
3714std::string WebMidiAccessShim::getPortName( unsigned int portNumber, bool isInput )
3715{
3716 if( !checkWebMidiAvailability() )
3717 return "";
3718 char *ret = (char*) MAIN_THREAD_EM_ASM_INT( {
3719 var port = window._rtmidi_internals_get_port_by_number($0, $1);
3720 if( port == null)
3721 return null;
3722 var length = lengthBytesUTF8(port.name) + 1;
3723 var ret = _malloc(length);
3724 stringToUTF8(port.name, ret, length);
3725 return ret;
3726 }, portNumber, isInput, &ret );
3727 if (ret == nullptr)
3728 return "";
3729 std::string s = ret;
3730 free(ret);
3731 return s;
3732}
3733
3734//*********************************************************************//
3735// API: WEB MIDI

Callers 2

getPortNameMethod · 0.45
getOutputCountMethod · 0.45

Calls 2

checkWebMidiAvailabilityFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected