This site is no longer active and is available for archival purposes only. Registration and login is disabled.

BeatsPerMinute useage in code running smooth


BeatsPerMinute useage in code running smooth

Postby Fuzzajakka » Apr 16, 2002 @ 3:14pm

:? hmm.... H'm workin on this drum-pattern editor for PocketPC and now it's just about done... The only thing i just cant figure out is how i'm supposed to make the BPM run smoothly. At this time i'm using a SetTimer(win,1,60000/BPM/4,(TIMERPROC)Updatesong);... I think the reason why it isnt running smooth is that the program loop slows down the process and Phantom told me something about high resolution timers but i couldnt figure it out. No i'm not a pro. :lol: Just tryin to make something i can use for mixing in my band and it's GOTTA run smooth. :x well well. please help. thx!
Fuzzajakka
 


Postby Dan East » Apr 16, 2002 @ 3:42pm

For time-critical applications you are better off not using a message-based technique as you are now.

The idea is to have a main loop and not relinquish control to the system. You can use GetTickCount to get a millisecond value to determine how much time elapses in each loop. Use Sleep to give up unused clock cycles (Sleeping saves battery life, allows other multi-tasking applications to still function properly, and is necessary if you take the multithreaded route below).

Regarding the GUI; you can either create a new thread to do the above mentioned processing in, or you can use the main thread, and add a Message Pump to your loop. Let me know if you want to go the latter route and I'll post some code.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby refractor » Apr 16, 2002 @ 3:53pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Sorry but i dont think i got that...

Postby Fuzzajakka » Apr 16, 2002 @ 3:57pm

Fuzzajakka
 


Oh! Another reply. =)

Postby Fuzzajakka » Apr 16, 2002 @ 4:01pm

Fuzzajakka
 


Postby refractor » Apr 16, 2002 @ 4:07pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Dan East » Apr 16, 2002 @ 4:11pm

Last edited by Dan East on Apr 16, 2002 @ 4:17pm, edited 1 time in total.
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Dan East » Apr 16, 2002 @ 4:14pm

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby refractor » Apr 16, 2002 @ 4:21pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Awesome!

Postby Fuzzajakka » Apr 16, 2002 @ 4:56pm

=D =D =D THANKS!!! ok. so it's workin now... cant thank you enough! :P :lol: :twisted: ALLRIGHT!!! SHOWTIME!!! okok... easy.... Well... Thanks for the help!
Fuzzajakka
 


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron