Class: Song
Source Location: /lib/class/song.class.php
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Class Methods
static method build_cache [line 79]
static void build_cache(
$song_ids)
|
|
build_cache This attempts to reduce # of queries by asking for everything in the browse all at once and storing it in the cache, this can help if the db connection is the slow point
Tags:
Parameters:
static method compare_song_information [line 319]
static void compare_song_information(
$song,
$new_song)
|
|
compare_song_information this compares the new ID3 tags of a file against the ones in the database to see if they have changed it returns false if nothing has changes, or the true if they have. Static because it doesn't need this
Tags:
Parameters:
static method get_fields [line 743]
static void get_fields(
)
|
|
get_fields This returns all of the 'data' fields for this object, we need to filter out some that we don't want to present to a user, and add some that don't exist directly on the object but are related
Tags:
static method get_from_path [line 764]
static void get_from_path(
$path)
|
|
get_from_path This returns all of the songs that exist under the specified path
Tags:
Parameters:
static method get_recently_played [line 936]
static void get_recently_played(
[
$user_id = ''])
|
|
get_recently_played This function returns the last X songs that have been played it uses the popular threshold to figure out how many to pull it will only return unique object
Tags:
Parameters:
static method parse_song_url [line 914]
static void parse_song_url(
$url)
|
|
parse_song_url Takes a URL from this ampache install and returns the song that the url represents used by the API, and used to parse out stream urls for localplay right now just gets song id might do more later, hence the complexity
Tags:
Parameters:
static method play_url [line 856]
static void play_url(
$oid, [
$session_id = ''], [
$force_http = ''])
|
|
play_url This function takes all the song information and correctly formats a a stream URL taking into account the downsmapling mojo and everything else, this is the true function
Tags:
Implementation of:
- media::play_url()
Parameters:
static method update_album [line 566]
static void update_album(
$new_album,
$song_id)
|
|
update_album updates the album field
Tags:
Parameters:
static method update_artist [line 556]
static void update_artist(
$new_artist,
$song_id)
|
|
update_artist updates the artist field
Tags:
Parameters:
static method update_bitrate [line 496]
static void update_bitrate(
$new_bitrate,
$song_id)
|
|
update_bitrate updates the bitrate field
Tags:
Parameters:
static method update_comment [line 466]
static void update_comment(
$new_comment,
$song_id)
|
|
update_comment updates the comment field
Tags:
Parameters:
static method update_enabled [line 598]
static void update_enabled(
$new_enabled,
$song_id)
|
|
update_enabled sets the enabled flag
Tags:
Parameters:
static method update_language [line 456]
static void update_language(
$new_lang,
$song_id)
|
|
update_language This updates the language tag of the song
Tags:
Parameters:
static method update_lyrics [line 476]
static void update_lyrics(
$new_lyrics,
$song_id)
|
|
update_lyrics updates the lyrics field
Tags:
Parameters:
static method update_mode [line 516]
static void update_mode(
$new_mode,
$song_id)
|
|
update_mode updates the mode field
Tags:
Parameters:
static method update_played [line 588]
static void update_played(
$new_played,
$song_id)
|
|
update_played sets the played flag
Tags:
Parameters:
static method update_rate [line 506]
static void update_rate(
$new_rate,
$song_id)
|
|
update_rate updates the rate field
Tags:
Parameters:
static method update_size [line 526]
static void update_size(
$new_size,
$song_id)
|
|
update_size updates the size field
Tags:
Parameters:
static method update_song [line 409]
static void update_song(
$song_id,
$new_song)
|
|
update_song this is the main updater for a song it actually calls a whole bunch of mini functions to update each little part of the song... lastly it updates the "update_time" of the song
Tags:
Parameters:
static method update_time [line 536]
static void update_time(
$new_time,
$song_id)
|
|
update_time updates the time field
Tags:
Parameters:
static method update_title [line 486]
static void update_title(
$new_title,
$song_id)
|
|
update_title updates the title field
Tags:
Parameters:
static method update_track [line 546]
static void update_track(
$new_track,
$song_id)
|
|
update_track this updates the track field
Tags:
Parameters:
static method update_utime [line 576]
static void update_utime(
$song_id, [
$time = 0])
|
|
update_utime sets a new update time
Tags:
Parameters:
static method update_year [line 446]
static void update_year(
$new_year,
$song_id)
|
|
update_year update the year tag
Tags:
Parameters:
constructor __construct [line 52]
Song __construct(
[
$id = ''])
|
|
Constructor Song class, for modifing a song.
Tags:
Parameters:
method fill_ext_info [line 179]
fill_ext_info This calls the _get_ext_info and then sets the correct vars
Tags:
method fill_info [line 810]
void fill_info(
$results,
$pattern,
$catalog_id,
$key)
|
|
Parameters:
method format [line 653]
format This takes the current song object and does a ton of formating on it creating f_??? variables on the current object
Tags:
Implementation of:
- media::format()
method format_pattern [line 705]
format_pattern This reformates the song information based on the catalog rename patterns
Tags:
method format_type [line 197]
void format_type(
[
$override = ''])
|
|
format_type gets the type of song we are trying to play, used to set mime headers and to trick players into playing them correctly
Tags:
Parameters:
method get_album_name [line 252]
void get_album_name(
[
$album_id = 0])
|
|
get_album_name gets the name of $this->album, allows passing of id
Tags:
Parameters:
method get_artist_name [line 265]
void get_artist_name(
[
$artist_id = 0])
|
|
get_artist_name gets the name of $this->artist, allows passing of id
Tags:
Parameters:
method get_info_from_filename [line 838]
void get_info_from_filename(
$file,
$pattern,
$tag)
|
|
Parameters:
method get_rel_path [line 786]
void get_rel_path(
[
$file_path = 0], [
$catalog_id = 0])
|
|
Tags:
Parameters:
method get_url [line 867]
void get_url(
[
$session_id = ''], [
$force_http = ''])
|
|
get_url This function takes all the song information and correctly formats a stream URL taking into account the downsampling mojo and everything else, this is used or will be used by _EVERYTHING_
Tags:
Parameters:
method has_flag [line 281]
has_flag This just returns true or false depending on if this song is flagged for something We don't care what so we limit the SELECT to 1
Tags:
method native_stream [line 964]
native_stream This returns true/false if this can be nativly streamed
Tags:
Implementation of:
- media::native_stream()
method set_played [line 299]
set_played this checks to see if the current object has been played if not then it sets it to played
Tags:
method stream_cmd [line 988]
stream_cmd test if the song type streams natively and if not returns a transcoding command from the config we can't use this->type because its been formated for the downsampling
Tags:
Implementation of:
- media::stream_cmd()
method update [line 364]
update This takes a key'd array of data does any cleaning it needs to do and then calls the helper functions as needed. This will also cause the song to be flagged
Tags:
Parameters:
method _get_ext_info [line 156]
_get_ext_info This function gathers information from the song_ext_info table and adds it to the current object
Tags:
|
|