Location: PHPKode > scripts > MP3 Jukebox > mp3-jukebox/docs/mp3_radio.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mp3_radio</title>
<link rel="stylesheet" href="pod.css" type="text/css" />
<link rev="made" href="mailto:" />
</head>

<body>
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="block" valign="middle">
<big><strong><span class="block">&nbsp;mp3_radio</span></strong></big>
</td></tr>
</table>

<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->

<ul>

	<li><a href="#mp3_radio">mp3_radio</a></li>
	<ul>

		<li><a href="#license">License</a></li>
		<li><a href="#dependencies">Dependencies</a></li>
		<li><a href="#description">Description</a></li>
		<li><a href="#usage">Usage</a></li>
		<li><a href="#dogma__constants_and_variables_">DOGMA (Constants and Variables)</a></li>
		<ul>

			<li><a href="#_string__mp3_radio__cwd">(string) mp3_radio::cwd</a></li>
		</ul>

		<li><a href="#ritual__methods_">RITUAL (Methods)</a></li>
		<ul>

			<li><a href="#_void__mp3_filelist__mp3_radio__">(void) mp3_filelist::mp3_radio()</a></li>
			<li><a href="#_void__mp3_filelist__play__">(void) mp3_filelist::play()</a></li>
			<li><a href="#_void__mp3_filelist__unlink_last__">(void) mp3_filelist::unlink_last()</a></li>
			<li><a href="#_string__mp3_filelist__link_encode__string__p_url_">(string) mp3_filelist::link_encode (string $p_url)</a></li>
		</ul>

	</ul>

</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="mp3_radio">mp3_radio</a></h1>
<p>Main class for setting up an online mp3 radio.</p>
<p>
</p>
<h2><a name="license">License</a></h2>
<p>Copyright (C) 2005 Ondrej Maly &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</p>
<p>This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but <strong>WITHOUT ANY WARRANTY</strong>; without even the implied warranty of
<strong>MERCHANTABILITY</strong> or <strong>FITNESS FOR A PARTICULAR PURPOSE</strong>.  See the
GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.</p>
<p>You can found more information about GPL licence at:
<a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>
</p>
<h2><a name="dependencies">Dependencies</a></h2>
<p>This class depends on <a href='mp3_filelist.html'>mp3_filelist</a> and <a href='mp3_idv.html'>mp3_idv</a>.</p><p>
</p>
<h2><a name="description">Description</a></h2>
<p>This class provides a simple Internet Radio functionality. There's a queue of mp3 files in the 
specified directory, which are served consecutively by each request. It holds the order of the
files as they are uploaded. The files are deleted from the directory when they are sent. 
In fact, it's more a jukebox than radio :) It supports both Windows 
Media Player and WinAmp (and like), but WinAmp is more reccomended because it doesn't cache the 
files. (WMP hangs up on playing just one file again and again sometimes.) The player must be set 
to repeat continuously the 'track' and in case of WMP also to always connect to the Internet 
(<em>'Options/Player/Connect to the Internet'</em>). Then just select <em>'File/Open URL'</em> and type in the Internet 
address of the script.</p>
<p>
</p>
<h2><a name="usage">Usage</a></h2>
<p>Invoke as frequently as Thou wilt:</p>
<p>
<span class="gray">&lt;?php</span><br />
<b>require_once</b> ( "class.mp3_radio.php");
</p>
<p>
$radio = &<b>new</b> mp3_radio();<br />
$radio->play();<br />
<span class="gray">?&gt;</span>
</p><p>That's all.</p>
<p>
</p>
<h2><a name="dogma__constants_and_variables_">DOGMA (Constants and Variables)</a></h2>
<p>
</p>
<h3><a name="_string__mp3_radio__cwd">(string) mp3_radio::cwd</a></h3>
<p>Path where the script resides</p>
<p>
</p>
<h2><a name="ritual__methods_">RITUAL (Methods)</a></h2>
<p>
</p>
<h3><a name="_void__mp3_filelist__mp3_radio__">(void) mp3_filelist::mp3_radio()</a></h3>
<p>Constructor. When called, it performs following actions. Sets the mp3_radio::cwd, erases last
served music file and rebuilds the playlist (see <a href='mp3_filelist.html'>mp3_filelist</a>).</p><p>
</p>
<h3><a name="_void__mp3_filelist__play__">(void) mp3_filelist::play()</a></h3>
<p>This is the only public method in this class. It prepares the headers and the content to be sent to 
the client. It behaves slightly differently according to the client application. When the client is 
the Windows Media Player, it sends a link to the file, in other cases it sends the whole file as
desired by WinAmp for example.</p>
<p>
</p>
<h3><a name="_void__mp3_filelist__unlink_last__">(void) mp3_filelist::unlink_last()</a></h3>
<p>Erases last served music file.</p>
<p>
</p>
<h3><a name="_string__mp3_filelist__link_encode__string__p_url_">(string) mp3_filelist::link_encode (string $p_url)</a></h3>
<p>function 'linkencode' by<br />
<a href='mailto:hide@address.com'>hide@address.com</a><br />
03-Feb-2002 03:48<br />
found at php.net</p><p>Encodes properly the link to the music file. It takes an absolute URL as an argument.</p>
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="block" valign="middle">
<big><strong><span class="block">&nbsp;mp3_radio</span></strong></big>
</td></tr>
</table>

</body>

</html>
Return current item: MP3 Jukebox