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

Method pop

TheForceEngine/TFE_Audio/RtMidi.cpp:771–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

769}
770
771bool MidiInApi::MidiQueue::pop( std::vector<unsigned char> *msg, double* timeStamp )
772{
773 // Local stack copies of front/back
774 unsigned int _back, _front, _size;
775
776 // Get back/front indexes exactly once and calculate current size
777 _size = size( &_back, &_front );
778
779 if ( _size == 0 )
780 return false;
781
782 // Copy queued message to the vector pointer argument and then "pop" it.
783 msg->assign( ring[_front].bytes.begin(), ring[_front].bytes.end() );
784 *timeStamp = ring[_front].timeStamp;
785
786 // Update front
787 front = (front+1)%ringSize;
788 return true;
789}
790
791//*********************************************************************//
792// Common MidiOutApi Definitions

Callers 3

PopScanbeamMethod · 0.80
read_internalFunction · 0.80
getMessageMethod · 0.80

Calls 3

sizeFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected