summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/localplay.class.php61
1 files changed, 61 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
?>