CC-430: Audio normalization (Replaygain Support)

-values are now written through to database
This commit is contained in:
Martin Konecny 2012-07-15 22:13:04 -04:00
parent 39760f8494
commit 583695f98c
7 changed files with 13 additions and 12 deletions

View file

@ -949,10 +949,14 @@ class ApiController extends Zend_Controller_Action
{
// disable the view and the layout
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$dir_id = $this->_getParam('dir_id');
//connect to db and get get sql
$this->view->rows = Application_Model_StoredFile::listAllFiles2($dir_id, 100);
$rows = Application_Model_StoredFile::listAllFiles2($dir_id, 100);
echo json_encode($rows);
}
public function updateReplayGainValueAction()
@ -961,6 +965,8 @@ class ApiController extends Zend_Controller_Action
// disable layout
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$data = json_decode($request->getParam('data'));

View file

@ -615,7 +615,7 @@ class Application_Model_Schedule
'start' => $start,
'end' => Application_Model_Schedule::AirtimeTimeToPypoTime($item["end"]),
'show_name' => $showName,
'replay_gain' => $item["replay_gain"]
'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"]
);
}

View file

@ -974,7 +974,8 @@ Logging::log("getting media! - 2");
$sql = "SELECT id, filepath as fp"
." FROM CC_FILES"
." WHERE directory = $dir_id"
." AND file_exists = 'TRUE'";
." AND file_exists = 'TRUE'"
." AND replay_gain is NULL";
if (!is_null($limit) && is_int($limit)) {
$sql .= " LIMIT $limit";
}

View file

@ -1,3 +0,0 @@
<?php
echo json_encode($this->rows);

View file

@ -98,7 +98,7 @@
<column name="soundcloud_error_msg" phpName="DbSoundcloudErrorMsg" type="VARCHAR" size="512" required="false"/>
<column name="soundcloud_link_to_file" phpName="DbSoundcloudLinkToFile" type="VARCHAR" size="4096" required="false"/>
<column name="soundcloud_upload_time" phpName="DbSoundCloundUploadTime" type="TIMESTAMP" size="6" required="false"/>
<column name="replay_gain" phpName="DbReplayGain" type="VARCHAR" size="16" required="false" defaultValue="0"/>
<column name="replay_gain" phpName="DbReplayGain" type="VARCHAR" size="16" required="false"/>
<foreign-key foreignTable="cc_subjs" name="cc_files_editedby_fkey">
<reference local="editedby" foreign="id"/>
</foreign-key>