PDA

View Full Version : feature request: bulk import / edit MB radio stations



kurtlewis
April 21st, 2006, 11:57 AM
I've been trying to figure out a better way to manage/ add / remove the radio station entries in MB. I don't know about anyone else, but at our house the family here listens to a lot of different radio stations - from Winamp because, well, winamp has the best stations selection.
Since implementing NR / JRMC, I've manually input some of the radio stations into MB. I am finding the task of inputting and maintaining over 100 stations to be unreasonable giving the current 'one at a time' method allowed in MB. It seems to me that these station entries are stored inside one of the MB main program files and is not easily editable externally.

Looking at Winamp's directory file 'winamp.bm', it appears to be a flat text file in the format of 'station name' - 'URL' and hosts all of our bookmarked radio stations.

Is there any way something can be developed similarly for MB, where these stations are stored in a bookmark file in the MB directory and can be edited in notepad? This would be HUGE! I could then copy or export the text in the winamp.bm file and paste into MB's bookmark file. -hopefully I'm making sense...

I've attached the winamp.bm file for your review-

Promixis
April 21st, 2006, 09:20 PM
I was looking for this info... this is where wmp stores its radiostations?

kurtlewis
April 21st, 2006, 09:27 PM
Hi Mike- this is where winamp stores anything you add to the 'bookmarks' while you are in the program-
Go into winamp, right-click on an item like a radio station or mp3, and 'add to bookmarks'

Then open the winamp.bm file in notepad and you will see the addition. I'm not sure where the actual list of stations is stored, but it's so easy to select an entire block of stations and 'add to bookmarks' that finding it didn't concern me too much.

Is there hope for doing some sort of bulk edit to MB's radio station entries?

Promixis
April 21st, 2006, 09:37 PM
maybe, I am not sure how shoutcast works but I am guessing this is good enough...

Promixis
April 21st, 2006, 09:40 PM
can you paste this into MB and see if it works...

HBR1.com - Dream Factory
http://www.shoutcast.com/sbin/tunein-station.pls?id=317514&filename=playlist.pls

kurtlewis
April 21st, 2006, 09:49 PM
do you mean paste both the title name and the streaming link, or are you just concerned with the functionality of the link?

I can tell you that the .pls links work fine and play back through JRMC fine (as long as JRMC is the registered player on the host server for pls files)
I have a few of these set up in MB already that I copy / pasted from winamp. The big pain-in-the-arse I have is with doing them all one at a time - I literally manage about 60+ stations for the family here....heh.

kurtlewis
April 21st, 2006, 09:51 PM
btw, I don't use winamp with MB- I use JRMC.
I'm only referencing winamp because it is still hands-down the best source for finding good radio station links.

Promixis
April 21st, 2006, 10:02 PM
I just want to see if we can extract them and make it work... so if we know we can extract it then it should be doable.

