Skip to content

Commit

Permalink
fixed msaa on 1 for disabling, much faster it seems -- added (unused)…
Browse files Browse the repository at this point in the history
… notifications for playback state
  • Loading branch information
tillt committed May 26, 2024
1 parent 6cb7a71 commit 1ebefce
Show file tree
Hide file tree
Showing 7 changed files with 346 additions and 354 deletions.
10 changes: 10 additions & 0 deletions PlayEm/Audio/AudioController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
static const float kDecodingPollInterval = 0.3f;
static const float kEnoughSecondsDecoded = 5.0f;

NSString * const kAudioControllerChangedPlaybackStateNotification = @"AudioControllerChangedPlaybackStateNotification";

typedef struct {
int bufferIndex;
AudioQueueBufferRef buffers[kPlaybackBufferCount];
Expand Down Expand Up @@ -113,8 +115,12 @@ void propertyCallback (void* user_data, AudioQueueRef queue, AudioQueuePropertyI
NSLog(@"audio now running = %d", isRunning);
if (isRunning) {
[context->delegate audioControllerPlaybackStarted];
[[NSNotificationCenter defaultCenter] postNotificationName:kAudioControllerChangedPlaybackStateNotification
object:nil];
} else {
[context->delegate audioControllerPlaybackEnded];
[[NSNotificationCenter defaultCenter] postNotificationName:kAudioControllerChangedPlaybackStateNotification
object:nil];
}
});
}
Expand Down Expand Up @@ -286,6 +292,8 @@ - (void)pause

_isPaused = YES;
[self.delegate audioControllerPlaybackPaused];
[[NSNotificationCenter defaultCenter] postNotificationName:kAudioControllerChangedPlaybackStateNotification
object:self];
}

- (void)play
Expand Down Expand Up @@ -316,6 +324,8 @@ - (void)play

_isPaused = NO;
[self.delegate audioControllerPlaybackPlaying];
[[NSNotificationCenter defaultCenter] postNotificationName:kAudioControllerChangedPlaybackStateNotification
object:self];
}

- (NSTimeInterval)currentTime
Expand Down
4 changes: 2 additions & 2 deletions PlayEm/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<string>1.3</string>
<key>CFBundleVersion</key>
<string>5891</string>
<string>5986</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.music</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Loading

0 comments on commit 1ebefce

Please sign in to comment.