Hi jbernabeu,
I asked this a couple of weeks ago, and Shilo kindly pointed me in the right direction in this thread:
http://forum.sparrow-framework.org/topic/get-current-time-from-spsoundchannel
Basically the same as what Daniel says above.
So, credit to Shilo (I just filled in the blanks), I came up with this:
//
// SPSoundChannel+CurrentTime.h
//
//
#import "SPSoundChannel.h"
@class AVAudioPlayer;
@interface SPSoundChannel (CurrentTime)
@property (nonatomic, readonly) float currentTime;
@end
//
// SPSoundChannel+CurrentTime.m
//
//
#import "SPSoundChannel+CurrentTime.h"
#import "SPAVSoundChannel.h"
#import "SPALSoundChannel.h"
@interface SPAVSoundChannel ()
{
AVAudioPlayer *_player;
}
@end
@implementation SPAVSoundChannel (CurrentTime)
- (float)currentTime
{
return _player.currentTime;
}
@end
@implementation SPSoundChannel (CurrentTime)
- (float)currentTime
{
// OVERRIDE AS REQUIRED
return 0.0f;
}
@end
@implementation SPALSoundChannel (CurrentTime)
- (float)currentTime
{
// OVERRIDE AS REQUIRED
return 0.0f;
}
@end
HTH 🙂