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

Source for file Admin.php

Documentation is available at Admin.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4.  * Music Player Daemon API
  5.  *
  6.  * PHP Version 5
  7.  *
  8.  * LICENSE: This source file is subject to version 3.01 of the PHP license
  9.  * that is available thorugh the world-wide-web at the following URI:
  10.  * http://www.php.net/license/3_01.txt. If you did not receive a copy of
  11.  * the PHP License and are unable to obtain it through the web, please
  12.  * send a note to license@php.net so we can mail you a copy immediately.
  13.  *
  14.  *
  15.  *
  16.  * API for the administrative portion of Music Player Daemon commands
  17.  *
  18.  * Used for maintaining and controlling various administrative tasks
  19.  * of the MPD software.
  20.  *
  21.  * @category  Networking
  22.  * @package   Net_MPD
  23.  * @author    Graham Christensen <graham.christensen@itrebal.com>
  24.  * @copyright 2006 Graham Christensen
  25.  * @license   http://www.php.net/license/3_01.txt
  26.  * @version   CVS: $ID:$
  27.  */
  28. class Net_MPD_Admin extends Net_MPD_Common
  29. {
  30.  
  31.     /**
  32.     * List available audio outputs
  33.     *
  34.     * @return array or int on failure
  35.     */
  36.     public function getOutputs()
  37.     {
  38.     return $this->runCommand('outputs');
  39.     }
  40.  
  41.     /**
  42.     * Disables an audio output
  43.     *
  44.     * @param $id int output Id to disable
  45.     * @return bool 
  46.     */
  47.     public function disableOutput($id)
  48.     {
  49.       if ($this->runCommand('disableoutput'$id== array()) {
  50.     return true;
  51.       }
  52.       return false;
  53.     }
  54.  
  55.     /**
  56.     * Enables an audio output
  57.     *
  58.     * @param $id int Id to enable
  59.     * @return bool 
  60.     */
  61.     public function enableOutput($id)
  62.     {
  63.       if ($this->runCommand('enableoutput'$id== array()) {
  64.     return true;
  65.       }
  66.       return false;
  67.     }
  68.  
  69.     /**
  70.     * Kills the MPD server in a safe way, saving state if possible
  71.     *
  72.     * @return bool 
  73.     */
  74.     public function kill()
  75.     {
  76.     $r $this->runCommand('kill');
  77.     if ($r{
  78.         @$this->disconnect();
  79.     }
  80.     return true;
  81.     }
  82.  
  83.     /**
  84.     * Updates the music database
  85.     *
  86.     * @param $path string path which to search for music, optional
  87.     * @return bool 
  88.     */
  89.     public function updateDatabase($path '')
  90.     {
  91.     $this->runCommand('update'$path);
  92.         return true;
  93.     }
  94. }
  95. ?>

Documentation generated on Mon, 11 Mar 2019 14:56:51 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.