23 Apr '14 - 14:09 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Getting track info from external application  (Read 4730 times)
mcm
Guest
« on: 10 Apr '06 - 21:33 »
Reply with quoteQuote

Hi everyone,

I want to code a tiny utility for myself that would get track info from xmp and format it in basic html for putting on web page. So, could anyone help me with getting the info? GetWindowText isn't suitable as it would return only artist - title, and I want some extended info.

Thanks in advance,
mcm.
Logged
Torkell
Posts: 1167


« Reply #1 on: 11 Apr '06 - 14:18 »
Reply with quoteQuote

You'll need to use DDE to get the information. Have a look here for details and some sample code.
Logged
mcm
Guest
« Reply #2 on: 11 Apr '06 - 20:21 »
Reply with quoteQuote

Thanks a lot.
Logged
Rah'Dick
XMPlay Support
Posts: 927


« Reply #3 on: 21 Apr '06 - 02:48 »
Reply with quoteQuote

Just promoting the new Support site a little:

The DDE command list can now be found on the Support site, too - free for everyone to look at without searching first. Smiley
Logged
Guest2
Guest
« Reply #4 on: 11 May '06 - 00:01 »
Reply with quoteQuote

Thanks for the info Rah'Dick. However, I don't have VB installed and I'm having a hard time understanding the code example.

Can anyone write or link to some command line utility/script that works as a simple "middle man"? For example, when executing "utility.exe -128", the sought after utility should take parameter 128 and carry out its corresponding DDE function for Xmplay ("Change track - Next")? That would give everyone an easy way to control Xmplay through command line!  
Logged
Guest2
Guest
« Reply #5 on: 11 May '06 - 21:44 »
Reply with quoteQuote

No replies... Ok, onto the second strategy  Grin

All I really need is to do these things

80 = Current track - Play/pause
81 = Current track - Stop
82 = Current track - Forward
83 = Current track - Back

128 = Change track - Next
129 = Change track - Previous

512 = Volume up
513 = Volume down

Can someone with VB6 just please help me with this:
(i) mod the example code to have one button for each of the commands above,
(ii) add an alt + [some key] hotkey for each button
(iii) compile it and post it

I can manage the rest through an AutoIt script or something like that.

(preview: third strategy = me begging and crying)
Logged
Rah'Dick
XMPlay Support
Posts: 927


« Reply #6 on: 12 May '06 - 07:47 »
Reply with quoteQuote

I tried to establish a DDE connection with XMPlay from a Delphi app, but no luck. The documentation is so vague at that point that I don't know what to insert into the DDE Link, DDE Topic etc. I looked at the VB example but none of the values there worked for me.  Sad
I also found several sites that said "DDE is sooo yesterday's app-to-app communication - use OLE instead" or something, which discouraged me even more.
« Last Edit: 12 May '06 - 07:49 by Rah'Dick » Logged
Torkell
Posts: 1167


« Reply #7 on: 12 May '06 - 09:26 »
Reply with quoteQuote

The code works, but the command list on the support site is wrong. You need to send "keyXXX" where XXX is the number, so e.g. pause is "key80". To get the contents of the info screens you need to send "infoX" where X is the number of the screen (0=general, 1=message, 2=samples).
Logged
Rah'Dick
XMPlay Support
Posts: 927


« Reply #8 on: 12 May '06 - 16:03 »
Reply with quoteQuote

I did this (with "keyXXX"), but I couldn't even establish a DDE link to XMPlay.
Logged
Guest2
Guest
« Reply #9 on: 14 May '06 - 20:52 »
Reply with quoteQuote

Ok, I just spent almost an hour just trying to get a way to control Xmplay through command line of some sorts. Without success. Annoying!

As I said, all I want to do is send some basic commands to Xmplay without using the GUI or the hotkeys. Since I don't have VB6 or a compiled copy of the example code, can someone perhaps give a reference to (a) some script language that can handle DDE by itself (I know that VBScript for example doesn't support DDE; I'd prefer something that comes pre-installed with win xp) or (b) some free application that lets me compile the example code (Would that work with Visual Basic Express 2005 for example? I think that's free and I could DL it and read up enough to get the example code running)

Also, is there some way to tie multiple hotkeys to the same command in Xmplay? For exampe, tie both "multimedia keyboard play button" and "ctrl + allt + p" to command "play/pause".

Also, is command line support coming to Xmplay anytime soon? :-)
Logged
Dotpitch
Posts: 2690


« Reply #10 on: 14 May '06 - 21:18 »
Reply with quoteQuote

Also, is there some way to tie multiple hotkeys to the same command in Xmplay? For exampe, tie both "multimedia keyboard play button" and "ctrl + allt + p" to command "play/pause".
Sure, just assign it twice...
Logged
Torkell
Posts: 1167


« Reply #11 on: 14 May '06 - 21:58 »
Reply with quoteQuote

It won't work as-is with Visual Basic Express, due to Microsoft deciding to screw backwards compatability when they came up with .net. I don't know if VB.net even has native DDE support, or if you have to use the Windows API for that in it.

I've compiled the example code that's on the support site, and uploaded the program here. Note that this is a quick'n'dirty one, and may fail in interesting ways. Put the command you want to send in the top-left text box. Click 'Query' if you're using one of the infoX codes, or 'Command' for the keyXXX ones.
Logged
Guest2
Guest
« Reply #12 on: 16 May '06 - 00:54 »
Reply with quoteQuote

Thanks a lot BoggyB!  Smiley

I got it working (I think).

I also got command line control working by
(1) adding extra hotkeys (some weird ones like CTRL + ALT + SHIFT + 0 to avoid collision with hotkeys in other programs)
and
(2) making AutoIt scripts to execute the hotkeys and
(3) starting those script through command line.

Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines