CC-4754: Replay gain modifier
- Initial commit
This commit is contained in:
parent
b78fa5129f
commit
c0665e4748
6 changed files with 61 additions and 2 deletions
|
@ -1183,4 +1183,19 @@ class Application_Model_Preference
|
|||
$data = self::getValue("nowplaying_screen", true);
|
||||
return ($data != "") ? unserialize($data) : null;
|
||||
}
|
||||
|
||||
public static function getReplayGainModifier(){
|
||||
$rg_modifier = self::getValue("replay_gain_modifier");
|
||||
|
||||
if ($rg_modifier === "") {
|
||||
return "0";
|
||||
}
|
||||
|
||||
return $rg_modifier;
|
||||
}
|
||||
|
||||
public static function setReplayGainModifier($rg_modifier)
|
||||
{
|
||||
self::setValue("replay_gain_modifier", $rg_modifier, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -679,6 +679,8 @@ SQL;
|
|||
|
||||
$same_hour = $start_hour == $end_hour;
|
||||
$independent_event = !$same_hour;
|
||||
$replay_gain = is_null($item["replay_gain"]) ? "0": $item["replay_gain"];
|
||||
$replay_gain += Application_Model_Preference::getReplayGainModifier();
|
||||
|
||||
$schedule_item = array(
|
||||
'id' => $media_id,
|
||||
|
@ -692,7 +694,7 @@ SQL;
|
|||
'start' => $start,
|
||||
'end' => $end,
|
||||
'show_name' => $item["show_name"],
|
||||
'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"],
|
||||
'replay_gain' => $replay_gain,
|
||||
'independent_event' => $independent_event,
|
||||
);
|
||||
self::appendScheduleItem($data, $start, $schedule_item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue