473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Multi-Threading Question

Hi,
I need to use Windows Meadia Player in my application to run som mpeg
movies. I do not want to use the playlist facility of the Windows Media
Player Control, I want to queue up the files to play myself. In order to do
that I need to know when the current file has been played and has stopped. I
started looking at multi-threading as a solution, but am having difficultly
with the algorithm. I get the main thread to start the first clip and get
the worker function to check when the player has stopped the first clip, but
then I am wondering where I put the code to load the next mpeg file and
start the worker function again. I hope this make sense.
Any help would be appreciated.
Michael Murphy
md******@scs-techresources.com
954-452-1047
Jul 21 '05 #1
7 1194
Hi Michael,
Two bits of advice:

1) Post in a language group... you will get specific help.
C#: microsoft.public.dotnet.languages.csharp
VB: microsoft.public.dotnet.languages.vb

2) Post a short, working, section of code (in your case, you may need a few
snippets of code). That gives us all a tangible way to approach the problem
with you and, possibly, see any "gotchas" that we might have faced before.

--- Nick

"Michael D Murphy" <md******@scs-techresources.com> wrote in message
news:eN**************@TK2MSFTNGP11.phx.gbl...
Hi,
I need to use Windows Meadia Player in my application to run som mpeg
movies. I do not want to use the playlist facility of the Windows Media
Player Control, I want to queue up the files to play myself. In order to do that I need to know when the current file has been played and has stopped. I started looking at multi-threading as a solution, but am having difficultly with the algorithm. I get the main thread to start the first clip and get
the worker function to check when the player has stopped the first clip, but then I am wondering where I put the code to load the next mpeg file and
start the worker function again. I hope this make sense.
Any help would be appreciated.
Michael Murphy
md******@scs-techresources.com
954-452-1047

Jul 21 '05 #2
Michael,

Completly in addition to Nick in a general way without code, your problem
looks like a simple problem (I can be wrong of course).

A main user interface (UI)
A thread playing

Actually you probably do not need a thread, however in this case it will
probably be nicer when you use a thread and give the playing thread a high
priority and the UI a low.

When the thread has to be stopped in the UI, just abort the thread and than
when a new one is needed create a new thread. Let the framework than do its
job to remove that old thread (which will be still a while to see in memory)

In this way it is really very easy to do. There comes a little bit more work
when you have as well a continue button on your UI.

Here some walkthroughs when I showed them last time to somebody he said that
he had done it in short while afer reading this and thought before that
multithreading was something difficult.

I thought it was for both language, now I saw this is VBNet.
http://msdn.microsoft.com/library/de...isualBasic.asp

(Nick a little bit in advance sorry)

I hope this helps?

Cor
Jul 21 '05 #3
I hadn't see that article. Good link.
--- N

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
Michael,

Completly in addition to Nick in a general way without code, your problem
looks like a simple problem (I can be wrong of course).

A main user interface (UI)
A thread playing

Actually you probably do not need a thread, however in this case it will
probably be nicer when you use a thread and give the playing thread a high
priority and the UI a low.

When the thread has to be stopped in the UI, just abort the thread and than when a new one is needed create a new thread. Let the framework than do its job to remove that old thread (which will be still a while to see in memory)
In this way it is really very easy to do. There comes a little bit more work when you have as well a continue button on your UI.

Here some walkthroughs when I showed them last time to somebody he said that he had done it in short while afer reading this and thought before that
multithreading was something difficult.

I thought it was for both language, now I saw this is VBNet.
http://msdn.microsoft.com/library/de...isualBasic.asp
(Nick a little bit in advance sorry)

I hope this helps?

Cor

Jul 21 '05 #4
Nick and Cor, Please check out my new posting in the VB newsgroup (Michael D
Murphy)
Thanks!

