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.   * Permission is hereby granted, free of charge, to any person obtaining a copy
  9.  * of this software and associated documentation files (the "Software"), to
  10.  * deal in the Software without restriction, including without limitation the
  11.  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  12.  * sell copies of the Software, and to permit persons to whom the Software is
  13.  * furnished to do so, subject to the following conditions:
  14.  *
  15.  * The above copyright notice and this permission notice shall be included in
  16.  * all copies or substantial portions of the Software.
  17.  *
  18.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21.  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22.  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  23.  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  24.  * IN THE SOFTWARE.
  25.  *
  26.  *
  27.  *
  28.  * API for the administrative portion of Music Player Daemon commands
  29.  *
  30.  * Used for maintaining and controlling various administrative tasks
  31.  * of the MPD software.
  32.  *
  33.  * @category  Networking
  34.  * @package   Net_MPD
  35.  * @author    Graham Christensen <graham.christensen@itrebal.com>
  36.  * @copyright 2006 Graham Christensen
  37.  * @license   http://www.opensource.org/licenses/mit-license.php MIT License
  38.  * @version   CVS: $ID:$
  39.  */
  40. class Net_MPD_Admin extends Net_MPD_Common
  41. {
  42.  
  43.     /**
  44.     * List available audio outputs
  45.     *
  46.     * @return array or int on failure
  47.     */
  48.     public function getOutputs()
  49.     {
  50.     return $this->runCommand('outputs');
  51.     }
  52.  
  53.     /**
  54.     * Disables an audio output
  55.     *
  56.     * @param $id int output Id to disable
  57.     * @return bool 
  58.     */
  59.     public function disableOutput($id)
  60.     {
  61.       if ($this->runCommand('disableoutput'$id== array()) {
  62.     return true;
  63.       }
  64.       return false;
  65.     }
  66.  
  67.     /**
  68.     * Enables an audio output
  69.     *
  70.     * @param $id int Id to enable
  71.     * @return bool 
  72.     */
  73.     public function enableOutput($id)
  74.     {
  75.       if ($this->runCommand('enableoutput'$id== array()) {
  76.     return true;
  77.       }
  78.       return false;
  79.     }
  80.  
  81.     /**
  82.     * Kills the MPD server in a safe way, saving state if possible
  83.     *
  84.     * @return bool 
  85.     */
  86.     public function kill()
  87.     {
  88.     $r $this->runCommand('kill');
  89.     if ($r{
  90.         @$this->disconnect();
  91.     }
  92.     return true;
  93.     }
  94.  
  95.     /**
  96.     * Updates the music database
  97.     *
  98.     * @param $path string path which to search for music, optional
  99.     * @return bool 
  100.     */
  101.     public function updateDatabase($path '')
  102.     {
  103.     $this->runCommand('update'$path);
  104.         return true;
  105.     }
  106. }
  107. ?>

Documentation generated on Mon, 11 Mar 2019 15:21:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.