Help - Search - Members - Calendar
Full Version: playlist format
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
mcgoner
Hi,

when I'm listening internet streams, like www.di.fm, then in the play list foobar2k shows me the name of the station (something like: D I G I T A L L Y - I M P O R T E D - Hard Dance - are you ready for this!). when I push the play button, then foobar2k changes the name to what's plaing on the radio at the moment (like: Scott Mac - Damager).

How can I change it so foobar2k would show me the radio stations name or even better would be if foobar2k changed time to time the name of the song thats plaing on the radio and the stations name?

I've tried
$if($strcmp(%_path%,'http://64.236.36.54/stream/1025'),$puts(station,'D I G I T A L L Y - I M P O R T E D - Hard Dance'))

but it dosen't work.

Does anyone haave some good ideas and perhaps some script to do it?

McGoner
Yotsuya
There is a way to grab that information using pvars and refresh tags under Panels UI:
CODE
// PerTrack
$ifgreater(%playback_time_seconds%,0,,
$setpvar(station.name,%title%)
$setpvar(station.url,%url%)
$setpvar(station.genre,%genre%)
)

// PerSecond
$alignabs(0,0,50,15,right,)Name:
$alignabs(0,15,50,15,right,)URL:
$alignabs(0,30,50,15,right,)Genre:
$alignabs(0,60,50,15,right,)IP:
$alignabs(0,75,50,15,right,)Port:
$alignabs(0,105,50,15,right,)Title:
$alignabs(0,120,50,15,right,)Artist:

$alignabs(60,0,$sub(%_width%,60),15,,)$getpvar(station.name)
$alignabs(60,15,$sub(%_width%,60),15,,)$getpvar(station.url)
$alignabs(60,30,$sub(%_width%,60),15,,)$getpvar(station.genre)
$alignabs(60,60,$sub(%_width%,60),15,,)$substr(%path%,8,$if2($add($strrchr($substr(%path%,8,$len(%path%)),:),6),$len(%path%)))
$alignabs(60,75,$sub(%_width%,60),15,,)$if($strcmp($strchr(%path%,:),$strrchr(%path%,:)),$rgb(128,128,128)n/a,$substr(%path%,$add($strrchr(%path%,:),1),$sub($len(%path%),1)))
$alignabs(60,105,$sub(%_width%,60),15,,)$if($strcmp($getpvar(station.name),%title%),,%title%)
$alignabs(60,120,$sub(%_width%,60),15,,)[%artist%]

This solution is far from ideal but it works. The above code will display station name, url, genre, ip, port, song title, and song artist. In order to "fix" the playlist you would need to include the above // PerTrack code in any existing track display panel to set the pvars. You can then use the pvars in your SCPL Item Display code like this:
CODE
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
$ifgreater(%playback_time_seconds%,0,
$getpvar(station.name)
,
%title%
)
,
[%album artist% - ]%title%
)

Thanks for asking the question, this sort of thing has bugged me for awhile and you have motivated me to find a solution. If you are not using PanelsUI/SCPL then I'm sorry I do not know of a simpler solution.
mcgoner
it dosn't work for me. how can i find out that am i or am i not using PanelsUI/SCPL , so i coult use the script in the last post.
Yotsuya
File> Preferences> Components: See if you have it loaded.
File> Preferences> Display> "User Interface Module": See if you have it activated.
IPB ImageIPB Image

You can find out more about Panels UI (Which includes SingleColumnPlaylist and TrackDisplay) at it's dedicated thread here.
JadeElephant
QUOTE(mcgoner)
it dosn't work for me. how can i find out that am i or am i not using PanelsUI/SCPL , so i coult use the script in the last post.

It's pretty simple, really. Are you using Panels UI? Yes or no?
mcgoner
I didn't have it installed. know I installed it
IPB Image


but where exactly I must add this code what Yotsuya did put in here?
and if I use Panels UI I must abandon tab what I used for different play lists?

I tried to add this code to the configuration window but as a result my foobar2k user interface went just black.
and Panels UI is active and running nicely know.

is there somekind of a tutorial for writing scripts for foobar2k?

thanx
Yotsuya
Converting your layout to PanelsUI is not an easy task if you are new to PanelsUI. If you post a picture of your existing layout I can try to help you. I have been unable to get playlist tabs to work under PanelsUI because it is a "Splitter". However you may want to try foo_uie_playlists_dropdown.

I have actually implemented this functionality into my own layout and debugged it a bit more than when I originally posted. Add this to the // PerTrack section of your man PanelsUI Configuration code:
CODE
// PerTrack
// ----------------------------------
// Grab Online Radio Station Information
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
$ifgreater(%playback_time_seconds%,0,,
$setpvar(station.name,%title%)$setpvar(station.url,%url%)$setpvar(station.genre,%genre%)
),
$setpvar(station.name,)$setpvar(station.url,)$setpvar(station.genre,)
)


Then in the SCPL Item Display code:
CODE
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
$ifgreater(%playback_time_seconds%,0,
$getpvar(station.name)
,
$if(%isplaying%,Loading...,%title%)
)
,
// Normal code for displaying local songs, for example
[%album artist% - ]%title%
)

You appear to be new to PanelsUI, again I'm sorry I know of no easier solution.
mcgoner
My UI:
IPB Image

I tried to add the code to the window configuration.
IPB Image

where the heck i have to put those images and other stuff to get it work?

a little help would be quit good, so tnx for help.
Yotsuya
You are using PanelsUI code you obtained from somewhere I am unfamiliar with and the only thing displayed in the screenshot is SCPL. The only code displayed is a bunch of user variables. Try starting with something a bit more simple like this:
(if you can post a screenshot of your previous layout I can give something more useful)
CODE
$drawrect(0,0,0,0,brushcolor-255-255-255 pencolor-null)

$panel(Menu,Menu,0,0,%_width%,20,)
$panel(Playlist,Single Column Playlist,0,20,%_width%,$sub(%_height%,40),)
$panel(Buttons,Buttons,0,$sub(%_height%,20),%_width%,20,)

Then you can add the // PerTrack code to the bottom like this:
CODE
$drawrect(0,0,0,0,brushcolor-255-255-255 pencolor-null)

$panel(Menu,Menu,0,0,%_width%,20,)
$panel(Playlist,Single Column Playlist,0,20,%_width%,$sub(%_height%,40),)
$panel(Buttons,Buttons,0,$sub(%_height%,20),%_width%,20,)

// PerTrack
// Grab Online Radio Station Information
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
$ifgreater(%playback_time_seconds%,0,,
$setpvar(station.name,%title%)$setpvar(station.url,%url%)$setpvar(station.genre,%genre%)
),
$setpvar(station.name,)$setpvar(station.url,)$setpvar(station.genre,)
)

That will take care of setting the pvars no matter what panels are displayed. Now you can exit the PanelsUI configuration, right click on the playist and enter the SCPL configuration. Switch to the "Item Display" code, locate the portion that displays the song %title% and replace it with this:
CODE
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
$ifgreater(%playback_time_seconds%,0,
$getpvar(station.name)
,
$if(%isplaying%,Loading...,%title%)
)
,
// Normal code for displaying local songs, for example
[%album artist% - ]%title%
)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.