[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Progress control

Posted on 2004-10-14
3
Medium Priority
?
254 Views
Last Modified: 2010-04-17
I need to create a progress bar control while playing media.I need an algorithm to construct the progress control.

MediaTotalPlayTime = 32000;

suppose width of the progress bar rectangle,
dx = 60.

I have to fill the rectangle every 1000 sec. So how much of the rectangle shd be filled every 1000th time.

Hope I have made myself clear!!!

Thanks.
0
Comment
Question by:abi_a
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
david_barker earned 2000 total points
ID: 12307380
time : the current value
32000 : the max value
60 : the max size of the progress bar

xpos = (time * 60) / 32000

xpos is the current position versus time.

Is that clear enough ?
0
 
LVL 3

Expert Comment

by:kumvjuec
ID: 12310599
it's trickier. you should keep track of how much time you have played and how much rectangle you have already filled.
suppose that t is the time already played and x units of rectangle already filled. Then now you have to fill

(60-x)*1000/(32000-t)

This will guarantee that your progress bar is completely filled when you have played for the full time. You start with t=0 and x=0
0
 
LVL 3

Expert Comment

by:kumvjuec
ID: 12310616
This much for every 1000 seconds. But if you want to fill every 1000th time, then of course don't multiply by 1000 above.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question