Author Topic: Determine XMP playback status via XMP GUI  (Read 2633 times)

AEN007

  • Posts: 16
Determine XMP playback status via XMP GUI
« on: 29 Mar '11 - 09:39 »
Please, next time you post, read the thread title. Your question has nothing to do with the Support Site.
Anyway, my most important first impression is that XMP could/should give better GUI indications of whether XMP is Playing, Stopped or Paused. ... Now the XMP WinTitle is either "XMP" ... or the Formatting string (Fs) - BUT the WinTitle is the Fs whether XMP is playing, paused or stopped after playing.
Ah, it's indeed rather difficult to find out whether XMPlay is playing if you're just using a script, there are not interface for that. What exactly do you want to achieve?
29March2011
Sorry, after being up all night, I read the title as "Comments and suggestions concerning XMPlay" ... XMP could introduce a ISplaying/ISpaused variables for the Fs ...
foobar2000 has %ispaused% ... but when foobar is stopped (not stopped AND unloaded)
the WinTitle says just "foobar2000".
My foobar2000 Fs is»
Code: [Select]
%artist% - %album%   «$if(%ispaused%,Paused,Playing)»   '['%_foobar2000_version%']'   So, my fb2k title ...
includes «Paused» when fb2k is paused;
includes «Playing» when fb2k is playing;
is only foobar2000 when fb2k is stopped (whether unloaded or not ...)

My PII plays MM files all day and sometimes all night while I am working on my PIVs (or sleeping).
My scripts "run" the PII while I am working (or sleeping ...) and need to be able to determine the playback status of whichever player I am using ...
Right now XMP is (as far as this issue goes) slightly better than CoolPlayer
but not as good as WinAmp or foobar or jetAudio or ... because when the XMP WinTitle is the Fs,
a script cannot determine if XMP is playing, paused or stopped ...

This issue might be relevant to others - not just me ...
Thanks again in any case ...

Cris

  • Posts: 232
Re: Determine XMP playback status via XMP GUI
« Reply #1 on: 29 Mar '11 - 11:01 »
I'm not sure if this changed (however I doubt it), but a few years ago I used the SendMessage API to find XMPlay's playing state. Something like this:

Code: [Select]
int result = SendMessage (XMP_hwnd, WM_USER, 0, 104);

Looking now in the old C++ sources I wrote back then (which, sadly, are very poorly documented and commented :( ), I can deduce this:
result will be 0 if XMPlay is stopped. I don't remember if there was a difference between stopped with the file loaded (one-click stop), or stopped with the file unloaded (two-clicks stop)
result will be 1 or 3, depending if XMPlay is Playing or Paused (again, I can't remember if 1 is playing and 3 Paused, or vice-versa).

But anyway, if those scripts you are using support sending window messages, you should give this a try. With a simple trial-and-error approach, you will sure be able to find the exact values. It worked perfectly a few years back when I used it. :)

Also, as far as I know, there is a method of callind any API directly from the Windows command line (cmd). So there might even be a way of using this approach in a BAT file (however, you still need a way to get the XMPlay main window handle, XMP_hwnd).

AEN007

  • Posts: 16
Re: Determine XMP playback status via XMP GUI
« Reply #2 on: 29 Apr '11 - 14:08 »
29April2011

Greetings.
Thanks for the reply!

Code: [Select]
SendMessage, 0x400, 0, 104, , ahk_class XMPLAY-MAINreturns 0 when XMPlay is stopped (unloaded or not);
returns 1 when XMPlay is playing; &
returns 3 when XMPlay is paused!

Great. I can use that! - maybe/probably not only with XMP ...

I don't know that much about SendMessage ... like why use WM_USER, 0, 104
but I'll never know everything about everything ...

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: Determine XMP playback status via XMP GUI
« Reply #3 on: 29 Apr '11 - 14:58 »
I don't know that much about SendMessage ... like why use WM_USER, 0, 104

That is actually a Winamp message (IPC_ISPLAYING) that XMPlay supports. You can find details in the Winamp plugin SDK. For reference, these are the Winamp messages that are currently supported by XMPlay: IPC_STARTPLAY, IPC_ISPLAYING, IPC_GETOUTPUTTIME, IPC_JUMPTOTIME, IPC_SETPLAYLISTPOS, IPC_SETVOLUME, IPC_SETPANNING, IPC_GETLISTLENGTH, IPC_GETLISTPOS, IPC_GETPLAYLISTFILE, IPC_GETPLAYLISTTITLE.

XMPlay's native plugin API (see the "DSP/general plugin SDK") can also be used to get info and perform actions.

AEN007

  • Posts: 16
Re: Determine XMP playback status via XMP GUI
« Reply #4 on: 29 Apr '11 - 22:23 »
29April2011

Greetings.
Thanks for the reply.

I'll need some time to digest what you are saying.
The SendMessage code I posted also works (when appropriately adjusted) with jetAudio and Trout
- which is great because although they were not impossible to exactingly manage with a script,
it is MUCH easier to use the SendMessage.

The SendMessage code I posted does not work with CoolPlayer, MPlayer nor with MPCHC.
I guess that is an API issue?
I currently have no way to tell with a script the playback status of CoolP or MPlayer.
It is a total bitch to exactingly manage MPCHC with a script.
I would really like to be able to use something like SendMessage with CoolPlayer, MPlayer & MPCHC!

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ

AEN007

  • Posts: 16
Re: Determine XMP playback status via XMP GUI
« Reply #5 on: 19 Dec '11 - 10:50 »
19December2011
Greetings.
Today I found the following statement about CoolPlayer»
Quote
A: It's written in 'C' and plain Windows API's
Maybe someone could reply/advise regarding
the SendMessage syntax for Windows APIs?
The SendMessage syntax in previous posts in this thread
have been for the WinAmp API ...