Add doc blocks

This commit is contained in:
Romain Neutron 2012-04-13 15:42:34 +02:00
commit d58059c087
5 changed files with 126 additions and 5 deletions

View file

@ -11,6 +11,11 @@
namespace FFMpeg\Format;
/**
* The abstract default Audio format
*
* @author Romain Neutron imprec@gmail.com
*/
abstract class DefaultAudioFormat implements AudioFormat
{
@ -18,16 +23,33 @@ abstract class DefaultAudioFormat implements AudioFormat
protected $audioSampleRate = 44100;
protected $kiloBitrate = 128;
/**
* Returns extra parameters for the encoding
*
* @return string
*/
public function getExtraParams()
{
return '';
}
/**
* Returns the audio codec
*
* @return string
*/
public function getAudioCodec()
{
return $this->audioCodec;
}
/**
* Set the audio codec, Should be in the available ones, otherwise an
* exception is thrown
*
* @param string $audioCodec
* @throws \InvalidArgumentException
*/
public function setAudioCodec($audioCodec)
{
if ( ! in_array($audioCodec, $this->getAvailableAudioCodecs()))
@ -38,11 +60,22 @@ abstract class DefaultAudioFormat implements AudioFormat
$this->audioCodec = $audioCodec;
}
/**
* Get the audio sample rate
*
* @return type
*/
public function getAudioSampleRate()
{
return $this->audioSampleRate;
}
/**
* Set the audio sample rate
*
* @param int $audioSampleRate
* @throws \InvalidArgumentException
*/
public function setAudioSampleRate($audioSampleRate)
{
if ($audioSampleRate < 1)
@ -53,11 +86,22 @@ abstract class DefaultAudioFormat implements AudioFormat
$this->audioSampleRate = (int) $audioSampleRate;
}
/**
* Get the kiloBitrate value
*
* @return int
*/
public function getKiloBitrate()
{
return $this->kiloBitrate;
}
/**
* Set the kiloBitrate value
*
* @param int $kiloBitrate
* @throws \InvalidArgumentException
*/
public function setKiloBitrate($kiloBitrate)
{
if ($kiloBitrate < 1)
@ -68,6 +112,11 @@ abstract class DefaultAudioFormat implements AudioFormat
$this->kiloBitrate = (int) $kiloBitrate;
}
abstract protected function getAvailableAudioCodecs();
/**
* Returns the list of available audio codecs for this format
*
* @return array
*/
abstract public function getAvailableAudioCodecs();
}