Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Formulas to control WMP Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: June 18 2006 at 21:28 | IP Logged Quote onhiatus

I started to play around with sending the WM_APPCOMMAND to control Windows Media Player (see Thoughts on WMP control) and had very good results. The following PH formulas seem to work very reliably and much quicker than the sendkeys I was previously using (tested on XPHome w/ WMP 10 - ymmv, but should work on any XP or later os).

The following formulas assume that windows media player is already running. In my "play" macro, I check to see that WMP is running, and if not launch it, wait 1 second, then send the message.

     Play: ph_sendmsg(ph_findwindow("WMPlayerApp",0),793,0,3014656)
     Pause: ph_sendmsg(ph_findwindow("WMPlayerApp",0),793,0,3080192)
     Stop: ph_sendmsg(ph_findwindow("WMPlayerApp",0),793,0,851968)
     Back: ph_sendmsg(ph_findwindow("WMPlayerApp",0),793,0,786432)
     Next: ph_sendmsg(ph_findwindow("WMPlayerApp",0),793,0,720896)

Note that Play and Pause are discrete - not toggled. There's a toggle value to, but I was excited to find discrete keys.

Have fun!
Back to Top View onhiatus's Profile Search for other posts by onhiatus Visit onhiatus's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: June 19 2006 at 08:14 | IP Logged Quote krommetje

Hey that is interesting:

I was trying to use winamp for my Streaming Radio, but for some reason winamp exits with an error when I call the link to the radiostation. Is it possible to open an address with the formula ph_sendmsg?

Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: June 19 2006 at 18:06 | IP Logged Quote onhiatus

I don't think you would use sendmsg to do this. If you relaunch wmp (e.g. double clicking a mp3 file) it brings up the current instance and plays the new file, so, if you use ph_launchapp to "launch" your address it should open it with the correct player (assuming you have wmp configured to handle the file type).

This was basically how my old roll-your-own Pronto based system worked - including internet radio...
Back to Top View onhiatus's Profile Search for other posts by onhiatus Visit onhiatus's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: June 21 2006 at 05:22 | IP Logged Quote krommetje

I am going to play around a bit as soon as I've got this CM11 business sorted out....

Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum