AutoHotkey Community

It is currently May 25th, 2012, 3:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 646 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 44  Next
Author Message
 Post subject:
PostPosted: September 13th, 2007, 12:01 pm 
Well, I have found a [thread] like this one.

And it says:
> Aktuellen Song aus Windows Media Player auslesen
Read current song from Windows Media Player
> Versionen sind anscheinend egal. Ich habe das Vista SDK auf XP installiert und es mit dem WMP9 ausprobiert.
Looks like there are no (WMP) version dependancies. [He] has installed the Vista SDK on XP and tested it with WMP9.
> Ich habe mal das RemoteHost-Beispiel soweit gekürzt, dass nur der aktuelle Titel auf der Konsole ausgegeben wird. Die "RemoteHost.h" ist aus dem Sample.
[He] has used the RemoteHost-Sample [I guess from Vista SDK] and shortened it to display the current song at the console.

As I need the output as a variable to trigger my AHG script/GUI, I thought that method could be used.
Well, I'm not aware how to parse an audio stream [directly] with AHK, therefore I've expected to trigger WMP instead (which I use to execute/play the stream). :(

Quote:
Exactly from where are you trying to get the infos?
From the stream (prefered) or the player.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2007, 12:14 pm 
Had a request [here] to follow another concept using [mediainfo.dll]. But had no response/luck. :(


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2007, 12:16 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
BoBo¨ wrote:
I've expected to trigger WMP instead (which I use to execute/play the stream).

You may use this instead. But I don't know if the URL will be updated to the original source, as MS is careful enough to not expose the original source of the streams.
You may better redownload COM.ahk as I recently updated it to include CoInitialize() inside AtlAxWinInit() too.

Code:
sUrl := "C:\temp.wmv" ; Replace it to the real URL.

COM_AtlAxWinInit()
Gui, +Resize +LastFound
Gui, Show, w800 h600 Center, WMP
hGui := WinExist()
pwmp := COM_AtlAxCreateControl(hGui, "WMPlayer.OCX")
COM_Invoke(pwmp, "URL=", sUrl)
COM_Invoke(pwmp, "Play")
Sleep, 3000

pmda := COM_Invoke(pwmp, "CurrentMedia")
sURL1:= COM_Invoke(pmda, "SourceURL")
name := COM_Invoke(pmda, "Name")
durn := COM_Invoke(pmda, "durationString")

MsgBox, % sURL1 . "|" . name . "|" . durn
Return

GuiClose:
Gui, Destroy
COM_Release(pmda)
COM_Release(pwmp)
COM_AtlAxWinTerm()
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2007, 3:31 pm 
Hi Sean,
thx for your effort+time. Much appreciated (well, as always :D)
If it comes to run local files/tracks your script is working perfect and delivered all details.
Unfortunately I can't still find a way to extract details on a single-track basis from within a mp3-stream running via WMP.

btw. Can you point out where to find that specific "strings" (methods?) which are used within your functions ...
Code:
COM_Invoke(pwmp, "Play")
pmda := COM_Invoke(pwmp, "CurrentMedia")
sURL1:= COM_Invoke(pmda, "SourceURL")
name := COM_Invoke(pmda, "Name")
durn := COM_Invoke(pmda, "durationString")
Back to Google ... 8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2007, 3:59 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
BoBo¨ wrote:
btw. Can you point out where to find that specific "strings" (methods?) which are used within your functions

I suppose the best place for these is always MSDN:
http://msdn2.microsoft.com/en-us/library/bb249259.aspx


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2007, 4:13 pm 
Quote:
I suppose the best place for these is always MSDN
Erm, that's the environment where I've spent the last hours (indeed, I do my very best to help myself not to need help from you :oops:).
Well, it looks like I will need an extra lifetime (or some good advise/training) to get an idea of those cryptic concepts. :cry:

What I've encountered so far:

oWMP.GetItemInfo("Artist")
oWMP.GetItemInfo("Title")

[?]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2007, 1:45 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
BoBo¨ wrote:
Well, it looks like I will need an extra lifetime (or some good advise/training) to get an idea of those cryptic concepts.

It needs some practice, as it's not so clear as crystal, obviously.

Quote:
oWMP.GetItemInfo("Artist")
oWMP.GetItemInfo("Title")

That page says they are obsolete. Sorry, but, I don't really want to go further into it myself, you better read the pages I linked. I'd welcome them if you have questions about CoHelper.ahk or COM.ahk, but, from now on I'd like to avoid questions about a specific COM object, unless it happens to be one I'm interested in or can be done in less than 10 minutes, because I think the function Invoke() now reaches the stage of resembling the well-known VBS syntax as possible as it can, so I suppose users could now adopt many useful sources in VBS to AHK scripts, hopefully without much effort.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2007, 8:50 pm 
Quote:
I'd welcome them if you have questions about CoHelper.ahk or COM.ahk,
Thx, I'm more than happy for that offer. Of help would be to have a sample "how to identify relevant objects and arguments within MSDN, and how to use them within these functions".
A how-to-use-Seans-COM-interface-tut.

Quote:
but, from now on I'd like to avoid questions about a specific COM object, unless it happens to be one I'm interested in or can be done in less than 10 minutes
Fair enough. 8) I've assumed my request had to be categorized as '5 minute challenge'. :shock: Looks like I was wrong :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2007, 3:51 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
BoBo¨ wrote:
Of help would be to have a sample "how to identify relevant objects and arguments within MSDN, and how to use them within these functions".

You have to be already familiar with how to use COM, e.g. in VBS/JS, to utilize CoHelper.ahk/COM.ahk. It won't tell you about COM itself. I posted the translation of VBS/JS to AHK in the thread of CoHelper.ahk. And, occasionally I posted an example of it, if I think it's a good and relatively simple example to analyze, the recent one is:
http://www.autohotkey.com/forum/viewtopic.php?t=23117

I'm really perplexed that people expect more from me as I don't really know what should/could I do further than this. I'm not Chris. I really admire Chris for the excellent job he has done and his patience in dealing with the complaints, mostly unjustified/unfair IMO, he's got.

Quote:
I've assumed my request had to be categorized as '5 minute challenge'. :shock: Looks like I was wrong :lol:

I suppose you'd be really surprised when figuring out the needed work/objects you may have to do/deal with for your purpose. The worse is that even after that there is no guarantee that it'll succeed.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2007, 8:39 pm 
Hi Sean,

Thanks for your work. But I must say I don't understand how this work. I'm not a noob in using VBScript to access MS Office apps and in VBA (even if I'm not an expert...), but I don't understand how I can use your Standard Library COM to open an XL file, read or write in a cell, ...
So 2 questions :
- can you please give an example of how to work with Excel (for example), with some explanations ?
- can you give us a little doc for your COM library : for each function, what is it supposed to do, with which parameters and eventually a little example.
I know that writing doc is the less interesting thing in programming, but it's the more usefull to share your work, that seems very good (I red this post and the one on CoHelper, but the examples given don't help me much, and I ask myself if they are compatible with COM.ahk, as you said it is not fully compatible with CoHelper.ahk, and things like
Quote:
CLSID_iTunesApp := "{DC0C2640-1415-4644-875C-6F4D769839BA}"
IID_IiTunes := "{9DD6680B-3EDC-40DB-A771-E6FE4832E34A}"
are like chinese for me...)
Thanks a lot for all that you did and in advance for that you will do....


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2007, 11:50 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Washboard wrote:
So 2 questions :
- can you please give an example of how to work with Excel (for example), with some explanations ?

Here is an example of Excel:
http://www.autohotkey.com/forum/topic16565-45.html

You better read about using Invoke() here:
http://www.autohotkey.com/forum/topic16631.html

Quote:
- can you give us a little doc for your COM library : for each function, what is it supposed to do, with which parameters and eventually a little example.

It's planned. OTOH, now most functions in COM.ahk are mainly used internally, so no real need to concern about them. The users need only to know to use:
Invoke, CreateObject/ActiveXObject, GetObject, ConnectObject.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2007, 12:06 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Washboard wrote:
Quote:
CLSID_iTunesApp := "{DC0C2640-1415-4644-875C-6F4D769839BA}"
IID_IiTunes := "{9DD6680B-3EDC-40DB-A771-E6FE4832E34A}"

For the example of iTunes, see this thread:
http://www.autohotkey.com/forum/topic19443.html


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2007, 12:12 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Here is one for Skype:
http://www.autohotkey.com/forum/topic23117.html


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2007, 12:32 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Example for the Voice Recognition:
http://www.autohotkey.com/forum/topic20493.html


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2007, 5:53 am 
Thanks Sean.
I didn't seen the topic on ADO COM. Very interesting. I'll try to use it.
Some (again) questions :
- These examples make reference to CoHelper.ahk. But you said (I don't remember where) that CoHelper and COM.ahk are not fully compatibles. So what is incompatible ? Are the examples in ADO COM (for example) can be "prefixed" with "#Include COM.ahk" rather than "#Include CoHelper.ahk"with no more modification than to prefix each COM function with "COM_" ?
For the documentation, I'd like to know, if it is usefull, the difference between COM_Invoke() and COM_Invoke_(), that I seen in the COM source, if the second one can be called directly and is usefull to use ...
For COM_CreateObject and COM_GetObject, I know what they do. They must work (almost) in the same way as the VBS/VBA equivalent. But I don't know the usage/utility of COM_ActiveXObject. Idem for COM_ConnectObject.
Thanks for the answers you gave/will give to me and for your work.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 646 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 44  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, JamixZol, Rajat and 25 guests


You can post new topics in this forum
You can 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

Search for:
Powered by phpBB® Forum Software © phpBB Group