Skip to content

Commit

Permalink
Call GetSamplePosition() in FlexASIOTest.
Browse files Browse the repository at this point in the history
See #7.
  • Loading branch information
dechamps committed Oct 24, 2018
1 parent 057b028 commit 085cffb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions FlexASIOTest/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,14 @@ namespace flexasio_test {
return PrintError(ASIOStop()) == ASE_OK;
}

void GetSamplePosition() {
std::cout << "ASIOGetSamplePosition()" << std::endl;
ASIOSamples samples;
ASIOTimeStamp timeStamp;
if (PrintError(ASIOGetSamplePosition(&samples, &timeStamp)) != ASE_OK) return;
std::cout << "Sample position: " << ASIOToInt64(samples) << " timestamp: " << ASIOToInt64(timeStamp) << std::endl;
}

using ASIOMessageHandler = decltype(ASIOCallbacks::asioMessage);

long HandleSelectorSupportedMessage(long, long value, void*, double*);
Expand Down Expand Up @@ -412,6 +420,7 @@ namespace flexasio_test {
Callbacks callbacks;
callbacks.bufferSwitch = [&](long doubleBufferIndex, ASIOBool directProcess) {
std::cout << "bufferSwitch(doubleBufferIndex = " << doubleBufferIndex << ", directProcess = " << directProcess << ")" << std::endl;
GetSamplePosition();
incrementBufferSwitchCount();
std::cout << "<-" << std::endl;
};
Expand All @@ -428,6 +437,7 @@ namespace flexasio_test {
callbacks.bufferSwitchTimeInfo = [&](ASIOTime* params, long doubleBufferIndex, ASIOBool directProcess) {
std::cout << "bufferSwitchTimeInfo(params = " << params << ", doubleBufferIndex = " << doubleBufferIndex << ", directProcess = " << directProcess << ")" << std::endl;
if (params != nullptr) PrintASIOTime(*params);
GetSamplePosition();
incrementBufferSwitchCount();
std::cout << "<- nullptr" << std::endl;
return nullptr;
Expand Down

0 comments on commit 085cffb

Please sign in to comment.