Author |
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: June 03 2006 at 00:28 | IP Logged
|
|
|
I am currently looking around the possibiblity to have Winamp as a streamer for webradio... in fact: winamp streams... it would be nice to have PH change streams as we listen to several of them...
Peter
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: June 07 2006 at 03:35 | IP Logged
|
|
|
Didn't get very far... MP7 is not installed on my PH-Server. But after I install MP7, would it be possible to instead of opening a file, with ph_winmampctrl(..), opening a streaming location?
Or should I first save a playlist en then play the only entry in the playlist?
I would like to stream a radiostation instead of a file....
Peter
Edited by krommetje - June 07 2006 at 03:36
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: June 07 2006 at 07:16 | IP Logged
|
|
|
At one time, I had a few playlists that contained stream addresses, so that would work.
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: June 07 2006 at 07:26 | IP Logged
|
|
|
Before I can try it, I have to reboot the PH-server and that is one thing I don't like
I recall something like that winamp has to be installed in the PH-dir... is that correct?
I am going to husl-up and post some code the next few days...
Peter
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: June 07 2006 at 13:52 | IP Logged
|
|
|
Why would you need to reboot?
Winamp can be installed anywhere on your machine; no restrictions.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 07 2006 at 20:36 | IP Logged
|
|
|
Peter,
You shouldnt have to reboot. Just install Winamp whereever you like on the PH machine (default works fine) and then edit the pwrhome.ini file and set the "Path" parameter in the [WinAmp] section to the directory that you installed in...ex: Path=c:\program files\winamp\winamp.exe. That should be all that you need to do.
Concerning streams...Ive never used Winamp to play streams so cant really comment, but I don't see why you couldnt pass a complete HTTP path in the sdata parameter for the ph_winampctrl function.
Dave.
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: June 08 2006 at 02:31 | IP Logged
|
|
|
TonyNo wrote:
Why would you need to reboot?
Winamp can be installed anywhere on your machine; no restrictions. |
|
|
Because Media Player 7 was not installed during installation.WinAmp is already installed but for Winamp to be able to stream wma, there has to be MP7 or later on the system....
Peter
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: June 08 2006 at 02:33 | IP Logged
|
|
|
dhoward wrote:
Peter,
You shouldnt have to reboot. Just install Winamp whereever you like on the PH machine (default works fine) and then edit the pwrhome.ini file and set the "Path" parameter in the [WinAmp] section to the directory that you installed in...ex: Path=c:\program files\winamp\winamp.exe. That should be all that you need to do. |
|
|
Will do...
dhoward wrote:
Concerning streams...Ive never used Winamp to play streams so cant really comment, but I don't see why you couldnt pass a complete HTTP path in the sdata parameter for the ph_winampctrl function.
|
|
|
I am going to try a few things this weekend... will keep you posted...
Peter
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: June 08 2006 at 03:22 | IP Logged
|
|
|
What Should I do:
I came up with this:
Code:
ph_run('cmd.exe /c "~"c:\program files\powerhome\winamp.exe"')
ph_winampctrl ( addlist, 0, http://lsd.newmedia.tiscali-business.com/bb/redirect.lsc?str eam=swr3$livestream.wma&content=live&media=ms )
ph_winampctrl (play, 0, http://lsd.newmedia.tiscali-business.com/bb/redirect.lsc?str eam=swr3$livestream.wma&content=live&media=ms )
|
|
|
Is this the correct way to go about? Or is this adding to the playlist redundant?
Peter
Edited by krommetje - June 08 2006 at 03:23
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 11 2006 at 22:39 | IP Logged
|
|
|
Peter,
Instead of using the ph_run command, I would just use the "launch" command in ph_winampctrl:
ph_winampctrl("launch",0,"")
The "addlist" command adds the stream to whatever the current playlist is. I wouldnt think this is quite what you want to do. I would use the "playfile" command again like this:
ph_winampctrl("playfile",0,"http://www.surgeradio.org:8060")
The "play" file as you've got it above ignores the sdata parameter so it doesnt matter what you put there. Also, not sure if it was an oversight but the command parameter is a string and the sdata parameter is a string so both need quotes.
You would probably want to put this in a macro to make sure that Winamp is open before continuing like below:
Code:
10 Formula Immediate ph_winampctrl("launch",0,"")
20 Wait 0.5
30 Jump if(ph_winampinfo("status",0) = "not running"), - 1,1)
40 Formula Immediate ph_winampctrl("playfile",0,"http://www.surgeradio.org:8060")
50 Wait 0.25
60 Formula Immediate ph_winampctrl("play",0,"")
|
|
|
I found that it helps to put a small delay between the "playfile" command and the "play" command when using streams because it times a short period of time to connect.
HTH,
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: October 08 2006 at 12:10 | IP Logged
|
|
|
Getting back to the original thread, I have updated and combined the Info and Art macros for the new version...
Code:
insert into macroheader values ('WINAMP GET INFO','GET WINAMP INFO',0,0,1);
insert into macrodetail values ('WINAMP GET INFO',1,38,'',0,'if( ph_ismacrowaiting( "WINAMP GET INFO")=0, 0, ph_killmacrowait("WINAMP GET INFO"))',0,'');
insert into macrodetail values ('WINAMP GET INFO',2,15,'[LOCAL1]',NULL,'ph_winampinfo("listpos", 0, 0)',0,'');
insert into macrodetail values ('WINAMP GET INFO',3,37,'',NULL,'Don''t get info if same',0,'');
insert into macrodetail values ('WINAMP GET INFO',4,27,'',NULL,'if( ph_winampinfo( "listtitle", [LOCAL1], 0) = "{WINAMP SONG}", "Out", "X")',0,'');
insert into macrodetail values ('WINAMP GET INFO',5,10,'WINAMP SONG',NULL,'ph_winampinfo( "listtitle",[LOCAL1], 0)',0,'');
insert into macrodetail values ('WINAMP GET INFO',6,10,'WINAMP ARTIST',NULL,'ph_winampinfo( "listartist", [LOCAL1], 0)',0,'');
insert into macrodetail values ('WINAMP GET INFO',7,10,'WINAMP ALBUM',NULL,'ph_winampinfo( "listalbum", [LOCAL1], 0)',0,'');
insert into macrodetail values ('WINAMP GET INFO',8,10,'WINAMP NEXT',NULL,'ph_winampinfo( "listtitlename", [LOCAL1] + 1, 0)',0,'');
insert into macrodetail values ('WINAMP GET INFO',9,37,'',NULL,'Get Song Path',0,'');
insert into macrodetail values ('WINAMP GET INFO',10,15,'[LOCAL2]',NULL,'ph_regexdiff( "^","[^\\]*\.[wm][mp][a3]$", ph_winampinfo( "listfilename", [LOCAL1], 0) ,1,0)',0,'');
insert into macrodetail values ('WINAMP GET INFO',11,36,'',NULL,'"Path: [LOCAL2]"',0,'');
insert into macrodetail values ('WINAMP GET INFO',12,37,'',NULL,'Clear potential Read Only attribs',0,'');
insert into macrodetail values ('WINAMP GET INFO',13,15,'[LOCAL3]',NULL,'ph_setfileattrib( ph_getphwebdir() + "\folder.jpg" , 0 ) + ph_setfileattrib( ph_getphwebdir() + "\albumartsmall.jpg", 0 )',0,'');
insert into macrodetail values ('WINAMP GET INFO',14,36,'',NULL,'"Attrib Result: " + [LOCAL3]',0,'');
insert into macrodetail values ('WINAMP GET INFO',15,37,'',NULL,'Copy art file to PH web folder',0,'');
insert into macrodetail values ('WINAMP GET INFO',16,15,'[LOCAL3]',NULL,'ph_copyfile( "[LOCAL2]" + "folder.jpg", ph_getphwebdir() + "\folder.jpg", 1) + ph_copyfile( "[LOCAL2]" + "albumartsmall.jpg", ph_getphwebdir() + "\albumartsmall.jpg", 1)',0,'');
insert into macrodetail values ('WINAMP GET INFO',17,36,'',NULL,'"Copy Result: " + [LOCAL3]',0,'');
insert into macrodetail values ('WINAMP GET INFO',18,37,'',NULL,'If error, copy backup art file',0,'');
insert into macrodetail values ('WINAMP GET INFO',19,16,'',NULL,'if( [LOCAL3] = 0, 2, 1)',0,'');
insert into macrodetail values ('WINAMP GET INFO',20,15,'[LOCAL3]',NULL,'ph_copyfile( ph_getphwebdir() + "\folder.jpg.bak", ph_getphwebdir() + "\folder.jpg", 1) + ph_copyfile( ph_getphwebdir() + "\albumartsmall.jpg.bak", ph_getphwebdir() + "\albumartsmall.jpg", 1)',0,'');
insert into macrodetail values ('WINAMP GET INFO',21,26,'',NULL,'Out',0,'');
insert into macrodetail values ('WINAMP GET INFO',22,31,'',NULL,'int(number( ph_winampinfo("tracklen",0, 0)) - ( number( ph_winampinfo("trackpos",0, 0)) / 1000) + 1)',0,'');
insert into macrodetail values ('WINAMP GET INFO',23,1,'WINAMP GET INFO',1,'',0,'');
|
|
|
|
Back to Top |
|
|
|
|