php-pulseaudio/src/Module/Module.php

95 lines
1.5 KiB
PHP

<?php
namespace NoccyLabs\PulseAudio\Module;
use NoccyLabs\PulseAudio\PropertyList;
/**
* Contains information on a PulseAudio module.
*
*
*/
class Module
{
/** @var string */
protected $name;
/** @var array */
protected $arguments = [];
/** @var int */
protected $used;
/** @var bool */
protected $loadOnce;
/** @var PropertyList */
protected $properties;
/**
*
*
* @param string $name
* @param array $arguments
* @param int $used
* @param bool $loadOnce
* @param array $properties
*/
public function __construct(array $info)
{
$this->name = $info['name'];
$this->arguments = $info['argument'];
$this->used = $info['used'];
$this->loadOnce = $info['load once'];
$props = array_key_exists('properties',$info)?$info['properties']:[];
$this->properties = new PropertyList($props, true);
}
/**
*
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
*
*
* @return array
*/
public function getArguments()
{
return $this->arguments;
}
/**
*
*
* @return int
*/
public function getUsed()
{
return $this->used;
}
/**
*
*
* @return bool
*/
public function getLoadOnce()
{
return $this->loadOnce;
}
/**
*
*
* @return PropertyList
*/
public function getProperties()
{
return $this->properties;
}
}