Merge branch 'CC-3174' into devel
This commit is contained in:
commit
194de3c2bf
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once 'formatters/LengthFormatter.php';
|
require_once 'formatters/LengthFormatter.php';
|
||||||
|
require_once 'formatters/SamplerateFormatter.php';
|
||||||
|
require_once 'formatters/BitrateFormatter.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application_Model_StoredFile class
|
* Application_Model_StoredFile class
|
||||||
|
@ -634,6 +636,14 @@ class Application_Model_StoredFile {
|
||||||
$formatter = new LengthFormatter($row['length']);
|
$formatter = new LengthFormatter($row['length']);
|
||||||
$row['length'] = $formatter->format();
|
$row['length'] = $formatter->format();
|
||||||
|
|
||||||
|
if ($row['ftype'] === "audioclip") {
|
||||||
|
$formatter = new SamplerateFormatter($row['sample_rate']);
|
||||||
|
$row['sample_rate'] = $formatter->format();
|
||||||
|
|
||||||
|
$formatter = new BitrateFormatter($row['bit_rate']);
|
||||||
|
$row['bit_rate'] = $formatter->format();
|
||||||
|
}
|
||||||
|
|
||||||
// add checkbox row
|
// add checkbox row
|
||||||
$row['checkbox'] = "<input type='checkbox' name='cb_".$row['id']."'>";
|
$row['checkbox'] = "<input type='checkbox' name='cb_".$row['id']."'>";
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class BitrateFormatter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @string length
|
||||||
|
*/
|
||||||
|
private $_bitrate;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param string $bitrate (bits per second)
|
||||||
|
*/
|
||||||
|
public function __construct($bitrate)
|
||||||
|
{
|
||||||
|
$this->_bitrate = $bitrate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function format()
|
||||||
|
{
|
||||||
|
$Kbps = bcdiv($this->_bitrate, 1000, 0);
|
||||||
|
|
||||||
|
return "{$Kbps} Kbps";
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class SamplerateFormatter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @string sample rate
|
||||||
|
*/
|
||||||
|
private $_samplerate;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param string $samplerate Hz
|
||||||
|
*/
|
||||||
|
public function __construct($samplerate)
|
||||||
|
{
|
||||||
|
$this->_samplerate = $samplerate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function format()
|
||||||
|
{
|
||||||
|
$kHz = bcdiv($this->_samplerate, 1000, 1);
|
||||||
|
|
||||||
|
return "{$kHz} kHz";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue