Ampache
[ class tree: Ampache ] [ index: Ampache ] [ all elements ]

Class: Stream

Source Location: /lib/class/stream.class.php

Class Overview


Stream


Variables

Methods



Class Details

[line 29]
Stream

This class is used to generate the Playlists and pass them on With Localplay this actually just sends the commands to the localplay module in question. It has two sources for data songs (array of ids) and urls (array of full urls)




[ Top ]


Class Variables

static $session =

[line 40]



Tags:

access:  public

Type:   mixed


[ Top ]

$sess =

[line 36]



Tags:

access:  public

Type:   mixed


[ Top ]

$songs = array()

[line 34]



Tags:

access:  public

Type:   mixed


[ Top ]

$type =

[line 32]



Tags:

access:  public

Type:   mixed


[ Top ]

$urls = array()

[line 35]



Tags:

access:  public

Type:   mixed


[ Top ]

$user_id =

[line 37]



Tags:

access:  public

Type:   mixed


[ Top ]

$web_path =

[line 33]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


static method clear_now_playing [line 698]

static void clear_now_playing( )

clear_now_playing

There really isn't anywhere else for this function, shouldn't have deleted it in the first place




Tags:

access:  public


[ Top ]

static method extend_session [line 196]

static void extend_session( $sid, $uid)

extend_session

This takes the passed sid and does a replace into also setting the user agent and IP also do a little GC in this function




Tags:

access:  public


Parameters:

   $sid  
   $uid  

[ Top ]

static method gc_now_playing [line 665]

static void gc_now_playing( )

gc_now_playing

This will garbage collect the now playing data, this is done on every play start




Tags:

access:  public


[ Top ]

static method gc_session [line 168]

static void gc_session( [ $ip = ''], [ $agent = ''], [ $uid = ''], [ $sid = ''])

gc_session

This function performes the garbage collection stuff, run on extend and on now playing refresh There is an array of agents that we will never GC because of their nature, MPD being the best example




Tags:

access:  public


Parameters:

   $ip  
   $agent  
   $uid  
   $sid  

[ Top ]

static method get_base_url [line 758]

static void get_base_url( [ $session_id = ''], [ $force_http = ''])

get_base_url

This returns the base requirements for a stream URL this does not include anything after the index.php?sid=????




Tags:

access:  public


Parameters:

   $session_id  
   $force_http  

[ Top ]

static method get_session [line 110]

static void get_session( )

get_session

This returns the current stream session




Tags:

access:  public


[ Top ]

static method insert_now_playing [line 681]

static void insert_now_playing( $song_id, $uid, $song_length, $sid)

insert_now_playing

This will insert the now playing data This fucntion is used by the /play/index.php song primarily, but could be used by other people




Tags:

access:  public


Parameters:

   $song_id  
   $uid  
   $song_length  
   $sid  

[ Top ]

static method insert_session [line 124]

static void insert_session( [ $sid = ''], [ $uid = ''])

insert_session

This inserts a row into the session_stream table




Tags:

access:  public


Parameters:

   $sid  
   $uid  

[ Top ]

static method run_playlist_method [line 724]

static void run_playlist_method( )

run_playlist_method This takes care of the different types of 'playlist methods' the reason this is here is because it deals with streaming rather then playlist mojo. If something needs to happen this will echo the javascript required to cause a reload of the iframe.



Tags:

access:  public


[ Top ]

static method session_exists [line 147]

static void session_exists( $sid)

session_exists

This checks to see if the passed stream session exists and is valid




Tags:

access:  public


Parameters:

   $sid  

[ Top ]

static method start_downsample [line 542]

static void start_downsample( &$song, [ $now_playing_id = 0], [ $song_name = 0], [ $start = 0])

start_downsample

This is a rather complext function that starts the downsampling of a song and returns the opened file handled a reference to the song object is passed so that the changes we make in here affect the external object, References++




Tags:

access:  public


Parameters:

   &$song  
   $now_playing_id  
   $song_name  
   $start  

[ Top ]

static method validate_bitrate [line 650]

static void validate_bitrate( $bitrate)

validate_bitrate

this function takes a bitrate and returns a valid one




Tags:

access:  public


Parameters:

   $bitrate  

[ Top ]

static method _auto_init [line 711]

static void _auto_init( )

auto_init

This is called on class load it sets the session




Tags:

access:  public


[ Top ]

constructor __construct [line 49]

Stream __construct( [ $type = 'm3u'], [ $song_ids = 0])

Constructor for the stream class takes a type and an array

of song ids




Tags:

access:  public


Parameters:

   $type  
   $song_ids  

[ Top ]

method create_asx [line 328]

void create_asx( )

create_asx creates an ASX playlist (Thx Samir Kuthiala) This should really only be used if all of the content is ASF files.



Tags:

access:  public


[ Top ]

method create_democratic [line 491]

void create_democratic( )

create_democratic

This 'votes' on the songs it inserts them into a tmp_playlist with user of -1 (System)




Tags:

access:  public


[ Top ]

method create_localplay [line 464]

void create_localplay( )

create_localplay

This calls the Localplay API and attempts to add, and then start playback




Tags:

access:  public


[ Top ]

method create_m3u [line 251]

void create_m3u( )

create_m3u

creates an m3u file, this includes the EXTINFO and as such can be large with very long playlsits




Tags:

access:  public


[ Top ]

method create_pls [line 289]

void create_pls( )

create_pls

This creates a new pls file from an array of songs and urls, exciting I know




Tags:

access:  public


[ Top ]

method create_ram [line 524]

void create_ram( )

create_ram

this functions creates a RAM file for use by Real Player




Tags:

access:  public


[ Top ]

method create_simple_m3u [line 218]

void create_simple_m3u( )

create_simplem3u

this creates a simple m3u without any of the extended information




Tags:

access:  public


[ Top ]

method create_xspf [line 368]

void create_xspf( )

create_xspf

creates an XSPF playlist (Thx PB1DFT)




Tags:

access:  public


[ Top ]

method create_xspf_player [line 420]

void create_xspf_player( )

create_xspf_player

due to the fact that this is an integrated player (flash) we actually have to do a little 'cheating' to make this work, we are going to take advantage of tmp_playlists to do all of this hotness




Tags:

access:  public


[ Top ]

method manual_url_add [line 100]

void manual_url_add( $url)

manual_url_add

This manually adds a URL to the stream object for passing to whatever, this is an exception for when we don't actually have a object_id but instead a weird or special URL




Tags:

access:  public


Parameters:

   $url  

[ Top ]

method start [line 67]

void start( )

start

runs this and depending on the type passed it will call the correct function




Tags:

access:  public


[ Top ]


Documentation generated on Thu, 12 Feb 2009 08:00:10 +0900 by phpDocumentor 1.4.2