Example #1
0
<?php

require_once "./vendor/autoload.php";
use PHPMPDClient\MPD as mpd;
// instantiate a connection
class test
{
    public $val1 = 7;
    public $val8 = 8;
    public $val9 = 9;
    public $vala = 'a';
}
$sample = array(1, 2, 3, array(4, 5, 6), new test(), array('b', 'c', array('d', 'e', 'f')));
Kint::dump(mpd::condense($sample));
Example #2
0
 /**
  * Set the current volume
  *
  * @param int $volume
  * A volume value between 0 and 100
  */
 public static function setVolume($volume)
 {
     if (!is_numeric($volume)) {
         $volume = 0;
     }
     if ($volume < 0) {
         $volume = 0;
     }
     if ($volume > 100) {
         $volume = 100;
     }
     static::connect();
     MPD::send('setvol', $volume);
 }