"Michael D Murphy" <md******@scs-techresources.com> wrote in message
news:eN**************@TK2MSFTNGP11.phx.gbl...
Hi,
I need to use Windows Meadia Player in my application to run som mpeg
movies. I do not want to use the playlist facility of the Windows Media
Player Control, I want to queue up the files to play myself. In order to
do that I need to know when the current file has been played and has
stopped. I started looking at multi-threading as a solution, but am having
difficultly with the algorithm. I get the main thread to start the first
clip and get the worker function to check when the player has stopped the
first clip, but then I am wondering where I put the code to load the next
mpeg file and start the worker function again. I hope this make sense.
Any help would be appreciated.
Michael Murphy
md******@scs-techresources.com
954-452-1047

Jul 21 '05 #5
I sure wish Microsoft with all their talent could figure out a way to allow
people to print these articles, like giving us a PRINT button. When I print a
one page article on that site, I get 3 blank pages, 2 pages of 'Deeptree'
menus, and then my one page article. In other words 5 pages wasted!

"Cor Ligthert" wrote:
Michael,

Completly in addition to Nick in a general way without code, your problem
looks like a simple problem (I can be wrong of course).

A main user interface (UI)
A thread playing

Actually you probably do not need a thread, however in this case it will
probably be nicer when you use a thread and give the playing thread a high
priority and the UI a low.

When the thread has to be stopped in the UI, just abort the thread and than
when a new one is needed create a new thread. Let the framework than do its
job to remove that old thread (which will be still a while to see in memory)

In this way it is really very easy to do. There comes a little bit more work
when you have as well a continue button on your UI.

Here some walkthroughs when I showed them last time to somebody he said that
he had done it in short while afer reading this and thought before that
multithreading was something difficult.

I thought it was for both language, now I saw this is VBNet.
http://msdn.microsoft.com/library/de...isualBasic.asp

(Nick a little bit in advance sorry)

I hope this helps?

Cor

Jul 21 '05 #6
Hi Michael,

I have replied to your in the newsgroup below, you may go and take a look.
Subject: How to do Multi-Threading
Newsgroups: microsoft.public.dotnet.languages.vb

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #7
Rupert,
They have.

If you are using IE, right click on an article (text) you want printed, then
select Print.

Optionally you can select Print Preview, then select the "Only the selected
frame" in the combo box in the header.

Hope this helps
Jay

"mscertified" <ru****@tigerlily.com> wrote in message
news:B6**********************************@microsof t.com...
I sure wish Microsoft with all their talent could figure out a way to allow
people to print these articles, like giving us a PRINT button. When I
print a
one page article on that site, I get 3 blank pages, 2 pages of 'Deeptree'
menus, and then my one page article. In other words 5 pages wasted!

<<snip>>
Jul 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Frank Jona | last post by:
Intellisense with C# and a multi-file assembly is not working. With VB.NET it is working. Is there a fix availible? We're using VisualStudio 2003 Regards Frank
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
0
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black...
6
by: cody | last post by:
What are multi file assemblies good for? What are the advantages of using multiple assemblies (A.DLL+B.DLL) vs. a single multi file assembly (A.DLL+A.NETMODULE)?
6
by: Joe | last post by:
I have 2 multi-list boxes, 1 displays course categories based on a table called CATEGORIES. This table has 2 fields CATEGORY_ID, CATEGORY_NAME The other multi-list box displays courses based on...
4
by: mimmo | last post by:
Hi! I should convert the accented letters of a string in the correspondent letters not accented. But when I compile with -Wall it give me: warning: multi-character character constant Do the...
5
by: Shane Story | last post by:
I can seem to get the dimensions of a frame in a multiframe tiff. After selecting activeframe, the Width/Height is still really much larger than the page's actual dimensions. When I split a...
5
by: dkelly925 | last post by:
Is there a way to add an If Statement to the following code so if data in a field equals "x" it will launch one report and if it equals "y" it would open another report. Anyone know how to modify...
0
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing...
1
by: mknoll217 | last post by:
I am recieving this error from my code: The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part identifier...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.