Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > updating NSSlider

updating NSSlider
Thread Tools
Dedicated MacNNer
Join Date: Nov 2000
Location: Malaysia
Status: Offline
Reply With Quote
Feb 9, 2003, 07:16 PM
 
I'm sure this is simple enough, I have a media file that I'm playing in a cocoa application. I can use the NSSlider to position the media file. I can update the slider from the position of the playing media file, but only when I do certain actions in the interface.

But I want the slider to automatically update while the media plays. What is the best way to do this? I was looking for some delegate I can use. I put [self updatePlayer] in applicationWillUpdate, but that only refreshes when something happens (basically hits ANY action in the application). Is the answer to use an NSTimer?

---gralem
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Feb 9, 2003, 09:29 PM
 
Yes, a repeating timer would do nicely.

Depending on the mechanism you're using to play the media, it might have a time-based callback you can register for. Then you could redraw every time a sample is processed, or a timecode interval is hit, or at various other interesting times.
Rick Roe
icons.cx | weblog
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:46 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2