On 7 Mar 2015, at 09:17, "Patrick J. Collins" <[email protected]> 
wrote:

> my playheadView's position setter just does this:
> 
> -(void)setPosition:(NSUInteger)position {
>    if (position == self.position) return;
>    [self setFrameOrigin:NSMakePoint(position, 0)];
> }

...


>    self.timer = [NSTimer scheduledTimerWithTimeInterval:(1.0f / 60) 
> target:self selector:@selector(updatePlayhead) userInfo:nil repeats:YES];


Trying to animate a simple vertical line by recalculating your application's 
view hierarchy sixty times a second is a) pointless (Walt Disney didn't need 
sixty frames a second and neither do you), and b) unlikely to work well, as you 
have discovered.  At a rough guess, you'll probably find you're being asked to 
redraw the entire waveform display every time.

If you want a draw a line, try just drawing a line:-)  Find a way to cache or 
redraw only the bit of waveform that was obscured by the line each time you 
move it.

CoreAnimation, as suggested by anther poster, does this caching for you, but 
not necessarily in a way which is optimal for your particular needs.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ian Kemmish                     18 Durham Close, Biggleswade, Beds SG18 8HZ
[email protected]        Tel: +44 1767 601361     Mob: +44 7952 854387
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to