Skip to content

Commit

Permalink
Fixing variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
dturner committed Apr 10, 2018
1 parent dc101a3 commit 7e69661
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions samples/RhythmGame/src/main/cpp/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void Game::start() {
AudioStreamBuilder builder;
builder.setFormat(AudioFormat::I16);
builder.setChannelCount(2);
builder.setSampleRate(kSampleRate);
builder.setSampleRate(kSampleRateHz);
builder.setCallback(this);
builder.setPerformanceMode(PerformanceMode::LowLatency);
builder.setSharingMode(SharingMode::Exclusive);
Expand Down Expand Up @@ -86,7 +86,7 @@ void Game::tap(int64_t eventTimeAsUptime) {
if (mClapWindows.pop(nextClapWindowFrame)){

int64_t frameDelta = nextClapWindowFrame - mCurrentFrame;
int64_t timeDelta = convertFramesToMillis(frameDelta, kSampleRate);
int64_t timeDelta = convertFramesToMillis(frameDelta, kSampleRateHz);
int64_t windowTime = mLastUpdateTime + timeDelta;
TapResult result = getTapResult(eventTimeAsUptime, windowTime);
mUiEvents.push(result);
Expand Down
4 changes: 2 additions & 2 deletions samples/RhythmGame/src/main/cpp/utils/UtilityFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ int64_t nowUptimeMillis() {
}

TapResult getTapResult(int64_t tapTimeInMillis, int64_t tapWindowInMillis){
if (tapTimeInMillis <= tapWindowInMillis + kWindowCenterOffset) {
if (tapTimeInMillis >= tapWindowInMillis - kWindowCenterOffset) {
if (tapTimeInMillis <= tapWindowInMillis + kWindowCenterOffsetMs) {
if (tapTimeInMillis >= tapWindowInMillis - kWindowCenterOffsetMs) {
return TapResult::Success;
} else {
return TapResult::Early;
Expand Down

0 comments on commit 7e69661

Please sign in to comment.