Don't use a define for MAX_PRESETS so that we can include control_functions multiple times

pull/4142/head
Isaac Connor 2024-09-19 17:43:17 -04:00
parent 2ed6ca0c0c
commit 05554757bc
1 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ function controlPanTilt($monitor, $cmds) {
function controlPresets($monitor, $cmds) {
$control = $monitor->Control();
// MAX_PRESETS IS PER LINE
define('MAX_PRESETS', '12');
$max_presets = 12;
$sql = 'SELECT * FROM ControlPresets WHERE MonitorId = ?';
$labels = array();
@ -157,7 +157,7 @@ function controlPresets($monitor, $cmds) {
$labels[$row['Preset']] = $row['Label'];
}
$presetBreak = (int)(($control->NumPresets()+1)/((int)(($control->NumPresets()-1)/MAX_PRESETS)+1));
$presetBreak = (int)(($control->NumPresets()+1)/((int)(($control->NumPresets()-1)/$max_presets)+1));
ob_start();
?>