21 Oct '14 - 16:07 *
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: API for XMPlay? (like WinAmp)  (Read 4576 times)
djwim
Posts: 29


« on: 17 Aug '11 - 16:44 »
Reply with quoteQuote

Does XMPlay has an option to control it from within an application, like VB6?

I have at the moment such application where I just invoke a MP3 player to listen to a certain song. WinAmp provides an API, using standard windows dll (user32.dll). Things like FindWindow and SendMessage are used to communicate with WinAmp. See for instance http://www.koders.com/vb/fid392170664938AB694E027831531D4BD8D40F14C0.aspx

I like XMPlay and would like to get rid of WinAmp in my application! Is a similar interface (API) available/possible for XMPlay??
_Wim_
Logged
saga
Posts: 1725


« Reply #1 on: 17 Aug '11 - 18:33 »
Reply with quoteQuote

XMPlay can be controlled via DDE, as shown by my old VB6 tray icons application.
Logged
Dotpitch
Posts: 2717


« Reply #2 on: 17 Aug '11 - 18:42 »
Reply with quoteQuote

There's a list of available DDE commands on the Support Site.
Logged
djwim
Posts: 29


« Reply #3 on: 17 Aug '11 - 18:49 »
Reply with quoteQuote

OK, Thanks. I wasn't aware of that support site, and especially that you can use DDE to control XMPlay... Got myself some homework to do now: how to use DDE..? But I'm sure with the help of the code you already pointed at, and the example on the support site, I'll manage.
Thanks again,
_Wim_
Logged
Jace
Posts: 807


« Reply #4 on: 17 Aug '11 - 22:40 »
Reply with quoteQuote

I made a commandline application to control XMP via DDE a while back. Did intend to get it uploaded to the support site, but I don't think that ever happened Tongue

If you think it might be of assistance, I shoved it up over here.

Readme included, which hopefully explains how it's to be used well enough. Delphi sources are available on request. Tongue
Logged
Dotpitch
Posts: 2717


« Reply #5 on: 18 Aug '11 - 06:22 »
Reply with quoteQuote

I made a commandline application to control XMP via DDE a while back.
Whoa, that's a nice one! Can I put it on the Support Site?
Logged
Jace
Posts: 807


« Reply #6 on: 18 Aug '11 - 08:47 »
Reply with quoteQuote

Feel free to
Logged
Dotpitch
Posts: 2717


« Reply #7 on: 18 Aug '11 - 17:07 »
Reply with quoteQuote

Done.
Logged
djwim
Posts: 29


« Reply #8 on: 18 Aug '11 - 20:16 »
Reply with quoteQuote

Hi,
Ok so I went ahead with the DDE codes as described. Pretty simple. The VB6 code as supplied demonstrates nicely what is possible.
However what I miss is to be able to send a filename of a song to play to XMPlay. And another command I would expect is to skip n seconds forward or backwards.
A final remark, I noticed that the list of cmds is not complete... The list shows a gap between the codes 12 and 512. So I tried a few, and for instance key14 toggles bubbles ON/OFF. So I wonder what more is possible. Also is "info" the only command for a LinkRequest transactions? (I tried INFO 0, INFO 1 and INFO 2).
Thanks for any answer,
_Wim_
Logged
Dotpitch
Posts: 2717


« Reply #9 on: 19 Aug '11 - 06:10 »
Reply with quoteQuote

However what I miss is to be able to send a filename of a song to play to XMPlay.
I think you should send
[open("drive:\path\filename.ext")]
to open a file. Replace open with list to add a file.

And another command I would expect is to skip n seconds forward or backwards.
XMPlay doesn't even have that it the GUI, so that's not available via DDE either. It is on the request list.

A final remark, I noticed that the list of cmds is not complete... The list shows a gap between the codes 12 and 512. So I tried a few, and for instance key14 toggles bubbles ON/OFF. So I wonder what more is possible.
Probably every shortcut (see Options and stuff - Shortcuts) has a DDE key linked to it. The key numbers may be a bit of a mess due to new feature introductions.
Logged
djwim
Posts: 29


« Reply #10 on: 19 Aug '11 - 15:14 »
Reply with quoteQuote

I tried sending: open("drive:\path\filename.ext"), also tried without the brackets and/or quotes, but no response...

Just to be sure I understand it correctly: I used the VB6 example on the support site, and instead of (for instance) sending 'KEY 512', I enter the open command, e.g.: 'OPEN ("M:\A_SONG.MP3")'
The key command turns volume up, the open command doesn't seem to make any change.

If I send something with the first button (using LinkRequest), then only the word 'INFOxxxx' seems to work. If enter the OPEN command, it comes a error message box.

Any other ideas?
Logged
Dotpitch
Posts: 2717


« Reply #11 on: 19 Aug '11 - 16:24 »
Reply with quoteQuote

