Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   Shoutcast Technical Support (http://forums.winamp.com/forumdisplay.php?f=86)
-   -   Please Help! (http://forums.winamp.com/showthread.php?t=148700)

Blind-Summit 9th September 2003 22:08

Please Help!
 
Hello everyone,

I have attempted to use Shoutcast several times now. I am not too hot on all this DNS and server stuff. I will now explain my problems and needs and if I could get as clear an answer as possible, this would make me very happy indeed.

Firstly my setup:

Winamp 2.91
SHOUTcast Source DSP 1.8.2b
XP2600 Processor
1GB PC 3200 DDR SDRAM

My needs are as follows.

I want to be able to stream audio from my list of mp3's.

I want to be able to have a link on my website to the stream that dynamically updates as my IP address changes as i connect and disconnect to the net.

I want users to be able to see the history etc as with that default page.


Please could someone help?

Many thanks to you all in advance, I thank you for your time

Alex Holsgrove

webmaster of http://www.blind-summit.co.uk

FesterHead 9th September 2003 22:15

1. I want to be able to stream audio from my list of mp3's.
Load your MP3s into your WInamp/DSP combo, shuffle/repeat as necessary, press play, and connect to the DNAS.

2. I want to be able to have a link on my website to the stream that dynamically updates as my IP address changes as i connect and disconnect to the net.
You can get a static name, such as foo.bar.com (not as cool as that, though :)) from http://www.no-ip.com or one of the other myriad of Dynamic DNS Services.
Then, your links would be:
DNAS link: http://foo.bar.com:yourDNASport
Listen link: http://foo.bar.com:yourDNASport/listen.pls

3. I want users to be able to see the history etc as with that default page.
http://DNAS-IP:DNAS-PORTBASE/played.html or see above for no-ip link format

Blind-Summit 9th September 2003 22:54

Festerhead, many thanks. I have setup :

blind-summit.no-ip.com have a username and password and the thing seems to connect.

I load my mp3's and i have the shoutcast server window and the DSP config window open.

My question is how can i get the link

blind-summit.no-ip.com/listen.pls to work?

Thanks for your speedy reply

Alex

LollipopLustKil 9th September 2003 23:05

It would be blind-summit.no-ip.com:PORTNUMBER/listen.pls (fill PORTNUMBER to whatever you are using, default is 8000).

FesterHead 9th September 2003 23:12

DNAS link: http://blind-summit.no-ip.com:8000
Listen link: http://blind-summit.no-ip.com:8000/listen.pls

Note (if applicable): If your router doesn't support local loopback then machines on the same lan as the DNAS (you) need to use the lan ip of the DNAS to connect/listen. Machines not on the same lan as the DNAS (the rest of the world) need to use the real, world-visible ip of the DNAS to connect/listen.

Blind-Summit 9th September 2003 23:16

Thanks everyone.

Just a few other questions.

Loppipop, how can i get one of those things in your signature?

Secondly, I want a small info box on my website that shows some stats? Is this possible, and can i customise what is shown.

Thanks again guys - u have been superb help

Alex

LollipopLustKil 9th September 2003 23:19

For the stats on the site, use this.

http://forums.winamp.com/showthread....hreadid=147719

As for my signature, I can't exactly remember where I got it. I was from one of the posts here. Fester will know, since he told me about the post.

FesterHead 9th September 2003 23:22

Please see this thread.

Blind-Summit 9th September 2003 23:56

OK, i am using this code:

<?php
// This image you can call immediately from an html file in the image tag
// (i.e. <image src="black.php">) easy huh?

Header("Content-type: image/png");

// Fill in your own server information here:
$host = "blind-summit.no-ip.com";
$port = "8000";
$listenlink = 'http://blind-summit.no-ip.com:8000/listen.pls';

$fp = fsockopen("$host", $port, &$errno, &$errstr, 30); //open connection
if(!$fp) {
$success=2; //se-t if no connection
}
if($success!=2){ //if connection
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //get 7.html
while(!feof($fp)) {
$page .= fgets($fp, 1000);
}
fclose($fp); //close connection
$page = ereg_replace(".*<body>", "", $page); //extract data
$page = ereg_replace("</body>.*", ",", $page); //extract data
$numbers = explode(",",$page); //extract data
$currentlisteners=$numbers[0]; //set variable
$connected=$numbers[1]; //set variable

if($connected==1) //if DSP is connected
$wordconnected="yes"; //set variable
else //if no DSP connection
$wordconnected="no"; //set variable
$peaklisteners=$numbers[2]; //set variable
$maxlisteners=$numbers[3]; //set variable
$reportedlisteners=$numbers[4]; //set variable
}

// Image size can be changed here: (x, y)
$im = ImageCreate(250,80);

// Background color in R(ed)G(reen)B(lue) below
$background_color = ImageColorAllocate($im,255,255,255);

// text colors also in RGB
$text_color1 = ImageColorAllocate($im,0,0,0);
$text_color2 = ImageColorAllocate($im,0,0,0);

if($success!=2 && $connected==1){

// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
$song=explode(" - ",$numbers[6]);

// strings can of course be replaced with your own bla
$string1= "Now playing on Blind-Summit Radio";
$string2= $song[0];
$string3= $song[1];
$string4= "[$currentlisteners/$maxlisteners users]";
}
else {
$string1= "Blind-Summit Radio is currently";
$string2= "OFFLINE.";
$string3= "Please return later.";
$string4= ":::";
}

// positioning below
$px = (imagesx($im)-5*strlen($string1))/2;
ImageString($im,1,$px,5,$string1,$text_color1);
// (image,font (from 1 to 5),starting x position, y position,line of text,color)
$px = (imagesx($im)-5*strlen($string2))/2;
ImageString($im,1,$px,20,$string2,$text_color2);
$px = (imagesx($im)-5*strlen($string3))/2;
ImageString($im,1,$px,30,$string3,$text_color2);
$px = (imagesx($im)-5*strlen($string4))/2;
ImageString($im,1,$px,45,$string4,$text_color1);
ImagePng($im);
// In response to KXRM's reaction:
// if you want to cache the picture, you should place this script in
// your internetpage, remove line 5 (Header-call)
// and use ImagePng($im, "filename.png");
// NB: filename.png must have the right permission settings
// (CHMOD 777 does it)
//
// Then you can place filename.png in the same html-file.
ImageDestroy($im);
?>


Sorry for all that. I have got it to work, but it's far too small and it won't display long names.

1. Could someone alter the code to display verdana text, size 10pt
2. Alter it to allow long song names. My example is

Emerson, Lake, & Plamer - Fanfare For The Common Man

Cheers

Blind-Summit 10th September 2003 00:50

bump

FesterHead 10th September 2003 01:55

Check out the imagestring and imageloadfont php functions.

[edit]
For dynamic image sizing, incorporate the ideas used here.
[/edit]

Blind-Summit 10th September 2003 10:53

Hey festerhead. I don,t really understand any of that stuff;

What doesn,t help is that i;m using this crap french keyboard at work whils trying to sort this out!!!!!!

I want to make a signature like yours that can take long filenames and it size 10 verdana font. I want to use this as a php file and none of this database mysql stuff.

Can you help me modify my code?

Alex


*cursing silly french azerty keyboard*

FesterHead 10th September 2003 17:54

Please take the time to understand it.

You may find someone to come along and edit the code for you, but don't hold your breath.

Many of us provide snippets to help others accomplish tasks.
Not many of us have the time to write custom scripts.

Please don't take offense at this reply. Instead, treat it as encouragement to learn some PHP. The power will soon be yours.

Blind-Summit 10th September 2003 18:24

I'm not asking for a custom script. Just to identify the section of code from the above PHP document that deals with the size of the text. Surely just changing something to make the text size 10pt isn't that much effort. I don't have the time to learn full on PHP code as I am already learning ATL, COM, C++, and MFC as it is.

Alex

FesterHead 10th September 2003 18:52

Quote:

Surely just changing something to make the text size 10pt isn't that much effort.
Quote:

Check out the imagestring and imageloadfont php functions.
imagestring by default has only 5 font choices. 1 through 5.

To load a different font, use imageloadfont or even imagettftext. The later can uses true type fonts.

Example code is available on each php function page.

Blind-Summit 11th September 2003 13:32

Great, got it sussed. It's not difficult, it was because I was using a french keyboard an it waz pissing me off.

Next question is how to allow users to request or even to choose the next song

And finally, how can i publish the current playlist onto my site, that will automatically updte when i load a new one?

Cheers

Alex

FesterHead 11th September 2003 15:52

Check out WWWinamp.

Check out the Sticky post titled...
SHOUTcast: Important Info & Answers to FAQs. READ ME!

Scroll down a bit and look for the section titled...
General SHOUTcast Information -> SHOUTcast ToolBox (All sorts of nifty add-ons for SHOUTcast)


All times are GMT. The time now is 16:23.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.