View Full Version : CSD214...Can you please help me solving this project?
pierre
06-27-2004, 10:02 AM
Dear CSD214:
Sorry for inconveninence again. Can you please help me again? Please you tell me how to modify this project?
I have a problem. The project uses Media Player Classic to play mp3. It has some functions. For instance...It can type Ctrl-s to stop playing list and it can input a numeric to run loops.
I remember last time that you give me a examples for my request. But now, I want to change Media Player Classic to play mp3. And it still has Ctrl-s to stop playing list and it can input a numeric to run loops also. How can I do ? Can you help me solving this important project? Thank.
__________________
csd214
06-27-2004, 03:09 PM
But what’s the problem? You have changed the File.Run command (now "C:\\wplayerc.exe") and the title ("Windows Media Classic") when assigning value to WMP_handle. That should be OK, IF the file C:\wplayerc.exe DOES EXIST.
I don’t have "Windows Media Classic" (wplayerc.exe), so the “while openLoop” becomes an infinitive loop. (BTW, I should never install an app in C: root). Last time I added a “Security Break”, but the code could be improved:
if loopCounter > 10 then
-- the app hasn't checked whether WMP is installed
restLoop = 0; -- added
Label.SetText("labRestLoop", ""); -- added
openLoop = false;
break -- to be sure to avoid an infinitive loop
end
(Audio files are not my kind of stuff...) :rolleyes
pierre
06-28-2004, 04:44 AM
Dear CSD214:
Sorry for bothering you again. Because the forum upload fix in 500kB. So if you can do it in your free time, you give me your email address, I can send the file to you. The file capacity is about 1.27MB. I really hope you can solve my problem. Because it related my job. Thank you for advance.
pierre
06-28-2004, 04:49 AM
Dear CSD214:
I had tested your methods as you said, it still can't reach my request. So may you please check these codes, oK? If you have any solutions, can you please tell me ASAP ? Thank you.
csd214
06-28-2004, 05:19 AM
Pierre,
You have some problems:
1) The "Windows Media Classic" file is named mplayerc.exe (not wplayerc.exe).
2) The app does not return any title through Window.EnumerateTitles() ????
Did you know that all Windows distributions still include the old Media Player v6.4? Try MPLAYER2.EXE in C:\Program Files\Windows Media Player.
May be you should change the e_Key to E (value 69) and the screen text to “PRESS - AND HOLD - E to end the playing list”. The AMS app has to have the focus. You can stop MPLAYER2.EXE with a period. Parameters /play /close are not supported.
I’m afraid you have to do some debugging.
pierre
06-28-2004, 07:43 AM
Dear CSD214:
You're right. The "Windows Media Classic" file is named mplayerc.exe. And the media play is old version. At present, I use the newest version to design multi media cd. Its version is 6482. And it has playlist functions. So I will use it. The old version hasn't this function. Sorry, I still can't understand your meaning, can you give me a simply example as last time? Thank you for advance.
pierre
06-28-2004, 10:41 AM
Dear CSD214:
I had tested your methods that it seems can't reach my request.
May be you should change the e_Key to E (value 69) and the screen text to “PRESS - AND HOLD - E to end the playing list”.
I have a confuse problem, can you know what is the app return any title through Window.EnumerateTitles() ? Thanks.
csd214
06-28-2004, 12:03 PM
I suppose you mean “Media Player Classic v. 6.4.8.2” from Gabest. I downloaded the app from this address (http://heanet.dl.sourceforge.net/sourceforge/guliverkli/)
When the prog is running I can’t retrieve the title (“Media Player Classic”) through Window.EnumerateTitles() in AMS! And if so, your project is not usable at all. Sorry. I didn’t know that an app could have a “hidden title”. Somebody else have to tell you (and me) WHY this happens!
Try it yourself with some ordinary AMS code. Create a button with this On Click event:
wins = Window.EnumerateTitles(true);
wins_count = Table.Count(wins);
strTitles = ""
for handle, title in wins do
strTitles = strTitles .. title .. ",\r\n"
end
Dialog.Message("Windows titles", wins_count.. " applications running".."\r\n"..strTitles);
If you can’t use either wmplayer.exe or mplayer2.exe (Microsoft), I’m not able to help you.
If you use mplayer2.exe, Ctrl-S is a shortcut for Save As.. Your app uses Ctrl-S to stop the play list. To avoid a mix up, I suggested modifying the lines
if e_Modifiers.ctrl and e_Key == 83 then
-- Ctrl-S
stopNow = true;
to this
if e_Key == 69 then
-- plain E (no Ctrl key)
stopNow = true;
(Part of the code assigned to inpControl object.)
pierre
06-29-2004, 11:28 AM
Dear CSD214:
It really can't do it by Media Player Classic. My god!! How can I do ? Because now, I design a project about multi media films. At present, only media player classic that it can do playlist functions and it can support all formats video files. It includes vob, rm ,rmvb ,wmv ,avi ,vcd,svcd..etc as my requires. So I really hope who can help me? I have no ideas for this project. I just demand you to help me. Sorry for bothering again. But I really have no method. The project bothered me for a long time. Can you help me thinking other methods for this project, ok? Thank you for advance.
I'm having a tough time understanding what Pierre is trying to do, but you can get information about Media Player Classic using Window.EnumerateProcesses instead of EnumerateTitles.
The help file has a nice example on how to get the window's handle using EnumerateProcesses.
HTH
Dear CSD214:
It really can't do it by Media Player Classic. My god!! How can I do ? Because now, I design a project about multi media films. At present, only media player classic that it can do playlist functions and it can support all formats video files. It includes vob, rm ,rmvb ,wmv ,avi ,vcd,svcd..etc as my requires. So I really hope who can help me? I have no ideas for this project. I just demand you to help me. Sorry for bothering again. But I really have no method. The project bothered me for a long time. Can you help me thinking other methods for this project, ok? Thank you for advance.
csd214
06-29-2004, 01:09 PM
:) Thanks for stepping in, Worm. (I should have looked for a process command!)
Pierre, now you should be on the road again.
pierre
06-29-2004, 08:21 PM
Hi Worm:
Where is your help file? And CSD214, I can't understand your meaning. You said that, [Pierre, now you should be on the road again.]
,Can you tell me reason? Thank you.
In the code editor, type:
Window.EnumerateProcesses
then press F1
At the top of the help page, choose Example.
What CSD214 meant was that with the help files example, you should be able to figure out how to get the needed information.
Hi Worm:
Where is your help file? And CSD214, I can't understand your meaning. You said that, [Pierre, now you should be on the road again.]
,Can you tell me reason? Thank you.
Be aware that Window.EnumerateProcesses requires PSAPI.dll. This file comes with all Win32 operating systems from Win 2k onwards but not with WinNT. If you don't have the file, the function will run but it will not detect any processes.
Refer to my post about this here (http://www.indigorose.com/forums/showthread.php?t=7946)
pierre
06-30-2004, 11:21 AM
SRJ:
I have that file, but it isn't this project problem. The Window.EnumerateProcesses function still can work. It can't detect the Media Player Classic of title name. So I have no completed the project. So I still need who can help and solve me these issues? Thank you for advance.
Who can help me.....
TJ_Tigger
06-30-2004, 11:52 AM
SRJ:
I have that file, but it isn't this project problem. The Window.EnumerateProcesses function still can work. It can't detect the Media Player Classic of title name. So I have no completed the project. So I still need who can help and solve me these issues? Thank you for advance.
Who can help me.....
Change the Windows.EnumerateTitles(true) to Windows.EnumerateTitles(false) and it will then find the Media Player Classic. For some reason, possible old coding standards, it does not appear on the top level, but will be found if you change true to false. Here is some sample code borrowed and modified from above.
wins = Window.EnumerateTitles(false);
wins_count = Table.Count(wins);
strTitles = ""
for handle, title in wins do
if String.Find(title, "Media Player Classic", 1, true) ~= -1 then
strTitles = strTitles .. title .." - "..handle.. ",\r\n"
end
end
Dialog.Message("Windows titles", wins_count.. " applications running".."\r\n"..strTitles);
pierre
07-01-2004, 07:56 AM
Hi TJ_Tigger:
I have tried your method and suggestion. But it can't solve my problem. Can the codes put in my project? And can it reach my require? If it can, where can I put in? Or my project must modify codes that it can reach my demand. Thank you.
TJ_Tigger
07-01-2004, 10:31 AM
The code above was provided as an example to show that you have to set the parameter in Windows.EnumerateTitles to False in order to find the Media Player Classic. The code was modified from an earlier post but you will have to figure out how and where to place it in your project. The code will not be a direct replacement but is provided as a learning tool.
I hope that helps.
pierre
07-01-2004, 11:54 AM
TJ_Tigger:
Do you have any ideas for my project? I really can't process these issues. So I will post this thread that it can be solved. May you help me solving or give me some suggestion, please? Because this project is important to my job. Please you kindly to help me. Thank you for advance. If you can't understand my project contents, or you can't know my requires. Please you tell me. I will explain to you clarity.
csd214
07-01-2004, 11:58 AM
But it can't solve my problem.
That’s not correct, Pierre. Your app worked with Windows Media Player 9 (but the run parameters /play /close are ignored) and you had to close the WMP window through an AMS command (CLOSEWND_SENDMESSAGE).
Then you changed the external app to Media Player Classic, but now the you couldn’t find the handle through Window.EnumerateTitles().
Both Worm’s suggestion Window.EnumerateProcesses() and TJ_Tigger’s Window.EnumerateTitles(false) is working! Also the EnumerateProcesses has to be run on all levels (false), but you have to modify the close command to end the processes (3 per running occurrence of MPC). The best solution is Window.EnumerateTitles(false).
BUT:
MPC recognizes the /play /close parameters: The MPC window is closed without the need of CLOSEWND_SENDMESSAGE from the AMS app. To use MPC you have to design a different workflow in your app!
pierre
07-02-2004, 04:14 AM
Hi CSD214:
Sorry for bothering your free time. As you said, the MPC doesn't require the CLOSEWND_SENDMESSAGE from the AMS app. You can tell me direction that it can design the project that reaches my demand. I am a stupid man. So I need you to help. Can you help me again, please? Thank you.
pierre
07-04-2004, 10:27 AM
CSD214:
Thank your remind. I have tried your methods. It is ok. But if it uses playlist functions , it seems can't be closed. It can only pause. Do you have any ideas for this functions? If the media player classic can be closed with playlist function? How can I do? How can I use to combine parameters for this function? Thank you.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.