Karaoke like algorithm
Karaoke like algorithm
- Subject: Karaoke like algorithm
- From: Ariel Rodriguez <email@hidden>
- Date: Wed, 11 Mar 2009 20:52:22 -0200
I'm working on a Karaoke-like application. I need to print out to the
screen text lines at a given time, and then, paint each word at a
given time. I keep thinking on an elegant way to do such that, and, i
hace to tell, i am afraid, i have not get it right :(.
Here's what i am doing (in pseudocode to keep things simple)
First, i store the time the line is supposed to show on the screen,
the time it is supposed to disappear from the screen, and an array
with the words and the time each word is supposed to be painted. All
times are stored as seconds.
When the application boot, i set and NSTimer to the amount of time i
need to wait for the first line to appear on screen. When time
elapsed, NStimer calls a function where i build UILabels for each
word, insert them in the main UIView. Once the UIView is packed with
all the UILabels, i fire a new loop to walk the UILabels array and
paint the words when needed.
Specifically, i am wondering if there is a better way to write words
to a UIView (and keep a handle to paint them at a given time). Does
anyone get a better algorithm?
best regards
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden