summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-28 04:34:02 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-28 04:34:02 +0000
commit79ca59df627660d635a9373bfeb293592c173793 (patch)
treedee673409ee084f47f2121ff049f2bdd859fb057 /lib/class
parent705fba8f49faa42ed7f004f67b74a996c29ddb3d (diff)
downloadampache-79ca59df627660d635a9373bfeb293592c173793.tar.gz
ampache-79ca59df627660d635a9373bfeb293592c173793.tar.bz2
ampache-79ca59df627660d635a9373bfeb293592c173793.zip
fixed some localplay issues, now correctly shows the active instance at least for the MPD module
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/localplay.abstract.php2
-rw-r--r--lib/class/localplay.class.php22
-rw-r--r--lib/class/user.class.php15
3 files changed, 30 insertions, 9 deletions
diff --git a/lib/class/localplay.abstract.php b/lib/class/localplay.abstract.php
index d66750a7..12df43cb 100644
--- a/lib/class/localplay.abstract.php
+++ b/lib/class/localplay.abstract.php
@@ -60,7 +60,7 @@ abstract class localplay_controller {
case 'radio':
case 'song':
default:
- $url = $object->get_url(Stream::$session);
+ $url = $object->get_url(Stream::get_session());
break;
} // end switch on objecttype
diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php
index c5b16fd3..dc367b28 100644
--- a/lib/class/localplay.class.php
+++ b/lib/class/localplay.class.php
@@ -544,6 +544,18 @@ class Localplay {
} // get_instances
/**
+ * current_instance
+ * This returns the UID of the current Instance
+ */
+ public function current_instance() {
+
+ $data = $this->_player->get_instance();
+
+ return $data['id'];
+
+ } // current_instance
+
+ /**
* add_instance
* This adds a new instance for the current controller type
*/
@@ -554,6 +566,16 @@ class Localplay {
} // add_instance
/**
+ * set_active_instance
+ * This sets the active instance of the localplay controller
+ */
+ public function set_active_instance($instance) {
+
+ $this->_player->set_active_instance($instance);
+
+ } // set_active_instance
+
+ /**
* delete
* This removes songs from the players playlist as defined get function
*/
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index 9ecc247a..2fc8412e 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -56,7 +56,7 @@ class User {
$this->$key = $value;
}
- // Set the preferences for thsi user
+ // Set the preferences for this user
$this->set_preferences();
// Make sure the Full name is always filled
@@ -157,12 +157,11 @@ class User {
} // get_preferences
- /*!
- @function set_preferences
- @discussion sets the prefs for this specific
- user
- */
- function set_preferences() {
+ /**
+ * set_preferences
+ * sets the prefs for this specific user
+ */
+ public function set_preferences() {
$sql = "SELECT preference.name,user_preference.value FROM preference,user_preference WHERE user_preference.user='$this->id' " .
"AND user_preference.preference=preference.id AND preference.type != 'system'";
@@ -172,7 +171,7 @@ class User {
$key = $r['name'];
$this->prefs[$key] = $r['value'];
}
- } // get_preferences
+ } // set_preferences
/**
* get_favorites