Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
Current position of the progress bar
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Strange error with arccos...
by
Paolo
[
Today
at 12:42:41 pm]
dBase in Lazarus
by
korba812
[
Today
at 11:28:17 am]
tvplanit - spooky context...
by
Nicole
[
Today
at 11:08:21 am]
What do you reach for whe...
by
SymbolicFrank
[
Today
at 10:44:11 am]
Get SourceCode from Exe ?
by
MarkMLl
[
Today
at 10:39:42 am]
Separating definition and...
by
MarkMLl
[
Today
at 10:08:14 am]
TIBTable for dummies - wh...
by
Nicole
[
Today
at 09:40:50 am]
How to solve synapse Erro...
by
Hartmut
[
Today
at 09:26:10 am]
Large/Big Integer Library...
by
af0815
[
Today
at 09:07:38 am]
Some questions about Clas...
by
PascalDragon
[
Today
at 09:04:28 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Current position of the progress bar (Read 495 times)
Pe3s
Full Member
Posts: 206
Current position of the progress bar
«
on:
May 15, 2022, 10:34:07 am »
Hi, how can I calculate the current position of the progress bar if I know the length of a music track or movie?
Logged
Thaddy
Hero Member
Posts: 11764
Re: Current position of the progress bar
«
Reply #1 on:
May 15, 2022, 10:43:47 am »
scale to 100%, position is at X% (very simple 12 year old math)
Logged
Black themes should be banned.
Pe3s
Full Member
Posts: 206
Re: Current position of the progress bar
«
Reply #2 on:
May 15, 2022, 11:30:55 am »
Code: Pascal
[Select]
[+]
[-]
pbar
.
value
:
=
pbar
.
ClientWidth
*
duration ?????
Logged
bytebites
Sr. Member
Posts: 493
Re: Current position of the progress bar
«
Reply #3 on:
May 15, 2022, 11:54:48 am »
Code: Pascal
[Select]
[+]
[-]
ProgressBar1
.
Min
:
=
0
;
ProgressBar1
.
Max
:
=
100
;
ProgressBar1
.
Position
:
=
trunc
(
music
.
position
/
duration
*
100
)
;
Application
.
ProcessMessages
;
Logged
howardpc
Hero Member
Posts: 3988
Re: Current position of the progress bar
«
Reply #4 on:
May 15, 2022, 07:14:31 pm »
Quote from: Thaddy on May 15, 2022, 10:43:47 am
scale to 100%, position is at X% (very simple 12 year old math)
@Thaddy
Sometimes your advice is negated by the way you belittle the questioner. Suppose the questioner is a refugee who has had no formal education at primary or teenage level?
If you can't resist adding a snide comment to complete your advice I feel it would be better that you not offer any response.
Logged
440bx
Hero Member
Posts: 2928
Re: Current position of the progress bar
«
Reply #5 on:
May 15, 2022, 09:13:45 pm »
@Thaddy,
I have to concur with @howardpc and, FYI, putting people down doesn't make you look good, on the contrary.
Logged
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
Current position of the progress bar
TinyPortal
© 2005-2018