Thread View: borland.public.cppbuilder.nativeapi
1 messages
1 total messages
Started by Phuoc Can HUA
Mon, 17 Mar 2003 00:10
TTrackBar->Position not set immediately in TThread ?
Author: Phuoc Can HUA
Date: Mon, 17 Mar 2003 00:10
Date: Mon, 17 Mar 2003 00:10
41 lines
2377 bytes
2377 bytes
My program ( a kind of MIDI player) allows user to move the song position by
clicking on a TrackBar. I'm passing the main form as a pointer to a TThread,
something like this:
while( !Terminated)
{ ...
switch( ...)
{ case A:
MForm->TBar->Position= X;
LogFile << X; // For debug only
...
break;
case B: // Only applied after acse A (next loop)
// Set the song position based on MForm->TBar->Position
....
}
LogFile << MForm->TBar->Position; // For debug only
}
The program works more than 90% as expected. BUT sometimes the slider only
set on the new position for short time then the song continues at the old
position with the slider. It looks like setting the position in case A is
buffered. In next loop, case B is still using the old position to move the
playing postion. When the slider moves to the new position case B has
already set the song position (old one). That's what I'm suspecting :-)
The fact is that log-file is showing the right value for X and the old value
for MForm->TBar->Position. The slider actually jumps to the new position
(assumed after case B).
Again, it works in most of the cases. What I'm suspecting is it possible?
and what can I do?
Phuoc Can HUA
--
_/\__/\__/\__/\__/\__/\_
www.huaonline.com
My Homepage is my Castle
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads