Old 25th April 2006, 12:26   #41
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
wow... 49 standalone downloads and 130 users of my first method.
zbowling is offline   Reply With Quote
Old 25th April 2006, 12:30   #42
jant77
Senior Member
 
Join Date: Jun 2004
Posts: 100
good work!
jant77 is offline   Reply With Quote
Old 25th April 2006, 13:00   #43
byblo
Member
 
byblo's Avatar
 
Join Date: Mar 2006
Posts: 88
Cannot initialize the app (0xc0000135)

Does it need .net or something ? (tried to get a mscoree.dll, but without result)
byblo is offline   Reply With Quote
Old 25th April 2006, 16:56   #44
M0g13r
Banned
 
Join Date: Nov 2005
Posts: 11
yes it needs .net framework :\

can someone make it working without .net ?!
M0g13r is offline   Reply With Quote
Old 25th April 2006, 18:49   #45
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
you can use mono :-) i wrote it on mono on linux in the first place. LOL

http://www.mono-project.com/
zbowling is offline   Reply With Quote
Old 25th April 2006, 20:03   #46
jstone
Junior Member
 
Join Date: Apr 2006
Posts: 4
Hi Zac,

The new version of Tunapie (0.9.5.2) works with the updated shoutcast listing system. You just need to watch out for your favorites file: it will be overwritten with a new blank one (I have changed the format of favorites to the new system).

James
jstone is offline   Reply With Quote
Old 25th April 2006, 20:10   #47
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Tunapie is UNIX right? I am so sick of Windoz.
antihadron is offline   Reply With Quote
Old 26th April 2006, 00:18   #48
jstone
Junior Member
 
Join Date: Apr 2006
Posts: 4
Quote:
Originally posted by antihadron
Tunapie is UNIX right? I am so sick of Windoz.
Yeh.. That's right!

Well, actually it is written in Python, so it runs on pretty much anything, but it is designed for Linux.

James
jstone is offline   Reply With Quote
Old 26th April 2006, 04:48   #49
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Hiya, I am working on updating the windows c# code so that it does three things:

1) Listen on something other than port 80
2) Cache results returned from shoutcast for about an hour.
3) Pass in the limit field passed in from winamp.

1 and 2 no big deal, anyone know what the equivlent field is in the newxml file is to limit the results returned?
antihadron is offline   Reply With Quote
Old 26th April 2006, 05:19   #50
ctkatz8086
Senior Member
 
Join Date: Sep 2002
Location: louisville, ky home of the CARDINALS
Posts: 401
hey guys.

could someone explain how to work this for someone who has no programming ability whatsoever?

ctkatz8086 is offline   Reply With Quote
Old 26th April 2006, 06:43   #51
jstone
Junior Member
 
Join Date: Apr 2006
Posts: 4
Quote:
Originally posted by antihadron
Hiya, I am working on updating the windows c# code so that it does three things:

1) Listen on something other than port 80
2) Cache results returned from shoutcast for about an hour.
3) Pass in the limit field passed in from winamp.

1 and 2 no big deal, anyone know what the equivlent field is in the newxml file is to limit the results returned?
I'd be interested to know this too.

On Tunapie I have a nasty hack which prevents the user searching for words shorter than three letters, or "the" (which returns too many results as well).. Really horrible, but works.

James
jstone is offline   Reply With Quote
Old 26th April 2006, 20:54   #52
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
Quote:
The new version of Tunapie (0.9.5.2) works with the updated shoutcast listing system. You just need to watch out for your favorites file: it will be overwritten with a new blank one (I have changed the format of favorites to the new system).
My version of Tunapie has so many hacks, I'm afriad of updating it now :-P. lol
zbowling is offline   Reply With Quote
Old 26th April 2006, 20:59   #53
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
Quote:
Originally posted by antihadron
...
3) Pass in the limit field passed in from winamp.
...
anyone know what the equivlent field is in the newxml file is to limit the results returned?
limit still works i think? i'm not sure. Might not be a way anymore.
zbowling is offline   Reply With Quote
Old 26th April 2006, 21:01   #54
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
Hehe.. this thread shows i know a few languages.. C#, PHP, python, ?XSL maybe counts?, lol...
zbowling is offline   Reply With Quote
Old 27th April 2006, 06:05   #55
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Hi Zac Thanks again for coding this up! Been fun at my first dive into C# (In visual studio not mono though :-(. Thanks for the opportunity! Added a few more hacks to the hack (see attachment, with source).

1) Can do command line pass in of a port to listen on other than 80. Skype and other programs think thats a great port to listen on unasked for some reason.
2) Updated so it can accept connections from any IP address other than 127.0.0.1. (Home Network)
3) Fixed problem where it was using UTF8 encoding, changed to ASCII. This was preventing Winamp from reading the stream.
4) Added gzip compression to the shoutcast site connection.
5) Added limits passed in from Winamp, feeds into XSLT if. Makes browser experience a little better.
6) Added a 1 hour cache to the radio listing.
7) Made it read all 14000 streams into the cache. Figured once an hour would'nt kill anything.


Since I did not write the original code and I did not spend much time testing it or my changes, caveat emptor! as before no warranty so if it does'nt work or blows anything up I am sorry but thats it. It seems to work pretty well for me while I was working on it. Pretty much the same instructions as before... but for the lazy:

1) Extract the files to a directory.
2) Change two entries in the file $winamphome/plugins/ml/ml_win_media.ini from shoutcast.com to the host (localhost)
i.e.
http://localhost/sbin/xmllister.phtm...ervice=winamp2
http://localhost/sbin/tvlister.phtml...ervice=winamp2

3) Restart Winamp
4) Run the program from the directory you extracted all the files in.

The limit field in the Library properties will limit the number of rows sent to Winamp, but you can have up to the full 14000 if you feel like it.
Attached Files
File Type: zip newshout2.zip (12.8 KB, 434 views)
antihadron is offline   Reply With Quote
Old 27th April 2006, 10:14   #56
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
Thats awesome!!

Your a C++ programmer aren't you? LoL

One thing I noticed is you upgrade it to .NET 2.0 (i was using 1.0 apis since many people don't have 2.0 installed yet).

Overall its really good code!

The lock right now doesn't do anything but test and block if a lock does exist on the class (which doesn't really do anything when the code is running in an instance member).

What you really want to do is something like
code:

private static MemoryStream cache = new MemoryStream();
...
private MemoryStream readRadioStream(string URL)

{

lock (cache)
{
... worth with the locked cache object ...
}; // Releases the lock here
return ...;
}



Really its not a big deal since it would be really rare for 2 requests to hit at the same time anyways :-P lol



Also when reading off a stream, instead of allocing a byte array of 10000 its better to use something like 1024 to 4096 because of the way the memory managment works in .NET.. You won't be able to use a stack memory, becuase it will be forced to alloc it on the heap, and make it a referenced pointer, pushing it up a gen on the GC and straining the jit. Its not really documented, one of those things you figure out from years of unit tests and working on the GC for mono :-P... You also don't want something to small because thats ineffecent :-P... You might see about a 50% increase in speed with that change :-P
zbowling is offline   Reply With Quote
Old 27th April 2006, 12:53   #57
byblo
Member
 
byblo's Avatar
 
Join Date: Mar 2006
Posts: 88
Thanks for your programs but between .NET and winamp 5.21 using IE, I guess I prefer the second solution.. (.NET is a pos. I installed once, never again..)
byblo is offline   Reply With Quote
Old 27th April 2006, 12:57   #58
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
Hence mono...
zbowling is offline   Reply With Quote
Old 27th April 2006, 13:49   #59
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Mostly a Java programmer now. Guess I still have an accent though :-) The XSLT is the important part. That can even be done by hand once a day relatively painlessly. Could rewrite the whole thing in Java or Scripts, but then this is just a workaround to tide me over till things get worked out or some plugin gets written. Mono does cross compilation right, does it also do conversions between languages?

I don't like .NET much either. Older versions just seem to screw things up. .Net seems to have gotten alot better and probably will continue to do so. C# is a heck of alot better than VB ever was. Eventually you have to buck up and see where the trend is going or risk being left behind. Especially if you want to write PocketPC apps. Knowledge itself is power.
antihadron is offline   Reply With Quote
Old 27th April 2006, 17:06   #60
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
What do you mean cross complication? Everything compiles to CLI (like java's bytecode) so it runs everwhere. It really doesn't matter the compiler that you use as long as it compiles to CLI (except in the very rare case that the compiler that are using dependes on its own class libraries, and those class libraries are not completely based on CLI themselves...).

It might look like a exe or dll but its not. CLI exes are and dlls are simply assemblies with PE header. You invoke Mono (unless you install a binfmt hack in linux) before the exe (instead of letting windows "autodetect" and launch .NET for you).

So on mono, you simply say "mono SomeApp.exe" to invoke it. Its that simple :-)
zbowling is offline   Reply With Quote
Old 27th April 2006, 17:09   #61
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
The really funny part is that CLI is so flexable that even Java runs on top of .NET now. :-P

http://www.ikvm.net/ is a byte code converter for Java bytecode to CLI. It comes with some nice tools and a fully converted version of GNU's classpath to CLI.

J# is microsoft's version of the same thing released after they seen us do what they couldn't (and its nasty to say the least being based on JDK 1.1.4).
zbowling is offline   Reply With Quote
Old 27th April 2006, 19:11   #62
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
compilation, not complication :-) The other question was that basically can you go from CLI back to arbitrary source language? So write something in C# and convert it to VB, C++, or Java. Although I have no idea how that would work. Kind of like jad (decompiler) does with java converting the bytecode back to source.
antihadron is offline   Reply With Quote
Old 27th April 2006, 20:23   #63
jstone
Junior Member
 
Join Date: Apr 2006
Posts: 4
Quote:
Originally posted by zbowling
My version of Tunapie has so many hacks, I'm afriad of updating it now :-P. lol
lol. Well I'm flattered you found my program useful, though I am a little embarrassed to know that such a competent programmer as yourself has looked at my code! I'm sure your additions must be excellent. Anything you would like to contribute back to the main tree?

James
jstone is offline   Reply With Quote
Old 28th April 2006, 03:57   #64
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
hehe.. a lot of my changes are really sloppy and I reference local directories and paths all through out it :-)

The code in tunapie isn't bad at all. A bunch of the stuff i did with tunapie was personal flavor stuff like changing the main list size, set default sorting to by name, making TV default, updaing the list of stations to include the program name as well (ess.tv is ess.tv for the station ID all the way down), etc.

Last edited by zbowling; 28th April 2006 at 04:32.
zbowling is offline   Reply With Quote
Old 28th April 2006, 04:05   #65
ctkatz8086
Senior Member
 
Join Date: Sep 2002
Location: louisville, ky home of the CARDINALS
Posts: 401
now that i have this working correctly (i think) i have to say this is one of the best companion programs for winamp i have used.

i do have one question- what is the criteria of stations pulled, popularity rating or something else? i only ask because one of the stations that was a part of the 1000 pulled in is not listed here.

ctkatz8086 is offline   Reply With Quote
Old 28th April 2006, 04:16   #66
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
Quote:
Originally posted by antihadron
compilation, not complication :-) The other question was that basically can you go from CLI back to arbitrary source language? So write something in C# and convert it to VB, C++, or Java. Although I have no idea how that would work. Kind of like jad (decompiler) does with java converting the bytecode back to source.
Basicly, all the languages that use CLI compile down to the intermeditate language (IL or bytecode). IL is universal and language indepedent. All language features that are publicly exposed by a langauge, have to be CLI compatable.

Basicly all the langauges had to be adapated slightly to conform the inter lanaguage rules of CLI. Like java for example, in order to support properties (getter/setter methods) in the language (since java doesn't have a built in feature for it already) a model was put in to handle it. Like for example in C# to get and set a prorperty you use:
code:

int weight = bear.Weight;
bear.Weight = 15;



but if you consumed that same bear class in Java, you would access its properties like this:
code:

int weight = bear.get_Weight();
bear.set_Weight(15);



and in VB.NET you would say:
code:

Dim weight as Integer
weight = bear.Weight
bear.Weight = 15



When .NET came out, VB6 had to be drasticly changed to support the requirements of CLI, like turely supporting OOP ideas like inheirtance and function overloading. Thats why VB.NET is nothing like VB6.

Then if you look at Boo (a python insipired langauge for CLI) (http://boo.codehaus.org/)
You say that that same code as:
code:

weight as int = bear.Weight
bear.Weight = 15



Since python is a interpretted language, it doesn't require declaring types, but CLI is staticly typed. So Boo keeps some of the language features in python but requires you specify a type.

The greatest part is say you write a class in VB.NET. Then someone in C# can inheirt that class and extend it. Then someone else could take your class and inheirt it back in VB.NET or Boo or mPHP (mono's PHP on the CLI) and extend it again. Its pretty amazing stuff.

Hehe...
zbowling is offline   Reply With Quote
Old 28th April 2006, 04:21   #67
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
Quote:
Originally posted by ctkatz8086
now that i have this working correctly (i think) i have to say this is one of the best companion programs for winamp i have used.

i do have one question- what is the criteria of stations pulled, popularity rating or something else? i only ask because one of the stations that was a part of the 1000 pulled in is not listed here.
Which version are you using? the PHP one or the standalone version?

The PHP version, if you are using my server, I'm limiting Radio to the TOP500 genre (bandwidth was killing me).

The standalone version has no limits by default.
zbowling is offline   Reply With Quote
Old 28th April 2006, 04:50   #68
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
It should be listing all 14000 stations if you are using the stand alone version. It maybe possible the station is not registered anymore too. Check the SC website. Check out the setting Media Library Preferences -> Online Media -> Modify Preferences -> Limit number of listings to xxx. If you don't have a lame machine like me, you can pretty much max it out. You get a performance hit when the thing is first loaded, but after that it is pretty fast. If you are using a limit that is less than that, it just returns the first X listings in whatever order shoutcast returns them in. You can sort in XSLT too see this link for details:

http://www.xml.com/pub/a/2002/07/03/transform.html
antihadron is offline   Reply With Quote
Old 28th April 2006, 05:08   #69
ctkatz8086
Senior Member
 
Join Date: Sep 2002
Location: louisville, ky home of the CARDINALS
Posts: 401
i'm using anti's version
i have my limit set at 1500 (1499 show up strangely) and this station is still registered at sc.

thankfully i have it bookmarked, so it isn't that big of a deal, but i just find it a bit strange is all.

as far as i know, my station may be station 1500 left out

ctkatz8086 is offline   Reply With Quote
Old 28th April 2006, 05:17   #70
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Sweet!, I think I am getting to like this mono stuff. I am reading about the integration between Java, mono, and .NET. I love the fact you can call .NET (ie Windoz) from java without JNI. I am working on a project where I have to make some native calls for some OS functions. I was not really looking forward to JNI javah junk. Looks pretty neat!
antihadron is offline   Reply With Quote
Old 28th April 2006, 05:19   #71
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Set it to 1501 (then you will get 1500 :-)) Try 20000 and see if its there at all.
antihadron is offline   Reply With Quote
Old 28th April 2006, 05:30   #72
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
Quote:
Originally posted by antihadron
Sweet!, I think I am getting to like this mono stuff. I am reading about the integration between Java, mono, and .NET. I love the fact you can call .NET (ie Windoz) from java without JNI. I am working on a project where I have to make some native calls for some OS functions. I was not really looking forward to JNI javah junk. Looks pretty neat!
Yah, P/invoke in .NET a little bit less trouble then JNI since you don't need to write a C/C++ wrapper most of the time. Which means mono is more portable then Java because with Java you always have to compile the native side to the JNI interfaces for each platform where as in mono if the interface is the same and its exported as a standard C export ( or with 'extern "C" ...' in C++) you can invoke it with Mono with out wrapping. :-)


Oh and JNI works with IKVM as well...
zbowling is offline   Reply With Quote
Old 29th April 2006, 08:18   #73
zbowling
Member
 
zbowling's Avatar
 
Join Date: Jun 2002
Location: Radio & TV Land
Posts: 78
Send a message via AIM to zbowling
mmm... shoutcast stopped working for a few hours. :-P
zbowling is offline   Reply With Quote
Old 30th April 2006, 22:13   #74
Winner2
Member
 
Join Date: Jul 2002
Posts: 62
Guys,

These are terrific hacks!

Zac, I'm running Winamp 5.13 using the PHP pages on your server, and it works fine. Oh, and as of today, I was only getting the 30 radio streams from the Shoutcast server.

Of course, I'd like to be able to have the full listings, but it seems like asking a lot of a user to download the 43MB (Windows) installation of Mono in order to get it to run. I'm with byblo; I'm not likely to install Microsoft .NET either (btw, just curious, I'm wondering what kind of installation footprint Mono has on Windows versus .NET).

Seems to me there should be some other way that users without .NET or Mono can invoke a program to convert the station lists and produce a copy locally.
Winner2 is offline   Reply With Quote
Old 1st May 2006, 05:10   #75
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Mono is pretty simple to install.

http://www.mono-project.com/Downloads

I am using it to run my server for my home network on a windows 2000 machine, because it won't run on this machine with .NET. It crashes on startup with .NET for some reason.

just install it, run the 'mono 1.1.1 command prompt', cd to the directory you stored the exec, and type 'mono NewShout2.exe'. Make sure nothing is listening on port 80 (like skype).

Aside from the 40 Meg download, I don't think Mono does anything nasty (no services, system dlls, or stuff like that) to your machine like .NET does.

Tell you the truth, I just wish AOL would take a hint and trivially (I hope) change the old URL to do something like this.
antihadron is offline   Reply With Quote
Old 1st May 2006, 05:41   #76
Winner2
Member
 
Join Date: Jul 2002
Posts: 62
Hmmm. The Mono installation requires almost 108M of disk space! Seems like overkill to accomplish what is trying to be done here. I am not a programmer, just a Winamp user trying to get the most out of Winamp.

At present, I can't justify the installation of Mono or .NET for this purpose; I haven't yet needed .NET (or a substitute) for any other programs I use, and don't anticipate I will need it anytime soon.

I very much appreciate the work that's been done to affect this workaround, though -- very clever. I think though for myself, I'll stay with Zac's listing of 500 stations until a less resource intensive solution shows up, or of course until Zac decides to stop hosting the PHP pages.
Winner2 is offline   Reply With Quote
Old 1st May 2006, 05:46   #77
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
well we all have our own personal tolerance for pain :-)
antihadron is offline   Reply With Quote
Old 1st May 2006, 18:09   #78
Winner2
Member
 
Join Date: Jul 2002
Posts: 62
Dang! The url2= and url3= lines in the ml_win_media.ini file are being rewritten by Winamp and reverted to show the shoutcast servers. I wonder why this is and what I can do about it? I don't think I can/should make this file read only.
Winner2 is offline   Reply With Quote
Old 2nd May 2006, 16:25   #79
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Thats odd, does not do that for me. You can also modify the $windows/system32/drivers/etc/hosts file to point www.shoutcast.com to 127.0.0.1 (Don't do yp.shoutcast.com the server uses that one). However, you will be unable to access the actual www.shoutcast.com after that.

ie.
127.0.0.1 www.shoutcast.com


then try 'ping www.shoutcast.com' from a command prompt. If it goes to 127.0.0.1 you did it right.
antihadron is offline   Reply With Quote
Old 2nd May 2006, 16:50   #80
antihadron
Junior Member
 
Join Date: Apr 2006
Posts: 41
Just thought of something else, try exiting winamp completely then editing the file. Its possible that winamp might write out the file when it exits.
antihadron is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump