Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/syedhali/EZAudio
Browse files Browse the repository at this point in the history
  • Loading branch information
syedhali committed Jul 6, 2015
2 parents 59bd612 + b89b225 commit 1c6213c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion EZAudio/EZAudioPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ FOUNDATION_EXPORT NSString * const EZAudioPlayerDidSeekNotification;
updatedPosition:(SInt64)framePosition
inAudioFile:(EZAudioFile *)audioFile;


/**
Triggered by EZAudioPlayer's internal EZAudioFile's EZAudioFileDelegate callback and notifies the delegate that the end of the file has been reached.
@param audioPlayer The instance of the EZAudioPlayer that triggered the event
@param audioFile The instance of the EZAudioFile that the event was triggered from
*/
- (void)audioPlayer:(EZAudioPlayer *)audioPlayer
reachedEndOfAudioFile:(EZAudioFile *)audioFile;

@end

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -411,4 +420,4 @@ FOUNDATION_EXPORT NSString * const EZAudioPlayerDidSeekNotification;
*/
- (void)seekToFrame:(SInt64)frame;

@end
@end
6 changes: 5 additions & 1 deletion EZAudio/EZAudioPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ - (OSStatus) output:(EZOutput *)output
audioBufferList:audioBufferList
bufferSize:&bufferSize
eof:&eof];
if (eof && [self.delegate respondsToSelector:@selector(audioPlayer:reachedEndOfAudioFile:)])
{
[self.delegate audioPlayer:self reachedEndOfAudioFile:self.audioFile];
}
if (eof && self.shouldLoop)
{
[self seekToFrame:0];
Expand Down Expand Up @@ -438,4 +442,4 @@ - (void) output:(EZOutput *)output

//------------------------------------------------------------------------------

@end
@end

0 comments on commit 1c6213c

Please sign in to comment.