summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-09-28 05:39:50 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-09-28 05:39:50 +0000
commitebdb7573bf4176b81264d2c66dd567fa3c3ee0bd (patch)
treef16da64cdfec967a34bc71d5902ca59c64d7b9ac /lib
parent6232e0f8d78c2555e64672341c54916cc0e8b3ed (diff)
downloadampache-ebdb7573bf4176b81264d2c66dd567fa3c3ee0bd.tar.gz
ampache-ebdb7573bf4176b81264d2c66dd567fa3c3ee0bd.tar.bz2
ampache-ebdb7573bf4176b81264d2c66dd567fa3c3ee0bd.zip
fixed up localplay a little more, to the point of it basicly working... added check for mysql on installer langue page, tweaked some css as well
Diffstat (limited to 'lib')
-rw-r--r--lib/class/localplay.class.php61
-rw-r--r--lib/general.lib.php15
2 files changed, 76 insertions, 0 deletions
diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php
index 4d027579..488714ea 100644
--- a/lib/class/localplay.class.php
+++ b/lib/class/localplay.class.php
@@ -242,6 +242,43 @@ class Localplay {
} // add
+ /**
+ * repeat
+ * This turns the repeat feature of a localplay method on or
+ * off, takes a 0/1 value
+ */
+ function repeat($state) {
+
+ $function = $this->_function_map['repeat'];
+
+ $data = $this->_player->$function($state);
+
+ if (!$data) {
+ debug_event('localplay',"Error Unable to set Repeat to $state",'1');
+ }
+
+ return $data;
+
+ } // repeat
+
+ /**
+ * random
+ * This turns on the random feature of a localplay method
+ * It takes a 0/1 value
+ */
+ function random($state) {
+
+ $function = $this->_function_map['random'];
+
+ $data = $this->_player->$function($state);
+
+ if (!$data) {
+ debug_event('localplay',"Error Unable to set Random to $state",'1');
+ }
+
+ return $data;
+
+ } // random
/**
* status
@@ -485,6 +522,30 @@ class Localplay {
} // delete_all
+ /**
+ * get_user_state
+ * This function returns a user friendly version
+ * of the current player state
+ */
+ function get_user_state($state) {
+
+ switch ($state) {
+ case 'play':
+ return _('Now Playing');
+ break;
+ case 'stop':
+ return _('Stopped');
+ break;
+ case 'pause':
+ return _('Paused');
+ break;
+ default:
+ return _('Unknown');
+ break;
+ } // switch on state
+
+ } // get_user_state
+
} //end localplay class
?>
diff --git a/lib/general.lib.php b/lib/general.lib.php
index 7fcb86e9..13951642 100644
--- a/lib/general.lib.php
+++ b/lib/general.lib.php
@@ -944,4 +944,19 @@ function print_boolean($value) {
} // print_boolean
+/**
+ * invert_boolean
+ * This returns the opposite of what you've got
+ */
+function invert_boolean($value) {
+
+ if (make_bool($value)) {
+ return '0';
+ }
+ else {
+ return '1';
+ }
+
+} // invert_boolean
+
?>