I tried sending: open("drive:\path\filename.ext"), also tried without the brackets and/or quotes, but no response...
Have you also tried with the square brackets around it, so [open("file.ext")]?
Logged
Ian @ un4seen
Administrator
Posts: 17027


« Reply #12 on: 19 Aug '11 - 17:39 »
Reply with quoteQuote

A final remark, I noticed that the list of cmds is not complete...

There have indeed been a few additions since the last update of the list. This is what has been added...

13 = Open from clipboard
14 = Toggle info bubbles
15 = Close at end of track/list
519 = DSP - Balance left
520 = DSP - Balance right
521 = DSP - Amplification reset
522 = DSP - Auto amplification
523 = DSP - Volume mute
265 = Info - Fullscreen visuals
266 = Info - Text size decrease
267 = Info - Text size increase
297 = MOD - Interpolation
298 = MOD - Ramping
299 = MOD - Surround sound
90 = Current track - Stop at end
112 = Current track - Rating - none
113 = Current track - Rating - 1
114 = Current track - Rating - 2
115 = Current track - Rating - 3
116 = Current track - Rating - 4
117 = Current track - Rating - 5
118 = Current track - Rating - down
119 = Current track - Rating - up
120 = Current track - Rating - show
97 = Plugins - DSP / general
344 = List nav - Select extend up
345 = List nav - Select extend down
346 = List nav - Top
347 = List nav - Bottom
326 = List sort - Tag - Title
327 = List sort - Tag - Artist
328 = List sort - Tag - Album
329 = List sort - Tag - Year
330 = List sort - Tag - Track
331 = List sort - Tag - Genre
332 = List sort - Tag - Comment
333 = List sort - Rating
356 = List nav - Find quick
381 = List - Add from clipboard
382 = List track - Dequeue
120 = List track - Rating - none
121 = List track - Rating - 1
122 = List track - Rating - 2
123 = List track - Rating - 3
124 = List track - Rating - 4
125 = List track - Rating - 5
126 = List track - Rating - down
127 = List track - Rating - up
416 = List nav - Select same title
417 = List nav - Select same artist
418 = List nav - Select same album
419 = List nav - Select same year
420 = List nav - Select same track
421 = List nav - Select same genre
422 = List nav - Select same comment
423 = List nav - Select same type
424 = List nav - Select same path
642 = Bookmark - Resume after queue
Logged
djwim
Posts: 29


« Reply #13 on: 22 Aug '11 - 19:14 »
Reply with quoteQuote

Have you also tried with the square brackets around it, so [open("file.ext")]?
I tried "[open("D:\Pinnacle\LesMasses\AudSrc\Darude - Sandstorm.mp3")]" (...without surrounding quotes ha ha. Smiley)
With LinkExecute --> no response (while e.g. KEY xxx performs an action)
With LinkRequest --> Generates an error ('Foreign application won't perform DDE method or operation') (while INFO 0 performs its task)

Would really appreciate, if possible, to find out how to open a song in XMPlay using the DDE interface.
Logged
Dotpitch
Posts: 2717


« Reply #14 on: 22 Aug '11 - 21:17 »
Reply with quoteQuote

What Windows do you use?
Wild guess: could you set the LinkTopic to XMPlay|system instead of XMPlay|XMPlay?
Btw, you don't have to try LinkRequest every time, as that only works to fetch the contents of the Info Window.
Logged
djwim
Posts: 29


« Reply #15 on: 23 Aug '11 - 16:11 »
Reply with quoteQuote

I use Windows XP, VB6, and tried your suggestion:
Private Sub Command2_Click()
' Use this one to execute a function, e.g. keyxxx topics or playlist manipulation
Text2.LinkTopic = "XMPlay|system" ' Init link topic. The second part (after the '|') doesn't appear to matter but must not be empty.
Text2.LinkMode = 2 'Open connection
Text2.LinkExecute Text1.Text 'Execute function, e.g: 'KEY 80' or 'OPEN ("X:\path\song.mp3")'
Text2.LinkMode = 0 'Close connection
End Sub
without success... Sad
Logged
djwim
Posts: 29


« Reply #16 on: 8 Sep '11 - 12:47 »
Reply with quoteQuote

Quote
I made a commandline application to control XMP via DDE a while back.
Hi Jace, are you able to send a filename to play with your command line program?
E.g.
C:\> xmpcontrol [open("D:\path\song.mp3")]

Because I still would like to find out how to send a filename to XMPLAY using DDE..!
Logged
Jace
Posts: 807


« Reply #17 on: 9 Sep '11 - 13:36 »
Reply with quoteQuote

To be honest, I don't know. Tongue

I coded the thing to be a LiteStep module and I only use the basic parts of it even with that.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.20 | SMF © 2013, Simple Machines