Welcome Guest.   Make a donation to an author on the site July 25, 2014, 10:59:12 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2014! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: playback status from Win API SendMessage  (Read 4253 times)
AEN007
Participant
*
Posts: 74


Imagination is more important than knowledge

View Profile Give some DonationCredits to this forum member
« on: December 19, 2011, 05:22:36 AM »

19December2011
SendMessage to WinAmp (or players that support WinAmp APIs like Trout)
to determine playback status (playing/paused/stopped) is»
Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. SendMessage, 0x400, 0, 104, , ahk_class Winamp v1.x
I would like to know the SM syntax for players (like CoolPlayer)
that use Windows APIs instead of WinAmp APIs ...
Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: December 19, 2011, 08:46:23 AM »

You'll have to look at each individual player you want to support.

If you're lucky, they'll have a well-defined open interface, either through SendMessage or proprietary plugins. If you're not lucky, you'll have to do a bit of reverse engineering to find out control IDs... and if it's something with a really custom skinned GUI, you might not be able to SendMessage at all.
Logged

- carpe noctem
AEN007
Participant
*
Posts: 74


Imagination is more important than knowledge

View Profile Give some DonationCredits to this forum member
« Reply #2 on: December 19, 2011, 10:06:00 AM »

19December2011
Greetings.
Thanks for the reply.
Today I found the following statement about CoolPlayer»
Quote
A: It's written in 'C' and plain Windows API's
Wouldn't all/any players that use Windows API's reply to the same syntax?
Anyway, I have no idea how to go about this.
What might be some standard syntax possibilities to try?
Any helpful replies/insights appreciated.
Thank you.
Regards
Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: December 19, 2011, 10:10:07 AM »

Wouldn't all/any players that use Windows API's reply to the same syntax?
Nope smiley

What "plain Windows APIs" means in this context is that instead of using a big set of GUI and class libraries, the application uses relatively low-level functions to do it's work. This is more work for the developer, but results in smaller and (sometimes) faster executables.

Unfortunately, it doesn't mean that there's a standard Windows API for controlling arbitrary media players.
Logged

- carpe noctem
skwire
Moderator
*****
Posts: 4,015



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: December 19, 2011, 11:02:47 AM »

As f0dder says, there is no standard for this sort of thing.  It's up to the developer to write in support for particular window messages (if any).  I became quite familiar with this sort of thing when writing my MPH application.  Only a few of the supported players I made work have any sort of API built-in.  At any rate, CoolPlayer was one of them and its messages are as follows:

Play: 40010
Pause: 40012
Stop: 40011
Prev: 40015
Next: 40014
Vol up: 40016
Vol down: 40017
Vol mute: 50000
Logged

AEN007
Participant
*
Posts: 74


Imagination is more important than knowledge

View Profile Give some DonationCredits to this forum member
« Reply #5 on: December 19, 2011, 02:48:59 PM »

19December2011
Wow ... I hit the jackpot by posting here ...
My interest in messaging CoolPlayer is mostly just to resolve a long standing "open item" of mine ...
how to determine CP playback status in a script because the GUI gives NO indication at all ...
CP uses the least CPU usage of any mp3 player I have encountered, but
I phased CP out of usage because of the no playback indication issue.
I have no real need/desire to put CP into my rotation of multimedia players ...
but it would/will be nice to have resolved this long standing open item ...

I need to ask/clarify something further.
I use the following items»
Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. SendMessage, 0x400, 0, 104, , ahk_class COWON Jet-Audio MainWnd Class
  2. SendMessage, 0x400, 0, 104, , - Trout ahk_class Winamp v1.x
  3. SendMessage, 0x400, 0, 104, , ahk_class Winamp v1.x
  4. SendMessage, 0x400, 0, 104, , ahk_class XMPLAY-MAIN
The AHK ErrorLevel is 0 when stopped, 1 when playing & 3 when paused.
The only thing that changes is the name of the receiving window.

It is (still) not (immediately) clear to me what syntax I should use with CoolPlayer.

Because I often use MPlayer (on my PII) for avi playback,
I would REALLY like to crack the SendMessage format for MPlayer ...
Logged
skwire
Moderator
*****
Posts: 4,015



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: December 19, 2011, 03:08:39 PM »

[copy or print]
[quote author=AEN007 link=topic=29339.msg272003#msg272003 date=1324327739]
The AHK ErrorLevel is 0 when stopped, 1 when playing & 3 when paused.
The only thing that changes is the name of the receiving window.

It is (still) not (immediately) clear to me what syntax I should use with CoolPlayer.
[/quote]

It's probably likely that CoolPlayer doesn't offer that sort of thing (playing status indication).  Were you able to get the other messages I posted to work?
Logged

AEN007
Participant
*
Posts: 74


Imagination is more important than knowledge

View Profile Give some DonationCredits to this forum member
« Reply #7 on: December 19, 2011, 03:44:12 PM »

No ... I have not tried
because
1) that is not what I am after ...
I would like to determine with a script whether CP is playing/paused/stopped.
2) CP (unlike Trout) responds to local hotkeys sent by an AHK script.
The CP local hotkeys are the same as WinAmp's ...
and like WA's they are hardcoded and non customizable ...
Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. WinActivate, ahk_class CoolPlayer
starts playback ... I guess like the 40010 would ...
3) I do not know the full syntax in any case.
I guess any of those CP codes would replace the 0x400? like ...
Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. SendMessage, 0x40010, ?, ?, , ahk_class CoolPlayer
What would be the correct syntax in any case?

I would guess it is certainly possible to use SendMessage with CP & MPlayer
to determine playback status. I hope to find out how ...
Logged
skwire
Moderator
*****
Posts: 4,015



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: December 19, 2011, 03:52:13 PM »

3) I do not know the full syntax in any case.
I guess any of those CP codes would replace the 0x400? like ...
Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. SendMessage, 0x40010, ?, ?, , ahk_class CoolPlayer
What would be the correct syntax in any case?

Correct syntax would be:
Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. SendMessage, 0x0111, 40010, 40010, , ahk_class CoolPlayer ; 0x0111 is WM_COMMAND

I would guess it is certainly possible to use SendMessage with CP & MPlayer
to determine playback status. I hope to find out how ...

Well, if the code isn't in the application to begin with, you're not going have much luck.  Another tip: most (all?) cross-platform apps like MPlayer will NOT have any sort of Windows API message handling built-in.  You'll have to find other ways to control it...sending keys, commandline switches, etc.


Logged

AEN007
Participant
*
Posts: 74


Imagination is more important than knowledge

View Profile Give some DonationCredits to this forum member
« Reply #9 on: December 19, 2011, 04:11:40 PM »

Well, the XMP GUI (like the CP GUI) gives no indications of playback status
and unlike the Trout/foobar GUIs cannot be tweaked with user formatting to do so;
but XMP responds to the WA APIs, so that is what started me on the SendMessage path ...

Controlling CP & MPlayer has not been the issue except that it is / has been impossible
to determine with a script whether either is playing or was actually paused
by the script command to pause the app ...

Today I also read here» CP
Quote
6: I would like to write a remote control for CoolPlayer, how can I do this?

A: It's possible to send Accelerators to the main CoolPlayer window for all playing controls.
If you send me an e-mail I will send you the messages.
I sent an email but do not know if I will ever receive a reply or not ...

Well, I hope to find some way to determine with a script the MPlayer playback status
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.122s | Server load: 0.05 ]