kurtlewis
April 21st, 2006, 10:17 PM
well, the process is this-
I open up the winamp.bm file in notepad. I copy the URL link. I then do into MB \ Radio and click 'add station'
I paste the link in, and then type a friendly name (or if it's a long one I go back to the winamp.bm file and copy the friendly name, and go back to MB and paste it.

but, I can't copy BOTH the URL and friendly name from the winamp.bm file and paste into MB in one operation. The way MB is set up for this is requires two separate fields to be filled in.

Now, if MB just read from a flat file like winamp does with winamp.bm, you could paste everything at once into the MB 'radio.mb' file and call it a day!

am I explaining this ok?

Promixis
April 21st, 2006, 10:18 PM
yup,

All I wanted to see was that the cut and paste worked. It should be pretty easy to automate this.

kurtlewis
April 22nd, 2006, 12:11 AM
that would be P-H-A-T !!!

Now realize, the copy-and-paste of the title and url is two operations into MB.
One copy / paste for the url, one for the title (or type the title manually)- this is because MB has two separate data entry fields.

To make it fully work there would have to be a way to copy both the title and url and paste into mb in one operation. And then be able to paste blocks of entries. Just pasting only the URL's does no good b/c you don;t have ability to name it.

If you try it out with winamp and go to add a station to MB you will see what I mean-

im avail to test it out if you design something!

Promixis
April 22nd, 2006, 09:53 AM
kurt, can you give me an example of what you are cut and pasting. I cannot get winamp to work doing this.

kurtlewis
April 22nd, 2006, 10:49 AM
I'm not clear on what's not working for you-
-being able to add a bookmark in winamp
-opening the file winamp.bm
-copying a url from winamp.bm / pasting into MB
-playing the url back from NR after you/ve entered it in MB

what version of winamp are you using- I just noticed today that they are forcing everyone to upgrade to 5.2, or the radio stations don't show up. I guess they upgraded their Shoutcast system

Promixis
April 22nd, 2006, 10:57 AM
I'm not clear on what's not working for you-
-being able to add a bookmark in winamp
-opening the file winamp.bm
-copying a url from winamp.bm / pasting into MB
-playing the url back from NR after you/ve entered it in MB

what version of winamp are you using- I just noticed today that they are forcing everyone to upgrade to 5.2, or the radio stations don't show up. I guess they upgraded their Shoutcast system

I cut and pasted one of the urls into mediabridge. I can see it from NR and select it but winamp does nothing.

i am using 5.2

danward79
April 22nd, 2006, 11:25 AM
If you use girder you could use a lua script to parse the file and add the stations to the registry were they are stored.

kurtlewis
April 22nd, 2006, 11:41 AM
If you use girder you could use a lua script to parse the file and add the stations to the registry were they are stored.

Now now, don't pop in here and tease me like that baby....

I have the bookmark file attached below, and I run winamp on the same server which hosts MB and G4. So a script would be nice if it is possible....
This is what you will see in the winamp.bm file:
Name: Radio Paradise - DJ-mixed modern & classic rock, world, electronica & more - info: radioparadise.com
Track url: http://www.shoutcast.com/sbin/tunein-station.pls?id=5043

So MB stores these in the windows registry?
Can you post an example? If you're going to lift the skirt, better put out.... :D

kurtlewis
April 22nd, 2006, 11:49 AM
I'm not clear on what's not working for you-
-being able to add a bookmark in winamp
-opening the file winamp.bm
-copying a url from winamp.bm / pasting into MB
-playing the url back from NR after you/ve entered it in MB

what version of winamp are you using- I just noticed today that they are forcing everyone to upgrade to 5.2, or the radio stations don't show up. I guess they upgraded their Shoutcast system

I cut and pasted one of the urls into mediabridge. I can see it from NR and select it but winamp does nothing.

i am using 5.2

I don't know- I don't use winamp for playback in NR- I use JRMC and have JRMC registered as the default player for *.pls files. I only use winamp for grabbing radio stations.

Try switching to JRMC as your player for MB, go into JRMC and make sure it is the default handler for *.pls files, then go back to Radio in the NR MB tree view, and play a station. It should play back fine in JRMC - That's how it works for me.

I was using 5.092, I just loaded 5.2 and it took me a bit to find the shoutcast radio stations. I think they made winamp worse with this new release. The XM stations are cool but only at 44k!! What a joke!! Umm, ya,, let's have high-res satellite music but only stream it at 44k.. Way to go... :roll:

Promixis
April 22nd, 2006, 12:33 PM
I have found most of the 'free' radio to be of such low bit rate its is useless.

kurtlewis
April 22nd, 2006, 01:22 PM
ya me too Mike- That is why I go to Winamp to find stations.
The Shoutcast list has a lot of stations at 256, 192 and 128k.

kurtlewis
April 22nd, 2006, 04:20 PM
I've found that winamp version 5.03 still pulls up the shoutcast stations fine and doesn't have all of the 'fluff' of the new 5.21- just FYI.
If you want 5.03 and don't have it let me know.

Promixis
April 23rd, 2006, 10:06 AM
ok,

run this by adding a scripting action to g4. this script will grab a text file name winampradio.txt in the root of c: and build the radiostation list in the registry. restart mediabridge.




--[[

lua script to build radiostation reg entries for the media bridge

--]]

clear ()

local fn = 'c:\\winampradio.txt'

local f = io.open(fn, "r")

if not f then
return false, 'File open failed'
end

local s = f:read('*a')

f:close()

--print (s)

local t = string.Split (s,string.char (10))

--table.print (t)

local function AddStation (name,url)

local reg = win.CreateRegistry("HKLM","Software\\Promixis\\NetRemoteServer\\RadioStations \\"..name,1)

reg:Write ('Name',name)
reg:Write ('URL',url)

reg:CloseKey ()
reg:Destroy ()

end

local i = 1

while t[i] and t [i+1] do

local url = string.gsub (t[i],'%b""','')
local name = string.gsub (t[i+1],'%b""','')

print ('Adding', name,url)

AddStation (name,url)

i = i + 2
end

Promixis
April 23rd, 2006, 10:13 AM
This works great with JRMC.

For some reason, winamp, WMP will not playback these URL's.

kurtlewis
April 23rd, 2006, 11:41 AM
Awesome :D :D

I experienced the same prob with winamp not playing back urls through MB- So I switched to JRMC very early on (and i'm glad I did :))

question-
so I'm seeing in your script that for the winampradio text file, should the entries in the file be:

NAME
URL

-or-

URL
NAME

Reason I ask is the entries from winamp.bm are in the order of:
URL
NAME
so I want to make sure they are 'read' correctly if I paste them this way into the winampradio.txt file

nice work, thank you mike!

kurtlewis
April 23rd, 2006, 11:46 AM
Mike - have you noticed that in JRMC, if you play a radio link from NR that doesn't respond (site unavailable or something), JRMC pops up an internal error dialogue box that says 'There is nothing to play'.

You have to then go to the server running JRMC, go to the error and hit 'ok'
This error popup stops all JRMC functions until the error prompt is closed- Probably nothing you guys can do about it from your end, sounds like an issue for JRMC support-
But it would be nice to be able to know when certain JRMC errors pop up and be able to close them from NR.

Promixis
April 23rd, 2006, 12:08 PM
Mike - have you noticed that in JRMC, if you play a radio link from NR that doesn't respond (site unavailable or something), JRMC pops up an internal error dialogue box that says 'There is nothing to play'.

You have to then go to the server running JRMC, go to the error and hit 'ok'
This error popup stops all JRMC functions until the error prompt is closed- Probably nothing you guys can do about it from your end, sounds like an issue for JRMC support-
But it would be nice to be able to know when certain JRMC errors pop up and be able to close them from NR.

yes, its a major PIA. ben and I are talking about it.

Promixis
April 23rd, 2006, 12:10 PM
it reads them as


url
name


at least that was the way the original file was.

kurtlewis
April 23rd, 2006, 12:18 PM
cool- so I created a txt file with your script and added a bit more instruction. This might be worth posting in the d/l section?
Heck, you could pretty much import into this from any source as long as the format in the txt file is
URL
NAME

ps- for JRMC, how about creating an NR action called 'MP.NukeJRMCPopups' -lol

Promixis
April 23rd, 2006, 01:22 PM
kill those nasty windows with G4





local f = function ()

local h = win.FindWindow (nil,'Warning')
print (h)
if h then
gir.SendKeys &#40;h,'<ENTER>'&#41;
end

h = win.FindWindow &#40;nil,'Information'&#41;
if h then
gir.SendKeys &#40;h,'<ENTER>'&#41;
end

end

JRMCTIMER = gir.CreateTimer &#40;nil,f,nil,1&#41;

JRMCTIMER&#58;Arm &#40;1000&#41;

kurtlewis
April 23rd, 2006, 02:02 PM
sweet! So it looks for a warning or information window in JRMC and then kills it by sending an enter command automatically.. brilliant.

Could you please explain to me where I put this script in G4? The only experience i've had with G4 so far is entering the serial commands for my Arcam and setting up the weather. I've a lot to learn....

Promixis
April 23rd, 2006, 04:07 PM
Create a script action and paste the code there. Add an event (right click on the action), select Girder Event, select Script Enable.

kurtlewis
April 23rd, 2006, 05:25 PM
cool cool-
I'll post this in the Girder d/l section as well- i'm sure others would love to use this.
Attached is the text file I intend to post-

kurtlewis
April 24th, 2006, 01:31 AM
Mike- is there a way to make a list box in NR that only shows the contents of the MB Radio branch?
I cant seem to find a variable or path to specify in NR. Maybe an RC5 code?

Promixis
April 26th, 2006, 08:32 PM
Mike- is there a way to make a list box in NR that only shows the contents of the MB Radio branch?
I cant seem to find a variable or path to specify in NR. Maybe an RC5 code?

I am not sure.

Ben?

kurtlewis
April 26th, 2006, 08:38 PM
Mike- I was talking to Ben about it here: http://www.promixis.com/phpBB2/viewtopic.php?t=14788

-Ben gave me some great stuff to try, and i got it all set up- but it is still not showing the contents of the MB Radio entries

Promixis
April 26th, 2006, 08:40 PM
ok, i see it.

Ben has another deadline on his plate right now. Hopefully he gets back to it this week.

kurtlewis
April 26th, 2006, 08:46 PM
No prob- It's definitely not going to kill me as I can still get to the stations by using the regular tree (but I lose major cool points...lol).

If you happen to have anything jump to mind by looking over the posts in the other thread let me know.