summaryrefslogtreecommitdiffstats
path: root/lib/class/stream.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-12 06:29:33 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-12 06:29:33 +0000
commit313e0209d80e28f9beb14cf60d4366fc5c5b0aef (patch)
treeae88dd17c94d839316aeb214164292675c03f2ef /lib/class/stream.class.php
parent1b1de9fa02b059d2651c06440c06052f5ded01f1 (diff)
downloadampache-313e0209d80e28f9beb14cf60d4366fc5c5b0aef.tar.gz
ampache-313e0209d80e28f9beb14cf60d4366fc5c5b0aef.tar.bz2
ampache-313e0209d80e28f9beb14cf60d4366fc5c5b0aef.zip
switched over to Dba:: for all vauth functions and deleted independent dba lib
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r--lib/class/stream.class.php29
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php
index 5b19ab23..f51fa238 100644
--- a/lib/class/stream.class.php
+++ b/lib/class/stream.class.php
@@ -54,12 +54,12 @@ class Stream {
} //constructor
- /*!
- @function start
- @discussion runs this and depending on the type passed it will
- call the correct function
- */
- function start() {
+ /**
+ * start
+ *runs this and depending on the type passed it will
+ *call the correct function
+ */
+ public function start() {
if (!is_array($this->songs)) {
debug_event('stream','Error: No Songs Passed on ' . $this->type . ' stream','2');
@@ -68,6 +68,8 @@ class Stream {
$methods = get_class_methods('Stream');
$create_function = "create_" . $this->type;
+
+ // If in the class, call it
if (in_array($create_function,$methods)) {
$this->{$create_function}();
}
@@ -123,23 +125,20 @@ class Stream {
* creates an m3u file, this includes the EXTINFO and as such can be
* large with very long playlsits
*/
- public function create_m3u() {
+ public public function create_m3u() {
// Send the client an m3u playlist
header("Cache-control: public");
- header("Content-Disposition: filename=playlist.m3u");
+ header("Content-Disposition: filename=ampache-playlist.m3u");
header("Content-Type: audio/x-mpegurl;");
echo "#EXTM3U\n";
- foreach($this->songs as $song_id) {
+ // Foreach the songs in this stream object
+ foreach ($this->songs as $song_id) {
$song = new Song($song_id);
$song->format();
- $song_name = $song->f_artist_full . " - " . $song->title . "." . $song->type;
+
echo "#EXTINF:$song->time," . $song->f_artist_full . " - " . $song->title . "\n";
- $sess = $_COOKIE[Config::get('sess_name')];
- if($GLOBALS['user']->prefs['play_type'] == 'downsample') {
- $ds = $GLOBALS['user']->prefs['sample_rate'];
- }
echo $song->get_url() . "\n";
} // end foreach
@@ -162,7 +161,7 @@ class Stream {
// Send the client a pls playlist
header("Cache-control: public");
- header("Content-Disposition: filename=playlist.pls");
+ header("Content-Disposition: filename=ampache-playlist.pls");
header("Content-Type: audio/x-scpls;");
echo "[Playlist]\n";
echo "NumberOfEntries=$total_entries\n";