Board index » cppbuilder » multimedia timer

multimedia timer


2005-03-29 10:23:34 PM
cppbuilder71
Hi all,
I wish to use a timer that create periodic events at the frequency up to 1
kHz. I don't know if it is possible. It seems that the timer available among
the component, with BCB, can just reach 18.2 Hz.
But I have seen that the resolution of the multimedia timer can reach 1 ms.
That let me some hope.
Does anybody has a simple example of using the multimedia timer ?
Thanks
dominique
 
 

Re:multimedia timer

Dominique MONTIN wrote:
Quote
I wish to use a timer that create periodic events at the frequency up to 1
kHz. I don't know if it is possible. It seems that the timer available among
the component, with BCB, can just reach 18.2 Hz.
But I have seen that the resolution of the multimedia timer can reach 1 ms.
That let me some hope.
Does anybody has a simple example of using the multimedia timer ?
Yes. Either use QueryPerformanceFrequency() and
QueryPerformanceCounter() (see
www.leunen.com/cbuilder/perfcount.html for a sample) or use a
multimedia counter. I have a component that uses it. It comes with the
source so you can see how it works (TMMTimer
www.leunen.com/cbuilder/comps.html)
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

Re:multimedia timer

Thanks a lot.
Your application (project1.bpr that use MMTimer.cpp) seems to be exactly
what I want. I have downloaded it but i can't run it because
the compiler error "unable to find Webdsnap.bpi" occurs.
I have not found this file installed on my hard disk with BCB6, nor in the
files you provide.
Where can i find it or is it possible not to use it ?
Thanks
Merci beaucoup. Il est toujours agréable de rencontrer des francophones sur
les newsgroup !!!
Dominique
"Michel Leunen" < XXXX@XXXXX.COM >a écrit dans le message de
Quote
Dominique MONTIN wrote:

>I wish to use a timer that create periodic events at the frequency up to
1
>kHz. I don't know if it is possible. It seems that the timer available
among
>the component, with BCB, can just reach 18.2 Hz.
>But I have seen that the resolution of the multimedia timer can reach 1
ms.
>That let me some hope.
>Does anybody has a simple example of using the multimedia timer ?

Yes. Either use QueryPerformanceFrequency() and
QueryPerformanceCounter() (see
www.leunen.com/cbuilder/perfcount.html for a sample) or use a
multimedia counter. I have a component that uses it. It comes with the
source so you can see how it works (TMMTimer
www.leunen.com/cbuilder/comps.html)

Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

{smallsort}

Re:multimedia timer

I have created a new project and copied the source code in it and it work
perfectly.
Thanks a lot
Dominique
"Dominique MONTIN" < XXXX@XXXXX.COM >a écrit dans le message de
Quote
Thanks a lot.

Your application (project1.bpr that use MMTimer.cpp) seems to be exactly
what I want. I have downloaded it but i can't run it because
the compiler error "unable to find Webdsnap.bpi" occurs.
I have not found this file installed on my hard disk with BCB6, nor in the
files you provide.
Where can i find it or is it possible not to use it ?
Thanks

Merci beaucoup. Il est toujours agréable de rencontrer des francophones
sur
les newsgroup !!!

Dominique




"Michel Leunen" < XXXX@XXXXX.COM >a écrit dans le message de
news:424982c1$ XXXX@XXXXX.COM ...
>Dominique MONTIN wrote:
>
>>I wish to use a timer that create periodic events at the frequency up
to
1
>>kHz. I don't know if it is possible. It seems that the timer available
among
>>the component, with BCB, can just reach 18.2 Hz.
>>But I have seen that the resolution of the multimedia timer can reach
1
ms.
>>That let me some hope.
>>Does anybody has a simple example of using the multimedia timer ?
>
>Yes. Either use QueryPerformanceFrequency() and
>QueryPerformanceCounter() (see
>www.leunen.com/cbuilder/perfcount.html for a sample) or use a
>multimedia counter. I have a component that uses it. It comes with the
>source so you can see how it works (TMMTimer
>www.leunen.com/cbuilder/comps.html)
>
>Michel
>--
>----------------------------------------
>Michel Leunen
>mailto: see my homepage.
>C++Builder, BCC5.5.1 Web site:
>www.leunen.com/
>----------------------------------------


 

Re:multimedia timer

I'm glad to see you've found a solution but can I ask you to trim your
quotes in future. If people want to see the message you are replying to
they can usually just ask their newsreader to display it. For more
hints and tips see the link below my signature :)
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html
 

Re:multimedia timer

What is going wrong with my question and reply ?
Maybe due to my bad english I don't understand the meaning of your reply.
If I have done something not in the netiquette excuse me and inform me.
Sorry
Dominique
"Andrue Cope [TeamB]" < XXXX@XXXXX.COM >a écrit dans le message
de news:424ab91f$ XXXX@XXXXX.COM ...
Quote
I'm glad to see you've found a solution but can I ask you to trim your
quotes in future. If people want to see the message you are replying to
they can usually just ask their newsreader to display it. For more
hints and tips see the link below my signature :)

--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html
 

Re:multimedia timer

Dominique MONTIN wrote:
Quote
What is going wrong with my question and reply ?
You posted a message to these groups consisting of over 60 lines of
text. Of those only two of the lines added anything and four lines were
a salution. The other nearly 60 lines of text (over 90% of your
posting) were duplicates of text already stored on the server and
available for download by any newsreader client.
A lot of the more seasoned newsgroup users consider this to be poor
posting style and it's often frowned upon. More importantly it wastes
bandwidth and server storage space and for that reason Borland (who
operate this newsserver) ask that posters keep quoting (that is
reposting prior material) to a minimum.
Imagine a conversation where the person you were talking to repeated
everything you said back to you when they replied. It'd get old pretty
quickly :)
Quote
If I have done something not in the netiquette excuse me and
inform me.
Oh you're excused - my reply was only a friendly 'heads up' so please
don't take it as anything other than that. As a member of TeamB I am
tasked with moderating this server and that means trying to ensure that
the server is run the way Borland want it to be.
It's also true that a lot of newsreaders default to just inserting the
prior message into the reply and it's often too much effort to stop
them or else the user can forget.
This message is an example of the preferred quoting style. You repeat
those parts of the message that relate to your comments followed by the
comment itself.
For more information the link below my signature will give you an idea
of what Borland want/expect from users of this server.
So once again;don't take it harshly. These things happen when new users
join a server. As long as you take the request on board no will give it
a second thought :)
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html