Skip to content

Commit

Permalink
In the FlexASIOTest message callback, print the message selector.
Browse files Browse the repository at this point in the history
See #7.
  • Loading branch information
dechamps committed Oct 24, 2018
1 parent 5db7910 commit b99f6f0
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion FlexASIOTest/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ namespace flexasio_test {
});
}

std::string GetASIOMessageSelectorString(long selector) {
return EnumToString(selector, {
{kAsioSelectorSupported, "kAsioSelectorSupported"},
{kAsioEngineVersion, "kAsioEngineVersion"},
{kAsioResetRequest, "kAsioResetRequest"},
{kAsioBufferSizeChange, "kAsioBufferSizeChange"},
{kAsioResyncRequest, "kAsioResyncRequest"},
{kAsioLatenciesChanged, "kAsioLatenciesChanged"},
{kAsioSupportsTimeInfo, "kAsioSupportsTimeInfo"},
{kAsioSupportsTimeCode, "kAsioSupportsTimeCode"},
{kAsioMMCCommand, "kAsioMMCCommand"},
{kAsioSupportsInputMonitor, "kAsioSupportsInputMonitor"},
{kAsioSupportsInputGain, "kAsioSupportsInputGain"},
{kAsioSupportsInputMeter, "kAsioSupportsInputMeter"},
{kAsioSupportsOutputGain, "kAsioSupportsOutputGain"},
{kAsioSupportsOutputMeter, "kAsioSupportsOutputMeter"},
{kAsioOverload, "kAsioOverload"},
});
}

ASIOError PrintError(ASIOError error) {
std::cout << "-> " << GetASIOErrorString(error) << std::endl;
return error;
Expand Down Expand Up @@ -304,7 +324,7 @@ namespace flexasio_test {
std::cout << "<-" << std::endl;
};
callbacks.asioMessage = [&](long selector, long value, void* message, double* opt) {
std::cout << "asioMessage(selector = " << selector << ", value = " << value << ", message = " << message << ", opt = " << opt << ")" << std::endl;
std::cout << "asioMessage(selector = " << GetASIOMessageSelectorString(selector) << ", value = " << value << ", message = " << message << ", opt = " << opt << ")" << std::endl;
std::cout << "<- 0" << std::endl;
return 0;
};
Expand Down

0 comments on commit b99f6f0

Please sign in to comment.