DirectShow TIMER

Im coding a music player and I want the timer to stop when the music stops.

I got a static text with the lenght of the song. (the static text shows the position of the song in seconds....like 00:00:01,00:00:02..and it increments as the songs plays.....)

Ive messed around with WaitForCompletion but no luck

oh yeah..im using DIRECTSHOW and COM for the music player

here is a link to a picture so you know what im saying

http://postimage.org/image/51nm0hrqz/


(as you see..the static text has more time then the acual song lenght.)

here is soem of the acual code that i tried

1
2
3
4
5
6
7
hr = pEvent->WaitForCompletion(0, &evCode);
		if (SUCCEEDED(hr))
    {
KillTimer(MY_TIMEREVENT);


		}


so how do i get the song time to stop?
Last edited on
heres what i got in my timer code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
timeElapsed++;
 long evCode;
         
	sprintf(time2, "%02u:%02u:%02u", (timeElapsed/3600)%60, (timeElapsed/60)%60, timeElapsed%60);


	SetDlgItemText(IDC_LENGHT1,time2);

   hr = pEvent->WaitForCompletion(0, &evCode);
	long EvCode = 0;
			bool b = pEvent->WaitForCompletion(0, &EvCode);

			if(b==TRUE)
			{
			
				KillTimer(MY_TIMEREVENT);
				
			}


but it only goes to 1 second and stops
bump?
Topic archived. No new replies allowed.